Rename registry resource enum

This commit is contained in:
TheMode 2021-07-28 13:02:12 +02:00
parent ec6bcf2d01
commit 8dff4227eb
4 changed files with 6 additions and 8 deletions

View File

@ -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);

View File

@ -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();

View File

@ -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();

View File

@ -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;