Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. public ContainerMagicalAnvilAdd(TileEntityMagicalAnvil tileEntityMagicalAnvil, EntityPlayer player) {
  2. this.inventory = player.inventory;
  3. this.tile = tileEntityMagicalAnvil;
  4. this.theWorld = player.worldObj;
  5. tile.markDirty();
  6. bindPlayerInventory();
  7. this.addSlotToContainer(new SingleItemSlot(inputSlots, 0, 69, 60));
  8. this.addSlotToContainer(new RuneItemSlot(inputSlots, 1, 25, 61));
  9. this.addSlotToContainer(new RuneItemSlot(inputSlots, 2, 109, 61));
  10. this.addSlotToContainer(new RuneItemSlot(inputSlots, 3, 68, 104));
  11. this.addSlotToContainer(new RuneItemSlot(inputSlots, 4, 69, 20));
  12. this.addSlotToContainer(new Slot(this.outputSlot, 5, 152, 60){
  13. public boolean isItemValid(ItemStack stack)
  14. {
  15. return false;
  16. }
  17. public boolean canTakeStack(EntityPlayer player)
  18. {
  19. return (player.capabilities.isCreativeMode || player.experienceLevel >= ContainerMagicalAnvilAdd.this.maximumCost) && ContainerMagicalAnvilAdd.this.maximumCost > 0 && this.getHasStack();
  20. }
  21. public void onPickupFromSlot(EntityPlayer player, ItemStack stack)
  22. {
  23. if (!player.capabilities.isCreativeMode)
  24. {
  25. player.addExperienceLevel(-ContainerMagicalAnvilAdd.this.maximumCost);
  26. }
  27. ContainerMagicalAnvilAdd.this.inputSlots.setInventorySlotContents(0, (ItemStack)null);
  28. ContainerMagicalAnvilAdd.this.inputSlots.setInventorySlotContents(1, (ItemStack)null);
  29. ContainerMagicalAnvilAdd.this.inputSlots.setInventorySlotContents(2, (ItemStack)null);
  30. ContainerMagicalAnvilAdd.this.inputSlots.setInventorySlotContents(3, (ItemStack)null);
  31. ContainerMagicalAnvilAdd.this.inputSlots.setInventorySlotContents(4, (ItemStack)null);
  32. }
  33. });
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement