package me.km.snuviscript; import me.hammerle.snuviscript.code.Script; import me.km.KajetansMod; import me.km.inventory.CustomContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.ClickType; public class ScriptInventoryHolder extends CustomContainer { private final Script sc; private final ScriptEvents e; public ScriptInventoryHolder(SnuviInventory inv, EntityPlayerMP p, Script qd) { super(inv, p); this.sc = qd; this.e = KajetansMod.scripts.getEvent(ScriptEvents.class); } @Override public boolean onButtonClick(int slot, int dragType, ClickType click, EntityPlayerMP p) { return e.onInventoryClick(sc, (SnuviInventory) inv, slot, click, p); } @Override public void onContainerClosed(EntityPlayer p) { e.onInventoryClose(sc, (SnuviInventory) inv, p); super.onContainerClosed(p); } }