aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
authorJuuz <6596629+Juuxel@users.noreply.github.com>2022-12-11 14:03:41 +0200
committerJuuz <6596629+Juuxel@users.noreply.github.com>2022-12-11 14:03:41 +0200
commit2aa6d47f648274137cd346115245c28a11ff1723 (patch)
treed1a1d7a2a27d01366e66dac22633c27df19ce730 /src/main/java/io
parentb67f79e7e7c95f79efb74c5f360978eb342d0920 (diff)
downloadLibGui-2aa6d47f648274137cd346115245c28a11ff1723.tar.gz
LibGui-2aa6d47f648274137cd346115245c28a11ff1723.tar.bz2
LibGui-2aa6d47f648274137cd346115245c28a11ff1723.zip
Update to Minecraft 1.19.3
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java6
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java9
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java4
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java6
4 files changed, 13 insertions, 12 deletions
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<ItemStack> getRenderStacks(TagKey<? extends ItemConvertible> tag) {
- Registry<ItemConvertible> registry = (Registry<ItemConvertible>) Registry.REGISTRIES.get(tag.registry().getValue());
+ Registry<ItemConvertible> registry = (Registry<ItemConvertible>) Registries.REGISTRIES.get(tag.registry().getValue());
ImmutableList.Builder<ItemStack> builder = ImmutableList.builder();
for (RegistryEntry<ItemConvertible> item : registry.getOrCreateEntryList((TagKey<ItemConvertible>) 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();
}