Guest User

Block

a guest
Apr 5th, 2016
27
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package dmz.icefeeling.ivi.tests;
  2.  
  3. import java.util.Random;
  4.  
  5. import dmz.icefeeling.ivi.mod.Main;
  6. import net.minecraft.block.Block;
  7. import net.minecraft.block.BlockContainer;
  8. import net.minecraft.block.BlockWorkbench;
  9. import net.minecraft.block.material.Material;
  10. import net.minecraft.block.state.IBlockState;
  11. import net.minecraft.entity.player.EntityPlayer;
  12. import net.minecraft.inventory.Container;
  13. import net.minecraft.stats.StatList;
  14. import net.minecraft.tileentity.TileEntity;
  15. import net.minecraft.util.BlockPos;
  16. import net.minecraft.util.EnumFacing;
  17. import net.minecraft.world.World;
  18.  
  19. public class ObsidianAnvil extends BlockContainer {
  20.  
  21.     private final boolean isActive;
  22.  
  23.     private static boolean keepInventory;
  24.     private Random rand = new Random();
  25.  
  26.     public ObsidianAnvil(String name, boolean isActive) {
  27.         super(Material.iron);
  28.         this.setUnlocalizedName(name);
  29.         this.isActive = isActive;
  30.     }
  31.  
  32.     public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
  33.     {
  34.         if (worldIn.isRemote)
  35.         {
  36.             return true;
  37.         }
  38.         else
  39.         {
  40.             playerIn.openGui(Main.instance, GuiHandler.OBANVIL, worldIn, pos.getX(),pos.getY(),pos.getZ());
  41.  
  42.             return true;
  43.         }
  44.     }
  45.  
  46.     @Override
  47.     public TileEntity createNewTileEntity(World worldIn, int meta) {
  48.         // TODO Auto-generated method stub
  49.         return new TileEntityObsidianAnvil();
  50.     }
  51. }
RAW Paste Data