diff --git a/CHANGELOG.md b/CHANGELOG.md index 9874a253..9a0353c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -144,6 +144,10 @@ - Updated [SpruceUI]. - Updated [pridelib]. +## 2.3.1 +- Updated to Minecraft 1.20 ([#156](https://github.com/LambdAurora/LambDynamicLights/pull/156)) +- Updated [SpruceUI]. + [SpruceUI]: https://github.com/LambdAurora/SpruceUI "SpruceUI page" [pridelib]: https://github.com/Queerbric/pridelib "Pridelib page" [Sodium]: https://modrinth.com/mod/sodium "Sodium Modrinth page" diff --git a/gradle.properties b/gradle.properties index 9bbea7df..e6bf5c85 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx2G # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version=1.19.4 -quilt_mappings=5 -loader_version=0.14.18 +minecraft_version=1.20 +quilt_mappings=4 +loader_version=0.14.21 # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api -fabric_api_version=0.76.0+1.19.4 +fabric_api_version=0.83.0+1.20 # Mod Properties -mod_version = 2.3.0 +mod_version = 2.3.1 maven_group = dev.lambdaurora archives_base_name = lambdynamiclights modrinth_id=yBW8D80W @@ -18,6 +18,6 @@ curseforge_id=393442 # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api -spruceui_version=4.2.0+1.19.4 +spruceui_version=5.0.0+1.20 pridelib_version=1.2.0+1.19.4 -modmenu_version=6.1.0-rc.4 +modmenu_version=7.0.1 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbf..c1962a79 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradlew b/gradlew index 65dcd68d..aeb74cbb 100755 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +141,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +149,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/src/main/java/dev/lambdaurora/lambdynlights/gui/InnerBackground.java b/src/main/java/dev/lambdaurora/lambdynlights/gui/InnerBackground.java index 799e0a43..0a0056b5 100644 --- a/src/main/java/dev/lambdaurora/lambdynlights/gui/InnerBackground.java +++ b/src/main/java/dev/lambdaurora/lambdynlights/gui/InnerBackground.java @@ -13,18 +13,18 @@ import dev.lambdaurora.spruceui.background.DirtTexturedBackground; import dev.lambdaurora.spruceui.widget.SpruceWidget; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.DrawableHelper; -import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.client.gui.GuiGraphics; + +public class InnerBackground implements Background { -public class InnerBackground extends DrawableHelper implements Background { @Override - public void render(MatrixStack matrices, SpruceWidget widget, int vOffset, int mouseX, int mouseY, float delta) { + public void render(GuiGraphics graphics, SpruceWidget widget, int vOffset, int mouseX, int mouseY, float delta) { if (MinecraftClient.getInstance().world != null) { - this.fillGradient(matrices, widget.getX(), widget.getY(), + graphics.fillGradient(widget.getX(), widget.getY(), widget.getX() + widget.getWidth(), widget.getY() + widget.getHeight(), 0xc0060606, 0xd0060606); } else { - DirtTexturedBackground.DARKENED.render(matrices, widget, vOffset, mouseX, mouseY, delta); + DirtTexturedBackground.DARKENED.render(graphics, widget, vOffset, mouseX, mouseY, delta); } } } diff --git a/src/main/java/dev/lambdaurora/lambdynlights/gui/LightSourceListWidget.java b/src/main/java/dev/lambdaurora/lambdynlights/gui/LightSourceListWidget.java index 7fc2c367..07022bca 100644 --- a/src/main/java/dev/lambdaurora/lambdynlights/gui/LightSourceListWidget.java +++ b/src/main/java/dev/lambdaurora/lambdynlights/gui/LightSourceListWidget.java @@ -22,9 +22,9 @@ import dev.lambdaurora.spruceui.widget.WithBackground; import dev.lambdaurora.spruceui.widget.container.SpruceEntryListWidget; import dev.lambdaurora.spruceui.widget.container.SpruceParentWidget; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; import net.minecraft.client.gui.screen.narration.NarrationPart; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import org.jetbrains.annotations.Nullable; import org.lwjgl.glfw.GLFW; @@ -203,14 +203,12 @@ protected boolean onCharTyped(char chr, int keyCode) { /* Rendering */ - @Override - protected void renderWidget(MatrixStack matrices, int mouseX, int mouseY, float delta) { - this.forEach(widget -> widget.render(matrices, mouseX, mouseY, delta)); + protected void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float delta) { + this.forEach(widget -> widget.render(graphics, mouseX, mouseY, delta)); } - @Override - protected void renderBackground(MatrixStack matrices, int mouseX, int mouseY, float delta) { - this.background.render(matrices, this, 0, mouseX, mouseY, delta); + protected void renderBackground(GuiGraphics graphics, int mouseX, int mouseY, float delta) { + this.background.render(graphics, this, 0, mouseX, mouseY, delta); } /* Narration */ diff --git a/src/main/java/dev/lambdaurora/lambdynlights/gui/RandomPrideFlagBackground.java b/src/main/java/dev/lambdaurora/lambdynlights/gui/RandomPrideFlagBackground.java index 908043ad..fd3dbbc6 100644 --- a/src/main/java/dev/lambdaurora/lambdynlights/gui/RandomPrideFlagBackground.java +++ b/src/main/java/dev/lambdaurora/lambdynlights/gui/RandomPrideFlagBackground.java @@ -18,8 +18,8 @@ import io.github.queerbric.pride.PrideFlag; import io.github.queerbric.pride.PrideFlagShapes; import io.github.queerbric.pride.PrideFlags; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.render.GameRenderer; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; import org.joml.Matrix4f; import org.joml.Vector4f; @@ -46,13 +46,13 @@ public RandomPrideFlagBackground(PrideFlag flag) { } @Override - public void render(MatrixStack matrices, SpruceWidget widget, int vOffset, int mouseX, int mouseY, float delta) { + public void render(GuiGraphics graphics, SpruceWidget widget, int vOffset, int mouseX, int mouseY, float delta) { int x = widget.getX(); int y = widget.getY(); RenderSystem.setShader(GameRenderer::getPositionColorShader); if (this.flag.getShape() == PrideFlagShapes.get(new Identifier("pride", "horizontal_stripes"))) { - var model = matrices.peek().getModel(); + var model = graphics.getMatrices().peek().getModel(); var tessellator = Tessellator.getInstance(); var vertices = tessellator.getBufferBuilder(); vertices.begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION_COLOR); @@ -96,10 +96,10 @@ public void render(MatrixStack matrices, SpruceWidget widget, int vOffset, int m tessellator.draw(); } else { - this.flag.render(matrices, x, y, widget.getWidth(), widget.getHeight()); + this.flag.render(graphics.getMatrices(), x, y, widget.getWidth(), widget.getHeight()); } - SECOND_LAYER.render(matrices, widget, vOffset, mouseX, mouseY, delta); + SECOND_LAYER.render(graphics, widget, vOffset, mouseX, mouseY, delta); } /** diff --git a/src/main/java/dev/lambdaurora/lambdynlights/gui/SettingsScreen.java b/src/main/java/dev/lambdaurora/lambdynlights/gui/SettingsScreen.java index f0e2aa24..d528afce 100644 --- a/src/main/java/dev/lambdaurora/lambdynlights/gui/SettingsScreen.java +++ b/src/main/java/dev/lambdaurora/lambdynlights/gui/SettingsScreen.java @@ -31,7 +31,6 @@ import dev.lambdaurora.spruceui.widget.container.tabbed.SpruceTabbedWidget; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.registry.Registries; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -134,12 +133,12 @@ private SpruceContainerWidget buildTabContainer(int width, int height, SpruceTab innerWidget.getPosition().setRelativeY(43); container.addChild(innerWidget); - container.setBackground((matrices, widget, vOffset, mouseX, mouseY, delta) -> { + container.setBackground((graphics, widget, vOffset, mouseX, mouseY, delta) -> { if (this.client.world != null) { - this.fillGradient(matrices, widget.getX(), widget.getY(), + graphics.fillGradient(widget.getX(), widget.getY(), widget.getX() + widget.getWidth(), innerWidget.getY(), 0xc0101010, 0xd0101010); - this.fillGradient(matrices, widget.getX(), innerWidget.getY() + innerWidget.getHeight(), + graphics.fillGradient(widget.getX(), innerWidget.getY() + innerWidget.getHeight(), widget.getX() + widget.getWidth(), widget.getY() + widget.getHeight(), 0xc0101010, 0xd0101010); } else { @@ -197,8 +196,4 @@ private LightSourceListWidget buildLightSourcesTab(int width, int height, List[] addOptionButton(Option[] old) { } @Inject(method = "render", at = @At("TAIL")) - private void onRender(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) { - Tooltip.renderAll(this, matrices); + private void onRender(GuiGraphics graphics, int mouseX, int mouseY, float delta, CallbackInfo ci) { + Tooltip.renderAll(graphics); } } diff --git a/src/main/java/dev/lambdaurora/lambdynlights/mixin/lightsource/AbstractMinecartEntityMixin.java b/src/main/java/dev/lambdaurora/lambdynlights/mixin/lightsource/AbstractMinecartEntityMixin.java index fd9ab255..cb7641cd 100644 --- a/src/main/java/dev/lambdaurora/lambdynlights/mixin/lightsource/AbstractMinecartEntityMixin.java +++ b/src/main/java/dev/lambdaurora/lambdynlights/mixin/lightsource/AbstractMinecartEntityMixin.java @@ -46,7 +46,7 @@ public AbstractMinecartEntityMixin(EntityType type, World world) { @Inject(method = "tick", at = @At("HEAD")) private void onTick(CallbackInfo ci) { // We do not want to update the entity on the server. - if (this.world.isClient()) { + if (this.getWorld().isClient()) { if (this.isRemoved()) { this.setDynamicLightEnabled(false); } else { diff --git a/src/main/java/dev/lambdaurora/lambdynlights/mixin/lightsource/LivingEntityMixin.java b/src/main/java/dev/lambdaurora/lambdynlights/mixin/lightsource/LivingEntityMixin.java index 220aade8..2b4cbe0c 100644 --- a/src/main/java/dev/lambdaurora/lambdynlights/mixin/lightsource/LivingEntityMixin.java +++ b/src/main/java/dev/lambdaurora/lambdynlights/mixin/lightsource/LivingEntityMixin.java @@ -41,7 +41,7 @@ public void dynamicLightTick() { } else { int luminance = 0; var eyePos = BlockPos.create(this.getX(), this.getEyeY(), this.getZ()); - boolean submergedInFluid = !this.world.getFluidState(eyePos).isEmpty(); + boolean submergedInFluid = !this.getWorld().getFluidState(eyePos).isEmpty(); for (var equipped : this.getItemsEquipped()) { if (!equipped.isEmpty()) luminance = Math.max(luminance, LambDynLights.getLuminanceFromItemStack(equipped, submergedInFluid)); diff --git a/src/main/java/dev/lambdaurora/lambdynlights/mixin/lightsource/PlayerEntityMixin.java b/src/main/java/dev/lambdaurora/lambdynlights/mixin/lightsource/PlayerEntityMixin.java index 666bfe3f..0b4ec109 100644 --- a/src/main/java/dev/lambdaurora/lambdynlights/mixin/lightsource/PlayerEntityMixin.java +++ b/src/main/java/dev/lambdaurora/lambdynlights/mixin/lightsource/PlayerEntityMixin.java @@ -49,7 +49,7 @@ public void dynamicLightTick() { int luminance = DynamicLightHandlers.getLuminanceFrom((Entity) this); var eyePos = BlockPos.create(this.getX(), this.getEyeY(), this.getZ()); - boolean submergedInFluid = !this.world.getFluidState(eyePos).isEmpty(); + boolean submergedInFluid = !this.getWorld().getFluidState(eyePos).isEmpty(); for (var equipped : this.getItemsEquipped()) { if (!equipped.isEmpty()) luminance = Math.max(luminance, LambDynLights.getLuminanceFromItemStack(equipped, submergedInFluid)); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 3254962f..0f05daf4 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,14 +29,14 @@ "lambdynlights.lightsource.mixins.json" ], "depends": { - "fabricloader": ">=0.14.11", - "fabric": ">=0.76.0+1.19.4", - "minecraft": "1.19.4", - "spruceui": ">=4.2.0", + "fabricloader": ">=0.14.21", + "fabric": ">=0.83.0+1.20", + "minecraft": "1.20", + "spruceui": ">=5.0.0", "java": ">=17" }, "recommends": { - "modmenu": ">=5.0.2" + "modmenu": ">=7.0.1" }, "suggests": { "ears": "*",