Guest User

New Block Class

a guest
Jan 23rd, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.74 KB | None | 0 0
  1. public class BlockEleventhTardis extends Block
  2. {
  3.     protected int renderType;
  4.    
  5.     public BlockEleventhTardis setRenderType(int id)
  6.     {
  7.         this.renderType = id;
  8.         return this;
  9.     }
  10.    
  11.     public BlockEleventhTardis(int id, Material material)
  12.     {
  13.         super(id, material);
  14.        
  15.         setHardness(3.5F);
  16.         setStepSound(Block.soundStoneFootstep);
  17.         setCreativeTab(DoctorWhoAdventure.tabDoctorWho);
  18.         setResistance(1000.0F);
  19.         setResistance(1000.0F);
  20.         setHardness(1.5F);
  21.         setLightOpacity(0);
  22.         setLightValue(0.4f);
  23.         setTickRandomly(false);
  24.         setUnlocalizedName("dwadventure:EleventhTardis");
  25.     }
  26.    
  27.     @SideOnly(Side.CLIENT)
  28.     public void registerIcons(IconRegister par1IconRegister)
  29.  
  30.         {
  31.             this.blockIcon = par1IconRegister.registerIcon("dwadventures:EleventhTARDIS");
  32.         }  
  33.  
  34.     /**
  35.      * Is this block (a) opaque and (b) a full 1m cube?  This determines whether or not to render the shared face of two
  36.      * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
  37.      */
  38.    
  39.     @Override
  40.     public boolean isOpaqueCube()
  41.     {
  42.         return false;
  43.     }
  44.  
  45.     /**
  46.      * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
  47.      */
  48.  
  49.     public boolean renderAsNormalBlock()
  50.     {
  51.         return false;
  52.     }
  53.  
  54.  
  55.  
  56.     /**
  57.      * The type of render function that is called for this block
  58.      */
  59.     @Override
  60.     public int getRenderType()
  61.     {
  62.         return renderType;
  63.     }
  64.    
  65.     @Override
  66.     public TileEntity createTileEntity(World world, int metadata) {
  67.             return new TileEntityTardis();
  68.  
  69.     }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment