SHARE
TWEET

Untitled

a guest Sep 30th, 2013 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package landcast.common;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraft.block.material.Material;
  5. import net.minecraft.creativetab.CreativeTabs;
  6. import net.minecraft.entity.EntityLivingBase;
  7. import net.minecraft.item.ItemStack;
  8. import net.minecraft.tileentity.TileEntity;
  9. import net.minecraft.util.MathHelper;
  10. import net.minecraft.world.World;
  11.  
  12. public class BlockTest extends Block
  13. {
  14.   public BlockTest(int id)
  15.   {
  16.     super(id, Material.wood);
  17.     this.setCreativeTab(CreativeTabs.tabDecorations);
  18.   }
  19.   @Override
  20.  
  21.   public TileEntity createTileEntity(World world, int metadata)
  22.   {
  23.   return new TileEntityBlockTest();
  24.   }
  25.  
  26.   public boolean hasTileEntity(int metadata)
  27.   {
  28.   return true;
  29.   }
  30.   public boolean isOpaqueCube()
  31.   {
  32.   return false;
  33.   }
  34.  
  35.   public boolean renderAsNormalBlock()
  36.   {
  37.   return false;
  38.   }
  39.  
  40.   public int getRenderType()
  41.   {
  42.   return -1;
  43.   }
  44.   public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase living, ItemStack stack)
  45.   {
  46.       int direction = MathHelper.floor_double((double)(living.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
  47.       world.setBlockMetadataWithNotify(x, y, z, direction, 2);
  48.   }
  49. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top