Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 09:00:09 +01:00
Add RegistryType#getByKey
Dieser Commit ist enthalten in:
Ursprung
6622b7dcff
Commit
823ac0e173
@ -1,5 +1,10 @@
|
|||||||
package us.myles.ViaVersion.api.rewriters;
|
package us.myles.ViaVersion.api.rewriters;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public enum RegistryType {
|
public enum RegistryType {
|
||||||
|
|
||||||
BLOCK("block"),
|
BLOCK("block"),
|
||||||
@ -8,11 +13,23 @@ public enum RegistryType {
|
|||||||
ENTITY("entity_type"),
|
ENTITY("entity_type"),
|
||||||
GAME_EVENT("game_event");
|
GAME_EVENT("game_event");
|
||||||
|
|
||||||
|
private static final Map<String, RegistryType> MAP = new HashMap<>();
|
||||||
|
private static final RegistryType[] VALUES = values();
|
||||||
|
|
||||||
|
static {
|
||||||
|
for (RegistryType type : getValues()) {
|
||||||
|
MAP.put(type.resourceLocation, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static RegistryType[] getValues() {
|
public static RegistryType[] getValues() {
|
||||||
return VALUES;
|
return VALUES;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final RegistryType[] VALUES = values();
|
@Nullable
|
||||||
|
public static RegistryType getByKey(String resourceKey) {
|
||||||
|
return MAP.get(resourceKey);
|
||||||
|
}
|
||||||
|
|
||||||
private final String resourceLocation;
|
private final String resourceLocation;
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren