From c98abaaa42fc4d09da849b9e9a9a6a458a8ac06e Mon Sep 17 00:00:00 2001 From: ichttt Date: Tue, 15 Oct 2019 23:54:47 +0200 Subject: [PATCH] Fix some config checks still using the old fields (#6193) --- .../client/renderer/WorldRenderer.java.patch | 2 +- .../minecraftforge/client/ForgeHooksClient.java | 2 +- .../client/gui/NotificationModUpdateScreen.java | 3 ++- .../client/model/FancyMissingModel.java | 3 ++- .../model/pipeline/ForgeBlockModelRenderer.java | 8 +++----- .../java/net/minecraftforge/common/ForgeMod.java | 14 ++++++++++---- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch index adb4c1298..e3042b60c 100644 --- a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch @@ -47,7 +47,7 @@ BlockPos blockpos2 = chunkrender4.func_178568_j().func_177982_a(8, 8, 8); boolean flag3 = blockpos2.func_177951_i(blockpos1) < 768.0D; - if (!chunkrender4.func_188281_o() && !flag3) { -+ if (net.minecraftforge.common.ForgeMod.alwaysSetupTerrainOffThread || !chunkrender4.func_188281_o() && !flag3) { ++ if (net.minecraftforge.common.ForgeConfig.CLIENT.alwaysSetupTerrainOffThread.get() || !chunkrender4.func_188281_o() && !flag3) { this.field_175009_l.add(chunkrender4); } else { this.field_72777_q.func_213239_aq().func_76320_a("build near"); diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index 77304e431..0b5d76b55 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -255,7 +255,7 @@ public class ForgeHooksClient skyInit = true; GameSettings settings = Minecraft.getInstance().gameSettings; - int[] ranges = ForgeMod.blendRanges; + int[] ranges = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34 }; int distance = 0; if (settings.fancyGraphics && ranges.length > 0) { diff --git a/src/main/java/net/minecraftforge/client/gui/NotificationModUpdateScreen.java b/src/main/java/net/minecraftforge/client/gui/NotificationModUpdateScreen.java index 3e1094ede..e34822e5e 100644 --- a/src/main/java/net/minecraftforge/client/gui/NotificationModUpdateScreen.java +++ b/src/main/java/net/minecraftforge/client/gui/NotificationModUpdateScreen.java @@ -29,6 +29,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TranslationTextComponent; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.ForgeMod; +import net.minecraftforge.fml.loading.FMLConfig; import net.minecraftforge.versions.forge.ForgeVersion; import net.minecraftforge.fml.VersionChecker; import net.minecraftforge.fml.client.ClientModLoader; @@ -66,7 +67,7 @@ public class NotificationModUpdateScreen extends Screen @Override public void render(int mouseX, int mouseY, float partialTicks) { - if (showNotification == null || !showNotification.shouldDraw() || ForgeMod.disableVersionCheck) + if (showNotification == null || !showNotification.shouldDraw() || !FMLConfig.runVersionCheck()) { return; } diff --git a/src/main/java/net/minecraftforge/client/model/FancyMissingModel.java b/src/main/java/net/minecraftforge/client/model/FancyMissingModel.java index 3e0a84891..974fccea5 100644 --- a/src/main/java/net/minecraftforge/client/model/FancyMissingModel.java +++ b/src/main/java/net/minecraftforge/client/model/FancyMissingModel.java @@ -34,6 +34,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.util.Direction; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.ForgeConfig; import net.minecraftforge.common.ForgeMod; import net.minecraftforge.common.model.IModelState; import net.minecraftforge.common.model.TRSRTransformation; @@ -209,7 +210,7 @@ final class FancyMissingModel implements IUnbakedModel case HEAD: break; case GUI: - if (ForgeMod.zoomInMissingModelTextInGui) + if (ForgeConfig.CLIENT.zoomInMissingModelTextInGui.get()) { transform = new TRSRTransformation(null, new Quat4f(1, 1, 1, 1), new Vector3f(4, 4, 4), null); big = false; diff --git a/src/main/java/net/minecraftforge/client/model/pipeline/ForgeBlockModelRenderer.java b/src/main/java/net/minecraftforge/client/model/pipeline/ForgeBlockModelRenderer.java index 7f7c497c2..8801d703d 100644 --- a/src/main/java/net/minecraftforge/client/model/pipeline/ForgeBlockModelRenderer.java +++ b/src/main/java/net/minecraftforge/client/model/pipeline/ForgeBlockModelRenderer.java @@ -32,10 +32,8 @@ import net.minecraft.client.renderer.color.BlockColors; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IEnviromentBlockReader; -import net.minecraft.world.IWorldReader; -import net.minecraft.world.IWorldReader; import net.minecraftforge.client.model.data.IModelData; -import net.minecraftforge.common.ForgeMod; +import net.minecraftforge.common.ForgeConfig; public class ForgeBlockModelRenderer extends BlockModelRenderer { @@ -54,7 +52,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer @Override public boolean renderModelFlat(IEnviromentBlockReader world, IBakedModel model, BlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, Random rand, long seed, IModelData modelData) { - if(ForgeMod.forgeLightPipelineEnabled) + if(ForgeConfig.CLIENT.forgeLightPipelineEnabled.get()) { VertexBufferConsumer consumer = consumerFlat.get(); consumer.setBuffer(buffer); @@ -74,7 +72,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer @Override public boolean renderModelSmooth(IEnviromentBlockReader world, IBakedModel model, BlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, Random rand, long seed, IModelData modelData) { - if(ForgeMod.forgeLightPipelineEnabled) + if(ForgeConfig.CLIENT.forgeLightPipelineEnabled.get()) { VertexBufferConsumer consumer = consumerSmooth.get(); consumer.setBuffer(buffer); diff --git a/src/main/java/net/minecraftforge/common/ForgeMod.java b/src/main/java/net/minecraftforge/common/ForgeMod.java index be881027f..36ccf3d98 100644 --- a/src/main/java/net/minecraftforge/common/ForgeMod.java +++ b/src/main/java/net/minecraftforge/common/ForgeMod.java @@ -77,13 +77,22 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook public static final String VERSION_CHECK_CAT = "version_checking"; private static final Logger LOGGER = LogManager.getLogger(); private static final Marker FORGEMOD = MarkerManager.getMarker("FORGEMOD"); + //TODO: Remove all of these, use ForgeConfig instead + @Deprecated public static int[] blendRanges = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34 }; + @Deprecated public static boolean disableVersionCheck = false; + @Deprecated public static boolean forgeLightPipelineEnabled = true; + @Deprecated public static boolean zoomInMissingModelTextInGui = false; + @Deprecated public static boolean disableStairSlabCulling = false; // Also known as the "DontCullStairsBecauseIUseACrappyTexturePackThatBreaksBasicBlockShapesSoICantTrustBasicBlockCulling" flag + @Deprecated public static boolean alwaysSetupTerrainOffThread = false; // In WorldRenderer.setupTerrain, always force the chunk render updates to be queued to the thread + @Deprecated public static boolean logCascadingWorldGeneration = true; // see Chunk#logCascadingWorldGeneration() + @Deprecated public static boolean fixVanillaCascading = false; // There are various places in vanilla that cause cascading worldgen. Enabling this WILL change where blocks are placed to prevent this. // DO NOT contact Forge about worldgen not 'matching' vanilla if this flag is set. @@ -124,10 +133,7 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook MinecraftForge.EVENT_BUS.register(MinecraftForge.INTERNAL_HANDLER); MinecraftForge.EVENT_BUS.register(this); - if (!ForgeMod.disableVersionCheck) - { - VersionChecker.startVersionCheck(); - } + VersionChecker.startVersionCheck(); /* * We can't actually add any of these, because vanilla clients will choke on unknown argument types