Added CustomGuiEvent.SlotClickEvent.

This commit is contained in:
Luis C.M committed 2022-06-18 12:52:23 -05:00
1 parent cc1c6c1910
commit b45cad77dd
5 files changed
+55

No files matched your search

@@ -89,6 +89,14 @@ public class CustomGuiController {
NpcAPI.EVENT_BUS.post(event);
}
public static boolean onSlotClick(CustomGuiEvent.SlotClickEvent event) {
EntityPlayer player = (EntityPlayer) event.player.getMCEntity();
if(checkGui(event) && getOpenGui(player).getScriptHandler()!=null) {
(getOpenGui(player).getScriptHandler()).callScript(EnumScriptType.CUSTOM_GUI_SLOT_CLICKED, event);
}
return NpcAPI.EVENT_BUS.post(event);
}
public static void onCustomGuiUnfocused(CustomGuiEvent.UnfocusedEvent event) {
EntityPlayer player = (EntityPlayer) event.player.getMCEntity();
if (checkGui(event) && getOpenGui(player).getScriptHandler() != null) {