diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ae186d00..a5e1d85fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,7 +36,7 @@ build: parallel: matrix: - 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.19.4", "1.19.2", "1.18.2", diff --git a/build.gradle b/build.gradle index 62a3ca144..9a0736cc2 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ plugins { id "systems.manifold.manifold-gradle-plugin" version "0.0.2-alpha" // 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 } diff --git a/common/src/main/java/com/seibel/distanthorizons/common/AbstractModInitializer.java b/common/src/main/java/com/seibel/distanthorizons/common/AbstractModInitializer.java index 367fd5289..c148e3ccc 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/AbstractModInitializer.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/AbstractModInitializer.java @@ -116,7 +116,7 @@ public abstract class AbstractModInitializer LOGGER.info(ModInfo.READABLE_NAME + " server Initialized, adding event subscribers..."); this.commandInitializer = new CommandInitializer(); - this.subscribeRegisterCommandsEvent(dispatcher -> { commandInitializer.initCommands(dispatcher); }); + this.subscribeRegisterCommandsEvent(dispatcher -> { this.commandInitializer.initCommands(dispatcher); }); this.subscribeServerStartingEvent(server -> { diff --git a/common/src/main/java/com/seibel/distanthorizons/common/AbstractPluginPacketSender.java b/common/src/main/java/com/seibel/distanthorizons/common/AbstractPluginPacketSender.java index f16f3addb..dd2b400dc 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/AbstractPluginPacketSender.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/AbstractPluginPacketSender.java @@ -13,9 +13,14 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IServerPlayerWrapp import com.seibel.distanthorizons.coreapi.ModInfo; import io.netty.buffer.ByteBufUtil; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; 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.util.Objects; @@ -25,10 +30,12 @@ public abstract class AbstractPluginPacketSender implements IPluginPacketSender .fileLevelConfig(Config.Common.Logging.logNetworkEventToFile) .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); #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 // "Forge byte" is an unused packet ID. We have our own system which works with all mod loaders, diff --git a/common/src/main/java/com/seibel/distanthorizons/common/commands/CommandInitializer.java b/common/src/main/java/com/seibel/distanthorizons/common/commands/CommandInitializer.java index 23f9ccab4..45c02ad50 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/commands/CommandInitializer.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/commands/CommandInitializer.java @@ -3,18 +3,24 @@ package com.seibel.distanthorizons.common.commands; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import net.minecraft.commands.CommandSourceStack; +import net.minecraft.server.permissions.PermissionCheck; +import net.minecraft.server.permissions.Permissions; import org.jetbrains.annotations.Nullable; import static com.seibel.distanthorizons.core.network.messages.MessageRegistry.DEBUG_CODEC_CRASH_MESSAGE; import static net.minecraft.commands.Commands.literal; -/** - * Initializes commands of the mod. - */ public class CommandInitializer { 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. */ @@ -50,7 +56,14 @@ public class CommandInitializer } LiteralArgumentBuilder 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 DebugCommand().buildCommand()); diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/VersionConstants.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/VersionConstants.java index 6e4fa0042..dada9d870 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/VersionConstants.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/VersionConstants.java @@ -83,6 +83,8 @@ public class VersionConstants implements IVersionConstants return "1.21.9"; #elif MC_VER == MC_1_21_10 return "1.21.10"; + #elif MC_VER == MC_1_21_11 + return "1.21.11"; #else ERROR MC version constant missing #endif diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BiomeWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BiomeWrapper.java index 5938f425f..b843805de 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BiomeWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BiomeWrapper.java @@ -29,7 +29,6 @@ import java.util.concurrent.ConcurrentMap; import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper; import net.minecraft.world.level.Level; -import org.apache.logging.log4j.LogManager; import com.seibel.distanthorizons.core.logging.DhLogger; import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper; @@ -46,7 +45,12 @@ import net.minecraft.core.Holder; import net.minecraft.core.registries.Registries; #endif +#if MC_VER <= MC_1_21_10 import net.minecraft.resources.ResourceLocation; +#else +import net.minecraft.resources.Identifier; +#endif + import net.minecraft.world.level.biome.Biome; #if MC_VER >= MC_1_18_2 @@ -217,7 +221,12 @@ public class BiomeWrapper implements IBiomeWrapper Level level = (Level)levelWrapper.getWrappedMcObject(); net.minecraft.core.RegistryAccess registryAccess = level.registryAccess(); + #if MC_VER < MC_1_21_11 ResourceLocation resourceLocation; + #else + Identifier resourceLocation; + #endif + #if MC_VER == MC_1_16_5 || MC_VER == MC_1_17_1 resourceLocation = registryAccess.registryOrThrow(Registry.BIOME_REGISTRY).getKey(this.biome); #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 + "]."); } + #if MC_VER < MC_1_21_11 ResourceLocation resourceLocation; + #else + Identifier resourceLocation; + #endif 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)); - #else + #elif MC_VER <= MC_1_21_10 resourceLocation = ResourceLocation.fromNamespaceAndPath(resourceLocationString.substring(0, separatorIndex), resourceLocationString.substring(separatorIndex + 1)); + #else + resourceLocation = Identifier.fromNamespaceAndPath(resourceLocationString.substring(0, separatorIndex), resourceLocationString.substring(separatorIndex + 1)); #endif } catch (Exception e) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java index 8829c8bb0..b16111fdc 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java @@ -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.world.ILevelWrapper; -import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; import net.minecraft.world.level.block.BeaconBeamBlock; import net.minecraft.world.level.block.Block; @@ -63,6 +62,12 @@ import net.minecraft.world.level.EmptyBlockGetter; import net.minecraft.core.Holder; #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 { /** example "minecraft:water" */ @@ -87,7 +92,11 @@ public class BlockStateWrapper implements IBlockStateWrapper public static HashSet rendererIgnoredCaveBlocks = null; /** keep track of broken blocks so we don't log every time */ + #if MC_VER < MC_1_21_10 private static final HashSet BROKEN_RESOURCE_LOCATIONS = new HashSet<>(); + #else + private static final HashSet BROKEN_RESOURCE_LOCATIONS = new HashSet<>(); + #endif @@ -555,7 +564,12 @@ public class BlockStateWrapper implements IBlockStateWrapper net.minecraft.core.RegistryAccess registryAccess = level.registryAccess(); #endif + #if MC_VER < MC_1_21_11 ResourceLocation resourceLocation; + #else + Identifier resourceLocation; + #endif + #if MC_VER == MC_1_16_5 || MC_VER == MC_1_17_1 resourceLocation = Registry.BLOCK.getKey(this.blockState.getBlock()); #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 + "]."); } + #if MC_VER < MC_1_21_11 ResourceLocation resourceLocation; + #else + Identifier resourceLocation; + #endif + try { #if MC_VER < MC_1_21_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)); + #else + resourceLocation = Identifier.fromNamespaceAndPath(resourceStateString.substring(0, separatorIndex), resourceStateString.substring(separatorIndex + 1)); #endif } catch (Exception e) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java index 7e17bd0d7..e6d592d7b 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/ClassicConfigGUI.java @@ -37,7 +37,6 @@ import net.minecraft.client.gui.components.EditBox; import net.minecraft.client.gui.components.events.GuiEventListener; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; import com.seibel.distanthorizons.core.logging.DhLogger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -54,6 +53,12 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.narration.NarratableEntry; #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.Translatable; @@ -180,8 +185,10 @@ public class ClassicConfigGUI 0, #if MC_VER < MC_1_21_1 new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"), - #else + #elif MC_VER < MC_1_21_10 ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), + #else + Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), #endif 20, 20, // Create the button and tell it where to go diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/DhDebugScreenEntry.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/DhDebugScreenEntry.java index e5c643e4f..775e7c5f1 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/DhDebugScreenEntry.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/DhDebugScreenEntry.java @@ -14,9 +14,13 @@ import java.util.List; import net.minecraft.client.gui.components.debug.DebugScreenDisplayer; import net.minecraft.client.gui.components.debug.DebugScreenEntries; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.Level; import net.minecraft.world.level.chunk.LevelChunk; + +#if MC_VER <= MC_1_21_10 +import net.minecraft.resources.ResourceLocation; +#endif + #endif #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 DebugScreenEntries.register( // The id, this will be displayed on the options screen + #if MC_VER <= MC_1_21_10 ResourceLocation.fromNamespaceAndPath(ModInfo.RESOURCE_NAMESPACE, "distant_horizons"), + #else + "distant_horizons", + #endif + // The screen entry new DhDebugScreenEntry() ); diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/MinecraftScreen.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/MinecraftScreen.java index fc2f7cb44..7b35a173f 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/MinecraftScreen.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/MinecraftScreen.java @@ -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) } + #if MC_VER <= MC_1_21_10 @Override 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(); this.screen.width = mcWindow.getWidth(); this.screen.height = mcWindow.getHeight(); diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/TexturedButtonWidget.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/TexturedButtonWidget.java index 88157d7f7..9d2e965dd 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/TexturedButtonWidget.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/TexturedButtonWidget.java @@ -20,7 +20,6 @@ package com.seibel.distanthorizons.common.wrappers.gui; import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; #if MC_VER >= MC_1_17_1 import net.minecraft.client.gui.components.Button; @@ -42,10 +41,19 @@ import net.minecraft.client.gui.GuiGraphics; #elif MC_VER < MC_1_21_6 import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.RenderType; -#else +#elif MC_VER <= MC_1_21_10 import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.RenderType; 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 /** @@ -67,18 +75,33 @@ public class TexturedButtonWidget extends Button private final int v; private final int hoveredVOffset; + #if MC_VER <= MC_1_21_10 private final ResourceLocation textureResourceLocation; + #else + private final Identifier textureResourceLocation; + #endif private final int textureWidth; private final int textureHeight; #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); } - 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 super(x, y, width, height, u, v, hoveredVOffset, textureResourceLocation, textureWidth, textureHeight, pressAction, text); @@ -169,8 +192,13 @@ public class TexturedButtonWidget extends Button #endif #else + #if MC_VER < MC_1_21_11 @Override 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) { diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java index 533559613..474313e82 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/UpdateModScreen.java @@ -9,14 +9,21 @@ import com.seibel.distanthorizons.coreapi.ModInfo; import com.seibel.distanthorizons.core.config.Config; import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter; 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 import net.minecraft.client.gui.GuiGraphics; #else import com.mojang.blaze3d.vertex.PoseStack; #endif -import net.minecraft.client.gui.screens.Screen; + +#if MC_VER <= MC_1_21_10 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.*; @@ -88,10 +95,12 @@ public class UpdateModScreen extends DhScreen 0, 0, // Some textuary stuff 0, - #if MC_VER < MC_1_21_1 + #if MC_VER <= MC_1_20_6 new ResourceLocation(ModInfo.ID, "logo.png"), - #else + #elif MC_VER <= MC_1_21_10 ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "logo.png"), + #else + Identifier.fromNamespaceAndPath(ModInfo.ID, "logo.png"), #endif 195, 65, // Create the button and tell it where to go @@ -121,12 +130,14 @@ public class UpdateModScreen extends DhScreen 0, #if MC_VER < MC_1_21_1 new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"), - #else + #elif MC_VER <= MC_1_21_10 ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), + #else + Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"), #endif 20, 20, // 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 Translatable(ModInfo.ID + ".updater.title") )); diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/minecraft/MinecraftRenderWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/minecraft/MinecraftRenderWrapper.java index 22768c86c..b009b6f11 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/minecraft/MinecraftRenderWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/minecraft/MinecraftRenderWrapper.java @@ -58,6 +58,8 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IOptifineAc import net.minecraft.client.Camera; import net.minecraft.client.Minecraft; +import net.minecraft.core.BlockPos; +import net.minecraft.world.attribute.EnvironmentAttributes; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.phys.Vec3; @@ -121,8 +123,13 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper @Override public Vec3f getLookAtVector() { + #if MC_VER <= MC_1_21_10 Camera camera = MC.gameRenderer.getMainCamera(); 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 } @Override @@ -151,7 +158,11 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper public Vec3d getCameraExactPosition() { Camera camera = MC.gameRenderer.getMainCamera(); + #if MC_VER <= MC_1_21_10 Vec3 projectedView = camera.getPosition(); + #else + Vec3 projectedView = camera.position(); + #endif return new Vec3d(projectedView.x, projectedView.y, projectedView.z); } @@ -185,8 +196,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper Math.max(0f, Math.min(colorValues.z, 1f)), // b Math.max(0f, Math.min(colorValues.w, 1f)) // a ); - #else - + #elif MC_VER <= MC_1_21_10 if (mcFogRenderer == null) { mcFogRenderer = new FogRenderer(); @@ -210,6 +220,31 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper Math.max(0f, Math.min(colorValues.z, 1f)), // b 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 } // getSpecialFogColor() is the same as getFogColor() @@ -224,8 +259,10 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper frameTime = MC.getFrameTime(); #elif MC_VER < MC_1_21_3 frameTime = MC.getTimer().getRealtimeDeltaTicks(); - #else + #elif MC_VER <= MC_1_21_10 frameTime = MC.deltaTracker.getGameTimeDeltaTicks(); + #else + frameTime = 0f; // unused #endif #if MC_VER < MC_1_17_1 @@ -234,9 +271,12 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper #elif MC_VER < MC_1_21_3 Vec3 colorValues = MC.level.getSkyColor(MC.gameRenderer.getMainCamera().getPosition(), frameTime); 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 - int argbColorInt = MC.level.getSkyColor(MC.gameRenderer.getMainCamera().getPosition(), frameTime);; - return ColorUtil.toColorObjARGB(argbColorInt); // TODO MC changed color formats + int argbColor = MC.level.environmentAttributes().getValue(EnvironmentAttributes.SKY_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 } else diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java index 2c80c5b06..a9620cb7b 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java @@ -21,6 +21,7 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.world.IDimensionTypeWra import com.seibel.distanthorizons.core.wrapperInterfaces.world.IServerLevelWrapper; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.ChunkAccess; @@ -50,6 +51,12 @@ import net.minecraft.world.phys.Vec3; import com.seibel.distanthorizons.core.util.ColorUtil; #endif +#if MC_VER <= MC_1_21_10 +#else +import net.minecraft.world.attribute.EnvironmentAttributes; +#endif + + public class ClientLevelWrapper implements IClientLevelWrapper { private static final DhLogger LOGGER = new DhLoggerBuilder().build(); @@ -92,7 +99,7 @@ public class ClientLevelWrapper implements IClientLevelWrapper * IE rendering. */ @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) { @@ -237,11 +244,24 @@ public class ClientLevelWrapper implements IClientLevelWrapper public void clearBlockColorCache() { this.blockColorCacheByBlockState.clear(); } @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 - 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().getPath(); + #endif + } @Override public long getHashedSeed() { return this.level.getBiomeManager().biomeZoomSeed; } @@ -342,9 +362,12 @@ public class ClientLevelWrapper implements IClientLevelWrapper #if MC_VER < MC_1_21_3 Vec3 colorVec3 = this.level.getCloudColor(tickDelta); 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); 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 } diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/DimensionTypeWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/DimensionTypeWrapper.java index 0191e43de..50101cd79 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/DimensionTypeWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/DimensionTypeWrapper.java @@ -26,25 +26,45 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.world.IDimensionTypeWra import net.minecraft.world.level.dimension.DimensionType; -/** - * @author James Seibel - */ public class DimensionTypeWrapper implements IDimensionTypeWrapper { private static final ConcurrentMap DIMENSION_WRAPPER_BY_NAME = new ConcurrentHashMap<>(); private final DimensionType dimensionType; + private final String name; + //=============// // Constructor // //=============// - public DimensionTypeWrapper(DimensionType dimensionType) { this.dimensionType = dimensionType; } - - public static DimensionTypeWrapper getDimensionTypeWrapper(DimensionType dimensionType) + #if MC_VER <= MC_1_21_10 + public DimensionTypeWrapper(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 if (DIMENSION_WRAPPER_BY_NAME.containsKey(dimName) @@ -55,10 +75,21 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper // create the missing wrapper - DimensionTypeWrapper dimensionTypeWrapper = new DimensionTypeWrapper(dimensionType); + DimensionTypeWrapper dimensionTypeWrapper = new DimensionTypeWrapper(dimensionType, dimName); DIMENSION_WRAPPER_BY_NAME.put(dimName, 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(); } @@ -69,16 +100,7 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper //=================// @Override - public String getName() { return getName(this.dimensionType); } - 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 - } + public String getName() { return this.name; } @Override public boolean hasCeiling() { return this.dimensionType.hasCeiling(); } @@ -89,7 +111,6 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper @Override public Object getWrappedMcObject() { return this.dimensionType; } - // there's definitely a better way of doing this, but it should work well enough for now @Override public boolean isTheEnd() { return this.getName().equalsIgnoreCase("the_end"); } @@ -98,7 +119,6 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper - //================// // base overrides // //================// diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java index cba6b4b66..b18a67e35 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java @@ -172,10 +172,24 @@ public class ServerLevelWrapper implements IServerLevelWrapper @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 - 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().getPath(); + #endif + } @Override public long getHashedSeed() { return this.level.getBiomeManager().biomeZoomSeed; } diff --git a/common/src/main/resources/1_16.distanthorizons.accesswidener b/common/src/main/resources/1_16.distanthorizons.accesswidener index 33952ea06..fb4fab8ad 100644 --- a/common/src/main/resources/1_16.distanthorizons.accesswidener +++ b/common/src/main/resources/1_16.distanthorizons.accesswidener @@ -18,7 +18,6 @@ accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chu # used for grabbing vanilla rendered chunks 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/world/entity/Entity blockPosition Lnet/minecraft/core/BlockPos; # lighting 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 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/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 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; diff --git a/common/src/main/resources/1_17.distanthorizons.accesswidener b/common/src/main/resources/1_17.distanthorizons.accesswidener index aa146bc38..c2d128192 100644 --- a/common/src/main/resources/1_17.distanthorizons.accesswidener +++ b/common/src/main/resources/1_17.distanthorizons.accesswidener @@ -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 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/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 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; diff --git a/common/src/main/resources/1_20.distanthorizons.accesswidener b/common/src/main/resources/1_20.distanthorizons.accesswidener index f25735769..4ffbdfde2 100644 --- a/common/src/main/resources/1_20.distanthorizons.accesswidener +++ b/common/src/main/resources/1_20.distanthorizons.accesswidener @@ -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; # 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/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z diff --git a/common/src/main/resources/1_20_2.distanthorizons.accesswidener b/common/src/main/resources/1_20_2.distanthorizons.accesswidener index 3d2dfb353..c08eec2e9 100644 --- a/common/src/main/resources/1_20_2.distanthorizons.accesswidener +++ b/common/src/main/resources/1_20_2.distanthorizons.accesswidener @@ -11,10 +11,7 @@ accessible method net/minecraft/client/renderer/GameRenderer getFov (Lnet/minecr # used for grabbing vanilla rendered chunks 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 -# 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/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z diff --git a/common/src/main/resources/1_20_6.distanthorizons.accesswidener b/common/src/main/resources/1_20_6.distanthorizons.accesswidener index 69792fead..0ee41695f 100644 --- a/common/src/main/resources/1_20_6.distanthorizons.accesswidener +++ b/common/src/main/resources/1_20_6.distanthorizons.accesswidener @@ -11,10 +11,7 @@ accessible method net/minecraft/client/renderer/GameRenderer getFov (Lnet/minecr # used for grabbing vanilla rendered chunks 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 -# 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/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z diff --git a/common/src/main/resources/1_21_10.distanthorizons.accesswidener b/common/src/main/resources/1_21_10.distanthorizons.accesswidener index ffac58134..3e8c62341 100644 --- a/common/src/main/resources/1_21_10.distanthorizons.accesswidener +++ b/common/src/main/resources/1_21_10.distanthorizons.accesswidener @@ -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; # 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/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z diff --git a/common/src/main/resources/1_21_11.distanthorizons.accesswidener b/common/src/main/resources/1_21_11.distanthorizons.accesswidener new file mode 100644 index 000000000..fc398c7da --- /dev/null +++ b/common/src/main/resources/1_21_11.distanthorizons.accesswidener @@ -0,0 +1,53 @@ +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; + +# 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; + + diff --git a/common/src/main/resources/1_21_3.distanthorizons.accesswidener b/common/src/main/resources/1_21_3.distanthorizons.accesswidener index 9e531f24f..99e723e14 100644 --- a/common/src/main/resources/1_21_3.distanthorizons.accesswidener +++ b/common/src/main/resources/1_21_3.distanthorizons.accesswidener @@ -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; # 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/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z diff --git a/common/src/main/resources/1_21_4.distanthorizons.accesswidener b/common/src/main/resources/1_21_4.distanthorizons.accesswidener index 0e3526f0d..d98a21a0e 100644 --- a/common/src/main/resources/1_21_4.distanthorizons.accesswidener +++ b/common/src/main/resources/1_21_4.distanthorizons.accesswidener @@ -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; # 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/lighting/LightEngine storage Lnet/minecraft/world/level/lighting/LayerLightSectionStorage; accessible method net/minecraft/world/level/lighting/LayerLightSectionStorage lightOnInSection (J)Z diff --git a/coreSubProjects b/coreSubProjects index 17c61a97c..c1c4328fa 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 17c61a97ccfaf3998be554a3b657efcfc385624b +Subproject commit c1c4328fa53211145732fd5712bb21b85083b7d6 diff --git a/fabric/build.gradle b/fabric/build.gradle index 6392ae6d7..77fabeb80 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -102,7 +102,7 @@ dependencies { // Mod Menu - modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}") + addMod("com.terraformersmc:modmenu:${rootProject.modmenu_version}", rootProject.enable_mod_menu) // Starlight addMod("curse.maven:starlight-521783:${rootProject.starlight_version_fabric}", rootProject.enable_starlight) diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java index e2fec7267..0f6010d16 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java @@ -36,7 +36,6 @@ import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; import net.fabricmc.fabric.api.event.Event; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.minecraft.commands.CommandSourceStack; -import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import com.seibel.distanthorizons.core.logging.DhLogger; import org.lwjgl.util.tinyfd.TinyFileDialogs; @@ -47,6 +46,12 @@ import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback; #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; /** @@ -56,10 +61,12 @@ import java.util.function.Consumer; */ 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); #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 private static final DhLogger LOGGER = new DhLoggerBuilder().build(); diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinChunkSectionsToRender.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinChunkSectionsToRender.java index 7ae38d6e0..fbdfa1419 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinChunkSectionsToRender.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinChunkSectionsToRender.java @@ -28,6 +28,7 @@ public class MixinChunkSectionsToRender { /* rendering before was handled via Fabric API events */ } #else +import com.mojang.blaze3d.textures.GpuSampler; import com.seibel.distanthorizons.common.wrappers.world.ClientLevelWrapper; import com.seibel.distanthorizons.core.api.internal.ClientApi; import net.minecraft.client.Minecraft; @@ -43,10 +44,17 @@ public class MixinChunkSectionsToRender { + #if MC_VER <= MC_1_21_10 // 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, 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); diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinFogRenderer.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinFogRenderer.java index 6292b6921..11a314138 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinFogRenderer.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinFogRenderer.java @@ -160,9 +160,12 @@ public class MixinFogRenderer { #if MC_VER < MC_1_21_6 Entity entity = camera.getEntity(); + #elif MC_VER <= MC_1_21_10 + Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera(); + Entity entity = camera.getEntity(); #else Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera(); - Entity entity = camera.getEntity(); + Entity entity = camera.entity(); #endif diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinOptionsScreen.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinOptionsScreen.java index 3ddbc948e..706b48cc9 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinOptionsScreen.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinOptionsScreen.java @@ -28,7 +28,6 @@ import net.minecraft.network.chat.Component; #if MC_VER < MC_1_19_2 import net.minecraft.network.chat.TranslatableComponent; #endif -import net.minecraft.resources.ResourceLocation; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; 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; #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 @@ -62,13 +66,16 @@ import net.minecraft.client.gui.screens.options.OptionsScreen; public class MixinOptionsScreen extends Screen { /** Texture used for the config opening button */ + #if MC_VER <= MC_1_20_6 @Unique - private static final ResourceLocation ICON_TEXTURE = - #if MC_VER < MC_1_21_1 - new ResourceLocation(ModInfo.ID, "textures/gui/button.png"); - #else - ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png"); - #endif + private static final ResourceLocation ICON_TEXTURE = new ResourceLocation(ModInfo.ID, "textures/gui/button.png"); + #elif MC_VER <= MC_1_21_10 + @Unique + private static final ResourceLocation ICON_TEXTURE = ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png"); + #else + @Unique + private static final Identifier ICON_TEXTURE = Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png"); + #endif @Unique diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/MixinUtilBackgroundThread.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/MixinUtilBackgroundThread.java index 80ea7f5df..35aaf68d4 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/MixinUtilBackgroundThread.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/server/MixinUtilBackgroundThread.java @@ -23,7 +23,11 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.BatchGeneratio import com.seibel.distanthorizons.core.util.objects.RunOnThisThreadExecutorService; import org.spongepowered.asm.mixin.Mixin; +#if MC_VER <= MC_1_21_10 import net.minecraft.Util; +#else +import net.minecraft.util.Util; +#endif import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/config/ModMenuIntegration.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/config/ModMenuIntegration.java index 2de1ffaf6..0c4f80155 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/config/ModMenuIntegration.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/wrappers/config/ModMenuIntegration.java @@ -20,19 +20,21 @@ package com.seibel.distanthorizons.fabric.wrappers.config; import com.seibel.distanthorizons.common.wrappers.gui.GetConfigScreen; +#if MC_VER != MC_1_21_11 import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; +#endif -/** - * For making the config show up in modmenu - */ -public class ModMenuIntegration implements ModMenuApi +/** For making the config show up in modmenu */ +public class ModMenuIntegration #if MC_VER != MC_1_21_11 implements ModMenuApi #endif { + #if MC_VER != MC_1_21_11 // For the custom config code @Override public ConfigScreenFactory getModConfigScreenFactory() { return parent -> GetConfigScreen.getScreen(parent); } + #endif } diff --git a/gradle.properties b/gradle.properties index b6c6fb489..4c9dd6567 100644 --- a/gradle.properties +++ b/gradle.properties @@ -55,7 +55,7 @@ versionStr= # This defines what MC version Intellij will use for the preprocessor # and what version is used automatically by build and run commands -mcVer=1.21.10 +mcVer=1.21.11 # Defines the maximum amount of memory Minecraft is allowed when run in a development environment #minecraftMemoryJavaArg="-Xmx4G" diff --git a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinFogRenderer.java b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinFogRenderer.java index cf999f04e..57864fd0a 100644 --- a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinFogRenderer.java +++ b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinFogRenderer.java @@ -160,9 +160,12 @@ public class MixinFogRenderer { #if MC_VER < MC_1_21_6 Entity entity = camera.getEntity(); + #elif MC_VER <= MC_1_21_10 + Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera(); + Entity entity = camera.getEntity(); #else Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera(); - Entity entity = camera.getEntity(); + Entity entity = camera.entity(); #endif diff --git a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinOptionsScreen.java b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinOptionsScreen.java index 27c41b6d4..053797334 100644 --- a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinOptionsScreen.java +++ b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/client/MixinOptionsScreen.java @@ -28,7 +28,6 @@ import net.minecraft.network.chat.Component; #if MC_VER < MC_1_19_2 import net.minecraft.network.chat.TranslatableComponent; #endif -import net.minecraft.resources.ResourceLocation; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; 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; #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 @@ -62,13 +66,16 @@ import net.minecraft.client.gui.screens.options.OptionsScreen; public class MixinOptionsScreen extends Screen { /** Texture used for the config opening button */ + #if MC_VER <= MC_1_20_6 @Unique - private static final ResourceLocation ICON_TEXTURE = - #if MC_VER < MC_1_21_1 - new ResourceLocation(ModInfo.ID, "textures/gui/button.png"); - #else - ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png"); - #endif + private static final ResourceLocation ICON_TEXTURE = new ResourceLocation(ModInfo.ID, "textures/gui/button.png"); + #elif MC_VER <= MC_1_21_10 + @Unique + private static final ResourceLocation ICON_TEXTURE = ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png"); + #else + @Unique + private static final Identifier ICON_TEXTURE = Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/button.png"); + #endif @Unique diff --git a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/server/MixinUtilBackgroundThread.java b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/server/MixinUtilBackgroundThread.java index 0974498ee..14ea2c148 100644 --- a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/server/MixinUtilBackgroundThread.java +++ b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/mixins/server/MixinUtilBackgroundThread.java @@ -23,7 +23,11 @@ import com.seibel.distanthorizons.common.wrappers.worldGeneration.BatchGeneratio import com.seibel.distanthorizons.core.util.objects.RunOnThisThreadExecutorService; import org.spongepowered.asm.mixin.Mixin; +#if MC_VER <= MC_1_21_10 import net.minecraft.Util; +#else +import net.minecraft.util.Util; +#endif #if MC_VER < MC_1_21_3 import org.spongepowered.asm.mixin.injection.At; diff --git a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/wrappers/modAccessor/IrisAccessor.java b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/wrappers/modAccessor/IrisAccessor.java index 26e9148a6..96cfe0fef 100644 --- a/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/wrappers/modAccessor/IrisAccessor.java +++ b/neoforge/src/main/java/com/seibel/distanthorizons/neoforge/wrappers/modAccessor/IrisAccessor.java @@ -24,17 +24,26 @@ package com.seibel.distanthorizons.neoforge.wrappers.modAccessor; import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IIrisAccessor; -#if MC_VER != MC_1_21_9 +#if MC_VER != MC_1_21_9 && MC_VER != MC_1_21_11 import net.irisshaders.iris.Iris; import net.irisshaders.iris.api.v0.IrisApi; #endif 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 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 #else return Iris.MODID; @@ -44,7 +53,7 @@ public class IrisAccessor implements IIrisAccessor @Override public boolean isShaderPackInUse() { - #if MC_VER == MC_1_21_9 + #if MC_VER == MC_1_21_9 || MC_VER == MC_1_21_11 return true; // Iris doesn't support this MC version #else return IrisApi.getInstance().isShaderPackInUse(); @@ -54,7 +63,7 @@ public class IrisAccessor implements IIrisAccessor @Override public boolean isRenderingShadowPass() { - #if MC_VER == MC_1_21_9 + #if MC_VER == MC_1_21_9 || MC_VER == MC_1_21_11 return false; // Iris doesn't support this MC version #else return IrisApi.getInstance().isRenderingShadowPass(); diff --git a/versionProperties/1.16.5.properties b/versionProperties/1.16.5.properties index 1c1751740..4de42a6c2 100644 --- a/versionProperties/1.16.5.properties +++ b/versionProperties/1.16.5.properties @@ -32,6 +32,7 @@ fabric_api_version=0.42.0+1.16 # 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_lithium=0 diff --git a/versionProperties/1.17.1.properties b/versionProperties/1.17.1.properties index e289396c6..f67f3a9a9 100644 --- a/versionProperties/1.17.1.properties +++ b/versionProperties/1.17.1.properties @@ -32,6 +32,7 @@ fabric_api_version=0.46.1+1.17 # 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_lithium=0 diff --git a/versionProperties/1.18.2.properties b/versionProperties/1.18.2.properties index 0690b97bb..208ace2ba 100644 --- a/versionProperties/1.18.2.properties +++ b/versionProperties/1.18.2.properties @@ -33,6 +33,7 @@ fabric_api_version=0.76.0+1.18.2 # 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 diff --git a/versionProperties/1.19.2.properties b/versionProperties/1.19.2.properties index e3d228d3a..ee94e1666 100644 --- a/versionProperties/1.19.2.properties +++ b/versionProperties/1.19.2.properties @@ -32,6 +32,7 @@ fabric_api_version=0.76.1+1.19.2 # 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 diff --git a/versionProperties/1.19.4.properties b/versionProperties/1.19.4.properties index ddddb1129..015d44069 100644 --- a/versionProperties/1.19.4.properties +++ b/versionProperties/1.19.4.properties @@ -31,6 +31,7 @@ fabric_api_version=0.87.1+1.19.4 # 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 diff --git a/versionProperties/1.20.1.properties b/versionProperties/1.20.1.properties index ae501f639..a312b75b2 100644 --- a/versionProperties/1.20.1.properties +++ b/versionProperties/1.20.1.properties @@ -31,6 +31,7 @@ fabric_api_version=0.90.4+1.20.1 # 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 diff --git a/versionProperties/1.20.2.properties b/versionProperties/1.20.2.properties index 625a901ba..230d27ce3 100644 --- a/versionProperties/1.20.2.properties +++ b/versionProperties/1.20.2.properties @@ -31,6 +31,7 @@ fabric_api_version=0.90.4+1.20.2 # 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 diff --git a/versionProperties/1.20.4.properties b/versionProperties/1.20.4.properties index f996087a3..e0fabea7b 100644 --- a/versionProperties/1.20.4.properties +++ b/versionProperties/1.20.4.properties @@ -32,6 +32,7 @@ fabric_api_version=0.91.2+1.20.4 # 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 diff --git a/versionProperties/1.20.6.properties b/versionProperties/1.20.6.properties index 33b8a9c40..b50c0ec88 100644 --- a/versionProperties/1.20.6.properties +++ b/versionProperties/1.20.6.properties @@ -32,6 +32,7 @@ fabric_api_version=0.97.8+1.20.6 # 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 diff --git a/versionProperties/1.21.1.properties b/versionProperties/1.21.1.properties index 5d54e32c4..b99bfcd80 100644 --- a/versionProperties/1.21.1.properties +++ b/versionProperties/1.21.1.properties @@ -32,6 +32,7 @@ fabric_api_version=0.115.0+1.21.1 # 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 diff --git a/versionProperties/1.21.10.properties b/versionProperties/1.21.10.properties index dc30ac02b..10f6ab032 100644 --- a/versionProperties/1.21.10.properties +++ b/versionProperties/1.21.10.properties @@ -30,6 +30,7 @@ fabric_api_version=0.138.3+1.21.10 # 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 diff --git a/versionProperties/1.21.11.properties b/versionProperties/1.21.11.properties new file mode 100644 index 000000000..0741b2682 --- /dev/null +++ b/versionProperties/1.21.11.properties @@ -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= + 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=0 + 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= + + # (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=0 diff --git a/versionProperties/1.21.3.properties b/versionProperties/1.21.3.properties index 5dec76fc8..c5e7f2072 100644 --- a/versionProperties/1.21.3.properties +++ b/versionProperties/1.21.3.properties @@ -32,6 +32,7 @@ fabric_api_version=0.110.0+1.21.3 # 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 diff --git a/versionProperties/1.21.4.properties b/versionProperties/1.21.4.properties index deaa58a70..99cff8899 100644 --- a/versionProperties/1.21.4.properties +++ b/versionProperties/1.21.4.properties @@ -31,6 +31,7 @@ fabric_api_version=0.110.5+1.21.4 # 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 diff --git a/versionProperties/1.21.5.properties b/versionProperties/1.21.5.properties index 365920e6a..44c5eb10d 100644 --- a/versionProperties/1.21.5.properties +++ b/versionProperties/1.21.5.properties @@ -31,6 +31,7 @@ fabric_api_version=0.119.5+1.21.5 # 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 diff --git a/versionProperties/1.21.6.properties b/versionProperties/1.21.6.properties index ebbd0fc9c..d4594b874 100644 --- a/versionProperties/1.21.6.properties +++ b/versionProperties/1.21.6.properties @@ -30,6 +30,7 @@ fabric_api_version=0.127.0+1.21.6 # 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 diff --git a/versionProperties/1.21.8.properties b/versionProperties/1.21.8.properties index 714227dea..2c7274926 100644 --- a/versionProperties/1.21.8.properties +++ b/versionProperties/1.21.8.properties @@ -30,6 +30,7 @@ fabric_api_version=0.133.4+1.21.8 # 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 diff --git a/versionProperties/1.21.9.properties b/versionProperties/1.21.9.properties index 6f9f0ca76..f86f9bff1 100644 --- a/versionProperties/1.21.9.properties +++ b/versionProperties/1.21.9.properties @@ -30,6 +30,7 @@ fabric_api_version=0.134.0+1.21.9 # 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