stop staring at me with them big ol' eyes.

*SHHHHOOONK*
This commit is contained in:
George Paton 2025-09-01 17:39:27 +10:00
parent 7e01544c19
commit 9a6cebe0fa
2 changed files with 22 additions and 14 deletions

View File

@ -98,7 +98,22 @@ public class GUIScreenSlicePrinter extends GuiScreen {
}
}
renderer.renderBlockByRenderType(block, x, 0, z);
int dx = x;
int dz = z;
// swizzle instead of rotating, so the PWR controller faces the correct rotation
if(dir == ForgeDirection.WEST) {
dx = sizeZ - 1 - z;
dz = x;
} else if(dir == ForgeDirection.SOUTH) {
dx = sizeX - 1 - x;
dz = sizeZ - 1 - z;
} else if(dir == ForgeDirection.EAST) {
dx = z;
dz = sizeX - 1 - x;
}
renderer.renderBlockByRenderType(block, dx, 0, dz);
}
}
@ -124,15 +139,7 @@ public class GUIScreenSlicePrinter extends GuiScreen {
GL11.glScaled(1, 1, 0.5); //incredible flattening power
GL11.glRotated(-30, 1, 0, 0);
GL11.glRotated(-45, 0, 1, 0);
if(dir == ForgeDirection.WEST) {
GL11.glRotated(180, 0, 1, 0);
} else if(dir == ForgeDirection.NORTH) {
GL11.glRotated(-90, 0, 1, 0);
} else if(dir == ForgeDirection.SOUTH) {
GL11.glRotated(90, 0, 1, 0);
}
GL11.glRotated(225, 0, 1, 0);
if(dir == ForgeDirection.WEST || dir == ForgeDirection.EAST) {
GL11.glTranslated(sizeX / -2D, -sizeY / 2D, sizeZ / -2D);

View File

@ -13,6 +13,8 @@ import com.hbm.tileentity.machine.TileEntityPWRController;
import com.hbm.util.fauxpointtwelve.BlockPos;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
@ -54,6 +56,8 @@ public class ItemPWRPrinter extends Item implements IGUIProvider {
blockSync = null;
}
// idiot box for server crashes: 2
@SideOnly(Side.CLIENT)
public static void deserialize(World world, ByteBuf buf) {
x1 = buf.readInt();
y1 = buf.readInt();
@ -75,15 +79,12 @@ public class ItemPWRPrinter extends Item implements IGUIProvider {
}
}
System.out.println("oh wow it synced and attempted to GUI!");
// Open the printer GUI on any client players holding the printer
// yeah it's a shit hack yay weee wooo
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if(player != null && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemPWRPrinter) {
FMLNetworkHandler.openGui(Minecraft.getMinecraft().thePlayer, MainRegistry.instance, 0, world, 0, 0, 0);
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, 0, 0, 0);
}
}
@Override