Advertisement
Guest User

Untitled

a guest
Mar 6th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.18 KB | None | 0 0
  1.     @Override
  2.     public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
  3.     {
  4.         if (!worldIn.isRemote)
  5.         {
  6.             NetworkHooks.openGui((EntityPlayerMP) player, new InteractionObjectCarpentersTable(worldIn, pos), pos);
  7.         }
  8.  
  9.         return true;
  10.     }
  11.  
  12. public class InteractionObjectCarpentersTable implements IInteractionObject
  13. {
  14.  
  15.     private final World world;
  16.     private BlockPos pos;
  17.  
  18.     public InteractionObjectCarpentersTable(World world, BlockPos pos)
  19.     {
  20.         this.world = world;
  21.         this.pos = pos;
  22.     }
  23.  
  24.     @Override
  25.     public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
  26.     {
  27.         return new ContainerCarpentersTable(playerInventory, this.world, this.pos);
  28.     }
  29.  
  30.     @Override
  31.     public String getGuiID()
  32.     {
  33.         return Constants.MODID + ":carpenters_table_gui";
  34.     }
  35.  
  36.     @Override
  37.     public ITextComponent getName()
  38.     {
  39.         return new TextComponentTranslation(MEBlocks.CARPENTERS_TABLE.getTranslationKey());
  40.     }
  41.  
  42.     @Override
  43.     public boolean hasCustomName()
  44.     {
  45.         return false;
  46.     }
  47.  
  48.     @Nullable
  49.     @Override
  50.     public ITextComponent getCustomName()
  51.     {
  52.         return null;
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement