ScriptInventoryHolder.java 1016 B

12345678910111213141516171819202122232425262728293031323334353637
  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. private final SnuviInventory inv;
  12. public ScriptInventoryHolder(SnuviInventory inv, EntityPlayerMP p, MinecraftScript qd)
  13. {
  14. super(inv, p);
  15. this.qd = qd;
  16. this.inv = inv;
  17. this.e = KajetansMod.scripts.getEvent(ScriptEvents.class);
  18. }
  19. @Override
  20. public boolean noClicking(int slot, int dragType, ClickType click, EntityPlayerMP p)
  21. {
  22. return e.QuestClickInventory(qd, inv, slot, click, p);
  23. }
  24. @Override
  25. public void onContainerClosed(EntityPlayer p)
  26. {
  27. if(!e.QuestCloseInventory(qd, inv, p))
  28. {
  29. super.onContainerClosed(p);
  30. }
  31. }
  32. }