mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-18 10:32:30 +00:00
fix loading
This commit is contained in:
parent
9d200565d7
commit
7ca24faad3
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user