aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorReece Mackie <20544390+Rover656@users.noreply.github.com>2021-05-21 14:45:58 +0100
committerGitHub <noreply@github.com>2021-05-21 16:45:58 +0300
commit494e8a6d34bb47e2e6f5c4301d0dcb8863e45f23 (patch)
treee59ada96cb212d9fd9439bc7ed67ea347b87ffcb /src/main
parenteb168c435be6d4cccb37a4b21dd616571b81917b (diff)
downloadLibGui-494e8a6d34bb47e2e6f5c4301d0dcb8863e45f23.tar.gz
LibGui-494e8a6d34bb47e2e6f5c4301d0dcb8863e45f23.tar.bz2
LibGui-494e8a6d34bb47e2e6f5c4301d0dcb8863e45f23.zip
Port to 21w20a. Fixes #109 (#110)4.0.0-alpha.2
* 21w20a. Fixes #109 * Indentation and spacing fixes
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java2
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java2
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/impl/client/NinePatchInternals.java4
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java4
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java b/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java
index 3c4d8ad..b0bf93d 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java
@@ -155,7 +155,7 @@ public class SyncedGuiDescription extends ScreenHandler implements GuiDescriptio
slot.markDirty();
}
}
-
+ } else {
super.onSlotClick(slotNumber, button, action, player);
}
}
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 7fae1bf..74a5aba 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
@@ -143,7 +143,7 @@ public class ScreenDrawing {
Matrix4f model = matrices.peek().getModel();
RenderSystem.setShaderTexture(0, texture);
RenderSystem.setShaderColor(r, g, b, opacity);
- RenderSystem.setShader(GameRenderer::method_34542);
+ RenderSystem.setShader(GameRenderer::getPositionTexShader);
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();
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/impl/client/NinePatchInternals.java b/src/main/java/io/github/cottonmc/cotton/gui/impl/client/NinePatchInternals.java
index f90ba7f..ddb4301 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/impl/client/NinePatchInternals.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/impl/client/NinePatchInternals.java
@@ -5,7 +5,7 @@ import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener;
import net.minecraft.resource.Resource;
import net.minecraft.resource.ResourceManager;
-import net.minecraft.resource.SinglePreparationResourceReloadListener;
+import net.minecraft.resource.SinglePreparationResourceReloader;
import net.minecraft.util.Identifier;
import net.minecraft.util.profiler.Profiler;
@@ -37,7 +37,7 @@ public final class NinePatchInternals {
}
@Environment(EnvType.CLIENT)
- public static class MetadataLoader extends SinglePreparationResourceReloadListener<Map<Identifier, Properties>> implements IdentifiableResourceReloadListener {
+ public static class MetadataLoader extends SinglePreparationResourceReloader<Map<Identifier, Properties>> implements IdentifiableResourceReloadListener {
public static final MetadataLoader INSTANCE = new MetadataLoader();
private static final Identifier ID = new Identifier(LibGuiCommon.MOD_ID, "9patch_metadata");
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java
index 33252a0..15cd6bb 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java
@@ -3,7 +3,7 @@ package io.github.cottonmc.cotton.gui.widget;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.widget.AbstractButtonWidget;
+import net.minecraft.client.gui.widget.ClickableWidget;
import net.minecraft.client.sound.PositionedSoundInstance;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.sound.SoundEvents;
@@ -221,6 +221,6 @@ public class WButton extends WWidget {
@Environment(EnvType.CLIENT)
static Identifier getTexture() {
- return LibGui.isDarkMode() ? DARK_WIDGETS_LOCATION : AbstractButtonWidget.WIDGETS_LOCATION;
+ return LibGui.isDarkMode() ? DARK_WIDGETS_LOCATION : ClickableWidget.WIDGETS_TEXTURE;
}
}
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 ac3c8bf..ba47296 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
@@ -406,7 +406,7 @@ public class WTextField extends WWidget {
Tessellator tessellator_1 = Tessellator.getInstance();
BufferBuilder bufferBuilder_1 = tessellator_1.getBuffer();
RenderSystem.setShaderColor(0.0F, 0.0F, 1.0F, 1.0F);
- RenderSystem.setShader(GameRenderer::method_34542);
+ RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.disableTexture();
RenderSystem.enableColorLogicOp();
RenderSystem.logicOp(GlStateManager.LogicOp.OR_REVERSE);