ScriptInventoryHolder.java 956 B

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