From 2aa6d47f648274137cd346115245c28a11ff1723 Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Sun, 11 Dec 2022 14:03:41 +0200 Subject: Update to Minecraft 1.19.3 --- .../java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java | 6 +++--- src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java | 9 +++++---- .../io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java | 4 ++-- .../java/io/github/cottonmc/cotton/gui/widget/WTextField.java | 6 +++--- src/main/resources/fabric.mod.json | 6 +++--- 5 files changed, 16 insertions(+), 15 deletions(-) (limited to 'src/main') diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java b/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java index 4fcb3f2..19171c9 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java @@ -13,12 +13,12 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.OrderedText; import net.minecraft.text.Style; import net.minecraft.util.Identifier; -import net.minecraft.util.math.Matrix4f; import io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl; import io.github.cottonmc.cotton.gui.widget.data.HorizontalAlignment; import io.github.cottonmc.cotton.gui.widget.data.Texture; import org.jetbrains.annotations.Nullable; +import org.joml.Matrix4f; /** * {@code ScreenDrawing} contains utility methods for drawing contents on a screen. @@ -140,13 +140,13 @@ public class ScreenDrawing { RenderSystem.enableBlend(); RenderSystem.setShaderTexture(0, texture); RenderSystem.setShaderColor(r, g, b, opacity); - RenderSystem.setShader(GameRenderer::getPositionTexShader); + RenderSystem.setShader(GameRenderer::getPositionTexProgram); buffer.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE); buffer.vertex(model, x, y + height, 0).texture(u1, v2).next(); buffer.vertex(model, x + width, y + height, 0).texture(u2, v2).next(); buffer.vertex(model, x + width, y, 0).texture(u2, v1).next(); buffer.vertex(model, x, y, 0).texture(u1, v1).next(); - BufferRenderer.drawWithShader(buffer.end()); + BufferRenderer.drawWithGlobalProgram(buffer.end()); RenderSystem.disableBlend(); } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java index 178f6c5..e309475 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java @@ -9,9 +9,10 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.Item; import net.minecraft.item.ItemConvertible; import net.minecraft.item.ItemStack; -import net.minecraft.tag.TagKey; -import net.minecraft.util.registry.Registry; -import net.minecraft.util.registry.RegistryEntry; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.registry.tag.TagKey; import com.google.common.collect.ImmutableList; @@ -110,7 +111,7 @@ public class WItem extends WWidget { */ @SuppressWarnings("unchecked") private static List getRenderStacks(TagKey tag) { - Registry registry = (Registry) Registry.REGISTRIES.get(tag.registry().getValue()); + Registry registry = (Registry) Registries.REGISTRIES.get(tag.registry().getValue()); ImmutableList.Builder builder = ImmutableList.builder(); for (RegistryEntry item : registry.getOrCreateEntryList((TagKey) tag)) { diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java index a8a912b..c750036 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java @@ -7,7 +7,7 @@ import net.minecraft.client.gui.screen.narration.NarrationPart; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import net.minecraft.util.Identifier; -import net.minecraft.util.math.Vec3f; +import net.minecraft.util.math.RotationAxis; import io.github.cottonmc.cotton.gui.client.ScreenDrawing; import io.github.cottonmc.cotton.gui.impl.client.NarrationMessages; @@ -172,7 +172,7 @@ public class WLabeledSlider extends WAbstractSlider { matrices.translate(x, y, 0); if (axis == Axis.VERTICAL) { matrices.translate(0, height, 0); - matrices.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(270)); + matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(270)); } drawButton(matrices, 0, 0, 0, aWidth); diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java index 69c8755..40bc67f 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java @@ -18,13 +18,13 @@ import net.minecraft.client.render.VertexFormats; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Matrix4f; import io.github.cottonmc.cotton.gui.client.BackgroundPainter; import io.github.cottonmc.cotton.gui.client.ScreenDrawing; import io.github.cottonmc.cotton.gui.impl.client.NarrationMessages; import io.github.cottonmc.cotton.gui.widget.data.InputResult; import org.jetbrains.annotations.Nullable; +import org.joml.Matrix4f; import org.lwjgl.glfw.GLFW; import java.util.function.Consumer; @@ -252,7 +252,7 @@ public class WTextField extends WWidget { BufferBuilder buffer = tessellator.getBuffer(); Matrix4f model = matrices.peek().getPositionMatrix(); RenderSystem.setShaderColor(0.0F, 0.0F, 1.0F, 1.0F); - RenderSystem.setShader(GameRenderer::getPositionTexShader); + RenderSystem.setShader(GameRenderer::getPositionTexProgram); RenderSystem.disableTexture(); RenderSystem.enableColorLogicOp(); RenderSystem.logicOp(GlStateManager.LogicOp.OR_REVERSE); @@ -261,7 +261,7 @@ public class WTextField extends WWidget { buffer.vertex(model, x + width, y + height, 0).next(); buffer.vertex(model, x + width, y, 0).next(); buffer.vertex(model, x, y, 0).next(); - BufferRenderer.drawWithShader(buffer.end()); + BufferRenderer.drawWithGlobalProgram(buffer.end()); RenderSystem.disableColorLogicOp(); RenderSystem.enableTexture(); } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 2e88dba..22868a2 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -24,13 +24,13 @@ }, "depends": { "java": ">=17", - "fabricloader": ">=0.13.3", + "fabricloader": ">=0.14.11", "fabric-api-base": ">=0.4.4", "fabric-lifecycle-events-v1": "^2.0.2", "fabric-networking-api-v1": "^1.0.21", "fabric-rendering-v1": "^1.10.7", - "minecraft": ">=1.19", - "jankson": "^4.0.0", + "minecraft": ">=1.19.3", + "jankson": "^5.0.0", "libninepatch": "^1.1.0" }, "suggests": { -- cgit