9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-29 03:49:19 +00:00

offhand switch cancel

This commit is contained in:
LoJoSho
2023-02-10 16:10:06 -06:00
parent b182e46b28
commit 42bae598a6

View File

@@ -205,6 +205,8 @@ public class PlayerGameListener implements Listener {
if (user.hasCosmeticInSlot(CosmeticSlot.EMOTE) && event.getPlayer().isSneaking()) {
CosmeticEmoteType cosmeticEmoteType = (CosmeticEmoteType) user.getCosmetic(CosmeticSlot.EMOTE);
cosmeticEmoteType.run(user);
event.setCancelled(true);
return;
}
Bukkit.getScheduler().runTaskLater(HMCCosmeticsPlugin.getInstance(), () -> {
user.updateCosmetic(CosmeticSlot.OFFHAND);