diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-01-29 18:28:37 +0000 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-01-29 18:28:37 +0000 |
| commit | 73ca377dc01f859dabd7b07738cb7aeb762272b1 (patch) | |
| tree | 9c0acccbfbf78e813fb838ab566c96a40c5f36bb /java/darkknight/jewelrycraft/block/BlockShadowEye.java | |
| parent | 06f62473f0622efe6decc32b70516a7c5d3d3572 (diff) | |
Made lots of changes
Diffstat (limited to 'java/darkknight/jewelrycraft/block/BlockShadowEye.java')
| -rw-r--r-- | java/darkknight/jewelrycraft/block/BlockShadowEye.java | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/java/darkknight/jewelrycraft/block/BlockShadowEye.java b/java/darkknight/jewelrycraft/block/BlockShadowEye.java new file mode 100644 index 0000000..94ece2a --- /dev/null +++ b/java/darkknight/jewelrycraft/block/BlockShadowEye.java @@ -0,0 +1,81 @@ +package darkknight.jewelrycraft.block; + +import java.util.Random; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import darkknight.jewelrycraft.tileentity.TileEntityShadowEye; + +public class BlockShadowEye extends BlockContainer +{ + Random rand = new Random(); + + protected BlockShadowEye() + { + super(Material.rock); + } + + @Override + public TileEntity createNewTileEntity(World world, int var2) + { + return new TileEntityShadowEye(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) + { + TileEntityShadowEye tile = (TileEntityShadowEye)world.getTileEntity(i, j, k); + tile.active = true; + return true; + } + + @Override + public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) + { + } + + @Override + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack) + { + int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + world.setBlockMetadataWithNotify(i, j, k, rotation, 2); + } + + @Override + public void registerBlockIcons(IIconRegister icon) + { + this.blockIcon = icon.registerIcon("minecraft:stonebrick"); + } +} |
