#1475: Add tests for Minecraft registry <-> Bukkit fields

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2024-09-27 08:15:18 +10:00
parent 8b1426d818
commit eb72b9d8a3
4 changed files with 576 additions and 3 deletions

View File

@@ -279,6 +279,16 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
return bukkit;
}
@NotNull
@Override
public B getOrThrow(@NotNull NamespacedKey namespacedKey) {
B object = get(namespacedKey);
Preconditions.checkArgument(object != null, "No registry entry found for key " + namespacedKey);
return object;
}
@NotNull
@Override
public Stream<B> stream() {