mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
commit
8f67cb6ba3
@ -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.glScaled(1, 1, 0.5); //incredible flattening power
|
||||||
|
|
||||||
GL11.glRotated(-30, 1, 0, 0);
|
GL11.glRotated(-30, 1, 0, 0);
|
||||||
GL11.glRotated(-45, 0, 1, 0);
|
GL11.glRotated(225, 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(dir == ForgeDirection.WEST || dir == ForgeDirection.EAST) {
|
if(dir == ForgeDirection.WEST || dir == ForgeDirection.EAST) {
|
||||||
GL11.glTranslated(sizeX / -2D, -sizeY / 2D, sizeZ / -2D);
|
GL11.glTranslated(sizeX / -2D, -sizeY / 2D, sizeZ / -2D);
|
||||||
|
|||||||
@ -13,6 +13,8 @@ import com.hbm.tileentity.machine.TileEntityPWRController;
|
|||||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
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 io.netty.buffer.ByteBuf;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
@ -54,6 +56,8 @@ public class ItemPWRPrinter extends Item implements IGUIProvider {
|
|||||||
blockSync = null;
|
blockSync = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// idiot box for server crashes: 2
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
public static void deserialize(World world, ByteBuf buf) {
|
public static void deserialize(World world, ByteBuf buf) {
|
||||||
x1 = buf.readInt();
|
x1 = buf.readInt();
|
||||||
y1 = 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
|
// Open the printer GUI on any client players holding the printer
|
||||||
// yeah it's a shit hack yay weee wooo
|
// yeah it's a shit hack yay weee wooo
|
||||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||||
if(player != null && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemPWRPrinter) {
|
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
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user