ScriptInventoryHolder.java 982 B

12345678910111213141516171819202122232425262728293031323334
  1. package me.km.snuviscript;
  2. import me.hammerle.snuviscript.code.Script;
  3. import me.km.KajetansMod;
  4. import me.km.inventory.CustomContainer;
  5. import net.minecraft.entity.player.EntityPlayer;
  6. import net.minecraft.entity.player.EntityPlayerMP;
  7. import net.minecraft.inventory.ClickType;
  8. public class ScriptInventoryHolder extends CustomContainer
  9. {
  10. private final Script sc;
  11. private final ScriptEvents e;
  12. public ScriptInventoryHolder(SnuviInventory inv, EntityPlayerMP p, Script qd)
  13. {
  14. super(inv, p);
  15. this.sc = qd;
  16. this.e = KajetansMod.scripts.getEvent(ScriptEvents.class);
  17. }
  18. @Override
  19. public boolean onButtonClick(int slot, int dragType, ClickType click, EntityPlayerMP p)
  20. {
  21. return e.onInventoryClick(sc, (SnuviInventory) inv, slot, click, p);
  22. }
  23. @Override
  24. public void onContainerClosed(EntityPlayer p)
  25. {
  26. e.onInventoryClose(sc, (SnuviInventory) inv, p);
  27. super.onContainerClosed(p);
  28. }
  29. }