reimplemented the aura type override config

This commit is contained in:
Ell 2020-09-22 15:19:14 +02:00
parent 27fa32dfbe
commit e4cb96ddcb
2 changed files with 6 additions and 7 deletions

View file

@ -181,13 +181,12 @@ public final class ModConfig {
} }
try { try {
// TODO aura type config for (String s : this.auraTypeOverrides.get()) {
/*for (String s : this.auraTypeOverrides.get()) {
String[] split = s.split("->"); String[] split = s.split("->");
ResourceLocation dim = new ResourceLocation(split[0]); 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);
}*/ }
} catch (Exception e) { } catch (Exception e) {
NaturesAura.LOGGER.warn("Error parsing auraTypeOverrides", e); NaturesAura.LOGGER.warn("Error parsing auraTypeOverrides", e);
} }

View file

@ -16,14 +16,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<RegistryKey<World>> dimensions = new HashSet<>(); private final Set<ResourceLocation> dimensions = new HashSet<>();
public BasicAuraType(ResourceLocation name, RegistryKey<World> dimension, int color, int priority) { public BasicAuraType(ResourceLocation name, RegistryKey<World> 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.func_240901_a_());
} }
public BasicAuraType register() { public BasicAuraType register() {
@ -38,7 +38,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) world).func_234923_W_()); return this.dimensions.isEmpty() || this.dimensions.contains(((World) world).func_234923_W_().func_240901_a_());
} }
@Override @Override
@ -51,7 +51,7 @@ public class BasicAuraType implements IAuraType {
return this.priority; return this.priority;
} }
public void addDimensionType(RegistryKey<World> type) { public void addDimensionType(ResourceLocation type) {
this.dimensions.add(type); this.dimensions.add(type);
} }
} }