Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-27 08:30:10 +01:00
Don't write null criteria for unknown advancements
Dieser Commit ist enthalten in:
Ursprung
633b4b393b
Commit
072b59060c
@ -24,12 +24,11 @@ import org.bukkit.advancement.Advancement;
|
|||||||
|
|
||||||
public final class BukkitAdvancementCriteriaProvider extends AdvancementCriteriaProvider {
|
public final class BukkitAdvancementCriteriaProvider extends AdvancementCriteriaProvider {
|
||||||
|
|
||||||
|
private static final String[] EMPTY_CRITERIA = new String[0];
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getCriteria(final String key) {
|
public String[] getCriteria(final String key) {
|
||||||
final Advancement advancement = Bukkit.getAdvancement(NamespacedKey.fromString(key));
|
final Advancement advancement = Bukkit.getAdvancement(NamespacedKey.fromString(key));
|
||||||
if (advancement == null) {
|
return advancement == null ? EMPTY_CRITERIA : advancement.getCriteria().toArray(EMPTY_CRITERIA);
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return advancement.getCriteria().toArray(new String[0]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren