Compare commits

..

54 Commits

Author SHA1 Message Date
James Seibel 008ad52bbc remove dev from version number 2025-12-23 22:57:10 -06:00
James Seibel d0b44a1ffc Fix toggling world gen not recreating queue 2025-12-23 22:57:05 -06:00
James Seibel 4ffe430686 up DH api version 5.0.0 -> 5.1.0 2025-12-23 20:01:19 -06:00
James Seibel 19ca97c6c1 add experimental option to ignore rendering dimensions by name 2025-12-23 12:22:05 -06:00
James Seibel 3334394bfd Fix earth curvature shader compiling 2025-12-23 08:47:50 -06:00
James Seibel 180e7cd814 change forge fog config to match neo/fabric 2025-12-22 20:32:41 -06:00
James Seibel 84cf4505f2 merge world gen refactor 2025-12-20 10:54:07 -06:00
James Seibel 1d74eea3ef reduce stuttering at the cost of lighting quality 2025-12-20 10:53:14 -06:00
James Seibel 6ee2e6be25 up manifold version 25.1.27 -> 25.1.28 2025-12-19 16:55:32 -06:00
James Seibel b5c47d67cb up version number 2.4.3 -> 2.4.4-dev 2025-12-18 10:04:57 -06:00
James Seibel ead59d0817 remove dev from version number 2025-12-18 09:35:57 -06:00
James Seibel 1c9229c8f1 Fix 1.21.11 stuttering when flying into new chunks in singleplayer 2025-12-18 09:35:54 -06:00
James Seibel 968a14c6a5 remove chunkWrapper.isStillValid() 2025-12-18 09:35:21 -06:00
James Seibel 851c7439d5 Fix GLProxy error in multiplayer 2025-12-17 09:02:15 -06:00
s809 c902357a8f Update core 2025-12-17 00:17:27 +05:00
s809 63170078f5 Fix returning wrong dimension name 2025-12-17 00:17:21 +05:00
James Seibel d0dd1f125b ignore chunk update events during all world gen pos 2025-12-15 15:07:01 -06:00
James Seibel 32950d793e slight light engine optimization 2025-12-15 14:37:22 -06:00
James Seibel 54e9bad907 up version number 2.4.2 -> 2.4.3-dev 2025-12-15 10:17:34 -06:00
James Seibel bb4ac770bd remove dev from version number 2025-12-15 09:49:23 -06:00
James Seibel 16afada6e9 Fix inconsistency with server/client wrapper dim names 2025-12-15 09:49:23 -06:00
James Seibel 7d0785a5fa Fix dimension names missing namespace for multiplayer folders 2025-12-15 08:56:08 -06:00
James Seibel 6a67df462b Move GC warning into the log 2025-12-15 08:44:12 -06:00
s809 0c45c76ff8 Use a different path for zstd natives 2025-12-15 11:21:28 +05:00
James Seibel bcb442e38d Improve initial library check error handling 2025-12-14 22:29:22 -06:00
James Seibel 977ae471ea Fix auto update success dialog 2025-12-14 21:51:00 -06:00
James Seibel b1701ab0d0 remove iris unsupported error for neo 1.21.11 2025-12-14 21:20:22 -06:00
James Seibel c048d5cb56 hide LODs when underwater 2025-12-14 17:22:40 -06:00
James Seibel 2702f742d6 up version number 2.4.1 -> 2.4.2-dev 2025-12-14 17:00:44 -06:00
James Seibel 7add025c8a remove dev from version number 2025-12-14 13:46:24 -06:00
James Seibel 9dc220feb2 re-generate ZStd relocated cache
The previous versions appeared to be out of date, causing linker errors
2025-12-13 21:32:15 -06:00
s809 79955252c9 Add zstd to relocated natives & update sqlite 2025-12-14 04:03:19 +05:00
James Seibel bf13cc48a3 Print a warning if G1GC is used 2025-12-13 16:47:03 -06:00
James Seibel cf454c80d7 add Zstd decompress lib check in initalizer 2025-12-13 15:48:09 -06:00
James Seibel e6404cd882 remove double ";" in ForgeMain 2025-12-13 15:44:40 -06:00
James Seibel 52e64dc403 log if a mod accessor isn't added 2025-12-13 15:44:27 -06:00
James Seibel 7c858afc5d add partial oculus support 2025-12-13 13:17:43 -06:00
James Seibel a44a5d7465 replace client ticks with a timer
Prevents DH loading issues when MC ticks are paused
2025-12-13 11:19:39 -06:00
James Seibel f2d373b779 up version number 2.4.0 -> 2.4.1-dev 2025-12-13 10:20:53 -06:00
James Seibel 5138af0b78 up version number 2.3.7 -> 2.4.0 2025-12-13 10:20:17 -06:00
James Seibel 37e99cd0a5 Fix infinite loop in DhSectionPos 2025-12-13 09:10:17 -06:00
James Seibel 6cb8cd2bd9 fix missing localization 2025-12-12 07:45:54 -06:00
James Seibel c5ae7da96c add mod menu and neo iris support 2025-12-11 21:37:08 -06:00
James Seibel 59b886c5e3 API cleanup 2025-12-11 07:35:47 -06:00
James Seibel 01e78f249f auto disable clouds/chunk fading and fix sodium crash 2025-12-10 18:51:13 -06:00
James Seibel e1c3da59db Fix pre MC 1.21.11 compiling 2025-12-10 07:28:39 -06:00
James Seibel cdfb46b041 Allow world gen limits on singleplayer 2025-12-10 07:09:44 -06:00
James Seibel f944fe4409 change the default issue template 2025-12-09 21:15:20 -06:00
James Seibel c2e45f3d65 add support for MC 1.21.11 2025-12-09 21:15:09 -06:00
James Seibel a9c4f3ea46 revert long windows filepath char 2025-12-09 07:21:45 -06:00
James Seibel 204d48517b Merge branch 'batchGenRefactor' 2025-12-09 07:16:32 -06:00
James Seibel 8d2b5fa3ce fix unit tests and enable long config file paths 2025-12-06 12:28:35 -06:00
James Seibel 2851b2c2db Merge branch 'batchGenRefactor' 2025-12-06 12:19:26 -06:00
James Seibel c518345bcd enable long file paths on windows for the DB 2025-12-02 07:08:27 -06:00
92 changed files with 914 additions and 476 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ build:
parallel: parallel:
matrix: matrix:
- MC_VER: [ - MC_VER: [
"1.21.10", "1.21.9", "1.21.8", "1.21.6", "1.21.5", "1.21.4", "1.21.3", "1.21.1", "1.21.11", "1.21.10", "1.21.9", "1.21.8", "1.21.6", "1.21.5", "1.21.4", "1.21.3", "1.21.1",
"1.20.6", "1.20.4", "1.20.2", "1.20.1", "1.20.6", "1.20.4", "1.20.2", "1.20.1",
"1.19.4", "1.19.2", "1.19.4", "1.19.2",
"1.18.2", "1.18.2",
+36 -2
View File
@@ -1,3 +1,37 @@
Before creating an issue, please select the appropriate template from the dropdown above. ## Check off each item in this list before submitting:
<!--
To mark a section as complete either put an "x" in between the square brackets, example: "[x]"
Or click the checkbox once the issue has been created.
-->
1. [ ] Check the FAQ to see if your issue has already been reported and has a solution:
[Problems-and-solutions](https://gitlab.com/distant-horizons-team/distant-horizons/-/wikis/1-user-guide/1-frequently-asked-questions/2-problems-and-solutions/Problems-and-Solutions)
2. [ ] Make sure you are not using any mods on the incompatible list:
[Mod support FAQ](https://gitlab.com/distant-horizons-team/distant-horizons/-/wikis/1-user-guide/1-frequently-asked-questions/4-mod-support/Mod-Support)
3. [ ] Check the existing issues to verify that your bug hasn't already been submitted:
[Issues](https://gitlab.com/distant-horizons-team/distant-horizons/-/issues)
4. [ ] Upload Minecraft's crash report and/or log. \
Minecraft crash reports are located in: `.minecraft/crash-reports` \
Minecraft logs are located in: `.minecraft/logs`
5. [ ] Upload your Distant Horizons Config. \
The config is found in: `.minecraft/configs/DistantHorizons.toml`
6. [ ] Fill out the information below:
* **minecraft version**:
* **Distant Horizons version**:
* **Mod loader**:
* **Installed mods (list the smallest number of mods that you can use to re-create the bug)**:
* **Describe the bug**:
* **Steps to reproduce the bug**:
The template will walk you through submitting a bug, feature, or improvement request.
+40 -9
View File
@@ -5,6 +5,9 @@ import org.apache.tools.zip.ZipEntry
import javax.annotation.Nonnull import javax.annotation.Nonnull
import org.apache.tools.zip.ZipOutputStream import org.apache.tools.zip.ZipOutputStream
import java.util.function.Function
import java.util.function.Predicate
plugins { plugins {
id "java" id "java"
@@ -19,7 +22,7 @@ plugins {
id "systems.manifold.manifold-gradle-plugin" version "0.0.2-alpha" id "systems.manifold.manifold-gradle-plugin" version "0.0.2-alpha"
// Architectury is used here only as a replacement for forge's own loom // Architectury is used here only as a replacement for forge's own loom
id "dev.architectury.loom" version "1.11-SNAPSHOT" apply false id "dev.architectury.loom" version "1.13-SNAPSHOT" apply false
} }
@@ -73,12 +76,23 @@ writeBuildGradlePredefine(rootProject.mcVers, rootProject.mcIndex)
rootProject.versionStr = rootProject.mod_version + "-" + rootProject.minecraft_version // + "-" + new Date().format("yyyy_MM_dd_HH_mm") rootProject.versionStr = rootProject.mod_version + "-" + rootProject.minecraft_version // + "-" + new Date().format("yyyy_MM_dd_HH_mm")
class NativeTransformer implements Transformer { class NativeTransformer implements Transformer {
private Predicate<String> fileMatcher
private Function<String, String> filePathMapper
private final HashMap<String, String> replacements = new HashMap() private final HashMap<String, String> replacements = new HashMap()
private final HashMap<String, byte[]> rewrittenFiles = new HashMap() private final HashMap<String, byte[]> rewrittenFiles = new HashMap()
private var nativeRelocator private var nativeRelocator
public File rootDir public File rootDir
void matchFiles(Predicate<String> matcher) {
fileMatcher = matcher
}
void mapPaths(Function<String, String> mapper) {
filePathMapper = mapper
}
void relocateNative(String target, String replacement) { void relocateNative(String target, String replacement) {
if (replacement.length() > target.length()) { if (replacement.length() > target.length()) {
throw new GradleException("Length of value \"${replacement}\" exceeds the length of \"${target}\": ${replacement.length()} > ${target.length()}") throw new GradleException("Length of value \"${replacement}\" exceeds the length of \"${target}\": ${replacement.length()} > ${target.length()}")
@@ -89,9 +103,7 @@ class NativeTransformer implements Transformer {
@Override @Override
boolean canTransformResource(@Nonnull FileTreeElement element) { boolean canTransformResource(@Nonnull FileTreeElement element) {
return replacements.keySet().stream().anyMatch { return fileMatcher.test(element.name)
element.name.startsWith(it as String)
}
} }
@Override @Override
@@ -103,11 +115,9 @@ class NativeTransformer implements Transformer {
} }
try { try {
Map.Entry<String, String> pathReplacement = replacements.entrySet().stream().filter { String path = filePathMapper != null
context.path.startsWith(it.key as String) ? filePathMapper.apply(context.path)
}.findFirst().orElseThrow() : context.path
String path = context.path.replace(pathReplacement.key as String, pathReplacement.value as String)
content = nativeRelocator.processBinary(path, content, replacements) content = nativeRelocator.processBinary(path, content, replacements)
rewrittenFiles.put(path, content) rewrittenFiles.put(path, content)
@@ -351,10 +361,31 @@ subprojects { p ->
transform(NativeTransformer) { transform(NativeTransformer) {
rootDir = project.rootDir rootDir = project.rootDir
matchFiles { it.startsWith("org/sqlite") }
mapPaths { it.replace("org/sqlite", "dh_sqlite") }
relocateNative "org/sqlite", "dh_sqlite" relocateNative "org/sqlite", "dh_sqlite"
relocateNative "org_sqlite", "dh_1sqlite" relocateNative "org_sqlite", "dh_1sqlite"
} }
// ZStd
// librariesLocation isn't used because it's too long for replacing paths in native libraries
// Allowing strings larger than the original string would require shifting the entire binary's contents
relocate "com.github.luben", "dhcomgithubluben"
relocate "libzstd-jni", "libzstd-jni_dh"
relocate "zstd-jni", "zstd-jni_dh"
transform(NativeTransformer) {
rootDir = project.rootDir
matchFiles { it.contains("libzstd-jni") && !it.contains("aix/ppc64") }
mapPaths { it.replace("libzstd-jni", "libzstd-jni_dh") }
relocateNative "com/github/luben", "dhcomgithubluben"
relocateNative "com_github_luben", "dhcomgithubluben"
}
// JOML // JOML
if (project.hasProperty("embed_joml") && embed_joml == "true") if (project.hasProperty("embed_joml") && embed_joml == "true")
@@ -116,7 +116,7 @@ public abstract class AbstractModInitializer
LOGGER.info(ModInfo.READABLE_NAME + " server Initialized, adding event subscribers..."); LOGGER.info(ModInfo.READABLE_NAME + " server Initialized, adding event subscribers...");
this.commandInitializer = new CommandInitializer(); this.commandInitializer = new CommandInitializer();
this.subscribeRegisterCommandsEvent(dispatcher -> { commandInitializer.initCommands(dispatcher); }); this.subscribeRegisterCommandsEvent(dispatcher -> { this.commandInitializer.initCommands(dispatcher); });
this.subscribeServerStartingEvent(server -> this.subscribeServerStartingEvent(server ->
{ {
@@ -166,6 +166,10 @@ public abstract class AbstractModInitializer
//noinspection unchecked //noinspection unchecked
ModAccessorInjector.INSTANCE.bind((Class<? extends IModAccessor>) accessorClass, accessorConstructor.get()); ModAccessorInjector.INSTANCE.bind((Class<? extends IModAccessor>) accessorClass, accessorConstructor.get());
} }
else
{
LOGGER.debug("Skipping mod compatibility accessor for: ["+modId+"]");
}
} }
private void initConfig() private void initConfig()
@@ -13,9 +13,14 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IServerPlayerWrapp
import com.seibel.distanthorizons.coreapi.ModInfo; import com.seibel.distanthorizons.coreapi.ModInfo;
import io.netty.buffer.ByteBufUtil; import io.netty.buffer.ByteBufUtil;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
#if MC_VER <= MC_1_21_10
import net.minecraft.resources.ResourceLocation;
#else
import net.minecraft.resources.Identifier;
#endif
import java.io.IOException; import java.io.IOException;
import java.util.Objects; import java.util.Objects;
@@ -25,10 +30,12 @@ public abstract class AbstractPluginPacketSender implements IPluginPacketSender
.fileLevelConfig(Config.Common.Logging.logNetworkEventToFile) .fileLevelConfig(Config.Common.Logging.logNetworkEventToFile)
.build(); .build();
#if MC_VER >= MC_1_21_1 #if MC_VER <= MC_1_20_6
public static final ResourceLocation WRAPPER_PACKET_RESOURCE = new ResourceLocation(ModInfo.RESOURCE_NAMESPACE, ModInfo.WRAPPER_PACKET_PATH);
#elif MC_VER <= MC_1_21_10
public static final ResourceLocation WRAPPER_PACKET_RESOURCE = ResourceLocation.fromNamespaceAndPath(ModInfo.RESOURCE_NAMESPACE, ModInfo.WRAPPER_PACKET_PATH); public static final ResourceLocation WRAPPER_PACKET_RESOURCE = ResourceLocation.fromNamespaceAndPath(ModInfo.RESOURCE_NAMESPACE, ModInfo.WRAPPER_PACKET_PATH);
#else #else
public static final ResourceLocation WRAPPER_PACKET_RESOURCE = new ResourceLocation(ModInfo.RESOURCE_NAMESPACE, ModInfo.WRAPPER_PACKET_PATH); public static final Identifier WRAPPER_PACKET_RESOURCE = Identifier.fromNamespaceAndPath(ModInfo.RESOURCE_NAMESPACE, ModInfo.WRAPPER_PACKET_PATH);
#endif #endif
// "Forge byte" is an unused packet ID. We have our own system which works with all mod loaders, // "Forge byte" is an unused packet ID. We have our own system which works with all mod loaders,
@@ -8,13 +8,23 @@ import org.jetbrains.annotations.Nullable;
import static com.seibel.distanthorizons.core.network.messages.MessageRegistry.DEBUG_CODEC_CRASH_MESSAGE; import static com.seibel.distanthorizons.core.network.messages.MessageRegistry.DEBUG_CODEC_CRASH_MESSAGE;
import static net.minecraft.commands.Commands.literal; import static net.minecraft.commands.Commands.literal;
/** #if MC_VER <= MC_1_21_10
* Initializes commands of the mod. #else
*/ import net.minecraft.server.permissions.PermissionCheck;
import net.minecraft.server.permissions.Permissions;
#endif
public class CommandInitializer public class CommandInitializer
{ {
private boolean serverReady = false; private boolean serverReady = false;
#if MC_VER <= MC_1_21_10
private static final int REQUIRED_PERMISSION_LEVEL = 4;
#else
private static final PermissionCheck COMMAND_PERMISSION_CHECK = new PermissionCheck.Require(Permissions.COMMANDS_OWNER);
#endif
/** /**
* A received command dispatcher, which is held until the server is ready to initialize the commands. * A received command dispatcher, which is held until the server is ready to initialize the commands.
*/ */
@@ -50,7 +60,14 @@ public class CommandInitializer
} }
LiteralArgumentBuilder<CommandSourceStack> builder = literal("dh") LiteralArgumentBuilder<CommandSourceStack> builder = literal("dh")
.requires(source -> source.hasPermission(4)); .requires((source) ->
{
#if MC_VER <= MC_1_21_10
return source.hasPermission(REQUIRED_PERMISSION_LEVEL);
#else
return COMMAND_PERMISSION_CHECK.check(source.permissions());
#endif
});
builder.then(new ConfigCommand().buildCommand()); builder.then(new ConfigCommand().buildCommand());
builder.then(new DebugCommand().buildCommand()); builder.then(new DebugCommand().buildCommand());
@@ -83,6 +83,8 @@ public class VersionConstants implements IVersionConstants
return "1.21.9"; return "1.21.9";
#elif MC_VER == MC_1_21_10 #elif MC_VER == MC_1_21_10
return "1.21.10"; return "1.21.10";
#elif MC_VER == MC_1_21_11
return "1.21.11";
#else #else
ERROR MC version constant missing ERROR MC version constant missing
#endif #endif
@@ -29,7 +29,6 @@ import java.util.concurrent.ConcurrentMap;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import org.apache.logging.log4j.LogManager;
import com.seibel.distanthorizons.core.logging.DhLogger; import com.seibel.distanthorizons.core.logging.DhLogger;
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper;
@@ -46,7 +45,12 @@ import net.minecraft.core.Holder;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
#endif #endif
#if MC_VER <= MC_1_21_10
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
#else
import net.minecraft.resources.Identifier;
#endif
import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.Biome;
#if MC_VER >= MC_1_18_2 #if MC_VER >= MC_1_18_2
@@ -217,7 +221,12 @@ public class BiomeWrapper implements IBiomeWrapper
Level level = (Level)levelWrapper.getWrappedMcObject(); Level level = (Level)levelWrapper.getWrappedMcObject();
net.minecraft.core.RegistryAccess registryAccess = level.registryAccess(); net.minecraft.core.RegistryAccess registryAccess = level.registryAccess();
#if MC_VER < MC_1_21_11
ResourceLocation resourceLocation; ResourceLocation resourceLocation;
#else
Identifier resourceLocation;
#endif
#if MC_VER == MC_1_16_5 || MC_VER == MC_1_17_1 #if MC_VER == MC_1_16_5 || MC_VER == MC_1_17_1
resourceLocation = registryAccess.registryOrThrow(Registry.BIOME_REGISTRY).getKey(this.biome); resourceLocation = registryAccess.registryOrThrow(Registry.BIOME_REGISTRY).getKey(this.biome);
#elif MC_VER == MC_1_18_2 || MC_VER == MC_1_19_2 #elif MC_VER == MC_1_18_2 || MC_VER == MC_1_19_2
@@ -324,13 +333,19 @@ public class BiomeWrapper implements IBiomeWrapper
throw new IOException("Unable to parse resource location string: [" + resourceLocationString + "]."); throw new IOException("Unable to parse resource location string: [" + resourceLocationString + "].");
} }
#if MC_VER < MC_1_21_11
ResourceLocation resourceLocation; ResourceLocation resourceLocation;
#else
Identifier resourceLocation;
#endif
try try
{ {
#if MC_VER < MC_1_21_1 #if MC_VER <= MC_1_20_6
resourceLocation = new ResourceLocation(resourceLocationString.substring(0, separatorIndex), resourceLocationString.substring(separatorIndex + 1)); resourceLocation = new ResourceLocation(resourceLocationString.substring(0, separatorIndex), resourceLocationString.substring(separatorIndex + 1));
#else #elif MC_VER <= MC_1_21_10
resourceLocation = ResourceLocation.fromNamespaceAndPath(resourceLocationString.substring(0, separatorIndex), resourceLocationString.substring(separatorIndex + 1)); resourceLocation = ResourceLocation.fromNamespaceAndPath(resourceLocationString.substring(0, separatorIndex), resourceLocationString.substring(separatorIndex + 1));
#else
resourceLocation = Identifier.fromNamespaceAndPath(resourceLocationString.substring(0, separatorIndex), resourceLocationString.substring(separatorIndex + 1));
#endif #endif
} }
catch (Exception e) catch (Exception e)
@@ -28,7 +28,6 @@ import com.seibel.distanthorizons.core.util.LodUtil;
import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags; import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.block.BeaconBeamBlock; import net.minecraft.world.level.block.BeaconBeamBlock;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
@@ -63,6 +62,12 @@ import net.minecraft.world.level.EmptyBlockGetter;
import net.minecraft.core.Holder; import net.minecraft.core.Holder;
#endif #endif
#if MC_VER <= MC_1_21_10
import net.minecraft.resources.ResourceLocation;
#else
import net.minecraft.resources.Identifier;
#endif
public class BlockStateWrapper implements IBlockStateWrapper public class BlockStateWrapper implements IBlockStateWrapper
{ {
/** example "minecraft:water" */ /** example "minecraft:water" */
@@ -87,7 +92,11 @@ public class BlockStateWrapper implements IBlockStateWrapper
public static HashSet<IBlockStateWrapper> rendererIgnoredCaveBlocks = null; public static HashSet<IBlockStateWrapper> rendererIgnoredCaveBlocks = null;
/** keep track of broken blocks so we don't log every time */ /** keep track of broken blocks so we don't log every time */
#if MC_VER <= MC_1_21_10
private static final HashSet<ResourceLocation> BROKEN_RESOURCE_LOCATIONS = new HashSet<>(); private static final HashSet<ResourceLocation> BROKEN_RESOURCE_LOCATIONS = new HashSet<>();
#else
private static final HashSet<Identifier> BROKEN_RESOURCE_LOCATIONS = new HashSet<>();
#endif
@@ -555,7 +564,12 @@ public class BlockStateWrapper implements IBlockStateWrapper
net.minecraft.core.RegistryAccess registryAccess = level.registryAccess(); net.minecraft.core.RegistryAccess registryAccess = level.registryAccess();
#endif #endif
#if MC_VER < MC_1_21_11
ResourceLocation resourceLocation; ResourceLocation resourceLocation;
#else
Identifier resourceLocation;
#endif
#if MC_VER == MC_1_16_5 || MC_VER == MC_1_17_1 #if MC_VER == MC_1_16_5 || MC_VER == MC_1_17_1
resourceLocation = Registry.BLOCK.getKey(this.blockState.getBlock()); resourceLocation = Registry.BLOCK.getKey(this.blockState.getBlock());
#elif MC_VER == MC_1_18_2 || MC_VER == MC_1_19_2 #elif MC_VER == MC_1_18_2 || MC_VER == MC_1_19_2
@@ -622,13 +636,20 @@ public class BlockStateWrapper implements IBlockStateWrapper
throw new IOException("Unable to parse Resource Location out of string: [" + resourceStateString + "]."); throw new IOException("Unable to parse Resource Location out of string: [" + resourceStateString + "].");
} }
#if MC_VER < MC_1_21_11
ResourceLocation resourceLocation; ResourceLocation resourceLocation;
#else
Identifier resourceLocation;
#endif
try try
{ {
#if MC_VER < MC_1_21_1 #if MC_VER < MC_1_21_1
resourceLocation = new ResourceLocation(resourceStateString.substring(0, separatorIndex), resourceStateString.substring(separatorIndex + 1)); resourceLocation = new ResourceLocation(resourceStateString.substring(0, separatorIndex), resourceStateString.substring(separatorIndex + 1));
#else #elif MC_VER <= MC_1_21_10
resourceLocation = ResourceLocation.fromNamespaceAndPath(resourceStateString.substring(0, separatorIndex), resourceStateString.substring(separatorIndex + 1)); resourceLocation = ResourceLocation.fromNamespaceAndPath(resourceStateString.substring(0, separatorIndex), resourceStateString.substring(separatorIndex + 1));
#else
resourceLocation = Identifier.fromNamespaceAndPath(resourceStateString.substring(0, separatorIndex), resourceStateString.substring(separatorIndex + 1));
#endif #endif
} }
catch (Exception e) catch (Exception e)
@@ -18,6 +18,7 @@
*/ */
package com.seibel.distanthorizons.common.wrappers.chunk; package com.seibel.distanthorizons.common.wrappers.chunk;
import com.seibel.distanthorizons.api.DhApi;
import com.seibel.distanthorizons.common.wrappers.block.BiomeWrapper; import com.seibel.distanthorizons.common.wrappers.block.BiomeWrapper;
import com.seibel.distanthorizons.common.wrappers.block.BlockStateWrapper; import com.seibel.distanthorizons.common.wrappers.block.BlockStateWrapper;
import com.seibel.distanthorizons.common.wrappers.misc.MutableBlockPosWrapper; import com.seibel.distanthorizons.common.wrappers.misc.MutableBlockPosWrapper;
@@ -80,6 +81,8 @@ public class ChunkWrapper implements IChunkWrapper
private static final ThreadLocal<BlockPos.MutableBlockPos> MUTABLE_BLOCK_POS_REF = ThreadLocal.withInitial(() -> new BlockPos.MutableBlockPos()); private static final ThreadLocal<BlockPos.MutableBlockPos> MUTABLE_BLOCK_POS_REF = ThreadLocal.withInitial(() -> new BlockPos.MutableBlockPos());
private static final ThreadLocal<MutableBlockPosWrapper> MUTABLE_BLOCK_POS_WRAPPER_REF = ThreadLocal.withInitial(() -> new MutableBlockPosWrapper()); private static final ThreadLocal<MutableBlockPosWrapper> MUTABLE_BLOCK_POS_WRAPPER_REF = ThreadLocal.withInitial(() -> new MutableBlockPosWrapper());
private static boolean heightmapThreadWarningLogged = false;
private final ChunkAccess chunk; private final ChunkAccess chunk;
private final DhChunkPos chunkPos; private final DhChunkPos chunkPos;
@@ -107,21 +110,20 @@ public class ChunkWrapper implements IChunkWrapper
// constructor // // constructor //
//=============// //=============//
/**
* Note: this constructor should be very
* fast since it will be called frequently on the MC
* server thread and a slow method will cause server lag.
*/
public ChunkWrapper(ChunkAccess chunk, ILevelWrapper wrappedLevel) public ChunkWrapper(ChunkAccess chunk, ILevelWrapper wrappedLevel)
{
this(chunk, wrappedLevel, true);
}
public ChunkWrapper(ChunkAccess chunk, ILevelWrapper wrappedLevel, boolean recreateHeightmaps)
{ {
this.chunk = chunk; this.chunk = chunk;
this.wrappedLevel = wrappedLevel; this.wrappedLevel = wrappedLevel;
this.chunkPos = new DhChunkPos(chunk.getPos().x, chunk.getPos().z); this.chunkPos = new DhChunkPos(chunk.getPos().x, chunk.getPos().z);
}
if (recreateHeightmaps) @Override
{ public ChunkWrapper copy() { return new ChunkWrapper(this.chunk, this.wrappedLevel); }
this.createDhHeightMaps();
}
}
@@ -242,11 +244,15 @@ public class ChunkWrapper implements IChunkWrapper
} }
private int getChunkSectionMinHeight(int index) { return (index * 16) + this.getInclusiveMinBuildHeight(); } private int getChunkSectionMinHeight(int index) { return (index * 16) + this.getInclusiveMinBuildHeight(); }
@Override
public void createDhHeightMaps() public void createDhHeightMaps()
{ {
// re-calculate the min/max heights for consistency (during world gen these may be wrong) if (heightmapThreadWarningLogged
this.minNonEmptyHeight = Integer.MIN_VALUE; && !DhApi.isDhThread())
this.maxNonEmptyHeight = Integer.MAX_VALUE; {
LOGGER.warn("ChunkWrapper Height maps created on non-DH thread ["+Thread.currentThread().getName()+"]. This may cause stuttering.");
}
this.solidHeightMap = new int[LodUtil.CHUNK_WIDTH][LodUtil.CHUNK_WIDTH]; this.solidHeightMap = new int[LodUtil.CHUNK_WIDTH][LodUtil.CHUNK_WIDTH];
@@ -614,15 +620,6 @@ public class ChunkWrapper implements IChunkWrapper
//===============//
// other methods //
//===============//
@Override
public boolean isStillValid() { return this.wrappedLevel.tryGetChunk(this.chunkPos) == this; }
//================// //================//
// base overrides // // base overrides //
//================// //================//
@@ -37,7 +37,6 @@ import net.minecraft.client.gui.components.EditBox;
import net.minecraft.client.gui.components.events.GuiEventListener; import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import com.seibel.distanthorizons.core.logging.DhLogger; import com.seibel.distanthorizons.core.logging.DhLogger;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@@ -54,6 +53,12 @@ import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.narration.NarratableEntry; import net.minecraft.client.gui.narration.NarratableEntry;
#endif #endif
#if MC_VER <= MC_1_21_10
import net.minecraft.resources.ResourceLocation;
#else
import net.minecraft.resources.Identifier;
#endif
import static com.seibel.distanthorizons.common.wrappers.gui.GuiHelper.*; import static com.seibel.distanthorizons.common.wrappers.gui.GuiHelper.*;
import static com.seibel.distanthorizons.common.wrappers.gui.GuiHelper.Translatable; import static com.seibel.distanthorizons.common.wrappers.gui.GuiHelper.Translatable;
@@ -180,8 +185,10 @@ public class ClassicConfigGUI
0, 0,
#if MC_VER < MC_1_21_1 #if MC_VER < MC_1_21_1
new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"), new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"),
#else #elif MC_VER <= MC_1_21_10
ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"),
#else
Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"),
#endif #endif
20, 20, 20, 20,
// Create the button and tell it where to go // Create the button and tell it where to go
@@ -14,9 +14,13 @@ import java.util.List;
import net.minecraft.client.gui.components.debug.DebugScreenDisplayer; import net.minecraft.client.gui.components.debug.DebugScreenDisplayer;
import net.minecraft.client.gui.components.debug.DebugScreenEntries; import net.minecraft.client.gui.components.debug.DebugScreenEntries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.chunk.LevelChunk; import net.minecraft.world.level.chunk.LevelChunk;
#if MC_VER <= MC_1_21_10
import net.minecraft.resources.ResourceLocation;
#endif
#endif #endif
#if MC_VER < MC_1_21_9 #if MC_VER < MC_1_21_9
@@ -31,7 +35,12 @@ public class DhDebugScreenEntry implements net.minecraft.client.gui.components.d
// This method is private, so its access will need to be widened // This method is private, so its access will need to be widened
DebugScreenEntries.register( DebugScreenEntries.register(
// The id, this will be displayed on the options screen // The id, this will be displayed on the options screen
#if MC_VER <= MC_1_21_10
ResourceLocation.fromNamespaceAndPath(ModInfo.RESOURCE_NAMESPACE, "distant_horizons"), ResourceLocation.fromNamespaceAndPath(ModInfo.RESOURCE_NAMESPACE, "distant_horizons"),
#else
"distant_horizons",
#endif
// The screen entry // The screen entry
new DhDebugScreenEntry() new DhDebugScreenEntry()
); );
@@ -95,10 +95,22 @@ public class MinecraftScreen
super.render(matrices, mouseX, mouseY, delta); // Render the vanilla stuff (currently only used for the background and tint) super.render(matrices, mouseX, mouseY, delta); // Render the vanilla stuff (currently only used for the background and tint)
} }
#if MC_VER <= MC_1_21_10
@Override @Override
public void resize(Minecraft mc, int width, int height) public void resize(Minecraft mc, int width, int height)
#else
@Override
public void resize(int width, int height)
#endif
{ {
super.resize(mc, width, height); // Resize Minecraft's screen // Resize Minecraft's screen
#if MC_VER <= MC_1_21_10
super.resize(mc, width, height);
#else
super.resize(width, height);
#endif
Window mcWindow = this.minecraft.getWindow(); Window mcWindow = this.minecraft.getWindow();
this.screen.width = mcWindow.getWidth(); this.screen.width = mcWindow.getWidth();
this.screen.height = mcWindow.getHeight(); this.screen.height = mcWindow.getHeight();
@@ -20,7 +20,6 @@
package com.seibel.distanthorizons.common.wrappers.gui; package com.seibel.distanthorizons.common.wrappers.gui;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
#if MC_VER >= MC_1_17_1 #if MC_VER >= MC_1_17_1
import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.Button;
@@ -42,10 +41,19 @@ import net.minecraft.client.gui.GuiGraphics;
#elif MC_VER < MC_1_21_6 #elif MC_VER < MC_1_21_6
import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderType;
#else #elif MC_VER <= MC_1_21_10
import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.RenderPipelines; import net.minecraft.client.renderer.RenderPipelines;
#else
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.renderer.RenderPipelines;
#endif
#if MC_VER <= MC_1_21_10
import net.minecraft.resources.ResourceLocation;
#else
import net.minecraft.resources.Identifier;
#endif #endif
/** /**
@@ -67,18 +75,33 @@ public class TexturedButtonWidget extends Button
private final int v; private final int v;
private final int hoveredVOffset; private final int hoveredVOffset;
#if MC_VER <= MC_1_21_10
private final ResourceLocation textureResourceLocation; private final ResourceLocation textureResourceLocation;
#else
private final Identifier textureResourceLocation;
#endif
private final int textureWidth; private final int textureWidth;
private final int textureHeight; private final int textureHeight;
#endif #endif
public TexturedButtonWidget(int x, int y, int width, int height, int u, int v, int hoveredVOffset, ResourceLocation textureResourceLocation, int textureWidth, int textureHeight, OnPress pressAction, Component text) public TexturedButtonWidget(
int x, int y, int width, int height, int u, int v, int hoveredVOffset,
#if MC_VER <= MC_1_21_10 ResourceLocation textureResourceLocation,
#else Identifier textureResourceLocation,
#endif
int textureWidth, int textureHeight, OnPress pressAction, Component text)
{ {
this(x, y, width, height, u, v, hoveredVOffset, textureResourceLocation, textureWidth, textureHeight, pressAction, text, true); this(x, y, width, height, u, v, hoveredVOffset, textureResourceLocation, textureWidth, textureHeight, pressAction, text, true);
} }
public TexturedButtonWidget(int x, int y, int width, int height, int u, int v, int hoveredVOffset, ResourceLocation textureResourceLocation, int textureWidth, int textureHeight, OnPress pressAction, Component text, boolean renderBackground) public TexturedButtonWidget(
int x, int y, int width, int height, int u, int v, int hoveredVOffset,
#if MC_VER <= MC_1_21_10 ResourceLocation textureResourceLocation,
#else Identifier textureResourceLocation,
#endif
int textureWidth, int textureHeight, OnPress pressAction, Component text,
boolean renderBackground)
{ {
#if MC_VER < MC_1_20_2 #if MC_VER < MC_1_20_2
super(x, y, width, height, u, v, hoveredVOffset, textureResourceLocation, textureWidth, textureHeight, pressAction, text); super(x, y, width, height, u, v, hoveredVOffset, textureResourceLocation, textureWidth, textureHeight, pressAction, text);
@@ -169,8 +192,13 @@ public class TexturedButtonWidget extends Button
#endif #endif
#else #else
#if MC_VER < MC_1_21_11
@Override @Override
public void renderWidget(GuiGraphics matrices, int mouseX, int mouseY, float delta) public void renderWidget(GuiGraphics matrices, int mouseX, int mouseY, float delta)
#else
@Override
protected void renderContents(GuiGraphics matrices, int mouseX, int mouseY, float delta)
#endif
{ {
if (this.renderBackground) if (this.renderBackground)
{ {
@@ -9,14 +9,21 @@ import com.seibel.distanthorizons.coreapi.ModInfo;
import com.seibel.distanthorizons.core.config.Config; import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter; import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter;
import com.seibel.distanthorizons.core.jar.updater.SelfUpdater; import com.seibel.distanthorizons.core.jar.updater.SelfUpdater;
import com.seibel.distanthorizons.core.logging.DhLogger;
import net.minecraft.client.gui.screens.Screen;
#if MC_VER >= MC_1_20_1 #if MC_VER >= MC_1_20_1
import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.GuiGraphics;
#else #else
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
#endif #endif
import net.minecraft.client.gui.screens.Screen;
#if MC_VER <= MC_1_21_10
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import com.seibel.distanthorizons.core.logging.DhLogger; #else
import net.minecraft.resources.Identifier;
#endif
import static com.seibel.distanthorizons.common.wrappers.gui.GuiHelper.*; import static com.seibel.distanthorizons.common.wrappers.gui.GuiHelper.*;
@@ -88,10 +95,12 @@ public class UpdateModScreen extends DhScreen
0, 0, 0, 0,
// Some textuary stuff // Some textuary stuff
0, 0,
#if MC_VER < MC_1_21_1 #if MC_VER <= MC_1_20_6
new ResourceLocation(ModInfo.ID, "logo.png"), new ResourceLocation(ModInfo.ID, "logo.png"),
#else #elif MC_VER <= MC_1_21_10
ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "logo.png"), ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "logo.png"),
#else
Identifier.fromNamespaceAndPath(ModInfo.ID, "logo.png"),
#endif #endif
195, 65, 195, 65,
// Create the button and tell it where to go // Create the button and tell it where to go
@@ -121,12 +130,14 @@ public class UpdateModScreen extends DhScreen
0, 0,
#if MC_VER < MC_1_21_1 #if MC_VER < MC_1_21_1
new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"), new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"),
#else #elif MC_VER <= MC_1_21_10
ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"),
#else
Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"),
#endif #endif
20, 20, 20, 20,
// Create the button and tell it where to go // Create the button and tell it where to go
(buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(new ChangelogScreen(this, this.newVersionID)), // TODO: Add a proper easter egg to pressing the logo (maybe with confetti) (buttonWidget) -> Objects.requireNonNull(this.minecraft).setScreen(new ChangelogScreen(this, this.newVersionID)),
// Add a title to the button // Add a title to the button
Translatable(ModInfo.ID + ".updater.title") Translatable(ModInfo.ID + ".updater.title")
)); ));
@@ -20,18 +20,8 @@
package com.seibel.distanthorizons.common.wrappers.minecraft; package com.seibel.distanthorizons.common.wrappers.minecraft;
import java.io.File; import java.io.File;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.Objects;
import java.util.UUID;
import com.mojang.blaze3d.platform.NativeImage;
import com.seibel.distanthorizons.api.enums.config.EDhApiLodShading;
import com.seibel.distanthorizons.common.wrappers.McObjectConverter;
import com.seibel.distanthorizons.common.wrappers.world.ClientLevelWrapper; import com.seibel.distanthorizons.common.wrappers.world.ClientLevelWrapper;
import com.seibel.distanthorizons.common.wrappers.world.ServerLevelWrapper;
import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.enums.EDhDirection;
import com.seibel.distanthorizons.core.file.structure.ClientOnlySaveStructure; import com.seibel.distanthorizons.core.file.structure.ClientOnlySaveStructure;
import com.seibel.distanthorizons.core.render.glObject.GLProxy; import com.seibel.distanthorizons.core.render.glObject.GLProxy;
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IClientLevelWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.IClientLevelWrapper;
@@ -40,25 +30,25 @@ import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftSharedWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftSharedWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IProfilerWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IProfilerWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper;
import com.seibel.distanthorizons.core.pos.blockPos.DhBlockPos; import com.seibel.distanthorizons.core.pos.blockPos.DhBlockPos;
import com.seibel.distanthorizons.core.pos.DhChunkPos; import com.seibel.distanthorizons.core.pos.DhChunkPos;
import com.seibel.distanthorizons.core.logging.DhLogger;
import net.minecraft.CrashReport; import net.minecraft.CrashReport;
import net.minecraft.client.CloudStatus;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.multiplayer.ServerData; import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.player.LocalPlayer; import net.minecraft.client.player.LocalPlayer;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.util.profiling.ProfilerFiller;
import net.minecraft.world.level.ChunkPos;
import org.jetbrains.annotations.Nullable;
#if MC_VER < MC_1_19_2 #if MC_VER < MC_1_19_2
import net.minecraft.network.chat.TextComponent; import net.minecraft.network.chat.TextComponent;
#endif #endif
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.profiling.ProfilerFiller;
import net.minecraft.world.level.ChunkPos;
import com.seibel.distanthorizons.core.logging.DhLogger;
import org.jetbrains.annotations.Nullable;
#if MC_VER < MC_1_21_3 #if MC_VER < MC_1_21_3
#else #else
@@ -78,82 +68,13 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
public static final MinecraftClientWrapper INSTANCE = new MinecraftClientWrapper(); public static final MinecraftClientWrapper INSTANCE = new MinecraftClientWrapper();
/**
* The lightmap for the current:
* Time, dimension, brightness setting, etc.
*/
private NativeImage lightMap = null;
private ProfilerWrapper profilerWrapper; private ProfilerWrapper profilerWrapper;
private MinecraftClientWrapper()
{
} //======================//
// multiplayer handling //
//======================//
//================//
// helper methods //
//================//
/**
* This should be called at the beginning of every frame to
* clear any Minecraft data that becomes out of date after a frame. <br> <br>
* <p>
* LightMaps and other time sensitive objects fall in this category. <br> <br>
* <p>
* This doesn't affect OpenGL objects in any way.
*/
@Override
public void clearFrameObjectCache() { this.lightMap = null; }
//=================//
// method wrappers //
//=================//
@Override
public float getShade(EDhDirection lodDirection)
{
EDhApiLodShading lodShading = Config.Client.Advanced.Graphics.Quality.lodShading.get();
switch (lodShading)
{
default:
case AUTO:
if (MINECRAFT.level != null)
{
Direction mcDir = McObjectConverter.Convert(lodDirection);
return MINECRAFT.level.getShade(mcDir, true);
}
else
{
return 0.0f;
}
case ENABLED:
switch (lodDirection)
{
case DOWN:
return 0.5F;
default:
case UP:
return 1.0F;
case NORTH:
case SOUTH:
return 0.8F;
case WEST:
case EAST:
return 0.6F;
}
case DISABLED:
return 1.0F;
}
}
@Override @Override
public boolean hasSinglePlayerServer() { return MINECRAFT.hasSingleplayerServer(); } public boolean hasSinglePlayerServer() { return MINECRAFT.hasSingleplayerServer(); }
@@ -183,7 +104,6 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
return (server != null) ? server.name : "NULL"; return (server != null) ? server.name : "NULL";
} }
} }
@Override @Override
public String getCurrentServerIp() public String getCurrentServerIp()
{ {
@@ -197,7 +117,6 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
return (server != null) ? server.ip : "NA"; return (server != null) ? server.ip : "NA";
} }
} }
@Override @Override
public String getCurrentServerVersion() public String getCurrentServerVersion()
{ {
@@ -205,21 +124,17 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
return (server != null) ? server.version.getString() : "UNKOWN"; return (server != null) ? server.version.getString() : "UNKOWN";
} }
//=============//
// Simple gets //
//=============// //=================//
// player handling //
//=================//
public LocalPlayer getPlayer() { return MINECRAFT.player; } public LocalPlayer getPlayer() { return MINECRAFT.player; }
@Override @Override
public boolean playerExists() { return MINECRAFT.player != null; } public boolean playerExists() { return MINECRAFT.player != null; }
@Override
public UUID getPlayerUUID() { return this.getPlayer().getUUID(); }
@Override
public String getUsername() { return MINECRAFT.getUser().getName(); }
@Override @Override
public DhBlockPos getPlayerBlockPos() public DhBlockPos getPlayerBlockPos()
{ {
@@ -250,6 +165,12 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
return new DhChunkPos(playerPos.x, playerPos.z); return new DhChunkPos(playerPos.x, playerPos.z);
} }
//================//
// level handling //
//================//
@Nullable @Nullable
@Override @Override
public IClientLevelWrapper getWrappedClientLevel() { return this.getWrappedClientLevel(false); } public IClientLevelWrapper getWrappedClientLevel() { return this.getWrappedClientLevel(false); }
@@ -267,6 +188,80 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
return ClientLevelWrapper.getWrapper(level, bypassLevelKeyManager); return ClientLevelWrapper.getWrapper(level, bypassLevelKeyManager);
} }
//===========//
// messaging //
//===========//
@Override
public void sendChatMessage(String string)
{
LocalPlayer player = this.getPlayer();
if (player == null)
{
return;
}
#if MC_VER < MC_1_19_2
player.sendMessage(new TextComponent(string), getPlayer().getUUID());
#elif MC_VER < MC_1_21_9
player.displayClientMessage(net.minecraft.network.chat.Component.translatable(string), /*isOverlay*/false);
#else
GLProxy.queueRunningOnRenderThread(() ->
{
player.displayClientMessage(net.minecraft.network.chat.Component.translatable(string), /*isOverlay*/false);
});
#endif
}
@Override
public void sendOverlayMessage(String string)
{
LocalPlayer player = this.getPlayer();
if (player == null)
{
return;
}
#if MC_VER < MC_1_19_2
player.displayClientMessage(new TextComponent(string), /*isOverlay*/true);
#else
player.displayClientMessage(net.minecraft.network.chat.Component.translatable(string), /*isOverlay*/true);
#endif
}
//==========================//
// vanilla option overrides //
//==========================//
public void disableVanillaClouds()
{
#if MC_VER <= MC_1_18_2
MINECRAFT.options.renderClouds = CloudStatus.OFF;
#else
MINECRAFT.options.cloudStatus().set(CloudStatus.OFF);
#endif
}
public void disableVanillaChunkFadeIn()
{
#if MC_VER <= MC_1_21_10
// chunk fade in was added MC 1.21.11
#else
MINECRAFT.options.chunkSectionFadeInTime().set(0.0);
#endif
}
//======//
// misc //
//======//
@Override @Override
public IProfilerWrapper getProfiler() public IProfilerWrapper getProfiler()
{ {
@@ -289,99 +284,39 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
return this.profilerWrapper; return this.profilerWrapper;
} }
/** Returns all worlds available to the server */
@Override
public ArrayList<ILevelWrapper> getAllServerWorlds()
{
ArrayList<ILevelWrapper> worlds = new ArrayList<ILevelWrapper>();
Iterable<ServerLevel> serverWorlds = MINECRAFT.getSingleplayerServer().getAllLevels();
for (ServerLevel world : serverWorlds)
{
worlds.add(ServerLevelWrapper.getWrapper(world));
}
return worlds;
}
@Override
public void sendChatMessage(String string)
{
LocalPlayer player = this.getPlayer();
if (player == null)
{
return;
}
if (!GLProxy.hasInstance())
{
// rendering setup hasn't finished
return;
}
#if MC_VER < MC_1_19_2
player.sendMessage(new TextComponent(string), getPlayer().getUUID());
#elif MC_VER < MC_1_21_9
player.displayClientMessage(net.minecraft.network.chat.Component.translatable(string), /*isOverlay*/false);
#else
GLProxy.getInstance().queueRunningOnRenderThread(() ->
{
player.displayClientMessage(net.minecraft.network.chat.Component.translatable(string), /*isOverlay*/false);
});
#endif
}
@Override
public void sendOverlayMessage(String string)
{
LocalPlayer player = this.getPlayer();
if (player == null)
{
return;
}
#if MC_VER < MC_1_19_2
player.displayClientMessage(new TextComponent(string), /*isOverlay*/true);
#else
player.displayClientMessage(net.minecraft.network.chat.Component.translatable(string), /*isOverlay*/true);
#endif
}
/**
* Crashes Minecraft, displaying the given errorMessage <br> <br>
* In the following format: <br>
*
* The game crashed whilst <strong>errorMessage</strong> <br>
* Error: <strong>ExceptionClass: exceptionErrorMessage</strong> <br>
* Exit Code: -1 <br>
*/
@Override @Override
public void crashMinecraft(String errorMessage, Throwable exception) public void crashMinecraft(String errorMessage, Throwable exception)
{ {
LOGGER.error(ModInfo.READABLE_NAME + " had the following error: [" + errorMessage + "]. Crashing Minecraft...", exception); LOGGER.fatal(ModInfo.READABLE_NAME + " had the following error: [" + errorMessage + "]. Crashing Minecraft...", exception);
CrashReport report = new CrashReport(errorMessage, exception); CrashReport report = new CrashReport(errorMessage, exception);
#if MC_VER < MC_1_20_4 #if MC_VER < MC_1_20_4
Minecraft.crash(report); Minecraft.crash(report);
#else #else
Minecraft.getInstance().delayCrash(report); MINECRAFT.delayCrash(report);
#endif #endif
} }
//=============//
// mod support //
//=============//
@Override @Override
public Object getOptionsObject() { return MINECRAFT.options; } public Object getOptionsObject() { return MINECRAFT.options; }
//========//
// shared //
//========//
@Override @Override
public boolean isDedicatedServer() { return false; } public boolean isDedicatedServer() { return false; }
@Override @Override
public File getInstallationDirectory() { return MINECRAFT.gameDirectory; } public File getInstallationDirectory() { return MINECRAFT.gameDirectory; }
@Override
public void executeOnRenderThread(Runnable runnable) { MINECRAFT.execute(runnable); }
@Override @Override
public int getPlayerCount() public int getPlayerCount()
{ {
@@ -396,10 +331,6 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
} }
} }
@Override
public void setPreventAutoPause(boolean preventAutoPause)
{
throw new UnsupportedOperationException();
}
} }
@@ -25,9 +25,13 @@ import java.util.concurrent.ConcurrentHashMap;
import com.mojang.blaze3d.pipeline.RenderTarget; import com.mojang.blaze3d.pipeline.RenderTarget;
import com.mojang.blaze3d.platform.NativeImage; import com.mojang.blaze3d.platform.NativeImage;
import com.seibel.distanthorizons.api.enums.config.EDhApiLodShading;
import com.seibel.distanthorizons.common.wrappers.McObjectConverter;
import com.seibel.distanthorizons.common.wrappers.misc.LightMapWrapper; import com.seibel.distanthorizons.common.wrappers.misc.LightMapWrapper;
import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.dependencyInjection.ModAccessorInjector; import com.seibel.distanthorizons.core.dependencyInjection.ModAccessorInjector;
import com.seibel.distanthorizons.core.enums.EDhDirection;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.util.ColorUtil; import com.seibel.distanthorizons.core.util.ColorUtil;
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.ILightMapWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.misc.ILightMapWrapper;
@@ -52,12 +56,12 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.world.IDimensionTypeWra
import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper;
import com.seibel.distanthorizons.core.util.math.Vec3d; import com.seibel.distanthorizons.core.util.math.Vec3d;
import com.seibel.distanthorizons.core.util.math.Vec3f; import com.seibel.distanthorizons.core.util.math.Vec3f;
import com.seibel.distanthorizons.core.wrapperInterfaces.IWrapperFactory;
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftRenderWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftRenderWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IOptifineAccessor;
import net.minecraft.client.Camera; import net.minecraft.client.Camera;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.effect.MobEffects; import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
@@ -79,6 +83,11 @@ import com.mojang.blaze3d.opengl.GlTexture;
#else #else
#endif #endif
#if MC_VER <= MC_1_21_10
#else
import net.minecraft.world.attribute.EnvironmentAttributes;
#endif
/** /**
* A singleton that contains everything * A singleton that contains everything
* related to rendering in Minecraft. * related to rendering in Minecraft.
@@ -90,8 +99,6 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
private static final DhLogger LOGGER = new DhLoggerBuilder().build(); private static final DhLogger LOGGER = new DhLoggerBuilder().build();
private static final Minecraft MC = Minecraft.getInstance(); private static final Minecraft MC = Minecraft.getInstance();
private static final IOptifineAccessor OPTIFINE_ACCESSOR = ModAccessorInjector.INSTANCE.get(IOptifineAccessor.class);
/** /**
* In the case of immersive portals multiple levels may be active at once, causing conflicting lightmaps. <br> * In the case of immersive portals multiple levels may be active at once, causing conflicting lightmaps. <br>
* Requiring the use of multiple {@link LightMapWrapper}. * Requiring the use of multiple {@link LightMapWrapper}.
@@ -121,12 +128,20 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
@Override @Override
public Vec3f getLookAtVector() public Vec3f getLookAtVector()
{ {
#if MC_VER <= MC_1_21_10
Camera camera = MC.gameRenderer.getMainCamera(); Camera camera = MC.gameRenderer.getMainCamera();
return new Vec3f(camera.getLookVector().x(), camera.getLookVector().y(), camera.getLookVector().z()); return new Vec3f(camera.getLookVector().x(), camera.getLookVector().y(), camera.getLookVector().z());
#else
Camera camera = MC.gameRenderer.getMainCamera();
return new Vec3f(camera.forwardVector().x(), camera.forwardVector().y(), camera.forwardVector().z());
#endif
} }
/**
* Unless you really need to know if the player is blind,
* use {@link MinecraftRenderWrapper#isFogStateSpecial()} or {@link IMinecraftRenderWrapper#isFogStateSpecial()} instead
*/
@Override @Override
/** Unless you really need to know if the player is blind, use {@link MinecraftRenderWrapper#isFogStateSpecial()}/{@link IMinecraftRenderWrapper#isFogStateSpecial()} instead */
public boolean playerHasBlindingEffect() public boolean playerHasBlindingEffect()
{ {
if (MC.player == null) if (MC.player == null)
@@ -151,7 +166,11 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
public Vec3d getCameraExactPosition() public Vec3d getCameraExactPosition()
{ {
Camera camera = MC.gameRenderer.getMainCamera(); Camera camera = MC.gameRenderer.getMainCamera();
#if MC_VER <= MC_1_21_10
Vec3 projectedView = camera.getPosition(); Vec3 projectedView = camera.getPosition();
#else
Vec3 projectedView = camera.position();
#endif
return new Vec3d(projectedView.x, projectedView.y, projectedView.z); return new Vec3d(projectedView.x, projectedView.y, projectedView.z);
} }
@@ -185,8 +204,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
Math.max(0f, Math.min(colorValues.z, 1f)), // b Math.max(0f, Math.min(colorValues.z, 1f)), // b
Math.max(0f, Math.min(colorValues.w, 1f)) // a Math.max(0f, Math.min(colorValues.w, 1f)) // a
); );
#else #elif MC_VER <= MC_1_21_10
if (mcFogRenderer == null) if (mcFogRenderer == null)
{ {
mcFogRenderer = new FogRenderer(); mcFogRenderer = new FogRenderer();
@@ -210,9 +228,33 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
Math.max(0f, Math.min(colorValues.z, 1f)), // b Math.max(0f, Math.min(colorValues.z, 1f)), // b
Math.max(0f, Math.min(colorValues.w, 1f)) // a Math.max(0f, Math.min(colorValues.w, 1f)) // a
); );
#else
if (mcFogRenderer == null)
{
mcFogRenderer = new FogRenderer();
}
if (MC.level == null)
{
// shouldn't happen, but just in case
return Color.white;
}
Vector4f colorValues = mcFogRenderer.setupFog(
MC.gameRenderer.getMainCamera(),
MC.options.getEffectiveRenderDistance(),
MC.deltaTracker,
MC.gameRenderer.getDarkenWorldAmount(MC.deltaTracker.getGameTimeDeltaPartialTick(true)),
MC.level);
return new Color(
Math.max(0f, Math.min(colorValues.x, 1f)), // r
Math.max(0f, Math.min(colorValues.y, 1f)), // g
Math.max(0f, Math.min(colorValues.z, 1f)), // b
Math.max(0f, Math.min(colorValues.w, 1f)) // a
);
#endif #endif
} }
// getSpecialFogColor() is the same as getFogColor()
@Override @Override
public Color getSkyColor() public Color getSkyColor()
@@ -224,8 +266,10 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
frameTime = MC.getFrameTime(); frameTime = MC.getFrameTime();
#elif MC_VER < MC_1_21_3 #elif MC_VER < MC_1_21_3
frameTime = MC.getTimer().getRealtimeDeltaTicks(); frameTime = MC.getTimer().getRealtimeDeltaTicks();
#else #elif MC_VER <= MC_1_21_10
frameTime = MC.deltaTracker.getGameTimeDeltaTicks(); frameTime = MC.deltaTracker.getGameTimeDeltaTicks();
#else
frameTime = 0f; // unused
#endif #endif
#if MC_VER < MC_1_17_1 #if MC_VER < MC_1_17_1
@@ -234,9 +278,12 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
#elif MC_VER < MC_1_21_3 #elif MC_VER < MC_1_21_3
Vec3 colorValues = MC.level.getSkyColor(MC.gameRenderer.getMainCamera().getPosition(), frameTime); Vec3 colorValues = MC.level.getSkyColor(MC.gameRenderer.getMainCamera().getPosition(), frameTime);
return new Color((float) colorValues.x, (float) colorValues.y, (float) colorValues.z); return new Color((float) colorValues.x, (float) colorValues.y, (float) colorValues.z);
#elif MC_VER <= MC_1_21_10
int argbColorInt = MC.level.getSkyColor(MC.gameRenderer.getMainCamera().getPosition(), frameTime);
return ColorUtil.toColorObjARGB(argbColorInt);
#else #else
int argbColorInt = MC.level.getSkyColor(MC.gameRenderer.getMainCamera().getPosition(), frameTime);; int argbColor = MC.level.environmentAttributes().getValue(EnvironmentAttributes.SKY_COLOR, BlockPos.ZERO);
return ColorUtil.toColorObjARGB(argbColorInt); // TODO MC changed color formats return new Color(ColorUtil.getRed(argbColor), ColorUtil.getGreen(argbColor), ColorUtil.getBlue(argbColor), 255 /* ignore alpha since DH clouds don't render correctly with transparency */);
#endif #endif
} }
else else
@@ -246,10 +293,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
} }
@Override @Override
public double getFov(float partialTicks) public double getFov(float partialTicks) { return MC.gameRenderer.getFov(MC.gameRenderer.getMainCamera(), partialTicks, true); }
{
return MC.gameRenderer.getFov(MC.gameRenderer.getMainCamera(), partialTicks, true);
}
/** Measured in chunks */ /** Measured in chunks */
@Override @Override
@@ -263,41 +307,6 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
#endif #endif
} }
@Override
public int getScreenWidth()
{
// alternate ways of getting the window's resolution,
// using one of these methods may fix the optifine render resolution bug
// TODO: test these once we can run with Optifine again
// int[] heightArray = new int[1];
// int[] widthArray = new int[1];
//
// long window = GLProxy.getInstance().minecraftGlContext;
// GLFW.glfwGetWindowSize(window, widthArray, heightArray); // option 1
// GLFW.glfwGetFramebufferSize(window, widthArray, heightArray); // option 2
int width = MC.getWindow().getWidth();
if (OPTIFINE_ACCESSOR != null)
{
// TODO remove comment after testing:
// this should fix the issue where different optifine render resolutions screw up the LOD rendering
width *= OPTIFINE_ACCESSOR.getRenderResolutionMultiplier();
}
return width;
}
@Override
public int getScreenHeight()
{
int height = MC.getWindow().getHeight();
if (OPTIFINE_ACCESSOR != null)
{
height *= OPTIFINE_ACCESSOR.getRenderResolutionMultiplier();
}
return height;
}
protected RenderTarget getRenderTarget() { return MC.getMainRenderTarget(); } protected RenderTarget getRenderTarget() { return MC.getMainRenderTarget(); }
@Override @Override
@@ -466,4 +475,45 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
wrapper.setLightmapId(tetxureId); wrapper.setLightmapId(tetxureId);
} }
@Override
public float getShade(EDhDirection lodDirection)
{
EDhApiLodShading lodShading = Config.Client.Advanced.Graphics.Quality.lodShading.get();
switch (lodShading)
{
default:
case AUTO:
if (MC.level != null)
{
Direction mcDir = McObjectConverter.Convert(lodDirection);
return MC.level.getShade(mcDir, true);
}
else
{
return 0.0f;
}
case ENABLED:
switch (lodDirection)
{
case DOWN:
return 0.5F;
default:
case UP:
return 1.0F;
case NORTH:
case SOUTH:
return 0.8F;
case WEST:
case EAST:
return 0.6F;
}
case DISABLED:
return 1.0F;
}
}
} }
@@ -2,16 +2,18 @@ package com.seibel.distanthorizons.common.wrappers.minecraft;
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftSharedWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftSharedWrapper;
import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.server.dedicated.DedicatedServer;
import org.jetbrains.annotations.Nullable;
import java.io.File; import java.io.File;
//@Environment(EnvType.SERVER)
public class MinecraftServerWrapper implements IMinecraftSharedWrapper public class MinecraftServerWrapper implements IMinecraftSharedWrapper
{ {
public static final MinecraftServerWrapper INSTANCE = new MinecraftServerWrapper(); public static final MinecraftServerWrapper INSTANCE = new MinecraftServerWrapper();
/** set during server startup */
@Nullable
public DedicatedServer dedicatedServer = null; public DedicatedServer dedicatedServer = null;
public boolean preventAutoPause = false;
//=============// //=============//
@@ -34,7 +36,7 @@ public class MinecraftServerWrapper implements IMinecraftSharedWrapper
{ {
if (this.dedicatedServer == null) if (this.dedicatedServer == null)
{ {
throw new IllegalStateException("Trying to get Installation Direction before Dedicated server completed initialization!"); throw new IllegalStateException("Trying to get Installation Direction before dedicated server completed initialization!");
} }
#if MC_VER < MC_1_21_1 #if MC_VER < MC_1_21_1
@@ -47,13 +49,14 @@ public class MinecraftServerWrapper implements IMinecraftSharedWrapper
@Override @Override
public int getPlayerCount() public int getPlayerCount()
{ {
if (this.dedicatedServer == null)
{
throw new IllegalStateException("Trying to get player count before dedicated server completed initialization!");
}
return this.dedicatedServer.getPlayerCount(); return this.dedicatedServer.getPlayerCount();
} }
@Override
public void setPreventAutoPause(boolean preventAutoPause)
{
this.preventAutoPause = preventAutoPause;
}
} }
@@ -21,6 +21,7 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.world.IDimensionTypeWra
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IServerLevelWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.world.IServerLevelWrapper;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkAccess; import net.minecraft.world.level.chunk.ChunkAccess;
@@ -50,6 +51,12 @@ import net.minecraft.world.phys.Vec3;
import com.seibel.distanthorizons.core.util.ColorUtil; import com.seibel.distanthorizons.core.util.ColorUtil;
#endif #endif
#if MC_VER <= MC_1_21_10
#else
import net.minecraft.world.attribute.EnvironmentAttributes;
#endif
public class ClientLevelWrapper implements IClientLevelWrapper public class ClientLevelWrapper implements IClientLevelWrapper
{ {
private static final DhLogger LOGGER = new DhLoggerBuilder().build(); private static final DhLogger LOGGER = new DhLoggerBuilder().build();
@@ -92,7 +99,7 @@ public class ClientLevelWrapper implements IClientLevelWrapper
* IE rendering. * IE rendering.
*/ */
@Nullable @Nullable
public static IClientLevelWrapper getWrapperIfDifferent(@Nullable IClientLevelWrapper levelWrapper, @NotNull ClientLevel level) public static IClientLevelWrapper getWrapperIfDifferent(@Nullable IClientLevelWrapper levelWrapper, @NotNull ClientLevel level) // TODO handle null level
{ {
if (KEYED_CLIENT_LEVEL_MANAGER.isEnabled() && KEYED_CLIENT_LEVEL_MANAGER.getServerKeyedLevel() != levelWrapper) if (KEYED_CLIENT_LEVEL_MANAGER.isEnabled() && KEYED_CLIENT_LEVEL_MANAGER.getServerKeyedLevel() != levelWrapper)
{ {
@@ -237,11 +244,24 @@ public class ClientLevelWrapper implements IClientLevelWrapper
public void clearBlockColorCache() { this.blockColorCacheByBlockState.clear(); } public void clearBlockColorCache() { this.blockColorCacheByBlockState.clear(); }
@Override @Override
public IDimensionTypeWrapper getDimensionType() { return DimensionTypeWrapper.getDimensionTypeWrapper(this.level.dimensionType()); } public IDimensionTypeWrapper getDimensionType()
{
#if MC_VER <= MC_1_21_10
return DimensionTypeWrapper.getDimensionTypeWrapper(this.level.dimensionType());
#else
return DimensionTypeWrapper.getDimensionTypeWrapper(this.level.dimensionType(), this.getDimensionName());
#endif
}
@Override @Override
public String getDimensionName() { return this.level.dimension().location().toString(); } public String getDimensionName()
{
#if MC_VER <= MC_1_21_10
return this.level.dimension().location().toString();
#else
return this.level.dimension().identifier().toString();
#endif
}
@Override @Override
public long getHashedSeed() { return this.level.getBiomeManager().biomeZoomSeed; } public long getHashedSeed() { return this.level.getBiomeManager().biomeZoomSeed; }
@@ -275,23 +295,6 @@ public class ClientLevelWrapper implements IClientLevelWrapper
#endif #endif
} }
@Override
public IChunkWrapper tryGetChunk(DhChunkPos pos)
{
if (!this.level.hasChunk(pos.getX(), pos.getZ()))
{
return null;
}
ChunkAccess chunk = this.level.getChunk(pos.getX(), pos.getZ(), ChunkStatus.EMPTY, false);
if (chunk == null)
{
return null;
}
return new ChunkWrapper(chunk, this);
}
@Override @Override
public ClientLevel getWrappedMcObject() { return this.level; } public ClientLevel getWrappedMcObject() { return this.level; }
@@ -342,9 +345,12 @@ public class ClientLevelWrapper implements IClientLevelWrapper
#if MC_VER < MC_1_21_3 #if MC_VER < MC_1_21_3
Vec3 colorVec3 = this.level.getCloudColor(tickDelta); Vec3 colorVec3 = this.level.getCloudColor(tickDelta);
return new Color((float)colorVec3.x, (float)colorVec3.y, (float)colorVec3.z); return new Color((float)colorVec3.x, (float)colorVec3.y, (float)colorVec3.z);
#else #elif MC_VER <= MC_1_21_10
int argbColor = this.level.getCloudColor(tickDelta); int argbColor = this.level.getCloudColor(tickDelta);
return ColorUtil.toColorObjARGB(argbColor); return ColorUtil.toColorObjARGB(argbColor);
#else
int argbColor = this.level.environmentAttributes().getValue(EnvironmentAttributes.CLOUD_COLOR, BlockPos.ZERO);
return new Color(ColorUtil.getRed(argbColor), ColorUtil.getGreen(argbColor), ColorUtil.getBlue(argbColor), 255 /* ignore alpha since DH clouds don't render correctly with transparency */);
#endif #endif
} }
@@ -26,25 +26,45 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.world.IDimensionTypeWra
import net.minecraft.world.level.dimension.DimensionType; import net.minecraft.world.level.dimension.DimensionType;
/**
* @author James Seibel
*/
public class DimensionTypeWrapper implements IDimensionTypeWrapper public class DimensionTypeWrapper implements IDimensionTypeWrapper
{ {
private static final ConcurrentMap<String, DimensionTypeWrapper> DIMENSION_WRAPPER_BY_NAME = new ConcurrentHashMap<>(); private static final ConcurrentMap<String, DimensionTypeWrapper> DIMENSION_WRAPPER_BY_NAME = new ConcurrentHashMap<>();
private final DimensionType dimensionType; private final DimensionType dimensionType;
private final String name;
//=============// //=============//
// Constructor // // Constructor //
//=============// //=============//
public DimensionTypeWrapper(DimensionType dimensionType) { this.dimensionType = dimensionType; } #if MC_VER <= MC_1_21_10
public DimensionTypeWrapper(DimensionType dimensionType)
public static DimensionTypeWrapper getDimensionTypeWrapper(DimensionType dimensionType) #else
public DimensionTypeWrapper(DimensionType dimensionType, String name)
#endif
{ {
String dimName = getName(dimensionType); this.dimensionType = dimensionType;
#if MC_VER <= MC_1_21_10
this.name = determineName(dimensionType);
#else
this.name = name;
#endif
}
#if MC_VER <= MC_1_21_10
public static DimensionTypeWrapper getDimensionTypeWrapper(DimensionType dimensionType)
#else
public static DimensionTypeWrapper getDimensionTypeWrapper(DimensionType dimensionType, String name)
#endif
{
#if MC_VER <= MC_1_21_10
String dimName = determineName(dimensionType);
#else
String dimName = name;
#endif
// check if the dimension has already been wrapped // check if the dimension has already been wrapped
if (DIMENSION_WRAPPER_BY_NAME.containsKey(dimName) if (DIMENSION_WRAPPER_BY_NAME.containsKey(dimName)
@@ -55,10 +75,26 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper
// create the missing wrapper // create the missing wrapper
#if MC_VER <= MC_1_21_10
DimensionTypeWrapper dimensionTypeWrapper = new DimensionTypeWrapper(dimensionType); DimensionTypeWrapper dimensionTypeWrapper = new DimensionTypeWrapper(dimensionType);
#else
DimensionTypeWrapper dimensionTypeWrapper = new DimensionTypeWrapper(dimensionType, dimName);
#endif
DIMENSION_WRAPPER_BY_NAME.put(dimName, dimensionTypeWrapper); DIMENSION_WRAPPER_BY_NAME.put(dimName, dimensionTypeWrapper);
return dimensionTypeWrapper; return dimensionTypeWrapper;
} }
private static String determineName(DimensionType dimensionType)
{
#if MC_VER <= MC_1_16_5
// effectsLocation() is marked as client only, so using the backing field directly
return dimensionType.effectsLocation.getPath();
#elif MC_VER <= MC_1_21_10
return dimensionType.effectsLocation().getPath();
#else
throw new UnsupportedOperationException("As of MC 1.21.11 the dimension type no longer stores it's name and must be determined from the level.");
#endif
}
public static void clearMap() { DIMENSION_WRAPPER_BY_NAME.clear(); } public static void clearMap() { DIMENSION_WRAPPER_BY_NAME.clear(); }
@@ -69,16 +105,7 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper
//=================// //=================//
@Override @Override
public String getName() { return getName(this.dimensionType); } public String getName() { return this.name; }
public static String getName(DimensionType dimensionType)
{
#if MC_VER <= MC_1_16_5
// effectsLocation() is marked as client only, so using the backing field directly
return dimensionType.effectsLocation.getPath();
#else
return dimensionType.effectsLocation().getPath();
#endif
}
@Override @Override
public boolean hasCeiling() { return this.dimensionType.hasCeiling(); } public boolean hasCeiling() { return this.dimensionType.hasCeiling(); }
@@ -89,7 +116,6 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper
@Override @Override
public Object getWrappedMcObject() { return this.dimensionType; } public Object getWrappedMcObject() { return this.dimensionType; }
// there's definitely a better way of doing this, but it should work well enough for now
@Override @Override
public boolean isTheEnd() { return this.getName().equalsIgnoreCase("the_end"); } public boolean isTheEnd() { return this.getName().equalsIgnoreCase("the_end"); }
@@ -98,7 +124,6 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper
//================// //================//
// base overrides // // base overrides //
//================// //================//
@@ -172,10 +172,24 @@ public class ServerLevelWrapper implements IServerLevelWrapper
@Override @Override
public DimensionTypeWrapper getDimensionType() { return DimensionTypeWrapper.getDimensionTypeWrapper(this.level.dimensionType()); } public DimensionTypeWrapper getDimensionType()
{
#if MC_VER <= MC_1_21_10
return DimensionTypeWrapper.getDimensionTypeWrapper(this.level.dimensionType());
#else
return DimensionTypeWrapper.getDimensionTypeWrapper(this.level.dimensionType(), this.getDimensionName());
#endif
}
@Override @Override
public String getDimensionName() { return this.level.dimension().location().toString(); } public String getDimensionName()
{
#if MC_VER <= MC_1_21_10
return this.level.dimension().location().toString();
#else
return this.level.dimension().identifier().toString();
#endif
}
@Override @Override
public long getHashedSeed() { return this.level.getBiomeManager().biomeZoomSeed; } public long getHashedSeed() { return this.level.getBiomeManager().biomeZoomSeed; }
@@ -209,23 +223,6 @@ public class ServerLevelWrapper implements IServerLevelWrapper
#endif #endif
} }
@Override
public IChunkWrapper tryGetChunk(DhChunkPos pos)
{
if (!this.level.hasChunk(pos.getX(), pos.getZ()))
{
return null;
}
ChunkAccess chunk = this.level.getChunk(pos.getX(), pos.getZ(), ChunkStatus.FULL, false);
if (chunk == null)
{
return null;
}
return new ChunkWrapper(chunk, this);
}
@Override @Override
public ServerLevel getWrappedMcObject() { return this.level; } public ServerLevel getWrappedMcObject() { return this.level; }
@@ -28,6 +28,7 @@ import com.seibel.distanthorizons.common.wrappers.world.ServerLevelWrapper;
import com.seibel.distanthorizons.common.wrappers.worldGeneration.chunkFileHandling.ChunkFileReader; import com.seibel.distanthorizons.common.wrappers.worldGeneration.chunkFileHandling.ChunkFileReader;
import com.seibel.distanthorizons.common.wrappers.worldGeneration.mimicObject.*; import com.seibel.distanthorizons.common.wrappers.worldGeneration.mimicObject.*;
import com.seibel.distanthorizons.common.wrappers.worldGeneration.params.GlobalWorldGenParams; import com.seibel.distanthorizons.common.wrappers.worldGeneration.params.GlobalWorldGenParams;
import com.seibel.distanthorizons.core.api.internal.SharedApi;
import com.seibel.distanthorizons.core.generation.DhLightingEngine; import com.seibel.distanthorizons.core.generation.DhLightingEngine;
import com.seibel.distanthorizons.core.level.IDhServerLevel; import com.seibel.distanthorizons.core.level.IDhServerLevel;
import com.seibel.distanthorizons.core.config.Config; import com.seibel.distanthorizons.core.config.Config;
@@ -37,6 +38,7 @@ import com.seibel.distanthorizons.core.pos.DhChunkPos;
import com.seibel.distanthorizons.core.sql.dto.BeaconBeamDTO; import com.seibel.distanthorizons.core.sql.dto.BeaconBeamDTO;
import com.seibel.distanthorizons.core.util.ExceptionUtil; import com.seibel.distanthorizons.core.util.ExceptionUtil;
import com.seibel.distanthorizons.core.util.LodUtil; import com.seibel.distanthorizons.core.util.LodUtil;
import com.seibel.distanthorizons.core.util.TimerUtil;
import com.seibel.distanthorizons.core.util.gridList.ArrayGridList; import com.seibel.distanthorizons.core.util.gridList.ArrayGridList;
import com.seibel.distanthorizons.core.util.objects.UncheckedInterruptedException; import com.seibel.distanthorizons.core.util.objects.UncheckedInterruptedException;
import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.ChunkLightStorage; import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.ChunkLightStorage;
@@ -100,6 +102,15 @@ public final class BatchGenerationEnvironment implements IBatchGeneratorEnvironm
public static final long EXCEPTION_TIMER_RESET_TIME = TimeUnit.NANOSECONDS.convert(1, TimeUnit.SECONDS); public static final long EXCEPTION_TIMER_RESET_TIME = TimeUnit.NANOSECONDS.convert(1, TimeUnit.SECONDS);
public static final int EXCEPTION_COUNTER_TRIGGER = 20; public static final int EXCEPTION_COUNTER_TRIGGER = 20;
/**
* Used to revert the ignore logic in {@link SharedApi} so
* that a given chunk pos can be handled again.
* A timer is used so we don't have to inject into MC's code and it works sell enough
* most of the time.
* If a chunk does get through due the timeout not being long enough that isn't the end of the world.
*/
private static final int MS_TO_IGNORE_CHUNK_AFTER_COMPLETION = 5_000;
private final IDhServerLevel dhServerLevel; private final IDhServerLevel dhServerLevel;
@@ -107,6 +118,8 @@ public final class BatchGenerationEnvironment implements IBatchGeneratorEnvironm
public final InternalServerGenerator internalServerGenerator; public final InternalServerGenerator internalServerGenerator;
public final ChunkFileReader chunkFileReader; public final ChunkFileReader chunkFileReader;
private final Timer chunkSaveIgnoreTimer = TimerUtil.CreateTimer("ChunkSaveIgnoreTimer");
public final LinkedBlockingQueue<GenerationEvent> generationEventQueue = new LinkedBlockingQueue<>(); public final LinkedBlockingQueue<GenerationEvent> generationEventQueue = new LinkedBlockingQueue<>();
@@ -435,10 +448,9 @@ public final class BatchGenerationEnvironment implements IBatchGeneratorEnvironm
//=============================// //=========================//
// process existing chunks // // process existing chunks //
// //=========================//
//=============================//
ArrayGridList<ChunkWrapper> chunkWrapperList = new ArrayGridList<>(regionChunks.gridSize); ArrayGridList<ChunkWrapper> chunkWrapperList = new ArrayGridList<>(regionChunks.gridSize);
regionChunks.forEachPos((relX, relZ) -> regionChunks.forEachPos((relX, relZ) ->
@@ -454,8 +466,8 @@ public final class BatchGenerationEnvironment implements IBatchGeneratorEnvironm
} }
else if (chunk != null) else if (chunk != null)
{ {
//
ChunkWrapper chunkWrapper = new ChunkWrapper(chunk, this.dhServerLevel.getLevelWrapper()); ChunkWrapper chunkWrapper = new ChunkWrapper(chunk, this.dhServerLevel.getLevelWrapper());
chunkWrapper.createDhHeightMaps();
chunkWrapperList.set(relX, relZ, chunkWrapper); chunkWrapperList.set(relX, relZ, chunkWrapper);
// try setting the wrapper's lighting // try setting the wrapper's lighting
@@ -575,6 +587,11 @@ public final class BatchGenerationEnvironment implements IBatchGeneratorEnvironm
ProtoChunk protoChunk = ((ProtoChunk) chunk); ProtoChunk protoChunk = ((ProtoChunk) chunk);
protoChunk.setLightEngine(region.getLightEngine()); protoChunk.setLightEngine(region.getLightEngine());
} }
// usually ignoring the chunk's position is unnecessary,
// but this improves performance if a chunk update event does sneak through
SharedApi.CHUNK_UPDATE_QUEUE_MANAGER.addPosToIgnore(chunkWrapper.getChunkPos());
}); });
@@ -684,6 +701,24 @@ public final class BatchGenerationEnvironment implements IBatchGeneratorEnvironm
this.dhServerLevel.updateBeaconBeamsForChunkPos(centerChunkWrapper.getChunkPos(), activeBeamList); this.dhServerLevel.updateBeaconBeamsForChunkPos(centerChunkWrapper.getChunkPos(), activeBeamList);
} }
} }
for (int i = 0; i < iChunkWrapperList.size(); i++)
{
ChunkWrapper chunkWrapper = (ChunkWrapper) iChunkWrapperList.get(i);
if (chunkWrapper == null)
{
continue;
}
// give MC a few seconds to save the chunk before
// we can process update events there again
this.chunkSaveIgnoreTimer.schedule(new TimerTask()
{
@Override
public void run() { SharedApi.CHUNK_UPDATE_QUEUE_MANAGER.removePosToIgnore(chunkWrapper.getChunkPos()); }
}, MS_TO_IGNORE_CHUNK_AFTER_COMPLETION);
}
} }
} }
private static <T> ArrayGridList<T> GetCutoutFrom(ArrayGridList<T> total, int border) { return new ArrayGridList<>(total, border, total.gridSize - border); } private static <T> ArrayGridList<T> GetCutoutFrom(ArrayGridList<T> total, int border) { return new ArrayGridList<>(total, border, total.gridSize - border); }
@@ -51,7 +51,7 @@ public class InternalServerGenerator
/** /**
* Used to revert the ignore logic in {@link SharedApi} so * Used to revert the ignore logic in {@link SharedApi} so
* that given chunk pos can be handled again. * that a given chunk pos can be handled again.
* A timer is used so we don't have to inject into MC's code and it works sell enough * A timer is used so we don't have to inject into MC's code and it works sell enough
* most of the time. * most of the time.
* If a chunk does get through due the timeout not being long enough that isn't the end of the world. * If a chunk does get through due the timeout not being long enough that isn't the end of the world.
@@ -156,6 +156,7 @@ public class InternalServerGenerator
if (chunk != null) if (chunk != null)
{ {
ChunkWrapper chunkWrapper = new ChunkWrapper(chunk, this.dhServerLevel.getLevelWrapper()); ChunkWrapper chunkWrapper = new ChunkWrapper(chunk, this.dhServerLevel.getLevelWrapper());
chunkWrapper.createDhHeightMaps();
chunkWrappers.add(chunkWrapper); chunkWrappers.add(chunkWrapper);
} }
} }
@@ -222,7 +222,8 @@ public class ChunkCompoundTagParser
boolean hasHeightmapData = readHeightmaps(chunk, chunkData); boolean hasHeightmapData = readHeightmaps(chunk, chunkData);
// chunk wrapper so we can pass along extra data more easily // chunk wrapper so we can pass along extra data more easily
ChunkWrapper chunkWrapper = new ChunkWrapper(chunk, dhServerLevel.getServerLevelWrapper(), !hasHeightmapData); ChunkWrapper chunkWrapper = new ChunkWrapper(chunk, dhServerLevel.getServerLevelWrapper());
chunkWrapper.createDhHeightMaps();
@@ -293,7 +293,7 @@ public class ChunkFileReader implements AutoCloseable
public ChunkWrapper CreateProtoChunkWrapper(ServerLevel level, ChunkPos chunkPos) public ChunkWrapper CreateProtoChunkWrapper(ServerLevel level, ChunkPos chunkPos)
{ {
ProtoChunk chunk = CreateProtoChunk(level, chunkPos); ProtoChunk chunk = CreateProtoChunk(level, chunkPos);
return new ChunkWrapper(chunk, this.params.dhServerLevel.getLevelWrapper(), false); return new ChunkWrapper(chunk, this.params.dhServerLevel.getLevelWrapper());
} }
public static ProtoChunk CreateProtoChunk(ServerLevel level, ChunkPos chunkPos) public static ProtoChunk CreateProtoChunk(ServerLevel level, ChunkPos chunkPos)
{ {
@@ -18,7 +18,6 @@ accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chu
# used for grabbing vanilla rendered chunks # used for grabbing vanilla rendered chunks
accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo
accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chunk Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk; accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chunk Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk;
#accessible field net/minecraft/world/entity/Entity blockPosition Lnet/minecraft/core/BlockPos;
# lighting # lighting
accessible field net/minecraft/client/renderer/LightTexture lightPixels Lcom/mojang/blaze3d/platform/NativeImage; accessible field net/minecraft/client/renderer/LightTexture lightPixels Lcom/mojang/blaze3d/platform/NativeImage;
@@ -30,8 +29,6 @@ accessible field net/minecraft/world/level/lighting/LevelLightEngine skyEngine L
accessible method net/minecraft/world/level/levelgen/Heightmap setHeight (III)V accessible method net/minecraft/world/level/levelgen/Heightmap setHeight (III)V
accessible field net/minecraft/world/level/biome/Biome generationSettings Lnet/minecraft/world/level/biome/BiomeGenerationSettings; accessible field net/minecraft/world/level/biome/Biome generationSettings Lnet/minecraft/world/level/biome/BiomeGenerationSettings;
accessible field net/minecraft/world/level/biome/Biome biomeCategory Lnet/minecraft/world/level/biome/Biome$BiomeCategory; accessible field net/minecraft/world/level/biome/Biome biomeCategory Lnet/minecraft/world/level/biome/Biome$BiomeCategory;
#accessible field net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator settings Lnet/minecraft/core/Holder;
#accessible method net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator doCreateBiomes (Lnet/minecraft/core/Registry;Lnet/minecraft/world/level/levelgen/blending/Blender;Lnet/minecraft/world/level/StructureFeatureManager;Lnet/minecraft/world/level/chunk/ChunkAccess;)V
accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V
accessible field net/minecraft/server/level/ServerChunkCache distanceManager Lnet/minecraft/server/level/DistanceManager; accessible field net/minecraft/server/level/ServerChunkCache distanceManager Lnet/minecraft/server/level/DistanceManager;
accessible method net/minecraft/server/level/ChunkMap getUpdatingChunkIfPresent (J)Lnet/minecraft/server/level/ChunkHolder; accessible method net/minecraft/server/level/ChunkMap getUpdatingChunkIfPresent (J)Lnet/minecraft/server/level/ChunkHolder;
@@ -29,8 +29,6 @@ accessible field net/minecraft/world/level/lighting/LevelLightEngine skyEngine L
accessible method net/minecraft/world/level/levelgen/Heightmap setHeight (III)V accessible method net/minecraft/world/level/levelgen/Heightmap setHeight (III)V
accessible field net/minecraft/world/level/biome/Biome generationSettings Lnet/minecraft/world/level/biome/BiomeGenerationSettings; accessible field net/minecraft/world/level/biome/Biome generationSettings Lnet/minecraft/world/level/biome/BiomeGenerationSettings;
accessible field net/minecraft/world/level/biome/Biome biomeCategory Lnet/minecraft/world/level/biome/Biome$BiomeCategory; accessible field net/minecraft/world/level/biome/Biome biomeCategory Lnet/minecraft/world/level/biome/Biome$BiomeCategory;
# accessible field net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator settings Lnet/minecraft/core/Holder;
#accessible method net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator doCreateBiomes (Lnet/minecraft/core/Registry;Lnet/minecraft/world/level/levelgen/blending/Blender;Lnet/minecraft/world/level/StructureFeatureManager;Lnet/minecraft/world/level/chunk/ChunkAccess;)V
accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V
accessible field net/minecraft/server/level/ServerChunkCache distanceManager Lnet/minecraft/server/level/DistanceManager; accessible field net/minecraft/server/level/ServerChunkCache distanceManager Lnet/minecraft/server/level/DistanceManager;
accessible method net/minecraft/server/level/ChunkMap getUpdatingChunkIfPresent (J)Lnet/minecraft/server/level/ChunkHolder; accessible method net/minecraft/server/level/ChunkMap getUpdatingChunkIfPresent (J)Lnet/minecraft/server/level/ChunkHolder;
@@ -15,7 +15,6 @@ accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo
accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chunk Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk; accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chunk Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk;
# world generation # world generation
# accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V
accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z
accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage;
accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z
@@ -11,10 +11,7 @@ accessible method net/minecraft/client/renderer/GameRenderer getFov (Lnet/minecr
# used for grabbing vanilla rendered chunks # used for grabbing vanilla rendered chunks
accessible field net/minecraft/client/renderer/LevelRenderer visibleSections Lit/unimi/dsi/fastutil/objects/ObjectArrayList; accessible field net/minecraft/client/renderer/LevelRenderer visibleSections Lit/unimi/dsi/fastutil/objects/ObjectArrayList;
#accessible method net/minecraft/client/renderer/LevelRenderer renderSectionLayer (Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/vertex/PoseStack;DDDLorg/joml/Matrix4f;)V
# world generation # world generation
# accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V
accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z
accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage;
accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z
@@ -11,10 +11,7 @@ accessible method net/minecraft/client/renderer/GameRenderer getFov (Lnet/minecr
# used for grabbing vanilla rendered chunks # used for grabbing vanilla rendered chunks
accessible field net/minecraft/client/renderer/LevelRenderer visibleSections Lit/unimi/dsi/fastutil/objects/ObjectArrayList; accessible field net/minecraft/client/renderer/LevelRenderer visibleSections Lit/unimi/dsi/fastutil/objects/ObjectArrayList;
#accessible method net/minecraft/client/renderer/LevelRenderer renderSectionLayer (Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/vertex/PoseStack;DDDLorg/joml/Matrix4f;)V
# world generation # world generation
# accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V
accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z
accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage;
accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z
@@ -15,7 +15,6 @@ accessible field net/minecraft/client/renderer/LevelRenderer level Lnet/minecraf
accessible field net/minecraft/client/renderer/LevelRenderer visibleSections Lit/unimi/dsi/fastutil/objects/ObjectArrayList; accessible field net/minecraft/client/renderer/LevelRenderer visibleSections Lit/unimi/dsi/fastutil/objects/ObjectArrayList;
# world generation # world generation
# accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V
accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z
accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage;
accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z
@@ -0,0 +1,56 @@
accessWidener v1 named
# used when determining where to save files to
accessible field net/minecraft/world/level/storage/DimensionDataStorage dataFolder Ljava/nio/file/Path;
# used to help determine what folder a clientLevel is
accessible field net/minecraft/world/level/biome/BiomeManager biomeZoomSeed J
# used when rendering
accessible method net/minecraft/client/renderer/GameRenderer getFov (Lnet/minecraft/client/Camera;FZ)F
accessible field net/minecraft/client/Minecraft deltaTracker Lnet/minecraft/client/DeltaTracker$Timer;
accessible field net/minecraft/client/renderer/LevelRenderer level Lnet/minecraft/client/multiplayer/ClientLevel;
# used for grabbing vanilla rendered chunks
accessible field net/minecraft/client/renderer/LevelRenderer visibleSections Lit/unimi/dsi/fastutil/objects/ObjectArrayList;
# world generation
accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z
accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage;
accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z
accessible field net/minecraft/server/level/ServerChunkCache distanceManager Lnet/minecraft/server/level/DistanceManager;
accessible method net/minecraft/server/level/ChunkMap getUpdatingChunkIfPresent (J)Lnet/minecraft/server/level/ChunkHolder;
accessible method net/minecraft/server/level/ChunkMap tick (Ljava/util/function/BooleanSupplier;)V
accessible field net/minecraft/server/level/ServerLevel entityManager Lnet/minecraft/world/level/entity/PersistentEntitySectionManager;
accessible field net/minecraft/server/level/ChunkMap mainThreadExecutor Lnet/minecraft/util/thread/BlockableEventLoop;
# getting existing chunks outside the main thread
accessible method net/minecraft/server/level/ChunkMap getVisibleChunkIfPresent (J)Lnet/minecraft/server/level/ChunkHolder;
# lod generation from save file
accessible field net/minecraft/world/level/chunk/storage/SimpleRegionStorage worker Lnet/minecraft/world/level/chunk/storage/IOWorker;
accessible field net/minecraft/world/level/chunk/storage/IOWorker storage Lnet/minecraft/world/level/chunk/storage/RegionFileStorage;
accessible field net/minecraft/world/level/chunk/storage/RegionFileStorage regionCache Lit/unimi/dsi/fastutil/longs/Long2ObjectLinkedOpenHashMap;
accessible field net/minecraft/world/level/chunk/storage/RegionFileStorage folder Ljava/nio/file/Path;
# grabbing textures
accessible class net/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture
accessible method net/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture getFrameX (I)I
accessible method net/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture getFrameY (I)I
accessible field net/minecraft/client/renderer/texture/SpriteContents animatedTexture Lnet/minecraft/client/renderer/texture/SpriteContents$AnimatedTexture;
accessible field net/minecraft/client/renderer/texture/SpriteContents originalImage Lcom/mojang/blaze3d/platform/NativeImage;
# UI stuff
accessible field net/minecraft/client/gui/components/AbstractButton SPRITES Lnet/minecraft/client/gui/components/WidgetSprites;
# Handles inserting the config button
accessible field net/minecraft/client/gui/layouts/HeaderAndFooterLayout headerFrame Lnet/minecraft/client/gui/layouts/FrameLayout;
accessible field net/minecraft/client/gui/layouts/FrameLayout children Ljava/util/List;
accessible class net/minecraft/client/gui/layouts/FrameLayout$ChildContainer
accessible field net/minecraft/client/gui/layouts/LinearLayout wrapped Lnet/minecraft/client/gui/layouts/GridLayout;
accessible method net/minecraft/client/gui/components/debug/DebugScreenEntries register (Ljava/lang/String;Lnet/minecraft/client/gui/components/debug/DebugScreenEntry;)Lnet/minecraft/resources/Identifier;
# hacky stuff
accessible field net/minecraft/util/ThreadingDetector lock Ljava/util/concurrent/Semaphore;
mutable field net/minecraft/util/ThreadingDetector lock Ljava/util/concurrent/Semaphore;
@@ -14,7 +14,6 @@ accessible field net/minecraft/client/Minecraft deltaTracker Lnet/minecraft/clie
accessible field net/minecraft/client/renderer/LevelRenderer visibleSections Lit/unimi/dsi/fastutil/objects/ObjectArrayList; accessible field net/minecraft/client/renderer/LevelRenderer visibleSections Lit/unimi/dsi/fastutil/objects/ObjectArrayList;
# world generation # world generation
# accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V
accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z
accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage;
accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z
@@ -14,7 +14,6 @@ accessible field net/minecraft/client/Minecraft deltaTracker Lnet/minecraft/clie
accessible field net/minecraft/client/renderer/LevelRenderer visibleSections Lit/unimi/dsi/fastutil/objects/ObjectArrayList; accessible field net/minecraft/client/renderer/LevelRenderer visibleSections Lit/unimi/dsi/fastutil/objects/ObjectArrayList;
# world generation # world generation
# accessible method net/minecraft/world/level/lighting/LayerLightEngine queueSectionData (JLnet/minecraft/world/level/chunk/DataLayer;Z)V
accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z accessible field net/minecraft/world/level/chunk/LevelChunk loaded Z
accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; accessible field net/minecraft/world/level/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage;
accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z
+1 -1
View File
@@ -102,7 +102,7 @@ dependencies {
// Mod Menu // Mod Menu
modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}") addMod("com.terraformersmc:modmenu:${rootProject.modmenu_version}", rootProject.enable_mod_menu)
// Starlight // Starlight
addMod("curse.maven:starlight-521783:${rootProject.starlight_version_fabric}", rootProject.enable_starlight) addMod("curse.maven:starlight-521783:${rootProject.starlight_version_fabric}", rootProject.enable_starlight)
@@ -113,14 +113,6 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
//=============//
// tick events //
//=============//
ClientTickEvents.START_CLIENT_TICK.register((client) -> { ClientApi.INSTANCE.clientTickEvent(); });
//==============// //==============//
// chunk events // // chunk events //
//==============// //==============//
@@ -25,6 +25,7 @@ import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.dependencyInjection.ModAccessorInjector; import com.seibel.distanthorizons.core.dependencyInjection.ModAccessorInjector;
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector; import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.util.NativeDialogUtil;
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IPluginPacketSender; import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IPluginPacketSender;
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.*; import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.*;
@@ -36,10 +37,8 @@ import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
import net.fabricmc.fabric.api.event.Event; import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.CommandSourceStack;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import com.seibel.distanthorizons.core.logging.DhLogger; import com.seibel.distanthorizons.core.logging.DhLogger;
import org.lwjgl.util.tinyfd.TinyFileDialogs;
#if MC_VER >= MC_1_19_2 #if MC_VER >= MC_1_19_2
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
@@ -47,6 +46,12 @@ import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback; import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
#endif #endif
#if MC_VER <= MC_1_21_10
import net.minecraft.resources.ResourceLocation;
#else
import net.minecraft.resources.Identifier;
#endif
import java.util.function.Consumer; import java.util.function.Consumer;
/** /**
@@ -56,10 +61,12 @@ import java.util.function.Consumer;
*/ */
public class FabricMain extends AbstractModInitializer implements ClientModInitializer, DedicatedServerModInitializer public class FabricMain extends AbstractModInitializer implements ClientModInitializer, DedicatedServerModInitializer
{ {
#if MC_VER >= MC_1_21_1 #if MC_VER <= MC_1_20_6
private static final ResourceLocation INITIAL_PHASE = new ResourceLocation(ModInfo.RESOURCE_NAMESPACE, ModInfo.DEDICATED_SERVER_INITIAL_PATH);
#elif MC_VER <= MC_1_21_10
private static final ResourceLocation INITIAL_PHASE = ResourceLocation.fromNamespaceAndPath(ModInfo.RESOURCE_NAMESPACE, ModInfo.DEDICATED_SERVER_INITIAL_PATH); private static final ResourceLocation INITIAL_PHASE = ResourceLocation.fromNamespaceAndPath(ModInfo.RESOURCE_NAMESPACE, ModInfo.DEDICATED_SERVER_INITIAL_PATH);
#else #else
private static final ResourceLocation INITIAL_PHASE = new ResourceLocation(ModInfo.RESOURCE_NAMESPACE, ModInfo.DEDICATED_SERVER_INITIAL_PATH); private static final Identifier INITIAL_PHASE = Identifier.fromNamespaceAndPath(ModInfo.RESOURCE_NAMESPACE, ModInfo.DEDICATED_SERVER_INITIAL_PATH);
#endif #endif
private static final DhLogger LOGGER = new DhLoggerBuilder().build(); private static final DhLogger LOGGER = new DhLoggerBuilder().build();
@@ -96,7 +103,7 @@ public class FabricMain extends AbstractModInitializer implements ClientModIniti
String indiumMissingMessage = ModInfo.READABLE_NAME + " needs Indium to work with Sodium.\nPlease download Indium from https://modrinth.com/mod/indium"; String indiumMissingMessage = ModInfo.READABLE_NAME + " needs Indium to work with Sodium.\nPlease download Indium from https://modrinth.com/mod/indium";
LOGGER.fatal(indiumMissingMessage); LOGGER.fatal(indiumMissingMessage);
TinyFileDialogs.tinyfd_messageBox(ModInfo.READABLE_NAME, indiumMissingMessage, "ok", "error", false); NativeDialogUtil.showDialog(ModInfo.READABLE_NAME, indiumMissingMessage, "ok", "error");
IMinecraftClientWrapper mc = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class); IMinecraftClientWrapper mc = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class);
String errorMessage = "loading Distant Horizons. Distant Horizons requires Indium in order to run with Sodium."; String errorMessage = "loading Distant Horizons. Distant Horizons requires Indium in order to run with Sodium.";
@@ -38,15 +38,27 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
#if MC_VER <= MC_1_21_10
#else
import com.mojang.blaze3d.textures.GpuSampler;
#endif
@Mixin(ChunkSectionsToRender.class) @Mixin(ChunkSectionsToRender.class)
public class MixinChunkSectionsToRender public class MixinChunkSectionsToRender
{ {
#if MC_VER <= MC_1_21_10
// needs to fire at HEAD with a lower than normal order (less than 1000) // needs to fire at HEAD with a lower than normal order (less than 1000)
// otherwise it will be canceled by Sodium // otherwise it will be canceled by Sodium
@Inject(at = @At("HEAD"), method = "renderGroup", order = 800) @Inject(at = @At("HEAD"), method = "renderGroup", order = 800)
private void renderDeferredLayer(ChunkSectionLayerGroup chunkSectionLayerGroup, CallbackInfo ci) private void renderDeferredLayer(ChunkSectionLayerGroup chunkSectionLayerGroup, CallbackInfo ci)
#else
// needs to fire at HEAD with a lower than normal order (less than 1000)
// otherwise it will be canceled by Sodium
@Inject(at = @At("HEAD"), method = "renderGroup", order = 800)
private void renderDeferredLayer(ChunkSectionLayerGroup chunkSectionLayerGroup, GpuSampler gpuSampler, CallbackInfo ci)
#endif
{ {
ClientApi.RENDER_STATE.clientLevelWrapper = ClientLevelWrapper.getWrapperIfDifferent(ClientApi.RENDER_STATE.clientLevelWrapper, Minecraft.getInstance().levelRenderer.level); ClientApi.RENDER_STATE.clientLevelWrapper = ClientLevelWrapper.getWrapperIfDifferent(ClientApi.RENDER_STATE.clientLevelWrapper, Minecraft.getInstance().levelRenderer.level);
@@ -160,9 +160,12 @@ public class MixinFogRenderer
{ {
#if MC_VER < MC_1_21_6 #if MC_VER < MC_1_21_6
Entity entity = camera.getEntity(); Entity entity = camera.getEntity();
#else #elif MC_VER <= MC_1_21_10
Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera(); Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera();
Entity entity = camera.getEntity(); Entity entity = camera.getEntity();
#else
Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera();
Entity entity = camera.entity();
#endif #endif
@@ -28,7 +28,6 @@ import net.minecraft.network.chat.Component;
#if MC_VER < MC_1_19_2 #if MC_VER < MC_1_19_2
import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.network.chat.TranslatableComponent;
#endif #endif
import net.minecraft.resources.ResourceLocation;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@@ -51,6 +50,11 @@ import net.minecraft.client.gui.screens.OptionsScreen;
import net.minecraft.client.gui.screens.options.OptionsScreen; import net.minecraft.client.gui.screens.options.OptionsScreen;
#endif #endif
#if MC_VER <= MC_1_21_10
import net.minecraft.resources.ResourceLocation;
#else
import net.minecraft.resources.Identifier;
#endif
/** /**
* Adds a button to the menu to goto the config * Adds a button to the menu to goto the config
@@ -62,12 +66,15 @@ import net.minecraft.client.gui.screens.options.OptionsScreen;
public class MixinOptionsScreen extends Screen public class MixinOptionsScreen extends Screen
{ {
/** Texture used for the config opening button */ /** Texture used for the config opening button */
#if MC_VER <= MC_1_20_6
@Unique @Unique
private static final ResourceLocation ICON_TEXTURE = private static final ResourceLocation ICON_TEXTURE = new ResourceLocation(ModInfo.ID, "textures/gui/button.png");
#if MC_VER < MC_1_21_1 #elif MC_VER <= MC_1_21_10
new ResourceLocation(ModInfo.ID, "textures/gui/button.png"); @Unique
private static final ResourceLocation ICON_TEXTURE = ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png");
#else #else
ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png"); @Unique
private static final Identifier ICON_TEXTURE = Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png");
#endif #endif
@@ -23,7 +23,11 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.BatchGeneratio
import com.seibel.distanthorizons.core.util.objects.RunOnThisThreadExecutorService; import com.seibel.distanthorizons.core.util.objects.RunOnThisThreadExecutorService;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
#if MC_VER <= MC_1_21_10
import net.minecraft.Util; import net.minecraft.Util;
#else
import net.minecraft.util.Util;
#endif
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
@@ -23,9 +23,7 @@ import com.seibel.distanthorizons.common.wrappers.gui.GetConfigScreen;
import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi; import com.terraformersmc.modmenu.api.ModMenuApi;
/** /** For making the config show up in modmenu */
* For making the config show up in modmenu
*/
public class ModMenuIntegration implements ModMenuApi public class ModMenuIntegration implements ModMenuApi
{ {
// For the custom config code // For the custom config code
@@ -28,9 +28,6 @@ public class OptifineAccessor extends AbstractOptifineAccessor
{ {
@Override @Override
public String getModName() public String getModName() { return "Optifine-Fabric"; }
{
return "Optifine-Fabric-1.18.X";
}
} }
@@ -26,6 +26,7 @@ import java.lang.invoke.MethodType;
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector; import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftRenderWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftRenderWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.ISodiumAccessor; import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.ISodiumAccessor;
import net.minecraft.client.Minecraft;
#if MC_VER < MC_1_20_1 #if MC_VER < MC_1_20_1
@@ -50,9 +51,11 @@ public class SodiumAccessor implements ISodiumAccessor
*/ */
public static final boolean isSodiumV5OrLess; public static final boolean isSodiumV5OrLess;
#if MC_VER >= MC_1_20_1 #if MC_VER <= MC_1_19_4
#elif MC_VER <= MC_1_21_10
private static MethodHandle setFogOcclusionMethod; private static MethodHandle setFogOcclusionMethod;
private static Object sodiumPerformanceOptions; private static Object sodiumPerformanceOptions;
#else
#endif #endif
static { static {
@@ -78,7 +81,8 @@ public class SodiumAccessor implements ISodiumAccessor
@Override @Override
public void setFogOcclusion(boolean occlusionEnabled) public void setFogOcclusion(boolean occlusionEnabled)
{ {
#if MC_VER >= MC_1_20_1 #if MC_VER <= MC_1_19_4
#elif MC_VER <= MC_1_21_10
try try
{ {
if (sodiumPerformanceOptions == null) if (sodiumPerformanceOptions == null)
@@ -122,6 +126,8 @@ public class SodiumAccessor implements ISodiumAccessor
{ {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
#else
// in newer versions of Sodium this doesn't appear to be an issue so it can probably just be ignored
#endif #endif
} }
@@ -107,21 +107,6 @@ public class ForgeClientProxy implements AbstractModInitializer.IEventProxy
//=============//
// tick events //
//=============//
@SubscribeEvent
public void clientTickEvent(TickEvent.ClientTickEvent event)
{
if (event.phase == TickEvent.Phase.START)
{
ClientApi.INSTANCE.clientTickEvent();
}
}
//==============// //==============//
// world events // // world events //
//==============// //==============//
@@ -22,17 +22,16 @@ package com.seibel.distanthorizons.forge;
import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.CommandDispatcher;
import com.seibel.distanthorizons.common.AbstractModInitializer; import com.seibel.distanthorizons.common.AbstractModInitializer;
import com.seibel.distanthorizons.common.wrappers.gui.GetConfigScreen; import com.seibel.distanthorizons.common.wrappers.gui.GetConfigScreen;
import com.seibel.distanthorizons.core.api.internal.ClientApi;
import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector; import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
import com.seibel.distanthorizons.common.wrappers.gui.GetConfigScreen;
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IPluginPacketSender; import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IPluginPacketSender;
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IIrisAccessor;
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IModChecker; import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IModChecker;
import com.seibel.distanthorizons.coreapi.ModInfo; import com.seibel.distanthorizons.coreapi.ModInfo;
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IOptifineAccessor; import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IOptifineAccessor;
import com.seibel.distanthorizons.forge.wrappers.modAccessor.ModChecker; import com.seibel.distanthorizons.forge.wrappers.modAccessor.ModChecker;
import com.seibel.distanthorizons.forge.wrappers.modAccessor.OptifineAccessor; import com.seibel.distanthorizons.forge.wrappers.modAccessor.OptifineAccessor;
import com.seibel.distanthorizons.forge.wrappers.modAccessor.OculusAccessor;
import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.CommandSourceStack;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
@@ -104,6 +103,7 @@ public class ForgeMain extends AbstractModInitializer
protected void initializeModCompat() protected void initializeModCompat()
{ {
this.tryCreateModCompatAccessor("optifine", IOptifineAccessor.class, OptifineAccessor::new); this.tryCreateModCompatAccessor("optifine", IOptifineAccessor.class, OptifineAccessor::new);
this.tryCreateModCompatAccessor("oculus", IIrisAccessor.class, OculusAccessor::new);
#if MC_VER < MC_1_17_1 #if MC_VER < MC_1_17_1
ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY, ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY,
@@ -67,9 +67,11 @@ public class MixinFogRenderer
Entity entity = camera.getEntity(); Entity entity = camera.getEntity();
boolean isSpecialFog = (entity instanceof LivingEntity) && ((LivingEntity) entity).hasEffect(MobEffects.BLINDNESS); boolean isSpecialFog = (entity instanceof LivingEntity) && ((LivingEntity) entity).hasEffect(MobEffects.BLINDNESS);
if (!isSpecialFog && cameraNotInFluid && fogMode == FogMode.FOG_TERRAIN if (!isSpecialFog
&& cameraNotInFluid
&& fogMode == FogMode.FOG_TERRAIN
&& !SingletonInjector.INSTANCE.get(IMinecraftRenderWrapper.class).isFogStateSpecial() && !SingletonInjector.INSTANCE.get(IMinecraftRenderWrapper.class).isFogStateSpecial()
&& Config.Client.Advanced.Graphics.Fog.disableVanillaFog.get()) && !Config.Client.Advanced.Graphics.Fog.enableVanillaFog.get())
{ {
#if MC_VER < MC_1_17_1 #if MC_VER < MC_1_17_1
RenderSystem.fogStart(A_REALLY_REALLY_BIG_VALUE); RenderSystem.fogStart(A_REALLY_REALLY_BIG_VALUE);
@@ -0,0 +1,57 @@
/*
* This file is part of the Distant Horizons mod
* licensed under the GNU LGPL v3 License.
*
* Copyright (C) 2020 James Seibel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.seibel.distanthorizons.forge.wrappers.modAccessor;
import com.seibel.distanthorizons.core.logging.DhLogger;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IIrisAccessor;
public class OculusAccessor implements IIrisAccessor
{
protected static final DhLogger LOGGER = new DhLoggerBuilder().build();
public OculusAccessor()
{
LOGGER.warn("Partial Oculus support enabled. Some DH features may be disabled or behave strangely, use Iris instead if possible.");
}
@Override
public String getModName()
{
return "oculus";
}
@Override
public boolean isShaderPackInUse()
{
// assume shaders are always active
return true;
}
@Override
public boolean isRenderingShadowPass()
{
return false;
}
}
+4 -4
View File
@@ -5,8 +5,8 @@ org.gradle.caching=true
# Mod Info # Mod Info
mod_name=DistantHorizons mod_name=DistantHorizons
mod_version=2.3.7-b-dev mod_version=2.4.4-b
api_version=5.0.0 api_version=5.1.0
maven_group=com.seibel.distanthorizons maven_group=com.seibel.distanthorizons
mod_readable_name=Distant Horizons mod_readable_name=Distant Horizons
mod_description=This mod generates and renders simplified terrain beyond the normal view distance at a low performance cost. Allowing you to see much farther without turning your game into a slideshow. mod_description=This mod generates and renders simplified terrain beyond the normal view distance at a low performance cost. Allowing you to see much farther without turning your game into a slideshow.
@@ -18,7 +18,7 @@ mod_issues=https://gitlab.com/jeseibel/distant-horizons/-/issues
mod_discord=https://discord.gg/xAB8G4cENx mod_discord=https://discord.gg/xAB8G4cENx
# Global Plugin Versions # Global Plugin Versions
manifold_version=2025.1.27 manifold_version=2025.1.28
# 2023.1.17 can be used if there are mystery Java compiler issues # 2023.1.17 can be used if there are mystery Java compiler issues
nightconfig_version=3.6.6 nightconfig_version=3.6.6
lz4_version=1.8.0 lz4_version=1.8.0
@@ -55,7 +55,7 @@ versionStr=
# This defines what MC version Intellij will use for the preprocessor # This defines what MC version Intellij will use for the preprocessor
# and what version is used automatically by build and run commands # and what version is used automatically by build and run commands
mcVer=1.21.10 mcVer=1.21.11
# Defines the maximum amount of memory Minecraft is allowed when run in a development environment # Defines the maximum amount of memory Minecraft is allowed when run in a development environment
#minecraftMemoryJavaArg="-Xmx4G" #minecraftMemoryJavaArg="-Xmx4G"
@@ -73,29 +73,6 @@ public class NeoforgeClientProxy implements AbstractModInitializer.IEventProxy
//=============//
// tick events //
//=============//
#if MC_VER < MC_1_20_6
@SubscribeEvent
public void clientTickEvent(TickEvent.ClientTickEvent event)
{
if (event.phase == TickEvent.Phase.START)
{
ClientApi.INSTANCE.clientTickEvent();
}
}
#else
@SubscribeEvent
public void clientTickEvent(ClientTickEvent.Pre event)
{
ClientApi.INSTANCE.clientTickEvent();
}
#endif
//==============// //==============//
// world events // // world events //
//==============// //==============//
@@ -160,9 +160,12 @@ public class MixinFogRenderer
{ {
#if MC_VER < MC_1_21_6 #if MC_VER < MC_1_21_6
Entity entity = camera.getEntity(); Entity entity = camera.getEntity();
#else #elif MC_VER <= MC_1_21_10
Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera(); Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera();
Entity entity = camera.getEntity(); Entity entity = camera.getEntity();
#else
Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera();
Entity entity = camera.entity();
#endif #endif
@@ -28,7 +28,6 @@ import net.minecraft.network.chat.Component;
#if MC_VER < MC_1_19_2 #if MC_VER < MC_1_19_2
import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.network.chat.TranslatableComponent;
#endif #endif
import net.minecraft.resources.ResourceLocation;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@@ -51,6 +50,11 @@ import net.minecraft.client.gui.screens.OptionsScreen;
import net.minecraft.client.gui.screens.options.OptionsScreen; import net.minecraft.client.gui.screens.options.OptionsScreen;
#endif #endif
#if MC_VER <= MC_1_21_10
import net.minecraft.resources.ResourceLocation;
#else
import net.minecraft.resources.Identifier;
#endif
/** /**
* Adds a button to the menu to goto the config * Adds a button to the menu to goto the config
@@ -62,12 +66,15 @@ import net.minecraft.client.gui.screens.options.OptionsScreen;
public class MixinOptionsScreen extends Screen public class MixinOptionsScreen extends Screen
{ {
/** Texture used for the config opening button */ /** Texture used for the config opening button */
#if MC_VER <= MC_1_20_6
@Unique @Unique
private static final ResourceLocation ICON_TEXTURE = private static final ResourceLocation ICON_TEXTURE = new ResourceLocation(ModInfo.ID, "textures/gui/button.png");
#if MC_VER < MC_1_21_1 #elif MC_VER <= MC_1_21_10
new ResourceLocation(ModInfo.ID, "textures/gui/button.png"); @Unique
private static final ResourceLocation ICON_TEXTURE = ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png");
#else #else
ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png"); @Unique
private static final Identifier ICON_TEXTURE = Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png");
#endif #endif
@@ -23,7 +23,11 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.BatchGeneratio
import com.seibel.distanthorizons.core.util.objects.RunOnThisThreadExecutorService; import com.seibel.distanthorizons.core.util.objects.RunOnThisThreadExecutorService;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
#if MC_VER <= MC_1_21_10
import net.minecraft.Util; import net.minecraft.Util;
#else
import net.minecraft.util.Util;
#endif
#if MC_VER < MC_1_21_3 #if MC_VER < MC_1_21_3
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@@ -31,10 +31,19 @@ import net.irisshaders.iris.api.v0.IrisApi;
public class IrisAccessor implements IIrisAccessor public class IrisAccessor implements IIrisAccessor
{ {
public IrisAccessor()
{
//#if MC_VER == MC_1_21_11
//throw new UnsupportedOperationException("Iris isn't supported on this version of DH. When this version of DH was created Iris wasn't available for Neoforge yet.");
//#endif
}
@Override @Override
public String getModName() public String getModName()
{ {
#if MC_VER == MC_1_21_9 #if MC_VER == MC_1_21_9 || MC_VER == MC_1_21_11
return "iris"; // Iris doesn't support this MC version return "iris"; // Iris doesn't support this MC version
#else #else
return Iris.MODID; return Iris.MODID;
@@ -28,9 +28,6 @@ public class OptifineAccessor extends AbstractOptifineAccessor
{ {
@Override @Override
public String getModName() public String getModName() { return "Optifine-Forge"; }
{
return "Optifine-Forge-1.18.X";
}
} }
+14
View File
@@ -12,15 +12,29 @@ How to add a library's natives:
Example: Example:
```groovy ```groovy
// Relocate the namespace (Java side)
relocate "org.sqlite", "dh_sqlite", { relocate "org.sqlite", "dh_sqlite", {
// (Specific to SQLite's relocation)
// Make sure that native paths are not changed before steps below
exclude "org/sqlite/native/**" exclude "org/sqlite/native/**"
} }
// Shadow also replaces strings inside the Java code
// See the library's source code to find strings used to call into the native code
// This also includes native library paths, if you use mapPaths {} below they will likely need adjustment as well
relocate "jdbc:sqlite", "jdbc:dh_sqlite"
transform(NativeTransformer) { transform(NativeTransformer) {
// NativeTransformer configuration // NativeTransformer configuration
rootDir = project.rootDir rootDir = project.rootDir
// Match native libraries
matchFiles { it.startsWith("org/sqlite") }
// Replace paths with ones that won't overlap with other mods
// Libraries are the ones choosing the path to use for natives; check the source code to see which paths are acceptable.
mapPaths { it.replace("org/sqlite", "dh_sqlite") }
// Replace native strings, e.g. used in calls back to Java // Replace native strings, e.g. used in calls back to Java
// They must be of the same length or shorter!
relocateNative "org/sqlite", "dh_sqlite" relocateNative "org/sqlite", "dh_sqlite"
// Rename native methods used when calling from Java // Rename native methods used when calling from Java
relocateNative "org_sqlite", "dh_1sqlite" relocateNative "org_sqlite", "dh_1sqlite"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -32,6 +32,7 @@ fabric_api_version=0.42.0+1.16
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_lithium=0 enable_lithium=0
+1
View File
@@ -32,6 +32,7 @@ fabric_api_version=0.46.1+1.17
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_lithium=0 enable_lithium=0
+1
View File
@@ -33,6 +33,7 @@ fabric_api_version=0.76.0+1.18.2
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -32,6 +32,7 @@ fabric_api_version=0.76.1+1.19.2
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -31,6 +31,7 @@ fabric_api_version=0.87.1+1.19.4
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -31,6 +31,7 @@ fabric_api_version=0.90.4+1.20.1
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -31,6 +31,7 @@ fabric_api_version=0.90.4+1.20.2
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -32,6 +32,7 @@ fabric_api_version=0.91.2+1.20.4
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -32,6 +32,7 @@ fabric_api_version=0.97.8+1.20.6
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -32,6 +32,7 @@ fabric_api_version=0.115.0+1.21.1
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -30,6 +30,7 @@ fabric_api_version=0.138.3+1.21.10
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+55
View File
@@ -0,0 +1,55 @@
# 1.21.11 version
java_version=21
minecraft_version=1.21.11
parchment_version=1.21:2024.07.28
compatible_minecraft_versions=["1.21.11"]
accessWidenerVersion=1_21_11
builds_for=fabric,neoforge
# forge is broken due to gradle/build script issues
# Netty
netty_version=4.1.97.Final
# Fabric loader
fabric_loader_version=0.17.3
fabric_api_version=0.139.4+1.21.11
modmenu_version=17.0.0-alpha.1
starlight_version_fabric=
phosphor_version_fabric=
lithium_version=
sodium_version=mc1.21.11-0.8.0-fabric
iris_version=1.10.0+1.21.11-fabric
bclib_version=
immersive_portals_version=
canvas_version=
fabric_incompatibility_list={ }
fabric_recommend_list={}
# Fabric mod run
# 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0
enable_phosphor=0
enable_sodium=1
enable_lithium=0
enable_iris=1
enable_bclib=0
enable_immersive_portals=0
enable_canvas=0
# NeoForge loader
forge_version=
neoforge_version=21.11.0-beta
neoforge_version_range=[*,)
# NeoForge mod versions
neo_iris_version=1.10.2+1.21.11-neoforge
# (Neo)Forge mod run
# 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client
neo_enable_iris=1
+1
View File
@@ -32,6 +32,7 @@ fabric_api_version=0.110.0+1.21.3
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -31,6 +31,7 @@ fabric_api_version=0.110.5+1.21.4
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -31,6 +31,7 @@ fabric_api_version=0.119.5+1.21.5
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -30,6 +30,7 @@ fabric_api_version=0.127.0+1.21.6
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -30,6 +30,7 @@ fabric_api_version=0.133.4+1.21.8
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1
+1
View File
@@ -30,6 +30,7 @@ fabric_api_version=0.134.0+1.21.9
# 0 = Don't enable and don't run # 0 = Don't enable and don't run
# 1 = Can be referenced in code but doesn't run # 1 = Can be referenced in code but doesn't run
# 2 = Can be referenced in code and runs in client # 2 = Can be referenced in code and runs in client
enable_mod_menu=2
enable_starlight=0 enable_starlight=0
enable_phosphor=0 enable_phosphor=0
enable_sodium=1 enable_sodium=1