mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fixed players kicked from server when trying to use an ability
This commit is contained in:
parent
0603ebf281
commit
e67954f370
2 changed files with 3 additions and 1 deletions
|
@ -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<ByteBuf, MsgCancelPlayerAbility> PACKET_CODEC = PacketCodec.unit(INSTANCE);
|
||||
|
||||
private MsgCancelPlayerAbility() {}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public record MsgPlayerAbility<T extends Hit> (
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue