diff --git a/src/main/java/tk/shanebee/bee/elements/other/expressions/ExprArmorChange.java b/src/main/java/tk/shanebee/bee/elements/other/expressions/ExprArmorChange.java index 9f9ce9cf8..effe9b93b 100644 --- a/src/main/java/tk/shanebee/bee/elements/other/expressions/ExprArmorChange.java +++ b/src/main/java/tk/shanebee/bee/elements/other/expressions/ExprArmorChange.java @@ -16,6 +16,7 @@ import ch.njol.util.Kleenean; import ch.njol.util.coll.CollectionUtils; import com.destroystokyo.paper.event.player.PlayerArmorChangeEvent; +import com.destroystokyo.paper.event.player.PlayerArmorChangeEvent.SlotType; import org.bukkit.event.Event; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; @@ -80,19 +81,15 @@ public void change(Event e, @Nullable Object[] delta, Changer.ChangeMode mode) { ItemStack itemStack = item.getRandom(); PlayerInventory playerInv = ((PlayerArmorChangeEvent) e).getPlayer().getInventory(); - switch (((PlayerArmorChangeEvent) e).getSlotType()) { - case HEAD: - playerInv.setHelmet(itemStack); - break; - case CHEST: - playerInv.setChestplate(itemStack); - break; - case LEGS: - playerInv.setLeggings(itemStack); - break; - case FEET: - playerInv.setBoots(itemStack); - break; + SlotType type = ((PlayerArmorChangeEvent) e).getSlotType(); + if (type == SlotType.HEAD) { + playerInv.setHelmet(itemStack); + } else if (type == SlotType.CHEST) { + playerInv.setChestplate(itemStack); + } else if (type == SlotType.LEGS) { + playerInv.setLeggings(itemStack); + } else if (type == SlotType.FEET) { + playerInv.setBoots(itemStack); } }