package net.minecraft.block; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import java.util.List; import java.util.Random; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityEndPortal; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockEndPortal extends BlockContainer { public static boolean field_149948_a; private static final String __OBFID = "CL_00000236"; protected BlockEndPortal(Material p_i45404_1_) { super(p_i45404_1_); this.setLightLevel(1.0F); } /** * Returns a new instance of a block's tile entity class. Called on placing the block. */ public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityEndPortal(); } public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) { float f = 0.0625F; this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); } /** * 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 */ @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) { return side != 0 ? false : super.shouldSideBeRendered(worldIn, x, y, z, side); } public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) {} public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random random) { return 0; } public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) { if (entityIn.ridingEntity == null && entityIn.riddenByEntity == null && !worldIn.isRemote) { entityIn.travelToDimension(1); } } /** * A randomly called display update to be able to add particles or other items for display */ @SideOnly(Side.CLIENT) public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) { double d0 = (double)((float)x + random.nextFloat()); double d1 = (double)((float)y + 0.8F); double d2 = (double)((float)z + random.nextFloat()); double d3 = 0.0D; double d4 = 0.0D; double d5 = 0.0D; worldIn.spawnParticle("smoke", d0, d1, d2, d3, d4, d5); } /** * The type of render function that is called for this block */ public int getRenderType() { return -1; } public void onBlockAdded(World worldIn, int x, int y, int z) { if (!field_149948_a) { if (worldIn.provider.dimensionId != 0) { worldIn.setBlockToAir(x, y, z); } } } /** * Gets an item for the block being called on. Args: world, x, y, z */ @SideOnly(Side.CLIENT) public Item getItem(World worldIn, int x, int y, int z) { return Item.getItemById(0); } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister reg) { this.blockIcon = reg.registerIcon("portal"); } public MapColor getMapColor(int meta) { return MapColor.obsidianColor; } }