From 374b8598825a466c995b4df332ecb96a0f58f870 Mon Sep 17 00:00:00 2001 From: coolGi Date: Mon, 20 Nov 2023 21:47:35 +1030 Subject: [PATCH 01/33] Fixed Indium dialog not showing --- .../java/com/seibel/distanthorizons/fabric/FabricMain.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java index e954e02dc..5941f54c9 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java @@ -96,10 +96,8 @@ public class FabricMain { // People don't read the crash logs!!! // So, just put a notification, so they hopefully realise what's the problem (and dont just open issues) - new Thread(() -> { - System.setProperty("java.awt.headless", "false"); // Required to make it work - JOptionPane.showMessageDialog(null, ModInfo.READABLE_NAME + " now relies on Indium to work with Sodium.\nPlease download Indium from https://modrinth.com/mod/indium", ModInfo.READABLE_NAME, JOptionPane.INFORMATION_MESSAGE); - }).start(); + System.setProperty("java.awt.headless", "false"); // Required to make it work + JOptionPane.showMessageDialog(null, ModInfo.READABLE_NAME + " now relies on Indium to work with Sodium.\nPlease download Indium from https://modrinth.com/mod/indium", ModInfo.READABLE_NAME, JOptionPane.INFORMATION_MESSAGE); IMinecraftClientWrapper mc = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class); String errorMessage = "loading Distant Horizons. Distant Horizons requires Indium in order to run with Sodium."; From 6a2278949e6472897223c7ddb0d877b4c072ef71 Mon Sep 17 00:00:00 2001 From: coolGi Date: Mon, 20 Nov 2023 21:59:12 +1030 Subject: [PATCH 02/33] Updated core submodule --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 1ebbd9f7e..8af14ad3e 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 1ebbd9f7e4a6d25351107dba482a25ff3c4d943a +Subproject commit 8af14ad3e74653f67367b177c911ac9eca0c2194 From 1411091f60acd52709e19855bdab00905bb5d6a4 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 20 Nov 2023 07:35:26 -0600 Subject: [PATCH 03/33] Fix null pointers when moving between multiverse levels --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 8af14ad3e..7e869105c 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 8af14ad3e74653f67367b177c911ac9eca0c2194 +Subproject commit 7e869105cbeeb319bd8bd574da2148ace6ea45ff From c4228f4e6393320e8a6f4ae2a8be5ee2572a6581 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 21 Nov 2023 07:44:28 -0600 Subject: [PATCH 04/33] Improve multiverse similarity logic and fix incorrect log --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 7e869105c..e73e3a558 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 7e869105cbeeb319bd8bd574da2148ace6ea45ff +Subproject commit e73e3a5587d168277ba0636fc88ffbcc21a8254c From 4e25d318ec4b6935dbe57e094a35ea98636479fe Mon Sep 17 00:00:00 2001 From: James Seibel Date: Fri, 24 Nov 2023 09:46:51 -0600 Subject: [PATCH 05/33] Fix a potential concurrent error on DhClientServerWorld shutdown --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index e73e3a558..7959097fe 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit e73e3a5587d168277ba0636fc88ffbcc21a8254c +Subproject commit 7959097fe35c952e372b9a3c17d186942f741fdb From 7e1c55a0c555d26c697e5895ad90537566052759 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Fri, 24 Nov 2023 14:02:33 -0600 Subject: [PATCH 06/33] Fix merging for transparent LODs over the void --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index 7959097fe..fc248d095 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 7959097fe35c952e372b9a3c17d186942f741fdb +Subproject commit fc248d095656b7328e489a1866446cf4d3ddafea From 10d542ed14c0db32417090a1f3e89a41401800ea Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 25 Nov 2023 08:45:23 -0600 Subject: [PATCH 07/33] Fix incorrect ChunkWrapper IndexOutOfBounds checking --- .../common/wrappers/chunk/ChunkWrapper.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java index bef8b46b7..63cde7683 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java @@ -31,6 +31,7 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; +import com.seibel.distanthorizons.coreapi.ModInfo; import net.minecraft.client.multiplayer.ClientChunkCache; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.core.BlockPos; @@ -77,7 +78,7 @@ public class ChunkWrapper implements IChunkWrapper private static final Logger LOGGER = DhLoggerBuilder.getLogger(); /** useful for debugging, but can slow down chunk operations quite a bit due to being called every time. */ - private static final boolean RUN_RELATIVE_POS_INDEX_VALIDATION = false; + private static final boolean RUN_RELATIVE_POS_INDEX_VALIDATION = ModInfo.IS_DEV_BUILD; /** can be used for interactions with the underlying chunk where creating new BlockPos objects could cause issues for the garbage collector. */ private static final ThreadLocal MUTABLE_BLOCK_POS_REF = ThreadLocal.withInitial(() -> new BlockPos.MutableBlockPos()); @@ -432,6 +433,8 @@ public class ChunkWrapper implements IChunkWrapper @Override public IBlockStateWrapper getBlockState(int relX, int relY, int relZ) { + this.throwIndexOutOfBoundsIfRelativePosOutsideChunkBounds(relX, relY, relZ); + BlockPos.MutableBlockPos blockPos = MUTABLE_BLOCK_POS_REF.get(); blockPos.setX(relX); @@ -511,7 +514,7 @@ public class ChunkWrapper implements IChunkWrapper /** used to prevent accidentally attempting to get/set values outside this chunk's boundaries */ private void throwIndexOutOfBoundsIfRelativePosOutsideChunkBounds(int x, int y, int z) throws IndexOutOfBoundsException { - if (RUN_RELATIVE_POS_INDEX_VALIDATION) + if (!RUN_RELATIVE_POS_INDEX_VALIDATION) { return; } From a95171dbbebf805761e3aaeeb73d17cf1c7f3dd0 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 25 Nov 2023 08:46:03 -0600 Subject: [PATCH 08/33] Add constants to BlockStateWrapper --- .../common/wrappers/block/BlockStateWrapper.java | 4 ++-- coreSubProjects | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java index ccd1e4fe2..1deb708e0 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java @@ -177,12 +177,12 @@ public class BlockStateWrapper implements IBlockStateWrapper if (this.isAir() || !this.blockState.canOcclude()) { // completely transparent - return 0; + return FULLY_TRANSPARENT; } else { // completely opaque - return 16; + return FULLY_OPAQUE; } } diff --git a/coreSubProjects b/coreSubProjects index fc248d095..e693e2f9e 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit fc248d095656b7328e489a1866446cf4d3ddafea +Subproject commit e693e2f9e0b82ebc8f4be1fb9e18816ffb772a48 From 83c01cabfb53e38348477b4874aa43b04bd9ce54 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 25 Nov 2023 11:08:44 -0600 Subject: [PATCH 09/33] Fix lighting on some servers --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index e693e2f9e..bd3592ee5 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit e693e2f9e0b82ebc8f4be1fb9e18816ffb772a48 +Subproject commit bd3592ee5bf20b522cdf8729449de7e2dd6664c0 From dd60c7620fda67bc792939b30f378726e32c02ad Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 25 Nov 2023 11:39:53 -0600 Subject: [PATCH 10/33] Fix null pointer when joining some multiverse servers --- .../common/wrappers/world/ClientLevelWrapper.java | 14 +++++++++----- coreSubProjects | 2 +- .../mixins/client/MixinClientPacketListener.java | 9 ++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java index 0c88bf752..08ffe1656 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java @@ -27,6 +27,7 @@ import net.minecraft.world.level.chunk.ChunkAccess; import net.minecraft.world.level.chunk.ChunkSource; import net.minecraft.world.level.chunk.ChunkStatus; import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.concurrent.ConcurrentHashMap; @@ -54,8 +55,14 @@ public class ClientLevelWrapper implements IClientLevelWrapper // wrapper logic // //===============// - public static IClientLevelWrapper getWrapper(ClientLevel level) + @Nullable + public static IClientLevelWrapper getWrapper(@Nullable ClientLevel level) { + if (level == null) + { + return null; + } + // used if the client is connected to a server that defines the currently loaded level if (KEYED_CLIENT_LEVEL_MANAGER.getUseOverrideWrapper()) { @@ -64,10 +71,7 @@ public class ClientLevelWrapper implements IClientLevelWrapper return getWrapperIgnoringOverride(level); } - public static IClientLevelWrapper getWrapperIgnoringOverride(ClientLevel level) - { - return LEVEL_WRAPPER_BY_CLIENT_LEVEL.computeIfAbsent(level, ClientLevelWrapper::new); - } + public static IClientLevelWrapper getWrapperIgnoringOverride(@NotNull ClientLevel level) { return LEVEL_WRAPPER_BY_CLIENT_LEVEL.computeIfAbsent(level, ClientLevelWrapper::new); } @Nullable @Override diff --git a/coreSubProjects b/coreSubProjects index bd3592ee5..efc2ce84e 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit bd3592ee5bf20b522cdf8729449de7e2dd6664c0 +Subproject commit efc2ce84e48ae6f9380fe9c5721d6883bd362a23 diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinClientPacketListener.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinClientPacketListener.java index d9ca84a05..b290d6aad 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinClientPacketListener.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinClientPacketListener.java @@ -27,9 +27,9 @@ public class MixinClientPacketListener void onHandleLoginEnd(CallbackInfo ci) { ClientApi.INSTANCE.onClientOnlyConnected(); } @Inject(method = "handleRespawn", at = @At("HEAD")) - void onHandleRespawnStart(CallbackInfo ci) { ClientApi.INSTANCE.clientLevelUnloadEvent(ClientLevelWrapper.getWrapper(level)); } + void onHandleRespawnStart(CallbackInfo ci) { ClientApi.INSTANCE.clientLevelUnloadEvent(ClientLevelWrapper.getWrapper(this.level)); } @Inject(method = "handleRespawn", at = @At("RETURN")) - void onHandleRespawnEnd(CallbackInfo ci) { ClientApi.INSTANCE.clientLevelLoadEvent(ClientLevelWrapper.getWrapper(level)); } + void onHandleRespawnEnd(CallbackInfo ci) { ClientApi.INSTANCE.clientLevelLoadEvent(ClientLevelWrapper.getWrapper(this.level)); } #if PRE_MC_1_19_4 @Inject(method = "cleanup", at = @At("HEAD")) @@ -38,10 +38,9 @@ public class MixinClientPacketListener #endif void onCleanupStart(CallbackInfo ci) { - // TODO Is this even needed here? - if (level != null) + if (this.level != null) { - ClientApi.INSTANCE.clientLevelUnloadEvent(ClientLevelWrapper.getWrapper(level)); + ClientApi.INSTANCE.clientLevelUnloadEvent(ClientLevelWrapper.getWrapper(this.level)); } ClientApi.INSTANCE.onClientOnlyDisconnected(); } From 13e53a18e30a59306cd393aca4da7a518903a5e2 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 25 Nov 2023 12:13:18 -0600 Subject: [PATCH 11/33] Change the default MC version from 1.20.1 -> 1.20.2 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 0015c9f66..cb24e1e8c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -44,7 +44,7 @@ versionStr= # This defines what MC version Intellij will use for the preprocessor # and what version is used automatically by build and run commands -mcVer=1.20.1 +mcVer=1.20.2 # Defines the maximum amount of memory Minecraft is allowed when run in a developement environment minecraftMemoryJavaArg="-Xmx4G" From e5043d6d9bb0bd980b397bc77ed4f6a10d854f4d Mon Sep 17 00:00:00 2001 From: Lorenzo Giannini Date: Sat, 25 Nov 2023 18:21:21 +0000 Subject: [PATCH 12/33] fix links --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index cb24e1e8c..7c6bd1ab1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,8 +13,8 @@ mod_description=This mod generates and renders simplified terrain beyond the nor # Note: In forge's mods.toml this is hard coded because Architectury throws an error with setting it as a varuable mod_authors=["James Seibel", "Leonardo Amato", "Cola", "coolGi", "Ran", "Leetom"] mod_homepage=https://modrinth.com/mod/distanthorizons -mod_source=https://gitlab.com/jeseibel/minecraft-lod-mod/ -mod_issues=https://gitlab.com/jeseibel/minecraft-lod-mod/-/issues +mod_source=https://gitlab.com/jeseibel/distant-horizons +mod_issues=https://gitlab.com/jeseibel/distant-horizons/-/issues mod_discord=https://discord.gg/xAB8G4cENx # Global Plugin Versions From 7325cedba612538953096c20e1306b87ea8f35f8 Mon Sep 17 00:00:00 2001 From: Lorenzo Giannini Date: Sat, 25 Nov 2023 18:31:10 +0000 Subject: [PATCH 13/33] Update pack.mcmeta --- forge/src/main/resources/pack.mcmeta | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/forge/src/main/resources/pack.mcmeta b/forge/src/main/resources/pack.mcmeta index 70b6321cb..451f30e1b 100644 --- a/forge/src/main/resources/pack.mcmeta +++ b/forge/src/main/resources/pack.mcmeta @@ -1,6 +1,6 @@ { - "pack": { - "description": "", - "pack_format": 7 - } -} + "pack": { + "pack_format": 7, + "supported_formats": {"min_inclusive": 16, "max_inclusive": 90000}, + "description": "Distant Horizons" + } From b8e7b14fbbb7bfbb9b1ff9b83b971efbdc499be0 Mon Sep 17 00:00:00 2001 From: Fourmisain <8102369-Fourmisain@users.noreply.gitlab.com> Date: Mon, 27 Nov 2023 16:45:19 +0100 Subject: [PATCH 14/33] fix light map update being done on non-light-map textures --- .../common/util/LightTextureMarker.java | 6 +++++ .../fabric/mixins/client/MixinLightmap.java | 17 +++++++++--- .../fabric/mixins/client/MixinLightmap2.java | 27 +++++++++++++++++++ .../DistantHorizons.fabric.mixins.json | 1 + .../forge/mixins/client/MixinLightmap.java | 19 +++++++++---- .../forge/mixins/client/MixinLightmap2.java | 27 +++++++++++++++++++ .../resources/DistantHorizons.mixins.json | 1 + 7 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 common/src/main/java/com/seibel/distanthorizons/common/util/LightTextureMarker.java create mode 100644 fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLightmap2.java create mode 100644 forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinLightmap2.java diff --git a/common/src/main/java/com/seibel/distanthorizons/common/util/LightTextureMarker.java b/common/src/main/java/com/seibel/distanthorizons/common/util/LightTextureMarker.java new file mode 100644 index 000000000..fd1e3474c --- /dev/null +++ b/common/src/main/java/com/seibel/distanthorizons/common/util/LightTextureMarker.java @@ -0,0 +1,6 @@ +package com.seibel.distanthorizons.common.util; + +public interface LightTextureMarker +{ + void markLightTexture(); +} diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLightmap.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLightmap.java index 92b91265c..542c27750 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLightmap.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLightmap.java @@ -6,29 +6,33 @@ import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftRenderWrapp import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector; import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.IClientLevelWrapper; -import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; -import net.minecraft.client.renderer.LightTexture; +import com.seibel.distanthorizons.common.util.LightTextureMarker; import net.minecraft.client.renderer.texture.DynamicTexture; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(DynamicTexture.class) -public class MixinLightmap +public class MixinLightmap implements LightTextureMarker { + @Unique + private boolean isLightTexture = false; + @Shadow @Final private NativeImage pixels; - @Inject(method = "Lnet/minecraft/client/renderer/texture/DynamicTexture;upload()V", at = @At("HEAD"), cancellable = true) + @Inject(method = "upload()V", at = @At("HEAD")) public void updateLightTexture(CallbackInfo ci) { // since the light map is always updated on the client render thread we should be able to access the client level at the same time IMinecraftClientWrapper mc = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class); if ( + !isLightTexture || mc == null || mc.getWrappedClientLevel() == null ) @@ -39,4 +43,9 @@ public class MixinLightmap MinecraftRenderWrapper.INSTANCE.updateLightmap(this.pixels, clientLevel); } + public void markLightTexture() + { + isLightTexture = true; + } + } diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLightmap2.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLightmap2.java new file mode 100644 index 000000000..2036aeeeb --- /dev/null +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLightmap2.java @@ -0,0 +1,27 @@ +package com.seibel.distanthorizons.fabric.mixins.client; + + +import com.seibel.distanthorizons.common.util.LightTextureMarker; +import net.minecraft.client.renderer.LightTexture; +import net.minecraft.client.renderer.texture.DynamicTexture; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(LightTexture.class) +public class MixinLightmap2 +{ + @Shadow + @Final + private DynamicTexture lightTexture; + + @Inject(method = "", at = @At("RETURN")) + public void markLightTexture(CallbackInfo ci) + { + ((LightTextureMarker) lightTexture).markLightTexture(); + } + +} diff --git a/fabric/src/main/resources/DistantHorizons.fabric.mixins.json b/fabric/src/main/resources/DistantHorizons.fabric.mixins.json index c95eb9786..121fecb15 100644 --- a/fabric/src/main/resources/DistantHorizons.fabric.mixins.json +++ b/fabric/src/main/resources/DistantHorizons.fabric.mixins.json @@ -16,6 +16,7 @@ "client.MixinGameRenderer", "client.MixinLevelRenderer", "client.MixinLightmap", + "client.MixinLightmap2", "client.MixinOptionsScreen", "client.MixinMinecraft", "client.MixinTextureUtil" diff --git a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinLightmap.java b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinLightmap.java index 108390f79..7ae524a4a 100644 --- a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinLightmap.java +++ b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinLightmap.java @@ -6,30 +6,34 @@ import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftRenderWrapp import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector; import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.IClientLevelWrapper; -import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; -import net.minecraft.client.renderer.LightTexture; +import com.seibel.distanthorizons.common.util.LightTextureMarker; import net.minecraft.client.renderer.texture.DynamicTexture; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(DynamicTexture.class) -public class MixinLightmap +public class MixinLightmap implements LightTextureMarker { + @Unique + private boolean isLightTexture = false; + @Shadow @Final private NativeImage pixels; - @Inject(method = "Lnet/minecraft/client/renderer/texture/DynamicTexture;upload()V", at = @At("HEAD"), cancellable = true) + @Inject(method = "upload()V", at = @At("HEAD")) public void updateLightTexture(CallbackInfo ci) { // since the light map is always updated on the client render thread we should be able to access the client level at the same time IMinecraftClientWrapper mc = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class); if ( - mc == null || + !isLightTexture || + mc == null || mc.getWrappedClientLevel() == null ) return; @@ -39,4 +43,9 @@ public class MixinLightmap MinecraftRenderWrapper.INSTANCE.updateLightmap(this.pixels, clientLevel); } + public void markLightTexture() + { + isLightTexture = true; + } + } diff --git a/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinLightmap2.java b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinLightmap2.java new file mode 100644 index 000000000..1a4945860 --- /dev/null +++ b/forge/src/main/java/com/seibel/distanthorizons/forge/mixins/client/MixinLightmap2.java @@ -0,0 +1,27 @@ +package com.seibel.distanthorizons.forge.mixins.client; + + +import com.seibel.distanthorizons.common.util.LightTextureMarker; +import net.minecraft.client.renderer.LightTexture; +import net.minecraft.client.renderer.texture.DynamicTexture; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(LightTexture.class) +public class MixinLightmap2 +{ + @Shadow + @Final + private DynamicTexture lightTexture; + + @Inject(method = "", at = @At("RETURN")) + public void markLightTexture(CallbackInfo ci) + { + ((LightTextureMarker) lightTexture).markLightTexture(); + } + +} diff --git a/forge/src/main/resources/DistantHorizons.mixins.json b/forge/src/main/resources/DistantHorizons.mixins.json index 4d03828c3..458a871af 100644 --- a/forge/src/main/resources/DistantHorizons.mixins.json +++ b/forge/src/main/resources/DistantHorizons.mixins.json @@ -15,6 +15,7 @@ "client.MixinGameRenderer", "client.MixinLevelRenderer", "client.MixinLightmap", + "client.MixinLightmap2", "client.MixinOptionsScreen", "client.MixinTextureUtil" ], From 5e17e4ea8c4e46170b83c33941662861403af919 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 28 Nov 2023 07:13:44 -0600 Subject: [PATCH 15/33] Update Sqlite 3.43.0.0 -> =3.44.1.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 7c6bd1ab1..335ee904c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ mod_discord=https://discord.gg/xAB8G4cENx manifold_version=2023.1.29 nightconfig_version=3.6.6 lz4_version=1.8.0 -sqlite_jdbc_version=3.43.0.0 +sqlite_jdbc_version=3.44.1.0 #svgSalamander_version=1.1.3 # Minecraft related libaries (included in MC's jar) From 6c1562ac33a8049e2206a1bad1ab07e12f102bf8 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 29 Nov 2023 07:44:27 -0600 Subject: [PATCH 16/33] Merge Null's fragment shader culling !38 --- coreSubProjects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreSubProjects b/coreSubProjects index efc2ce84e..466ebe050 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit efc2ce84e48ae6f9380fe9c5721d6883bd362a23 +Subproject commit 466ebe050359eb7b48e56d2968b8552bdf114ddb From cb7d980e1595dbd3ac9202423f446aab329fede3 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 30 Nov 2023 07:03:15 -0600 Subject: [PATCH 17/33] Fix a typo in the bug issue template --- .gitlab/issue_templates/Bug.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/issue_templates/Bug.md b/.gitlab/issue_templates/Bug.md index 5474dfcad..a6eb95cc2 100644 --- a/.gitlab/issue_templates/Bug.md +++ b/.gitlab/issue_templates/Bug.md @@ -1,4 +1,4 @@ -## Chcek off each item in this list before submitting: +## Check off each item in this list before submitting: