diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/VersionConstants.java b/common/src/main/java/com/seibel/lod/common/wrappers/VersionConstants.java index 6f1056619..46442a340 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/VersionConstants.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/VersionConstants.java @@ -41,4 +41,9 @@ public class VersionConstants implements IVersionConstants { } */ } + + @Override + public int getWorldGenerationCountPerThread() { + return 1; + } } \ No newline at end of file diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/config/ConfigGui.java b/common/src/main/java/com/seibel/lod/common/wrappers/config/ConfigGui.java index 77b31b88e..3ad2ae36c 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/config/ConfigGui.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/config/ConfigGui.java @@ -5,7 +5,6 @@ import com.moandjiezana.toml.Toml; // TomlWriter is threadsave while Writer is not import com.moandjiezana.toml.TomlWriter; import com.mojang.blaze3d.vertex.PoseStack; -import com.seibel.lod.common.Config; import com.seibel.lod.core.ModInfo; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; @@ -32,6 +31,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.*; @@ -124,6 +124,8 @@ public abstract class ConfigGui { private static final List entries = new ArrayList<>(); + private static TomlWriter tomlWriter = new TomlWriter(); + private static class ConfigScreenConfigs { // This contains all the configs for the configs public static final int SpaceFromRightScreen = 10; @@ -285,7 +287,7 @@ public abstract class ConfigGui { try { if (!Files.exists(path)) Files.createFile(path); - new TomlWriter().write(configClass.get(modid).getDeclaredConstructor().newInstance(), path.toFile()); + tomlWriter.write(configClass.get(modid).getDeclaredConstructor().newInstance()); } catch (Exception e) { e.printStackTrace(); } @@ -401,7 +403,7 @@ public abstract class ConfigGui { this.list.addButton(widget, resetButton, null, name); } else if (info.button) { Button widget = new Button(this.width / 2 - info.width, this.height - 28, info.width*2, 20, name, (button -> { - Objects.requireNonNull(minecraft).setScreen(ConfigGui.getScreen(this, ModInfo.ID, info.gotoScreen)); + Objects.requireNonNull(minecraft).setScreen(ConfigGui.getScreen(this, modid, info.gotoScreen)); })); this.list.addButton(widget, null, null, null); } else { diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/world/WorldWrapper.java b/common/src/main/java/com/seibel/lod/common/wrappers/world/WorldWrapper.java index bd1fd38af..49eb24800 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/world/WorldWrapper.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/world/WorldWrapper.java @@ -137,6 +137,11 @@ public class WorldWrapper implements IWorldWrapper return world.getHeight(); } + @Override + public short getMinHeight() { + return (short) world.getMinBuildHeight(); + } + /** @throws UnsupportedOperationException if the WorldWrapper isn't for a ServerWorld */ @Override public File getSaveFolder() throws UnsupportedOperationException diff --git a/core b/core index 244ead945..4229ed75a 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 244ead9451a48fc3ed7a0005321fd207af9a32c0 +Subproject commit 4229ed75ae766df939b8f5fe5fdcb948c487c442