Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
iTwins committed Aug 5, 2023
1 parent 8bcf073 commit a43a44e
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.LeatherArmorMeta;

import io.github.thebusybiscuit.slimefun4.api.items.HashedArmorpiece;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile;
import io.github.thebusybiscuit.slimefun4.implementation.items.armor.RainbowArmorPiece;

Expand All @@ -30,15 +30,10 @@ protected void onTick() {
protected void onPlayerTick(Player p, PlayerProfile profile) {
for (int i = 0; i < 4; i++) {
ItemStack item = p.getInventory().getArmorContents()[i];
SlimefunItem sfItem = SlimefunItem.getByItem(item);

if (item != null && item.hasItemMeta()) {
HashedArmorpiece armorPiece = profile.getArmor()[i];

armorPiece.getItem().ifPresent(sfArmorPiece -> {
if (sfArmorPiece instanceof RainbowArmorPiece rainbowArmorPiece && rainbowArmorPiece.canUse(p, true)) {
updateRainbowArmor(item, rainbowArmorPiece);
}
});
if (sfItem instanceof RainbowArmorPiece rainbowArmorPiece && rainbowArmorPiece.canUse(p, true)) {
updateRainbowArmor(item, rainbowArmorPiece);
}
}
}
Expand Down

0 comments on commit a43a44e

Please sign in to comment.