From 53b12a329403a9b9a89f41b146562ec0741e9485 Mon Sep 17 00:00:00 2001 From: GiantLuigi4 <49770992+GiantLuigi4@users.noreply.github.com> Date: Wed, 31 May 2023 15:49:15 -0400 Subject: [PATCH] more minepad stuff; need to copy some code from MCEF and look at why mouse input isn't working properly --- src/main/java/net/montoyo/wd/SharedProxy.java | 3 ++- src/main/java/net/montoyo/wd/client/ClientProxy.java | 2 +- .../java/net/montoyo/wd/client/gui/GuiMinePad.java | 12 +++++------- src/main/java/net/montoyo/wd/item/ItemMinePad2.java | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/net/montoyo/wd/SharedProxy.java b/src/main/java/net/montoyo/wd/SharedProxy.java index e5817c7..5e37164 100644 --- a/src/main/java/net/montoyo/wd/SharedProxy.java +++ b/src/main/java/net/montoyo/wd/SharedProxy.java @@ -24,6 +24,7 @@ import net.montoyo.wd.entity.TileEntityScreen; import net.montoyo.wd.utilities.*; import javax.annotation.Nonnull; +import java.util.UUID; public class SharedProxy { public void preInit() { @@ -80,7 +81,7 @@ public class SharedProxy { Log.error("Called SharedProxy.displaySetPadURLGui() on server side..."); } - public void openMinePadGui(int padId) { + public void openMinePadGui(UUID padId) { Log.error("Called SharedProxy.openMinePadGui() on server side..."); } diff --git a/src/main/java/net/montoyo/wd/client/ClientProxy.java b/src/main/java/net/montoyo/wd/client/ClientProxy.java index 25cd46c..6e2b715 100644 --- a/src/main/java/net/montoyo/wd/client/ClientProxy.java +++ b/src/main/java/net/montoyo/wd/client/ClientProxy.java @@ -273,7 +273,7 @@ public class ClientProxy extends SharedProxy implements IDisplayHandler, IJSQuer } @Override - public void openMinePadGui(int padId) { + public void openMinePadGui(UUID padId) { PadData pd = padMap.get(padId); if(pd != null && pd.view != null) diff --git a/src/main/java/net/montoyo/wd/client/gui/GuiMinePad.java b/src/main/java/net/montoyo/wd/client/gui/GuiMinePad.java index a328977..bdfd71c 100644 --- a/src/main/java/net/montoyo/wd/client/gui/GuiMinePad.java +++ b/src/main/java/net/montoyo/wd/client/gui/GuiMinePad.java @@ -17,7 +17,6 @@ import org.lwjgl.glfw.GLFW; import java.util.Optional; import static net.minecraftforge.api.distmarker.Dist.CLIENT; -import static org.lwjgl.opengl.GL11.glColor4f; @OnlyIn(CLIENT) public class GuiMinePad extends WDScreen { @@ -48,10 +47,10 @@ public class GuiMinePad extends WDScreen { } private static void addRect(BufferBuilder bb, double x, double y, double w, double h) { - bb.vertex(x, y, 0.0).endVertex(); - bb.vertex(x + w, y, 0.0).endVertex(); - bb.vertex(x + w, y + h, 0.0).endVertex(); - bb.vertex(x, y + h, 0.0).endVertex(); + bb.vertex(x, y, 0.0).color(255, 255, 255, 255).endVertex(); + bb.vertex(x + w, y, 0.0).color(255, 255, 255, 255).endVertex(); + bb.vertex(x + w, y + h, 0.0).color(255, 255, 255, 255).endVertex(); + bb.vertex(x, y + h, 0.0).color(255, 255, 255, 255).endVertex(); } @Override @@ -64,7 +63,7 @@ public class GuiMinePad extends WDScreen { Tesselator t = Tesselator.getInstance(); BufferBuilder bb = t.getBuilder(); - bb.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION); + bb.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR); addRect(bb, vx, vy - 16, vw, 16); addRect(bb, vx, vy + vh, vw, 16); addRect(bb, vx - 16, vy, 16, vh); @@ -74,7 +73,6 @@ public class GuiMinePad extends WDScreen { RenderSystem.enableTexture(); if (pad.view != null) { - glColor4f(1.0f, 1.0f, 1.0f, 1.0f); pad.view.draw(poseStack, vx, vy + vh, vx + vw, vy); } diff --git a/src/main/java/net/montoyo/wd/item/ItemMinePad2.java b/src/main/java/net/montoyo/wd/item/ItemMinePad2.java index 026bb73..94fdcba 100644 --- a/src/main/java/net/montoyo/wd/item/ItemMinePad2.java +++ b/src/main/java/net/montoyo/wd/item/ItemMinePad2.java @@ -55,7 +55,7 @@ public class ItemMinePad2 extends Item implements WDItem { ok = true; } else if (is.getTag() != null && is.getTag().contains("PadID")) { if (world.isClientSide) - WebDisplays.PROXY.openMinePadGui(is.getTag().getInt("PadID")); + WebDisplays.PROXY.openMinePadGui(is.getTag().getUUID("PadID")); ok = true; } else