Advertisement
Guest User

BlockShaft.java

a guest
Jan 20th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.37 KB | None | 0 0
  1. package logico.geartech.gear.blocks;
  2.  
  3. import ...
  4.  
  5. public class BlockShaft extends BlockContainer {
  6.  
  7.     public BlockShaft (final int id) {
  8.  
  9.         super(id, Material.iron);
  10.         setBlockName("gearShaft");
  11.         setCreativeTab(CreativeTabs.tabMisc);
  12.         //setBlockBounds(0F, 0.4375F, 0.4375F, 1F, 0.5625F, 0.5625F);
  13.  
  14.     }
  15.  
  16.     @Override public TileEntityShaft createNewTileEntity(final World world) {
  17.  
  18.         return new TileEntityShaft();
  19.  
  20.     }
  21.  
  22.     @Override public void onBlockAdded (final World world, final int x, final int y, final int z) {
  23.  
  24.         world.setBlockTileEntity(x, y, z, createNewTileEntity(world));
  25.         ((TileEntityShaft) world.getBlockTileEntity(x, y, z)).updateConnections();
  26.                 world.notifyBlocksOfNeighborChange(x, y, z, this.blockID);
  27.  
  28.     }
  29.  
  30.     @Override public void onNeighborBlockChange (final World world, final int x, final int y, final int z, final int blockID) {
  31.         ((TileEntityShaft) world.getBlockTileEntity(x, y, z)).updateConnections();
  32.     }
  33.        
  34.     @Override public boolean isOpaqueCube () {
  35.  
  36.         return false;
  37.  
  38.     }
  39.  
  40.     @Override public boolean renderAsNormalBlock () {
  41.  
  42.         return false;
  43.  
  44.     }
  45.  
  46.     @Override public boolean hasTileEntity (final int metadata) {
  47.  
  48.         return true;
  49.  
  50.     }
  51.  
  52.     @Override public int getRenderType () {
  53.  
  54.         return ClientProxyGear.shaftModelId;
  55.  
  56.     }
  57.  
  58.     @Override public int getBlockTextureFromSide (final int side) {
  59.  
  60.         return 1;
  61.  
  62.     }
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement