From 7afc4553024570942b9ddc72ec053f2e383e257e Mon Sep 17 00:00:00 2001 From: coolGi2007 Date: Tue, 8 Mar 2022 17:33:22 +1030 Subject: [PATCH] Added the multiplayer folder thing from 1.18 --- .../java/com/seibel/lod/common/Config.java | 11 +++++++ .../config/LodConfigWrapperSingleton.java | 29 +++++++++++++++++++ core | 2 +- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/seibel/lod/common/Config.java b/common/src/main/java/com/seibel/lod/common/Config.java index 8ac4b3048..ba5751117 100644 --- a/common/src/main/java/com/seibel/lod/common/Config.java +++ b/common/src/main/java/com/seibel/lod/common/Config.java @@ -27,6 +27,7 @@ import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton; import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IAdvanced.*; import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IGraphics.*; import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IWorldGenerator; +import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IMultiplayer; import net.minecraft.client.renderer.DimensionSpecialEffects; /** @@ -73,6 +74,9 @@ public class Config extends ConfigGui @ConfigAnnotations.ScreenEntry public static WorldGenerator worldGenerator; + @ConfigAnnotations.ScreenEntry + public static Multiplayer multiplayer; + @ConfigAnnotations.ScreenEntry public static Advanced advanced; @@ -209,6 +213,13 @@ public class Config extends ConfigGui public static BlocksToAvoid blocksToAvoid = IWorldGenerator.BLOCKS_TO_AVOID_DEFAULT; } + public static class Multiplayer { + @ConfigAnnotations.FileComment + public static String _serverFolderNameMode = IMultiplayer.SERVER_FOLDER_NAME_MODE_DESC; + @ConfigAnnotations.Entry + public static ServerFolderNameMode serverFolderNameMode = IMultiplayer.SERVER_FOLDER_NAME_MODE_DEFAULT; + } + public static class Advanced { @ConfigAnnotations.ScreenEntry diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/config/LodConfigWrapperSingleton.java b/common/src/main/java/com/seibel/lod/common/wrappers/config/LodConfigWrapperSingleton.java index b24a7f732..ef5d63eb6 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/config/LodConfigWrapperSingleton.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/config/LodConfigWrapperSingleton.java @@ -3,6 +3,7 @@ package com.seibel.lod.common.wrappers.config; import com.seibel.lod.core.enums.config.*; import com.seibel.lod.core.enums.rendering.*; import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton; +import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IMultiplayer; import com.seibel.lod.common.Config; /** @@ -28,6 +29,7 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton { public final IGraphics graphics; public final IWorldGenerator worldGenerator; + public final IMultiplayer multiplayer; public final IAdvanced advanced; @@ -43,6 +45,11 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton return worldGenerator; } + @Override + public IMultiplayer multiplayer() { + return multiplayer; + } + @Override public IAdvanced advanced() { @@ -70,6 +77,7 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton { graphics = new Graphics(); worldGenerator = new WorldGenerator(); + multiplayer = new Multiplayer(); advanced = new Advanced(); } @@ -370,6 +378,27 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton + //=====================// + // Multiplayer Configs // + //=====================// + public static class Multiplayer implements IMultiplayer + { + @Override + public ServerFolderNameMode getServerFolderNameMode() + { + return Config.Client.Multiplayer.serverFolderNameMode; + } + @Override + public void setServerFolderNameMode(ServerFolderNameMode newServerFolderNameMode) + { + ConfigGui.editSingleOption.getEntry("client.multiplayer.serverFolderNameMode").value = newServerFolderNameMode; + ConfigGui.editSingleOption.saveOption("client.multiplayer.serverFolderNameMode"); + } + + + } + + //============================// // AdvancedModOptions Configs // diff --git a/core b/core index 3f091af3f..510058b7d 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 3f091af3f8393397670c21d1a93871a8bb1dbf68 +Subproject commit 510058b7dfa8eb29e0d1de7028e54bea2691e53e