mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-12-22 14:59:22 +01:00
reimplemented the aura type override config
This commit is contained in:
parent
27fa32dfbe
commit
e4cb96ddcb
2 changed files with 6 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -16,14 +16,14 @@ public class BasicAuraType implements IAuraType {
|
|||
private final ResourceLocation name;
|
||||
private final int color;
|
||||
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) {
|
||||
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<World> type) {
|
||||
public void addDimensionType(ResourceLocation type) {
|
||||
this.dimensions.add(type);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue