Skip to content

Commit a43a44e

Browse files
committed
1 parent 8bcf073 commit a43a44e

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/armor/RainbowArmorTask.java

+4-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.bukkit.inventory.ItemStack;
88
import org.bukkit.inventory.meta.LeatherArmorMeta;
99

10-
import io.github.thebusybiscuit.slimefun4.api.items.HashedArmorpiece;
10+
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
1111
import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile;
1212
import io.github.thebusybiscuit.slimefun4.implementation.items.armor.RainbowArmorPiece;
1313

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

34-
if (item != null && item.hasItemMeta()) {
35-
HashedArmorpiece armorPiece = profile.getArmor()[i];
36-
37-
armorPiece.getItem().ifPresent(sfArmorPiece -> {
38-
if (sfArmorPiece instanceof RainbowArmorPiece rainbowArmorPiece && rainbowArmorPiece.canUse(p, true)) {
39-
updateRainbowArmor(item, rainbowArmorPiece);
40-
}
41-
});
35+
if (sfItem instanceof RainbowArmorPiece rainbowArmorPiece && rainbowArmorPiece.canUse(p, true)) {
36+
updateRainbowArmor(item, rainbowArmorPiece);
4237
}
4338
}
4439
}

0 commit comments

Comments
 (0)