From e4cb96ddcb3fcc1115afe55c067fda9de873a75b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 22 Sep 2020 15:19:14 +0200 Subject: [PATCH] reimplemented the aura type override config --- src/main/java/de/ellpeck/naturesaura/ModConfig.java | 5 ++--- .../ellpeck/naturesaura/api/aura/type/BasicAuraType.java | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/ModConfig.java b/src/main/java/de/ellpeck/naturesaura/ModConfig.java index 24b4cccd..5749171b 100644 --- a/src/main/java/de/ellpeck/naturesaura/ModConfig.java +++ b/src/main/java/de/ellpeck/naturesaura/ModConfig.java @@ -181,13 +181,12 @@ public final class ModConfig { } try { - // TODO aura type config - /*for (String s : this.auraTypeOverrides.get()) { + for (String s : this.auraTypeOverrides.get()) { String[] split = s.split("->"); ResourceLocation dim = new ResourceLocation(split[0]); BasicAuraType type = Objects.requireNonNull((BasicAuraType) NaturesAuraAPI.AURA_TYPES.get(new ResourceLocation(split[1])), "type"); type.addDimensionType(dim); - }*/ + } } catch (Exception e) { NaturesAura.LOGGER.warn("Error parsing auraTypeOverrides", e); } diff --git a/src/main/java/de/ellpeck/naturesaura/api/aura/type/BasicAuraType.java b/src/main/java/de/ellpeck/naturesaura/api/aura/type/BasicAuraType.java index 38f17590..af586c24 100644 --- a/src/main/java/de/ellpeck/naturesaura/api/aura/type/BasicAuraType.java +++ b/src/main/java/de/ellpeck/naturesaura/api/aura/type/BasicAuraType.java @@ -16,14 +16,14 @@ public class BasicAuraType implements IAuraType { private final ResourceLocation name; private final int color; private final int priority; - private final Set> dimensions = new HashSet<>(); + private final Set dimensions = new HashSet<>(); public BasicAuraType(ResourceLocation name, RegistryKey dimension, int color, int priority) { this.name = name; this.color = color; this.priority = priority; if (dimension != null) - this.dimensions.add(dimension); + this.dimensions.add(dimension.func_240901_a_()); } public BasicAuraType register() { @@ -38,7 +38,7 @@ public class BasicAuraType implements IAuraType { @Override public boolean isPresentInWorld(IWorld world) { - return this.dimensions.isEmpty() || this.dimensions.contains(((World) world).func_234923_W_()); + return this.dimensions.isEmpty() || this.dimensions.contains(((World) world).func_234923_W_().func_240901_a_()); } @Override @@ -51,7 +51,7 @@ public class BasicAuraType implements IAuraType { return this.priority; } - public void addDimensionType(RegistryKey type) { + public void addDimensionType(ResourceLocation type) { this.dimensions.add(type); } }