geforkt von Mirrors/Paper
Improve Registry#getOrThrow messages
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
42cd6c82ff
Commit
5f8dbb00f6
@ -65,7 +65,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
|||||||
public Advancement getOrThrow(@NotNull NamespacedKey key) {
|
public Advancement getOrThrow(@NotNull NamespacedKey key) {
|
||||||
Advancement advancement = get(key);
|
Advancement advancement = get(key);
|
||||||
|
|
||||||
Preconditions.checkArgument(advancement != null, "No registry entry found for key " + key);
|
Preconditions.checkArgument(advancement != null, "No Advancement registry entry found for key %s.", key);
|
||||||
|
|
||||||
return advancement;
|
return advancement;
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
|||||||
public KeyedBossBar getOrThrow(@NotNull NamespacedKey key) {
|
public KeyedBossBar getOrThrow(@NotNull NamespacedKey key) {
|
||||||
KeyedBossBar keyedBossBar = get(key);
|
KeyedBossBar keyedBossBar = get(key);
|
||||||
|
|
||||||
Preconditions.checkArgument(keyedBossBar != null, "No registry entry found for key " + key);
|
Preconditions.checkArgument(keyedBossBar != null, "No KeyedBossBar registry entry found for key %s.", key);
|
||||||
|
|
||||||
return keyedBossBar;
|
return keyedBossBar;
|
||||||
}
|
}
|
||||||
@ -307,7 +307,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
|||||||
public MemoryKey getOrThrow(@NotNull NamespacedKey key) {
|
public MemoryKey getOrThrow(@NotNull NamespacedKey key) {
|
||||||
MemoryKey memoryKey = get(key);
|
MemoryKey memoryKey = get(key);
|
||||||
|
|
||||||
Preconditions.checkArgument(memoryKey != null, "No registry entry found for key " + key);
|
Preconditions.checkArgument(memoryKey != null, "No MemoryKey registry entry found for key %s.", key);
|
||||||
|
|
||||||
return memoryKey;
|
return memoryKey;
|
||||||
}
|
}
|
||||||
@ -428,7 +428,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
|||||||
public T getOrThrow(@NotNull NamespacedKey key) {
|
public T getOrThrow(@NotNull NamespacedKey key) {
|
||||||
T object = get(key);
|
T object = get(key);
|
||||||
|
|
||||||
Preconditions.checkArgument(object != null, "No registry entry found for key " + key);
|
Preconditions.checkArgument(object != null, "No %s registry entry found for key %s.", type, key);
|
||||||
|
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ public final class TestServer {
|
|||||||
public Keyed getOrThrow(@NotNull NamespacedKey key) {
|
public Keyed getOrThrow(@NotNull NamespacedKey key) {
|
||||||
Keyed keyed = get(key);
|
Keyed keyed = get(key);
|
||||||
|
|
||||||
Preconditions.checkArgument(keyed != null, "No registry entry found for key " + key);
|
Preconditions.checkArgument(keyed != null, "No %s registry entry found for key %s.", aClass, key);
|
||||||
|
|
||||||
return keyed;
|
return keyed;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren