fix loading

This commit is contained in:
Zoë Gidiere 2023-12-12 17:15:54 -07:00
parent 9d200565d7
commit 7ca24faad3
2 changed files with 5 additions and 10 deletions

View File

@ -53,12 +53,9 @@ public abstract class MinecraftAddon implements BaseAddon {
public void initialize() {
modPlatform.getEventManager()
.getHandler(FunctionalEventHandler.class)
.register(this, ConfigurationLoadEvent.class)
.then(event -> {
if(event.is(ConfigPack.class)) {
event.getLoadedObject(ConfigPack.class).getContext().put(event.load(new VanillaWorldProperties()));
}
})
.register(this, ConfigPackPostLoadEvent.class)
.then(event -> event.getPack().getContext().put(event.loadTemplate(new VanillaWorldProperties())))
.priority(100)
.global();
modPlatform.getEventManager()
.getHandler(FunctionalEventHandler.class)

View File

@ -28,7 +28,7 @@ public class DimensionUtil {
public static DimensionType createDimension(ConfigPack pack, ModPlatform platform) {
VanillaWorldProperties vanillaWorldProperties;
MonsterSettingsConfig monsterSettingsConfig;
if (pack.getContext().has(VanillaBiomeProperties.class)) {
if (pack.getContext().has(VanillaWorldProperties.class)) {
vanillaWorldProperties = pack.getContext().get(VanillaWorldProperties.class);
} else {
vanillaWorldProperties = new VanillaWorldProperties();
@ -46,7 +46,7 @@ public class DimensionUtil {
assert defaultDimension != null;
MonsterSettings monsterSettings = getMonsterSettings(defaultDimension, monsterSettingsConfig);
DimensionType dimension = new DimensionType(
return new DimensionType(
vanillaWorldProperties.getFixedTime() == null ? defaultDimension.fixedTime() : OptionalLong.of(
vanillaWorldProperties.getFixedTime()),
vanillaWorldProperties.getHasSkyLight() == null ? defaultDimension.hasSkyLight() : vanillaWorldProperties.getHasSkyLight(),
@ -64,8 +64,6 @@ public class DimensionUtil {
vanillaWorldProperties.getAmbientLight() == null ? defaultDimension.ambientLight() : vanillaWorldProperties.getAmbientLight(),
monsterSettings
);
return dimension;
}
@NotNull