From 8dff4227eb7fb6dc83e3896258b2a4cd1d725059 Mon Sep 17 00:00:00 2001 From: TheMode Date: Wed, 28 Jul 2021 13:02:12 +0200 Subject: [PATCH] Rename registry resource enum --- .../java/net/minestom/server/entity/EntityTypeLoader.java | 4 +--- .../net/minestom/server/instance/block/BlockLoader.java | 2 +- src/main/java/net/minestom/server/item/MaterialLoader.java | 2 +- src/main/java/net/minestom/server/registry/Registry.java | 6 +++--- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/minestom/server/entity/EntityTypeLoader.java b/src/main/java/net/minestom/server/entity/EntityTypeLoader.java index a2a10ee3e..a3f133309 100644 --- a/src/main/java/net/minestom/server/entity/EntityTypeLoader.java +++ b/src/main/java/net/minestom/server/entity/EntityTypeLoader.java @@ -97,13 +97,11 @@ final class EntityTypeLoader { static { // Load data from file - JsonObject entities = Registry.load(Registry.Resource.ENTITY); + JsonObject entities = Registry.load(Registry.Resource.ENTITIES); entities.entrySet().forEach(entry -> { final String namespace = entry.getKey(); final JsonObject entityObject = entry.getValue().getAsJsonObject(); - final var metaSupplier = ENTITY_META_SUPPLIER.get(namespace); - final var entityType = new EntityTypeImpl(Registry.entity(namespace, entityObject, null)); ENTITY_ID_MAP.put(entityType.id(), entityType); NAMESPACE_MAP.put(namespace, entityType); diff --git a/src/main/java/net/minestom/server/instance/block/BlockLoader.java b/src/main/java/net/minestom/server/instance/block/BlockLoader.java index a3a3e3cd8..f3702e47a 100644 --- a/src/main/java/net/minestom/server/instance/block/BlockLoader.java +++ b/src/main/java/net/minestom/server/instance/block/BlockLoader.java @@ -53,7 +53,7 @@ final class BlockLoader { static { // Load data from file - JsonObject blocks = Registry.load(Registry.Resource.BLOCK); + JsonObject blocks = Registry.load(Registry.Resource.BLOCKS); blocks.entrySet().forEach(entry -> { final String blockNamespace = entry.getKey(); final JsonObject blockObject = entry.getValue().getAsJsonObject(); diff --git a/src/main/java/net/minestom/server/item/MaterialLoader.java b/src/main/java/net/minestom/server/item/MaterialLoader.java index dfa18766e..123d84175 100644 --- a/src/main/java/net/minestom/server/item/MaterialLoader.java +++ b/src/main/java/net/minestom/server/item/MaterialLoader.java @@ -45,7 +45,7 @@ final class MaterialLoader { static { // Load data from file - JsonObject materials = Registry.load(Registry.Resource.ITEM); + JsonObject materials = Registry.load(Registry.Resource.ITEMS); materials.entrySet().forEach(entry -> { final String namespace = entry.getKey(); final JsonObject materialObject = entry.getValue().getAsJsonObject(); diff --git a/src/main/java/net/minestom/server/registry/Registry.java b/src/main/java/net/minestom/server/registry/Registry.java index 08341d6e9..3bcbb6058 100644 --- a/src/main/java/net/minestom/server/registry/Registry.java +++ b/src/main/java/net/minestom/server/registry/Registry.java @@ -40,9 +40,9 @@ public class Registry { } public enum Resource { - BLOCK("blocks"), - ITEM("items"), - ENTITY("entities"); + BLOCKS("blocks"), + ITEMS("items"), + ENTITIES("entities"); private final String name;