From cd740b8485dfbbe1cf60fd683eebc67708d4a09d Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 13 May 2020 14:07:33 +0200 Subject: [PATCH] fixed the aura type config not working for some mods Closes #116 --- src/main/java/de/ellpeck/naturesaura/ModConfig.java | 2 +- .../naturesaura/api/aura/type/BasicAuraType.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/ModConfig.java b/src/main/java/de/ellpeck/naturesaura/ModConfig.java index 59d2761b..ea36a44d 100644 --- a/src/main/java/de/ellpeck/naturesaura/ModConfig.java +++ b/src/main/java/de/ellpeck/naturesaura/ModConfig.java @@ -184,7 +184,7 @@ public final class ModConfig { try { for (String s : this.auraTypeOverrides.get()) { String[] split = s.split("->"); - DimensionType dim = Objects.requireNonNull(DimensionType.byName(new ResourceLocation(split[0])), "dim"); + ResourceLocation dim = new ResourceLocation(split[0]); BasicAuraType type = Objects.requireNonNull((BasicAuraType) NaturesAuraAPI.AURA_TYPES.get(new ResourceLocation(split[1])), "type"); type.addDimensionType(dim); } 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 dc0f8ca1..440353a3 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 @@ -13,14 +13,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, DimensionType 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.getRegistryName()); } public BasicAuraType register() { @@ -35,7 +35,7 @@ public class BasicAuraType implements IAuraType { @Override public boolean isPresentInWorld(IWorld world) { - return this.dimensions.isEmpty() || this.dimensions.contains(world.getDimension().getType()); + return this.dimensions.isEmpty() || this.dimensions.contains(world.getDimension().getType().getRegistryName()); } @Override @@ -48,7 +48,7 @@ public class BasicAuraType implements IAuraType { return this.priority; } - public void addDimensionType(DimensionType type) { - this.dimensions.add(type); + public void addDimensionType(ResourceLocation typeName) { + this.dimensions.add(typeName); } }