mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-21 12:07:38 +01:00
Don't write null criteria for unknown advancements
This commit is contained in:
parent
633b4b393b
commit
072b59060c
@ -24,12 +24,11 @@ import org.bukkit.advancement.Advancement;
|
||||
|
||||
public final class BukkitAdvancementCriteriaProvider extends AdvancementCriteriaProvider {
|
||||
|
||||
private static final String[] EMPTY_CRITERIA = new String[0];
|
||||
|
||||
@Override
|
||||
public String[] getCriteria(final String key) {
|
||||
final Advancement advancement = Bukkit.getAdvancement(NamespacedKey.fromString(key));
|
||||
if (advancement == null) {
|
||||
return null;
|
||||
}
|
||||
return advancement.getCriteria().toArray(new String[0]);
|
||||
return advancement == null ? EMPTY_CRITERIA : advancement.getCriteria().toArray(EMPTY_CRITERIA);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user