Skip to content

Commit 3a99fe4

Browse files
committed
Ok Codacy, got it.
1 parent fd383bc commit 3a99fe4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/java/ru/endlesscode/rpginventory/event/listener/ArmorEquipListener.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,13 @@ public void onDispenseEquip(BlockDispenseEvent event) {
164164
if (this.hasInventoryArmorByType(type, player)) {
165165
continue;
166166
}
167-
if (!InventoryManager.playerIsLoaded(player)) {
167+
if (InventoryManager.playerIsLoaded(player)) {
168+
Slot armorSlot = SlotManager.instance().getSlot(type.name());
169+
event.setCancelled(armorSlot != null
170+
&& !InventoryManager.validateArmor(player, InventoryAction.PLACE_ONE, armorSlot, event.getItem())
171+
);
168172
return;
169173
}
170-
171-
Slot armorSlot = SlotManager.instance().getSlot(type.name());
172-
event.setCancelled(armorSlot != null
173-
&& !InventoryManager.validateArmor(player, InventoryAction.PLACE_ONE, armorSlot, event.getItem()));
174-
return;
175174
}
176175
}
177176

0 commit comments

Comments
 (0)