#1058: Add tests for Minecraft registry <-> Bukkit fields
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Keyed;
|
||||
import org.bukkit.NamespacedKey;
|
||||
@@ -104,10 +103,7 @@ public interface Wolf extends Tameable, Sittable {
|
||||
|
||||
@NotNull
|
||||
private static Variant getVariant(@NotNull String key) {
|
||||
NamespacedKey namespacedKey = NamespacedKey.minecraft(key);
|
||||
Variant variant = Registry.WOLF_VARIANT.get(namespacedKey);
|
||||
Preconditions.checkNotNull(variant, "No Wolf Variant found for %s. This is a bug.", namespacedKey);
|
||||
return variant;
|
||||
return Registry.WOLF_VARIANT.getOrThrow(NamespacedKey.minecraft(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user