fixed the aura type config not working for some mods

Closes #116
This commit is contained in:
Ellpeck 2020-05-13 14:07:33 +02:00
parent 8e66deeb9d
commit cd740b8485
2 changed files with 6 additions and 6 deletions

View file

@ -184,7 +184,7 @@ public final class ModConfig {
try { try {
for (String s : this.auraTypeOverrides.get()) { for (String s : this.auraTypeOverrides.get()) {
String[] split = s.split("->"); 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"); BasicAuraType type = Objects.requireNonNull((BasicAuraType) NaturesAuraAPI.AURA_TYPES.get(new ResourceLocation(split[1])), "type");
type.addDimensionType(dim); type.addDimensionType(dim);
} }

View file

@ -13,14 +13,14 @@ public class BasicAuraType implements IAuraType {
private final ResourceLocation name; private final ResourceLocation name;
private final int color; private final int color;
private final int priority; private final int priority;
private final Set<DimensionType> dimensions = new HashSet<>(); private final Set<ResourceLocation> dimensions = new HashSet<>();
public BasicAuraType(ResourceLocation name, DimensionType dimension, int color, int priority) { public BasicAuraType(ResourceLocation name, DimensionType dimension, int color, int priority) {
this.name = name; this.name = name;
this.color = color; this.color = color;
this.priority = priority; this.priority = priority;
if (dimension != null) if (dimension != null)
this.dimensions.add(dimension); this.dimensions.add(dimension.getRegistryName());
} }
public BasicAuraType register() { public BasicAuraType register() {
@ -35,7 +35,7 @@ public class BasicAuraType implements IAuraType {
@Override @Override
public boolean isPresentInWorld(IWorld world) { 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 @Override
@ -48,7 +48,7 @@ public class BasicAuraType implements IAuraType {
return this.priority; return this.priority;
} }
public void addDimensionType(DimensionType type) { public void addDimensionType(ResourceLocation typeName) {
this.dimensions.add(type); this.dimensions.add(typeName);
} }
} }