From e67954f370d928e914184b8e2af2554f2f84bece Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 28 Oct 2024 15:47:04 +0000 Subject: [PATCH] Fixed players kicked from server when trying to use an ability --- .../minelittlepony/unicopia/network/MsgCancelPlayerAbility.java | 2 ++ .../com/minelittlepony/unicopia/network/MsgPlayerAbility.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgCancelPlayerAbility.java b/src/main/java/com/minelittlepony/unicopia/network/MsgCancelPlayerAbility.java index edb69db1..c8be067a 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgCancelPlayerAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgCancelPlayerAbility.java @@ -9,4 +9,6 @@ import net.minecraft.network.codec.PacketCodec; public final class MsgCancelPlayerAbility { public static final MsgCancelPlayerAbility INSTANCE = new MsgCancelPlayerAbility(); public static final PacketCodec PACKET_CODEC = PacketCodec.unit(INSTANCE); + + private MsgCancelPlayerAbility() {} } diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerAbility.java b/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerAbility.java index 331a741b..191ac889 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerAbility.java @@ -48,7 +48,7 @@ public record MsgPlayerAbility ( power.onQuickAction(player, type, data); } else { if (data.filter(data -> power.apply(player, data)).isEmpty()) { - Channel.CANCEL_PLAYER_ABILITY.sendToPlayer(new MsgCancelPlayerAbility(), sender); + Channel.CANCEL_PLAYER_ABILITY.sendToPlayer(MsgCancelPlayerAbility.INSTANCE, sender); } } }