mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
use local variable to avoid accessing array multiple times
This commit is contained in:
parent
27f4ecbacf
commit
98cb08556b
@ -33,8 +33,9 @@ public class JoinListener implements Listener {
|
|||||||
final ItemStack[] armorContents = e.getPlayer().getInventory().getArmorContents();
|
final ItemStack[] armorContents = e.getPlayer().getInventory().getArmorContents();
|
||||||
final HashedArmorpiece[] hashedArmorpieces = playerProfile.getArmor();
|
final HashedArmorpiece[] hashedArmorpieces = playerProfile.getArmor();
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
if (armorContents[i] != null && armorContents[i].getType() != Material.AIR && SlimefunItem.getByItem(armorContents[i]) instanceof SlimefunArmorPiece sfArmorPiece) {
|
final ItemStack armorPiece = armorContents[i];
|
||||||
hashedArmorpieces[i].update(armorContents[i], sfArmorPiece);
|
if (armorPiece != null && armorPiece.getType() != Material.AIR && SlimefunItem.getByItem(armorPiece) instanceof SlimefunArmorPiece sfArmorPiece) {
|
||||||
|
hashedArmorpieces[i].update(armorPiece, sfArmorPiece);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user