mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
PWR printing device, exports a built PWR as a series of slices to be edited together for posting
This commit is contained in:
parent
a000347877
commit
c978fa8955
@ -4,6 +4,7 @@ import com.hbm.blocks.ITooltipProvider;
|
|||||||
import com.hbm.blocks.ModBlocks;
|
import com.hbm.blocks.ModBlocks;
|
||||||
import com.hbm.blocks.machine.BlockPWR.TileEntityBlockPWR;
|
import com.hbm.blocks.machine.BlockPWR.TileEntityBlockPWR;
|
||||||
import com.hbm.handler.threading.PacketThreading;
|
import com.hbm.handler.threading.PacketThreading;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||||
@ -80,6 +81,7 @@ public class MachinePWRController extends BlockContainer implements ITooltipProv
|
|||||||
if(!controller.assembled) {
|
if(!controller.assembled) {
|
||||||
assemble(world, x, y, z, player);
|
assemble(world, x, y, z, player);
|
||||||
} else {
|
} else {
|
||||||
|
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.pwr_printer) return false;
|
||||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
127
src/main/java/com/hbm/inventory/gui/GUIScreenSlicePrinter.java
Normal file
127
src/main/java/com/hbm/inventory/gui/GUIScreenSlicePrinter.java
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
package com.hbm.inventory.gui;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.hbm.blocks.machine.BlockPWR;
|
||||||
|
import com.hbm.blocks.machine.BlockPWR.TileEntityBlockPWR;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
|
||||||
|
public class GUIScreenSlicePrinter extends GuiScreen {
|
||||||
|
|
||||||
|
private final int x1, y1, z1;
|
||||||
|
private final int x2, y2, z2;
|
||||||
|
private final int sizeX, sizeY, sizeZ;
|
||||||
|
|
||||||
|
private HashSet<Block> whitelist;
|
||||||
|
|
||||||
|
private int yIndex;
|
||||||
|
|
||||||
|
private RenderBlocks renderer;
|
||||||
|
|
||||||
|
private String dirname;
|
||||||
|
private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss");
|
||||||
|
|
||||||
|
public GUIScreenSlicePrinter(int x1, int y1, int z1, int x2, int y2, int z2) {
|
||||||
|
this.x1 = Math.min(x1, x2);
|
||||||
|
this.y1 = Math.min(y1, y2);
|
||||||
|
this.z1 = Math.min(z1, z2);
|
||||||
|
this.x2 = Math.max(x1, x2);
|
||||||
|
this.y2 = Math.max(y1, y2);
|
||||||
|
this.z2 = Math.max(z1, z2);
|
||||||
|
|
||||||
|
this.sizeX = this.x2 - this.x1 + 1;
|
||||||
|
this.sizeY = this.y2 - this.y1 + 1;
|
||||||
|
this.sizeZ = this.z2 - this.z1 + 1;
|
||||||
|
|
||||||
|
dirname = dateFormat.format(new Date()).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GUIScreenSlicePrinter(int x1, int y1, int z1, int x2, int y2, int z2, HashSet<Block> whitelist) {
|
||||||
|
this(x1, y1, z1, x2, y2, z2);
|
||||||
|
this.whitelist = whitelist;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||||
|
if(renderer == null) {
|
||||||
|
this.renderer = new RenderBlocks(mc.theWorld);
|
||||||
|
}
|
||||||
|
|
||||||
|
GuiScreen.drawRect(0, 0, width, height, 0xFFFF00FF);
|
||||||
|
|
||||||
|
// Once we've reached the top slice, close the GUI
|
||||||
|
if(yIndex >= sizeY) {
|
||||||
|
mc.thePlayer.addChatMessage(new ChatComponentText("Slices saved to: .minecraft/printer/" + dirname));
|
||||||
|
mc.thePlayer.closeScreen();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
{
|
||||||
|
|
||||||
|
setupRotation();
|
||||||
|
|
||||||
|
mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
|
||||||
|
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||||
|
Tessellator.instance.startDrawingQuads();
|
||||||
|
|
||||||
|
for(int x = 0; x < sizeX; x++) {
|
||||||
|
for(int z = 0; z < sizeZ; z++) {
|
||||||
|
Block block = mc.theWorld.getBlock(x1 + x, y1 + yIndex, z1 + z);
|
||||||
|
if(whitelist != null && !whitelist.contains(block)) continue;
|
||||||
|
|
||||||
|
// Revert PWR blocks to originals for slice rendering
|
||||||
|
if(block instanceof BlockPWR) {
|
||||||
|
TileEntity tile = mc.theWorld.getTileEntity(x1 + x, y1 + yIndex, z1 + z);
|
||||||
|
if(tile instanceof TileEntityBlockPWR) {
|
||||||
|
TileEntityBlockPWR pwr = (TileEntityBlockPWR) tile;
|
||||||
|
if(pwr.block != null) {
|
||||||
|
block = pwr.block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
renderer.renderBlockByRenderType(block, x, 0, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Tessellator.instance.draw();
|
||||||
|
GL11.glShadeModel(GL11.GL_FLAT);
|
||||||
|
|
||||||
|
}
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
File printerDir = new File(mc.mcDataDir, "printer");
|
||||||
|
printerDir.mkdir();
|
||||||
|
|
||||||
|
GUIScreenWikiRender.saveScreenshot(printerDir, dirname, "slice_" + yIndex + ".png", 0, 0, mc.displayWidth, mc.displayHeight, 0xFFFF00FF);
|
||||||
|
|
||||||
|
yIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupRotation() {
|
||||||
|
double scale = -24;
|
||||||
|
|
||||||
|
GL11.glTranslated(width / 2, height / 2 - 36, 400);
|
||||||
|
GL11.glScaled(scale, scale, scale);
|
||||||
|
GL11.glScaled(1, 1, 0.5); //incredible flattening power
|
||||||
|
|
||||||
|
GL11.glRotated(-30, 1, 0, 0);
|
||||||
|
GL11.glRotated(-45, 0, 1, 0);
|
||||||
|
GL11.glTranslated(sizeX / -2D, -sizeY / 2D, sizeZ / -2D);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -116,7 +116,7 @@ public class GUIScreenWikiRender extends GuiScreen {
|
|||||||
|
|
||||||
// This implementation is based directly on ScreenShotHelper.saveScreenshot()
|
// This implementation is based directly on ScreenShotHelper.saveScreenshot()
|
||||||
// But allows for defining a rect where you want to sample pixels from
|
// But allows for defining a rect where you want to sample pixels from
|
||||||
private static void saveScreenshot(File dataDir, String ssDir, String fileName, int x, int y, int width, int height, int transparentColor) {
|
public static void saveScreenshot(File dataDir, String ssDir, String fileName, int x, int y, int width, int height, int transparentColor) {
|
||||||
try {
|
try {
|
||||||
File screenshotDirectory = new File(dataDir, ssDir);
|
File screenshotDirectory = new File(dataDir, ssDir);
|
||||||
screenshotDirectory.mkdir();
|
screenshotDirectory.mkdir();
|
||||||
|
|||||||
@ -1035,6 +1035,7 @@ public class ModItems {
|
|||||||
public static Item pwr_fuel;
|
public static Item pwr_fuel;
|
||||||
public static Item pwr_fuel_hot;
|
public static Item pwr_fuel_hot;
|
||||||
public static Item pwr_fuel_depleted;
|
public static Item pwr_fuel_depleted;
|
||||||
|
public static Item pwr_printer;
|
||||||
|
|
||||||
public static Item rbmk_lid;
|
public static Item rbmk_lid;
|
||||||
public static Item rbmk_lid_glass;
|
public static Item rbmk_lid_glass;
|
||||||
@ -3181,6 +3182,7 @@ public class ModItems {
|
|||||||
pwr_fuel = new ItemPWRFuel().setUnlocalizedName("pwr_fuel").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_fuel");
|
pwr_fuel = new ItemPWRFuel().setUnlocalizedName("pwr_fuel").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_fuel");
|
||||||
pwr_fuel_hot = new ItemEnumMulti(EnumPWRFuel.class, true, false).setUnlocalizedName("pwr_fuel_hot").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_fuel_hot");
|
pwr_fuel_hot = new ItemEnumMulti(EnumPWRFuel.class, true, false).setUnlocalizedName("pwr_fuel_hot").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_fuel_hot");
|
||||||
pwr_fuel_depleted = new ItemEnumMulti(EnumPWRFuel.class, true, false).setUnlocalizedName("pwr_fuel_depleted").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_fuel_depleted");
|
pwr_fuel_depleted = new ItemEnumMulti(EnumPWRFuel.class, true, false).setUnlocalizedName("pwr_fuel_depleted").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_fuel_depleted");
|
||||||
|
pwr_printer = new ItemPWRPrinter().setUnlocalizedName("pwr_printer").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_printer");
|
||||||
|
|
||||||
rbmk_lid = new ItemRBMKLid().setUnlocalizedName("rbmk_lid").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rbmk_lid");
|
rbmk_lid = new ItemRBMKLid().setUnlocalizedName("rbmk_lid").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rbmk_lid");
|
||||||
rbmk_lid_glass = new ItemRBMKLid().setUnlocalizedName("rbmk_lid_glass").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rbmk_lid_glass");
|
rbmk_lid_glass = new ItemRBMKLid().setUnlocalizedName("rbmk_lid_glass").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rbmk_lid_glass");
|
||||||
@ -5994,6 +5996,7 @@ public class ModItems {
|
|||||||
GameRegistry.registerItem(pwr_fuel, pwr_fuel.getUnlocalizedName());
|
GameRegistry.registerItem(pwr_fuel, pwr_fuel.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(pwr_fuel_hot, pwr_fuel_hot.getUnlocalizedName());
|
GameRegistry.registerItem(pwr_fuel_hot, pwr_fuel_hot.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(pwr_fuel_depleted, pwr_fuel_depleted.getUnlocalizedName());
|
GameRegistry.registerItem(pwr_fuel_depleted, pwr_fuel_depleted.getUnlocalizedName());
|
||||||
|
GameRegistry.registerItem(pwr_printer, pwr_printer.getUnlocalizedName());
|
||||||
|
|
||||||
//RBMK parts
|
//RBMK parts
|
||||||
GameRegistry.registerItem(rbmk_lid, rbmk_lid.getUnlocalizedName());
|
GameRegistry.registerItem(rbmk_lid, rbmk_lid.getUnlocalizedName());
|
||||||
|
|||||||
173
src/main/java/com/hbm/items/machine/ItemPWRPrinter.java
Normal file
173
src/main/java/com/hbm/items/machine/ItemPWRPrinter.java
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
package com.hbm.items.machine;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.blocks.machine.BlockPWR;
|
||||||
|
import com.hbm.blocks.machine.BlockPWR.TileEntityBlockPWR;
|
||||||
|
import com.hbm.inventory.gui.GUIScreenSlicePrinter;
|
||||||
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.tileentity.IGUIProvider;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityPWRController;
|
||||||
|
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
public class ItemPWRPrinter extends Item implements IGUIProvider {
|
||||||
|
|
||||||
|
private static int x1, y1, z1;
|
||||||
|
private static int x2, y2, z2;
|
||||||
|
private static Block[] blockSync;
|
||||||
|
|
||||||
|
private HashSet<BlockPos> fill = new HashSet<>();
|
||||||
|
private static HashSet<Block> whitelist = new HashSet<Block>() {{
|
||||||
|
add(ModBlocks.pwr_block);
|
||||||
|
add(ModBlocks.pwr_controller);
|
||||||
|
}};
|
||||||
|
|
||||||
|
// Piggybacking functions using the bytebuf TE sync
|
||||||
|
public static void serialize(World world, ByteBuf buf) {
|
||||||
|
buf.writeInt(x1);
|
||||||
|
buf.writeInt(y1);
|
||||||
|
buf.writeInt(z1);
|
||||||
|
buf.writeInt(x2);
|
||||||
|
buf.writeInt(y2);
|
||||||
|
buf.writeInt(z2);
|
||||||
|
|
||||||
|
for(Block block : blockSync) {
|
||||||
|
buf.writeInt(Block.getIdFromBlock(block));
|
||||||
|
}
|
||||||
|
|
||||||
|
blockSync = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void deserialize(World world, ByteBuf buf) {
|
||||||
|
x1 = buf.readInt();
|
||||||
|
y1 = buf.readInt();
|
||||||
|
z1 = buf.readInt();
|
||||||
|
x2 = buf.readInt();
|
||||||
|
y2 = buf.readInt();
|
||||||
|
z2 = buf.readInt();
|
||||||
|
|
||||||
|
for(int x = x1; x <= x2; x++) {
|
||||||
|
for(int y = y1; y <= y2; y++) {
|
||||||
|
for(int z = z1; z <= z2; z++) {
|
||||||
|
Block block = Block.getBlockById(buf.readInt());
|
||||||
|
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if(!(tile instanceof TileEntityBlockPWR)) continue;
|
||||||
|
((TileEntityBlockPWR) tile).block = block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int i, float f0, float f1, float f2) {
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if(!(tile instanceof TileEntityPWRController)) return false;
|
||||||
|
if(world.isRemote) return true;
|
||||||
|
|
||||||
|
TileEntityPWRController pwr = (TileEntityPWRController) tile;
|
||||||
|
syncAndScreenshot(world, pwr);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void syncAndScreenshot(World world, TileEntityPWRController pwr) {
|
||||||
|
findBounds(world, pwr);
|
||||||
|
|
||||||
|
int sizeX = x2 - x1 + 1;
|
||||||
|
int sizeY = y2 - y1 + 1;
|
||||||
|
int sizeZ = z2 - z1 + 1;
|
||||||
|
|
||||||
|
blockSync = new Block[sizeX * sizeY * sizeZ];
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
for(int x = x1; x <= x2; x++) {
|
||||||
|
for(int y = y1; y <= y2; y++) {
|
||||||
|
for(int z = z1; z <= z2; z++) {
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if(tile instanceof TileEntityBlockPWR) {
|
||||||
|
blockSync[i] = ((TileEntityBlockPWR) tile).block;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pwr.isPrinting = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void findBounds(World world, TileEntityPWRController pwr) {
|
||||||
|
ForgeDirection dir = ForgeDirection.getOrientation(world.getBlockMetadata(pwr.xCoord, pwr.yCoord, pwr.zCoord)).getOpposite();
|
||||||
|
|
||||||
|
fill.clear();
|
||||||
|
fill.add(new BlockPos(pwr.xCoord, pwr.yCoord, pwr.zCoord));
|
||||||
|
x1 = x2 = pwr.xCoord;
|
||||||
|
y1 = y2 = pwr.yCoord;
|
||||||
|
z1 = z2 = pwr.zCoord;
|
||||||
|
floodFill(world, pwr.xCoord + dir.offsetX, pwr.yCoord, pwr.zCoord + dir.offsetZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void floodFill(World world, int x, int y, int z) {
|
||||||
|
BlockPos pos = new BlockPos(x, y, z);
|
||||||
|
if(fill.contains(pos)) return;
|
||||||
|
|
||||||
|
if(world.getBlock(x, y, z) instanceof BlockPWR) {
|
||||||
|
fill.add(pos);
|
||||||
|
|
||||||
|
x1 = Math.min(x1, x);
|
||||||
|
y1 = Math.min(y1, y);
|
||||||
|
z1 = Math.min(z1, z);
|
||||||
|
x2 = Math.max(x2, x);
|
||||||
|
y2 = Math.max(y2, y);
|
||||||
|
z2 = Math.max(z2, z);
|
||||||
|
|
||||||
|
floodFill(world, x + 1, y, z);
|
||||||
|
floodFill(world, x - 1, y, z);
|
||||||
|
floodFill(world, x, y + 1, z);
|
||||||
|
floodFill(world, x, y - 1, z);
|
||||||
|
floodFill(world, x, y, z + 1);
|
||||||
|
floodFill(world, x, y, z - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||||
|
return new GUIScreenSlicePrinter(x1, y1, z1, x2, y2, z2, whitelist);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||||
|
list.add("Use on a constructed PWR controller to generate construction diagrams");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -12,12 +12,13 @@ import com.hbm.inventory.container.ContainerPWR;
|
|||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||||
import com.hbm.inventory.fluid.trait.FT_Heatable;
|
import com.hbm.inventory.fluid.trait.FT_Heatable;
|
||||||
import com.hbm.inventory.fluid.trait.FT_PWRModerator;
|
|
||||||
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingStep;
|
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingStep;
|
||||||
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType;
|
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType;
|
||||||
|
import com.hbm.inventory.fluid.trait.FT_PWRModerator;
|
||||||
import com.hbm.inventory.gui.GUIPWR;
|
import com.hbm.inventory.gui.GUIPWR;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.items.machine.ItemPWRFuel.EnumPWRFuel;
|
import com.hbm.items.machine.ItemPWRFuel.EnumPWRFuel;
|
||||||
|
import com.hbm.items.machine.ItemPWRPrinter;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.sound.AudioWrapper;
|
import com.hbm.sound.AudioWrapper;
|
||||||
import com.hbm.tileentity.IGUIProvider;
|
import com.hbm.tileentity.IGUIProvider;
|
||||||
@ -375,8 +376,17 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
|||||||
return this.rodCount + (int) Math.ceil(this.heatsinkCount / 4D);
|
return this.rodCount + (int) Math.ceil(this.heatsinkCount / 4D);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPrinting;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void serialize(ByteBuf buf) {
|
public void serialize(ByteBuf buf) {
|
||||||
|
buf.writeBoolean(isPrinting);
|
||||||
|
if(isPrinting) {
|
||||||
|
ItemPWRPrinter.serialize(worldObj, buf);
|
||||||
|
isPrinting = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
super.serialize(buf);
|
super.serialize(buf);
|
||||||
buf.writeInt(this.rodCount);
|
buf.writeInt(this.rodCount);
|
||||||
buf.writeLong(this.coreHeat);
|
buf.writeLong(this.coreHeat);
|
||||||
@ -395,6 +405,14 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deserialize(ByteBuf buf) {
|
public void deserialize(ByteBuf buf) {
|
||||||
|
if(buf.readBoolean()) {
|
||||||
|
// piggybacking off of this packet so that we don't have to sync EVERY PWR
|
||||||
|
// block continuously to the client for one tiny screenshot tool
|
||||||
|
|
||||||
|
ItemPWRPrinter.deserialize(worldObj, buf);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
super.deserialize(buf);
|
super.deserialize(buf);
|
||||||
this.rodCount = buf.readInt();
|
this.rodCount = buf.readInt();
|
||||||
this.coreHeat = buf.readLong();
|
this.coreHeat = buf.readLong();
|
||||||
|
|||||||
@ -4013,6 +4013,7 @@ item.pwr_fuel_hot.men.name=Hot MEN PWR Fuel Rod
|
|||||||
item.pwr_fuel_hot.mep.name=Hot MEP PWR Fuel Rod
|
item.pwr_fuel_hot.mep.name=Hot MEP PWR Fuel Rod
|
||||||
item.pwr_fuel_hot.meu.name=Hot MEU PWR Fuel Rod
|
item.pwr_fuel_hot.meu.name=Hot MEU PWR Fuel Rod
|
||||||
item.pwr_fuel_hot.mox.name=Hot MOX PWR Fuel Rod
|
item.pwr_fuel_hot.mox.name=Hot MOX PWR Fuel Rod
|
||||||
|
item.pwr_printer.name=PWR Printer
|
||||||
item.quartz_plutonium.name=Plutonic Quartz
|
item.quartz_plutonium.name=Plutonic Quartz
|
||||||
item.radar_linker.name=Radar Linker
|
item.radar_linker.name=Radar Linker
|
||||||
item.radaway.name=RadAway
|
item.radaway.name=RadAway
|
||||||
|
|||||||
BIN
src/main/resources/assets/hbm/textures/items/pwr_printer.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/pwr_printer.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 433 B |
Loading…
x
Reference in New Issue
Block a user