mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Fixes #2086
This commit is contained in:
parent
ba4282c3e7
commit
916fb554d0
@ -35,6 +35,7 @@
|
||||
#### Fixes
|
||||
* Fixed #2075
|
||||
* Fixed #2093
|
||||
* Fixed #2086
|
||||
|
||||
## Release Candidate 14 (12 Jul 2020)
|
||||
|
||||
|
@ -75,7 +75,9 @@ public class ArmorTask implements Runnable {
|
||||
|
||||
if (armorpiece.hasDiverged(item)) {
|
||||
SlimefunItem sfItem = SlimefunItem.getByItem(item);
|
||||
if (!(sfItem instanceof SlimefunArmorPiece) || !Slimefun.hasUnlocked(p, sfItem, true)) {
|
||||
|
||||
if (!(sfItem instanceof SlimefunArmorPiece)) {
|
||||
// If it isn't actually Armor, then we won't care about it.
|
||||
sfItem = null;
|
||||
}
|
||||
|
||||
@ -84,9 +86,13 @@ public class ArmorTask implements Runnable {
|
||||
|
||||
if (item != null && armorpiece.getItem().isPresent()) {
|
||||
Slimefun.runSync(() -> {
|
||||
for (PotionEffect effect : armorpiece.getItem().get().getPotionEffects()) {
|
||||
p.removePotionEffect(effect.getType());
|
||||
p.addPotionEffect(effect);
|
||||
SlimefunArmorPiece slimefunArmor = armorpiece.getItem().get();
|
||||
|
||||
if (Slimefun.hasUnlocked(p, slimefunArmor, true)) {
|
||||
for (PotionEffect effect : slimefunArmor.getPotionEffects()) {
|
||||
p.removePotionEffect(effect.getType());
|
||||
p.addPotionEffect(effect);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user