Commit a43a44e 1 parent 8bcf073 commit a43a44e Copy full SHA for a43a44e
File tree 1 file changed +4
-9
lines changed
src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/armor
1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 7
7
import org .bukkit .inventory .ItemStack ;
8
8
import org .bukkit .inventory .meta .LeatherArmorMeta ;
9
9
10
- import io .github .thebusybiscuit .slimefun4 .api .items .HashedArmorpiece ;
10
+ import io .github .thebusybiscuit .slimefun4 .api .items .SlimefunItem ;
11
11
import io .github .thebusybiscuit .slimefun4 .api .player .PlayerProfile ;
12
12
import io .github .thebusybiscuit .slimefun4 .implementation .items .armor .RainbowArmorPiece ;
13
13
@@ -30,15 +30,10 @@ protected void onTick() {
30
30
protected void onPlayerTick (Player p , PlayerProfile profile ) {
31
31
for (int i = 0 ; i < 4 ; i ++) {
32
32
ItemStack item = p .getInventory ().getArmorContents ()[i ];
33
+ SlimefunItem sfItem = SlimefunItem .getByItem (item );
33
34
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 );
42
37
}
43
38
}
44
39
}
You can’t perform that action at this time.
0 commit comments