From 4b16948d995f454cf944c110c35154d78b1005eb Mon Sep 17 00:00:00 2001 From: SamB440 Date: Sun, 26 Mar 2023 15:52:11 +0100 Subject: [PATCH] Fix banker packet error --- .../packet/outgoing/OutgoingBankerInteractPacketHandler.java | 2 +- .../taleofkingdoms/common/item/common/ItemPouch.java | 2 +- .../packet/incoming/IncomingBankerInteractPacketHandler.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/convallyria/taleofkingdoms/client/packet/outgoing/OutgoingBankerInteractPacketHandler.java b/src/main/java/com/convallyria/taleofkingdoms/client/packet/outgoing/OutgoingBankerInteractPacketHandler.java index 16b997f5..c5847570 100644 --- a/src/main/java/com/convallyria/taleofkingdoms/client/packet/outgoing/OutgoingBankerInteractPacketHandler.java +++ b/src/main/java/com/convallyria/taleofkingdoms/client/packet/outgoing/OutgoingBankerInteractPacketHandler.java @@ -17,7 +17,7 @@ public OutgoingBankerInteractPacketHandler() { } @Override - public void handleIncomingPacket( PacketContext context, PacketByteBuf attachedData) { + public void handleIncomingPacket(PacketContext context, PacketByteBuf attachedData) { throw new IllegalArgumentException("Not supported"); } diff --git a/src/main/java/com/convallyria/taleofkingdoms/common/item/common/ItemPouch.java b/src/main/java/com/convallyria/taleofkingdoms/common/item/common/ItemPouch.java index 3308e376..311e2a7c 100644 --- a/src/main/java/com/convallyria/taleofkingdoms/common/item/common/ItemPouch.java +++ b/src/main/java/com/convallyria/taleofkingdoms/common/item/common/ItemPouch.java @@ -31,7 +31,7 @@ public ItemPouch(Settings settings) { @Override public TypedActionResult use(World world, PlayerEntity user, Hand hand) { final UUID uuid = user.getUuid(); - if (!world.isClient()) return TypedActionResult.fail(user.getStackInHand(hand)); + if (world.isClient()) return TypedActionResult.fail(user.getStackInHand(hand)); ConquestInstance instance = TaleOfKingdoms.getAPI().getConquestInstanceStorage().mostRecentInstance().get(); final GuildPlayer guildPlayer = instance.getPlayer(user); ItemStack itemStack = user.getStackInHand(hand); diff --git a/src/main/java/com/convallyria/taleofkingdoms/server/packet/incoming/IncomingBankerInteractPacketHandler.java b/src/main/java/com/convallyria/taleofkingdoms/server/packet/incoming/IncomingBankerInteractPacketHandler.java index e63f0449..20210bba 100644 --- a/src/main/java/com/convallyria/taleofkingdoms/server/packet/incoming/IncomingBankerInteractPacketHandler.java +++ b/src/main/java/com/convallyria/taleofkingdoms/server/packet/incoming/IncomingBankerInteractPacketHandler.java @@ -26,7 +26,7 @@ public IncomingBankerInteractPacketHandler() { @Override public void handleIncomingPacket(PacketContext context, PacketByteBuf attachedData) { - ServerPlayerEntity player = (ServerPlayerEntity) context; + ServerPlayerEntity player = (ServerPlayerEntity) context.player(); UUID uuid = player.getUuid(); BankerMethod method = attachedData.readEnumConstant(BankerMethod.class); int coins = attachedData.readInt();