more minepad stuff; need to copy some code from MCEF and look at why mouse input isn't working properly

This commit is contained in:
GiantLuigi4 2023-05-31 15:49:15 -04:00
parent 5780cd1199
commit 53b12a3294
4 changed files with 9 additions and 10 deletions

View File

@ -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...");
}

View File

@ -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)

View File

@ -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);
}

View File

@ -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