Updated libreforge

This commit is contained in:
Auxilor 2022-05-08 16:11:21 +01:00
parent 91ff9c4394
commit 9c0a320eec
2 changed files with 21 additions and 2 deletions

View File

@ -3,6 +3,6 @@ version rootProject.version
subprojects { subprojects {
dependencies { dependencies {
implementation 'com.willfp:libreforge:3.40.0' implementation 'com.willfp:libreforge:3.40.1'
} }
} }

View File

@ -10,10 +10,15 @@ import com.willfp.libreforge.conditions.ConfiguredCondition;
import com.willfp.libreforge.effects.ConfiguredEffect; import com.willfp.libreforge.effects.ConfiguredEffect;
import com.willfp.libreforge.effects.Effects; import com.willfp.libreforge.effects.Effects;
import lombok.Getter; import lombok.Getter;
import lombok.val;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set; import java.util.Set;
public class CustomEcoEnchantLevel implements Holder { public class CustomEcoEnchantLevel implements Holder {
@ -104,7 +109,21 @@ public class CustomEcoEnchantLevel implements Holder {
+ '}'; + '}';
} }
@Nullable @NotNull
@Override
public List<String> getNotMetLines(@NotNull final Player player) {
List<String> lines = new ArrayList<>();
for (ConfiguredCondition condition : this.getConditions()) {
if (!condition.isMet(player)) {
lines.addAll(Objects.requireNonNullElse(condition.getNotMetLines(), new ArrayList<>()));
}
}
return lines;
}
@NotNull
@Override @Override
public String getId() { public String getId() {
return this.parent.getKey().getKey() + "_" + this.level; return this.parent.getKey().getKey() + "_" + this.level;