Fixed null pointer exceptions from new custom gui slot commit.

This commit is contained in:
Luis C.M committed 2023-03-18 03:47:24 -05:00
1 parent 586c451f06
commit e3405d22e9
4 files changed
+25 -10

No files matched your search

+3 -2
View File
@@ -26,6 +26,7 @@ import noppes.npcs.api.entity.IProjectile;
import noppes.npcs.api.gui.ICustomGui;
import noppes.npcs.api.item.IItemCustom;
import noppes.npcs.api.item.IItemStack;
import noppes.npcs.client.gui.custom.components.CustomGuiSlot;
import noppes.npcs.constants.EnumScriptType;
import noppes.npcs.controllers.CustomGuiController;
import noppes.npcs.controllers.ScriptContainer;
@@ -560,8 +561,8 @@ public class EventHooks {
CustomGuiController.onSlotChange(event);
}
public static boolean onCustomGuiSlotClicked(IPlayer player, ICustomGui gui, int slotId, int guiSlotId, int dragType, int clickType) {
CustomGuiEvent.SlotClickEvent event = new CustomGuiEvent.SlotClickEvent(player, gui, slotId, guiSlotId, player.getOpenContainer().getSlot(slotId), dragType, clickType);
public static boolean onCustomGuiSlotClicked(IPlayer player, ICustomGui gui, int slotId, CustomGuiSlot guiSlot, int dragType, int clickType) {
CustomGuiEvent.SlotClickEvent event = new CustomGuiEvent.SlotClickEvent(player, gui, slotId, guiSlot, player.getOpenContainer().getSlot(slotId), dragType, clickType);
return CustomGuiController.onSlotClick(event);
}