diff --git a/src/main/java/kamkeel/npcs/network/PacketHandler.java b/src/main/java/kamkeel/npcs/network/PacketHandler.java index fb1c9e46e..a72c88039 100644 --- a/src/main/java/kamkeel/npcs/network/PacketHandler.java +++ b/src/main/java/kamkeel/npcs/network/PacketHandler.java @@ -26,10 +26,10 @@ import kamkeel.npcs.network.packets.request.bank.BankRemovePacket; import kamkeel.npcs.network.packets.request.bank.BankSavePacket; import kamkeel.npcs.network.packets.request.bank.BanksGetPacket; import kamkeel.npcs.network.packets.request.clone.*; -import kamkeel.npcs.network.packets.request.customgui.CustomGuiButtonPacket; -import kamkeel.npcs.network.packets.request.customgui.CustomGuiClosePacket; -import kamkeel.npcs.network.packets.request.customgui.CustomGuiUnfocusedPacket; -import kamkeel.npcs.network.packets.request.customgui.CustomScrollClickPacket; +import kamkeel.npcs.network.packets.player.customgui.CustomGuiButtonPacket; +import kamkeel.npcs.network.packets.player.customgui.CustomGuiClosePacket; +import kamkeel.npcs.network.packets.player.customgui.CustomGuiUnfocusedPacket; +import kamkeel.npcs.network.packets.player.customgui.CustomScrollClickPacket; import kamkeel.npcs.network.packets.request.dialog.*; import kamkeel.npcs.network.packets.request.effects.EffectGetPacket; import kamkeel.npcs.network.packets.request.effects.EffectRemovePacket; @@ -269,12 +269,6 @@ public class PacketHandler { REQUEST_PACKET.registerPacket(new RemoteResetPacket()); REQUEST_PACKET.registerPacket(new RemoteTpToNpcPacket()); - // CustomGUI Packets - REQUEST_PACKET.registerPacket(new CustomGuiButtonPacket()); - REQUEST_PACKET.registerPacket(new CustomGuiClosePacket()); - REQUEST_PACKET.registerPacket(new CustomGuiUnfocusedPacket()); - REQUEST_PACKET.registerPacket(new CustomScrollClickPacket()); - // Job Packets REQUEST_PACKET.registerPacket(new JobGetPacket()); REQUEST_PACKET.registerPacket(new JobSavePacket()); @@ -433,6 +427,12 @@ public class PacketHandler { PLAYER_PACKET.registerPacket(new InputDevicePacket()); PLAYER_PACKET.registerPacket(new ScreenSizePacket()); + + // CustomGUI Packets + PLAYER_PACKET.registerPacket(new CustomGuiButtonPacket()); + PLAYER_PACKET.registerPacket(new CustomGuiClosePacket()); + PLAYER_PACKET.registerPacket(new CustomGuiUnfocusedPacket()); + PLAYER_PACKET.registerPacket(new CustomScrollClickPacket()); } public void registerChannels() { diff --git a/src/main/java/kamkeel/npcs/network/enums/EnumPlayerPacket.java b/src/main/java/kamkeel/npcs/network/enums/EnumPlayerPacket.java index 953e7ff19..b228fc6c8 100644 --- a/src/main/java/kamkeel/npcs/network/enums/EnumPlayerPacket.java +++ b/src/main/java/kamkeel/npcs/network/enums/EnumPlayerPacket.java @@ -13,5 +13,10 @@ public enum EnumPlayerPacket { CompanionAction, GetRole, InputDevice, - ScreenSize + ScreenSize, + + CustomGuiButton, + CustomGuiScrollClick, + CustomGuiClose, + CustomGuiUnfocused, } diff --git a/src/main/java/kamkeel/npcs/network/enums/EnumRequestPacket.java b/src/main/java/kamkeel/npcs/network/enums/EnumRequestPacket.java index 332fa52e2..040909e3f 100644 --- a/src/main/java/kamkeel/npcs/network/enums/EnumRequestPacket.java +++ b/src/main/java/kamkeel/npcs/network/enums/EnumRequestPacket.java @@ -102,11 +102,6 @@ public enum EnumRequestPacket { IsGuiOpen, CacheAnimation, - CustomGuiButton, - CustomGuiScrollClick, - CustomGuiClose, - CustomGuiUnfocused, - PartyLogToServer, PartySave, PartyInfo, diff --git a/src/main/java/kamkeel/npcs/network/packets/request/customgui/CustomGuiButtonPacket.java b/src/main/java/kamkeel/npcs/network/packets/player/customgui/CustomGuiButtonPacket.java similarity index 89% rename from src/main/java/kamkeel/npcs/network/packets/request/customgui/CustomGuiButtonPacket.java rename to src/main/java/kamkeel/npcs/network/packets/player/customgui/CustomGuiButtonPacket.java index 4dbec3676..b5616de4a 100644 --- a/src/main/java/kamkeel/npcs/network/packets/request/customgui/CustomGuiButtonPacket.java +++ b/src/main/java/kamkeel/npcs/network/packets/player/customgui/CustomGuiButtonPacket.java @@ -1,4 +1,4 @@ -package kamkeel.npcs.network.packets.request.customgui; +package kamkeel.npcs.network.packets.player.customgui; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -6,6 +6,7 @@ import io.netty.buffer.ByteBuf; import kamkeel.npcs.network.AbstractPacket; import kamkeel.npcs.network.PacketChannel; import kamkeel.npcs.network.PacketHandler; +import kamkeel.npcs.network.enums.EnumPlayerPacket; import kamkeel.npcs.network.enums.EnumRequestPacket; import kamkeel.npcs.util.ByteBufUtils; import net.minecraft.entity.player.EntityPlayer; @@ -33,12 +34,12 @@ public final class CustomGuiButtonPacket extends AbstractPacket { @Override public Enum getType() { - return EnumRequestPacket.CustomGuiButton; + return EnumPlayerPacket.CustomGuiButton; } @Override public PacketChannel getChannel() { - return PacketHandler.REQUEST_PACKET; + return PacketHandler.PLAYER_PACKET; } diff --git a/src/main/java/kamkeel/npcs/network/packets/request/customgui/CustomGuiClosePacket.java b/src/main/java/kamkeel/npcs/network/packets/player/customgui/CustomGuiClosePacket.java similarity index 88% rename from src/main/java/kamkeel/npcs/network/packets/request/customgui/CustomGuiClosePacket.java rename to src/main/java/kamkeel/npcs/network/packets/player/customgui/CustomGuiClosePacket.java index 813eccfb5..5802c1307 100644 --- a/src/main/java/kamkeel/npcs/network/packets/request/customgui/CustomGuiClosePacket.java +++ b/src/main/java/kamkeel/npcs/network/packets/player/customgui/CustomGuiClosePacket.java @@ -1,4 +1,4 @@ -package kamkeel.npcs.network.packets.request.customgui; +package kamkeel.npcs.network.packets.player.customgui; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -6,6 +6,7 @@ import io.netty.buffer.ByteBuf; import kamkeel.npcs.network.AbstractPacket; import kamkeel.npcs.network.PacketChannel; import kamkeel.npcs.network.PacketHandler; +import kamkeel.npcs.network.enums.EnumPlayerPacket; import kamkeel.npcs.network.enums.EnumRequestPacket; import kamkeel.npcs.util.ByteBufUtils; import net.minecraft.entity.player.EntityPlayer; @@ -32,12 +33,12 @@ public final class CustomGuiClosePacket extends AbstractPacket { @Override public Enum getType() { - return EnumRequestPacket.CustomGuiClose; + return EnumPlayerPacket.CustomGuiClose; } @Override public PacketChannel getChannel() { - return PacketHandler.REQUEST_PACKET; + return PacketHandler.PLAYER_PACKET; } diff --git a/src/main/java/kamkeel/npcs/network/packets/request/customgui/CustomGuiUnfocusedPacket.java b/src/main/java/kamkeel/npcs/network/packets/player/customgui/CustomGuiUnfocusedPacket.java similarity index 89% rename from src/main/java/kamkeel/npcs/network/packets/request/customgui/CustomGuiUnfocusedPacket.java rename to src/main/java/kamkeel/npcs/network/packets/player/customgui/CustomGuiUnfocusedPacket.java index adb3456c4..ebbe460c5 100644 --- a/src/main/java/kamkeel/npcs/network/packets/request/customgui/CustomGuiUnfocusedPacket.java +++ b/src/main/java/kamkeel/npcs/network/packets/player/customgui/CustomGuiUnfocusedPacket.java @@ -1,4 +1,4 @@ -package kamkeel.npcs.network.packets.request.customgui; +package kamkeel.npcs.network.packets.player.customgui; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -6,6 +6,7 @@ import io.netty.buffer.ByteBuf; import kamkeel.npcs.network.AbstractPacket; import kamkeel.npcs.network.PacketChannel; import kamkeel.npcs.network.PacketHandler; +import kamkeel.npcs.network.enums.EnumPlayerPacket; import kamkeel.npcs.network.enums.EnumRequestPacket; import kamkeel.npcs.util.ByteBufUtils; import net.minecraft.entity.player.EntityPlayer; @@ -32,12 +33,12 @@ public final class CustomGuiUnfocusedPacket extends AbstractPacket { @Override public Enum getType() { - return EnumRequestPacket.CustomGuiUnfocused; + return EnumPlayerPacket.CustomGuiUnfocused; } @Override public PacketChannel getChannel() { - return PacketHandler.REQUEST_PACKET; + return PacketHandler.PLAYER_PACKET; } diff --git a/src/main/java/kamkeel/npcs/network/packets/request/customgui/CustomScrollClickPacket.java b/src/main/java/kamkeel/npcs/network/packets/player/customgui/CustomScrollClickPacket.java similarity index 92% rename from src/main/java/kamkeel/npcs/network/packets/request/customgui/CustomScrollClickPacket.java rename to src/main/java/kamkeel/npcs/network/packets/player/customgui/CustomScrollClickPacket.java index d91502ef4..aacb873d0 100644 --- a/src/main/java/kamkeel/npcs/network/packets/request/customgui/CustomScrollClickPacket.java +++ b/src/main/java/kamkeel/npcs/network/packets/player/customgui/CustomScrollClickPacket.java @@ -1,4 +1,4 @@ -package kamkeel.npcs.network.packets.request.customgui; +package kamkeel.npcs.network.packets.player.customgui; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -6,6 +6,7 @@ import io.netty.buffer.ByteBuf; import kamkeel.npcs.network.AbstractPacket; import kamkeel.npcs.network.PacketChannel; import kamkeel.npcs.network.PacketHandler; +import kamkeel.npcs.network.enums.EnumPlayerPacket; import kamkeel.npcs.network.enums.EnumRequestPacket; import kamkeel.npcs.util.ByteBufUtils; import net.minecraft.entity.player.EntityPlayer; @@ -39,12 +40,12 @@ public final class CustomScrollClickPacket extends AbstractPacket { @Override public Enum getType() { - return EnumRequestPacket.CustomGuiScrollClick; + return EnumPlayerPacket.CustomGuiScrollClick; } @Override public PacketChannel getChannel() { - return PacketHandler.REQUEST_PACKET; + return PacketHandler.PLAYER_PACKET; } diff --git a/src/main/java/noppes/npcs/client/gui/custom/GuiCustom.java b/src/main/java/noppes/npcs/client/gui/custom/GuiCustom.java index dfa5b928d..c187118aa 100644 --- a/src/main/java/noppes/npcs/client/gui/custom/GuiCustom.java +++ b/src/main/java/noppes/npcs/client/gui/custom/GuiCustom.java @@ -1,10 +1,10 @@ package noppes.npcs.client.gui.custom; import kamkeel.npcs.network.PacketClient; -import kamkeel.npcs.network.packets.request.customgui.CustomGuiButtonPacket; -import kamkeel.npcs.network.packets.request.customgui.CustomGuiClosePacket; -import kamkeel.npcs.network.packets.request.customgui.CustomGuiUnfocusedPacket; -import kamkeel.npcs.network.packets.request.customgui.CustomScrollClickPacket; +import kamkeel.npcs.network.packets.player.customgui.CustomGuiButtonPacket; +import kamkeel.npcs.network.packets.player.customgui.CustomGuiClosePacket; +import kamkeel.npcs.network.packets.player.customgui.CustomGuiUnfocusedPacket; +import kamkeel.npcs.network.packets.player.customgui.CustomScrollClickPacket; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiButton;