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() {
|
public void initialize() {
|
||||||
modPlatform.getEventManager()
|
modPlatform.getEventManager()
|
||||||
.getHandler(FunctionalEventHandler.class)
|
.getHandler(FunctionalEventHandler.class)
|
||||||
.register(this, ConfigurationLoadEvent.class)
|
.register(this, ConfigPackPostLoadEvent.class)
|
||||||
.then(event -> {
|
.then(event -> event.getPack().getContext().put(event.loadTemplate(new VanillaWorldProperties())))
|
||||||
if(event.is(ConfigPack.class)) {
|
.priority(100)
|
||||||
event.getLoadedObject(ConfigPack.class).getContext().put(event.load(new VanillaWorldProperties()));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.global();
|
.global();
|
||||||
modPlatform.getEventManager()
|
modPlatform.getEventManager()
|
||||||
.getHandler(FunctionalEventHandler.class)
|
.getHandler(FunctionalEventHandler.class)
|
||||||
|
@ -28,7 +28,7 @@ public class DimensionUtil {
|
|||||||
public static DimensionType createDimension(ConfigPack pack, ModPlatform platform) {
|
public static DimensionType createDimension(ConfigPack pack, ModPlatform platform) {
|
||||||
VanillaWorldProperties vanillaWorldProperties;
|
VanillaWorldProperties vanillaWorldProperties;
|
||||||
MonsterSettingsConfig monsterSettingsConfig;
|
MonsterSettingsConfig monsterSettingsConfig;
|
||||||
if (pack.getContext().has(VanillaBiomeProperties.class)) {
|
if (pack.getContext().has(VanillaWorldProperties.class)) {
|
||||||
vanillaWorldProperties = pack.getContext().get(VanillaWorldProperties.class);
|
vanillaWorldProperties = pack.getContext().get(VanillaWorldProperties.class);
|
||||||
} else {
|
} else {
|
||||||
vanillaWorldProperties = new VanillaWorldProperties();
|
vanillaWorldProperties = new VanillaWorldProperties();
|
||||||
@ -46,7 +46,7 @@ public class DimensionUtil {
|
|||||||
assert defaultDimension != null;
|
assert defaultDimension != null;
|
||||||
MonsterSettings monsterSettings = getMonsterSettings(defaultDimension, monsterSettingsConfig);
|
MonsterSettings monsterSettings = getMonsterSettings(defaultDimension, monsterSettingsConfig);
|
||||||
|
|
||||||
DimensionType dimension = new DimensionType(
|
return new DimensionType(
|
||||||
vanillaWorldProperties.getFixedTime() == null ? defaultDimension.fixedTime() : OptionalLong.of(
|
vanillaWorldProperties.getFixedTime() == null ? defaultDimension.fixedTime() : OptionalLong.of(
|
||||||
vanillaWorldProperties.getFixedTime()),
|
vanillaWorldProperties.getFixedTime()),
|
||||||
vanillaWorldProperties.getHasSkyLight() == null ? defaultDimension.hasSkyLight() : vanillaWorldProperties.getHasSkyLight(),
|
vanillaWorldProperties.getHasSkyLight() == null ? defaultDimension.hasSkyLight() : vanillaWorldProperties.getHasSkyLight(),
|
||||||
@ -64,8 +64,6 @@ public class DimensionUtil {
|
|||||||
vanillaWorldProperties.getAmbientLight() == null ? defaultDimension.ambientLight() : vanillaWorldProperties.getAmbientLight(),
|
vanillaWorldProperties.getAmbientLight() == null ? defaultDimension.ambientLight() : vanillaWorldProperties.getAmbientLight(),
|
||||||
monsterSettings
|
monsterSettings
|
||||||
);
|
);
|
||||||
|
|
||||||
return dimension;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
Loading…
x
Reference in New Issue
Block a user