Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-08 17:20:24 +01:00
Don't check block items for armor swapping
Dieser Commit ist enthalten in:
Ursprung
0bb940e42d
Commit
4971eeab6a
@ -39,12 +39,16 @@ public final class ArmorToggleListener extends ViaBukkitListener {
|
||||
public void itemUse(final PlayerInteractEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
final ItemStack item = event.getItem();
|
||||
if (item == null || event.getHand() == null || !isOnPipe(player)) {
|
||||
if (item == null || event.getHand() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final EquipmentSlot armorItemSlot = item.getType().getEquipmentSlot();
|
||||
if (armorItemSlot != EquipmentSlot.HAND && armorItemSlot != EquipmentSlot.OFF_HAND) {
|
||||
if (armorItemSlot == EquipmentSlot.HAND || armorItemSlot == EquipmentSlot.OFF_HAND || item.getType().isBlock()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isOnPipe(player)) {
|
||||
final PlayerInventory inventory = player.getInventory();
|
||||
final ItemStack armor = inventory.getItem(armorItemSlot);
|
||||
// If two pieces of armor are equal, the client will do nothing.
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren