mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
Rename registry resource enum
This commit is contained in:
parent
ec6bcf2d01
commit
8dff4227eb
@ -97,13 +97,11 @@ final class EntityTypeLoader {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
// Load data from file
|
// Load data from file
|
||||||
JsonObject entities = Registry.load(Registry.Resource.ENTITY);
|
JsonObject entities = Registry.load(Registry.Resource.ENTITIES);
|
||||||
entities.entrySet().forEach(entry -> {
|
entities.entrySet().forEach(entry -> {
|
||||||
final String namespace = entry.getKey();
|
final String namespace = entry.getKey();
|
||||||
final JsonObject entityObject = entry.getValue().getAsJsonObject();
|
final JsonObject entityObject = entry.getValue().getAsJsonObject();
|
||||||
|
|
||||||
final var metaSupplier = ENTITY_META_SUPPLIER.get(namespace);
|
|
||||||
|
|
||||||
final var entityType = new EntityTypeImpl(Registry.entity(namespace, entityObject, null));
|
final var entityType = new EntityTypeImpl(Registry.entity(namespace, entityObject, null));
|
||||||
ENTITY_ID_MAP.put(entityType.id(), entityType);
|
ENTITY_ID_MAP.put(entityType.id(), entityType);
|
||||||
NAMESPACE_MAP.put(namespace, entityType);
|
NAMESPACE_MAP.put(namespace, entityType);
|
||||||
|
@ -53,7 +53,7 @@ final class BlockLoader {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
// Load data from file
|
// Load data from file
|
||||||
JsonObject blocks = Registry.load(Registry.Resource.BLOCK);
|
JsonObject blocks = Registry.load(Registry.Resource.BLOCKS);
|
||||||
blocks.entrySet().forEach(entry -> {
|
blocks.entrySet().forEach(entry -> {
|
||||||
final String blockNamespace = entry.getKey();
|
final String blockNamespace = entry.getKey();
|
||||||
final JsonObject blockObject = entry.getValue().getAsJsonObject();
|
final JsonObject blockObject = entry.getValue().getAsJsonObject();
|
||||||
|
@ -45,7 +45,7 @@ final class MaterialLoader {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
// Load data from file
|
// Load data from file
|
||||||
JsonObject materials = Registry.load(Registry.Resource.ITEM);
|
JsonObject materials = Registry.load(Registry.Resource.ITEMS);
|
||||||
materials.entrySet().forEach(entry -> {
|
materials.entrySet().forEach(entry -> {
|
||||||
final String namespace = entry.getKey();
|
final String namespace = entry.getKey();
|
||||||
final JsonObject materialObject = entry.getValue().getAsJsonObject();
|
final JsonObject materialObject = entry.getValue().getAsJsonObject();
|
||||||
|
@ -40,9 +40,9 @@ public class Registry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum Resource {
|
public enum Resource {
|
||||||
BLOCK("blocks"),
|
BLOCKS("blocks"),
|
||||||
ITEM("items"),
|
ITEMS("items"),
|
||||||
ENTITY("entities");
|
ENTITIES("entities");
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user