2013-05-03 13:00:44 +00:00
|
|
|
package biomesoplenty.blocks;
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.client.renderer.texture.IconRegister;
|
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.entity.player.EntityPlayerMP;
|
2013-07-02 07:43:39 +00:00
|
|
|
import net.minecraft.server.MinecraftServer;
|
2013-05-03 13:00:44 +00:00
|
|
|
import net.minecraft.util.AxisAlignedBB;
|
|
|
|
import net.minecraft.world.IBlockAccess;
|
|
|
|
import net.minecraft.world.World;
|
2013-05-29 01:05:27 +00:00
|
|
|
import biomesoplenty.configuration.BOPConfiguration;
|
|
|
|
import biomesoplenty.helpers.TeleporterPromised;
|
2013-05-03 13:00:44 +00:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
public class BlockPromisedPortal extends Block
|
|
|
|
{
|
|
|
|
public BlockPromisedPortal(int par1)
|
2013-05-31 10:34:02 +00:00
|
|
|
{
|
|
|
|
super(par1, Material.portal);
|
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void registerIcons(IconRegister par1IconRegister)
|
|
|
|
{
|
2013-05-31 10:34:02 +00:00
|
|
|
blockIcon = par1IconRegister.registerIcon("BiomesOPlenty:portal");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
|
|
|
|
*/
|
|
|
|
public int getRenderBlockPass()
|
|
|
|
{
|
|
|
|
return 1;
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
/**
|
|
|
|
* Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
|
|
* coordinates. Args: blockAccess, x, y, z, side
|
|
|
|
*/
|
|
|
|
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
|
|
{
|
|
|
|
return super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, 1 - par5);
|
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
/**
|
|
|
|
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
|
|
|
* cleared to be reused)
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
|
|
|
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public boolean isOpaqueCube()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-07-02 03:57:49 +00:00
|
|
|
/*@Override
|
2013-05-03 13:00:44 +00:00
|
|
|
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
|
|
|
{
|
|
|
|
if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null)
|
|
|
|
{
|
|
|
|
if (par5Entity instanceof EntityPlayerMP)
|
|
|
|
{
|
|
|
|
EntityPlayerMP thePlayer = (EntityPlayerMP) par5Entity;
|
|
|
|
if (par5Entity.dimension != BOPConfiguration.promisedLandDimID)
|
|
|
|
{
|
2013-07-02 07:43:39 +00:00
|
|
|
//getConfigurationManager
|
|
|
|
MinecraftServer.F()..transferPlayerToDimension(thePlayer, BOPConfiguration.promisedLandDimID, new TeleporterPromised(thePlayer.mcServer.worldServerForDimension(BOPConfiguration.promisedLandDimID)));
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-07-02 07:43:39 +00:00
|
|
|
thePlayer.mcServer..transferPlayerToDimension(thePlayer, 0, new TeleporterPromised(thePlayer.mcServer.worldServerForDimension(0)));
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-07-02 03:57:49 +00:00
|
|
|
}*/
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|