Implemented textfield unfocused event

This commit is contained in:
luisc committed 2022-01-14 16:09:27 -06:00
1 parent 2874643c84
commit 791adfc1b4
9 files changed
+50 -13

No files matched your search

@@ -75,24 +75,25 @@ public class PacketHandlerServer{
if(type == EnumPacketServer.IsGuiOpen) {
isGuiOpenPacket(buffer, player);
return;
} else if (type == EnumPacketServer.CustomGuiButton) {
if (player.openContainer instanceof ContainerCustomGui) {
((ContainerCustomGui)player.openContainer).customGui.fromNBT(Server.readNBT(buffer));
EventHooks.onCustomGuiButton((ScriptPlayer)NpcAPI.Instance().getIEntity(player), ((ContainerCustomGui)player.openContainer).customGui, buffer.readInt());
return;
}
} else if (type == EnumPacketServer.CustomGuiSlotChange) {
if (player.openContainer instanceof ContainerCustomGui) {
((ContainerCustomGui)player.openContainer).customGui.fromNBT(Server.readNBT(buffer));
EventHooks.onCustomGuiSlot((ScriptPlayer) NpcAPI.Instance().getIEntity(player), ((ContainerCustomGui)player.openContainer).customGui, buffer.readInt());
return;
}
} else if (type == EnumPacketServer.CustomGuiButton && player.openContainer instanceof ContainerCustomGui) {
((ContainerCustomGui)player.openContainer).customGui.fromNBT(Server.readNBT(buffer));
EventHooks.onCustomGuiButton((ScriptPlayer)NpcAPI.Instance().getIEntity(player), ((ContainerCustomGui)player.openContainer).customGui, buffer.readInt());
return;
} else if (type == EnumPacketServer.CustomGuiSlotChange && player.openContainer instanceof ContainerCustomGui) {
((ContainerCustomGui)player.openContainer).customGui.fromNBT(Server.readNBT(buffer));
EventHooks.onCustomGuiSlot((ScriptPlayer) NpcAPI.Instance().getIEntity(player), ((ContainerCustomGui)player.openContainer).customGui, buffer.readInt());
return;
} else if(type == EnumPacketServer.CustomGuiUnfocused && player.openContainer instanceof ContainerCustomGui) {
((ContainerCustomGui)player.openContainer).customGui.fromNBT(Server.readNBT(buffer));
EventHooks.onCustomGuiUnfocused((ScriptPlayer) NpcAPI.Instance().getIEntity(player), ((ContainerCustomGui) player.openContainer).customGui, buffer.readInt());
return;
} else if (type == EnumPacketServer.CustomGuiScrollClick && player.openContainer instanceof ContainerCustomGui) {
((ContainerCustomGui) player.openContainer).customGui.fromNBT(Server.readNBT(buffer));
EventHooks.onCustomGuiScrollClick((ScriptPlayer) NpcAPI.Instance().getIEntity(player), ((ContainerCustomGui) player.openContainer).customGui, buffer.readInt(), buffer.readInt(), CustomGuiController.readScrollSelection(buffer), buffer.readBoolean());
return;
} else if (type == EnumPacketServer.CustomGuiClose) {
EventHooks.onCustomGuiClose((ScriptPlayer)NpcAPI.Instance().getIEntity(player), (new ScriptGui()).fromNBT(Server.readNBT(buffer)));
return;
}
if(type.needsNpc && npc == null){