diff --git a/changelog b/changelog index 7abe48a6f..b0650e213 100644 --- a/changelog +++ b/changelog @@ -30,6 +30,12 @@ * Missile parts such as non-custom thrusters and fuselages are now made in the arc welder, recipe ingredients have been adjusted as well * Null grenades now have a slightly larger radius, should no longer wipe playerdata and require UNDEFINED to make * Added some breedable material to BFB PWR fuel rods, meaning that the recycling recipes now actually yield a net positive instead of being a massive waste of time +* The RBMK control panel has been upgraded + * Right.clicking the color buttons will now assign the color to the selected control rods + * There's now a new button that allows to cycle through compressor settings on RBMK steam channels + * The flux display is now functional. It will display the flux curve of the last 30 seconds, as well as labels for the total flux level. + * With the color assigning buttons and the flux display finished, the console is now finally complete +* Compressing blood at 4 PU now turns it into crude oil at a ratio of 2:1 ## Fixed * Fixed ancient bug where custom missiles launched using the launch table would not use the accuracy calculation and always be pin-point accurate diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineArcWelder.java b/src/main/java/com/hbm/inventory/gui/GUIMachineArcWelder.java index e37e7cf05..ae993fb9a 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineArcWelder.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineArcWelder.java @@ -30,6 +30,8 @@ public class GUIMachineArcWelder extends GuiInfoContainer { welder.tank.renderTankInfo(this, x, y, guiLeft + 35, guiTop + 63, 34, 16); this.drawElectricityInfo(this, x, y, guiLeft + 152, guiTop + 18, 16, 52, welder.getPower(), welder.getMaxPower()); + + this.drawCustomInfoStat(x, y, guiLeft + 78, guiTop + 67, 8, 8, guiLeft + 78, guiTop + 67, this.getUpgradeInfo(welder)); } @Override @@ -54,7 +56,8 @@ public class GUIMachineArcWelder extends GuiInfoContainer { if(welder.power >= welder.consumption) { drawTexturedModalRect(guiLeft + 156, guiTop + 4, 176, 52, 9, 12); } - + + this.drawInfoPanel(guiLeft + 78, guiTop + 67, 8, 8, 8); welder.tank.renderTank(guiLeft + 35, guiTop + 79, this.zLevel, 34, 16, 1); } } diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineAssembler.java b/src/main/java/com/hbm/inventory/gui/GUIMachineAssembler.java index 31ebd23ec..795d8882b 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineAssembler.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineAssembler.java @@ -41,12 +41,7 @@ public class GUIMachineAssembler extends GuiInfoContainer { String[] templateText = I18nUtil.resolveKeyArray("desc.gui.template"); this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 16, 16, 16, guiLeft - 8, guiTop + 16 + 16, templateText); - String[] upgradeText = new String[3]; - upgradeText[0] = I18nUtil.resolveKey("desc.gui.upgrade"); - upgradeText[1] = I18nUtil.resolveKey("desc.gui.upgrade.speed"); - upgradeText[2] = I18nUtil.resolveKey("desc.gui.upgrade.power"); - - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 141, guiTop + 40, 8, 8, guiLeft + 225, guiTop + 40 + 16 + 8, upgradeText); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 141, guiTop + 40, 8, 8, guiLeft + 225, guiTop + 40 + 16 + 8, this.getUpgradeInfo(assembler)); } @Override diff --git a/src/main/java/com/hbm/inventory/gui/GUIRBMKConsole.java b/src/main/java/com/hbm/inventory/gui/GUIRBMKConsole.java index 1f8d20881..b07d3a19c 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIRBMKConsole.java +++ b/src/main/java/com/hbm/inventory/gui/GUIRBMKConsole.java @@ -22,6 +22,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -102,11 +103,12 @@ public class GUIRBMKConsole extends GuiScreen { } } - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 6, guiTop + 70, 10, 10, mouseX, mouseY, new String[]{ "Select red group" } ); - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 17, guiTop + 70, 10, 10, mouseX, mouseY, new String[]{ "Select yellow group" } ); - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 28, guiTop + 70, 10, 10, mouseX, mouseY, new String[]{ "Select green group" } ); - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 39, guiTop + 70, 10, 10, mouseX, mouseY, new String[]{ "Select blue group" } ); - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 50, guiTop + 70, 10, 10, mouseX, mouseY, new String[]{ "Select purple group" } ); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 6, guiTop + 70, 10, 10, mouseX, mouseY, new String[]{ EnumChatFormatting.RED + "Left click: Select red group", EnumChatFormatting.RED + "Right click: Assign red group" } ); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 17, guiTop + 70, 10, 10, mouseX, mouseY, new String[]{ EnumChatFormatting.YELLOW + "Left click: Select yellow group", EnumChatFormatting.YELLOW + "Right click: Assign yellow group" } ); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 28, guiTop + 70, 10, 10, mouseX, mouseY, new String[]{ EnumChatFormatting.GREEN + "Left click: Select green group", EnumChatFormatting.GREEN + "Right click: Assign green group" } ); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 39, guiTop + 70, 10, 10, mouseX, mouseY, new String[]{ EnumChatFormatting.BLUE + "Left click: Select blue group", EnumChatFormatting.BLUE + "Right click: Assign blue group" } ); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 50, guiTop + 70, 10, 10, mouseX, mouseY, new String[]{ EnumChatFormatting.LIGHT_PURPLE + "Left click: Select purple group", EnumChatFormatting.LIGHT_PURPLE + "Right click: Assign purple group" } ); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 70, guiTop + 82, 12, 12, mouseX, mouseY, new String[]{ "Cycle steam channel compressor setting" } ); } public void drawCustomInfoStat(int mouseX, int mouseY, int x, int y, int width, int height, int tPosX, int tPosY, String[] text) { @@ -116,9 +118,12 @@ public class GUIRBMKConsole extends GuiScreen { } @Override - protected void mouseClicked(int mouseX, int mouseY, int i) { - super.mouseClicked(mouseX, mouseY, i); - this.field.mouseClicked(mouseX, mouseY, i); + protected void mouseClicked(int mouseX, int mouseY, int key) { + super.mouseClicked(mouseX, mouseY, key); + this.field.mouseClicked(mouseX, mouseY, key); + + int LEFT_CLICK = 0; + int RIGTH_CLICK = 1; int bX = 86; int bY = 11; @@ -158,19 +163,54 @@ public class GUIRBMKConsole extends GuiScreen { return; } + //compressor + if(guiLeft + 70 <= mouseX && guiLeft + 70 + 12 > mouseX && guiTop + 82 < mouseY && guiTop + 82 + 12 >= mouseY) { + NBTTagCompound control = new NBTTagCompound(); + control.setBoolean("compressor", true); + List ints = new ArrayList(); + for(int j = 0; j < console.columns.length; j++) { + if(console.columns[j] != null && console.columns[j].type == ColumnType.BOILER && this.selection[j]) { + ints.add(j); + } + } + int[] cols = new int[ints.size()]; + for(int i = 0; i < cols.length; i++) cols[i] = ints.get(i); + control.setIntArray("cols", cols); + PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(control, console.xCoord, console.yCoord, console.zCoord)); + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1F)); + } + //select color groups for(int k = 0; k < 5; k++) { if(guiLeft + 6 + k * 11 <= mouseX && guiLeft + 6 + k * 11 + 10 > mouseX && guiTop + 70 < mouseY && guiTop + 70 + 10 >= mouseY) { - this.selection = new boolean[15 * 15]; - for(int j = 0; j < console.columns.length; j++) { + if(key == LEFT_CLICK) { + this.selection = new boolean[15 * 15]; - if(console.columns[j] != null && console.columns[j].type == ColumnType.CONTROL && console.columns[j].data.getShort("color") == k) { - this.selection[j] = true; + for(int j = 0; j < console.columns.length; j++) { + + if(console.columns[j] != null && console.columns[j].type == ColumnType.CONTROL && console.columns[j].data.getShort("color") == k) { + this.selection[j] = true; + } } } + if(key == RIGTH_CLICK) { + NBTTagCompound control = new NBTTagCompound(); + control.setByte("assignColor", (byte) k); + List ints = new ArrayList(); + for(int j = 0; j < console.columns.length; j++) { + if(console.columns[j] != null && console.columns[j].type == ColumnType.CONTROL && this.selection[j]) { + ints.add(j); + } + } + int[] cols = new int[ints.size()]; + for(int i = 0; i < cols.length; i++) cols[i] = ints.get(i); + control.setIntArray("cols", cols); + PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(control, console.xCoord, console.yCoord, console.zCoord)); + } + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.8F + k * 0.1F)); return; } @@ -358,6 +398,41 @@ public class GUIRBMKConsole extends GuiScreen { drawTexturedModalRect(guiLeft + x, guiTop + y, 0, 192, 10, 10); } + int highest = Integer.MIN_VALUE; + int lowest = Integer.MAX_VALUE; + + for(int i : console.fluxBuffer) { + if(i > highest) highest = i; + if(i < lowest) lowest = i; + } + + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glLineWidth(2F); + Tessellator tess = Tessellator.instance; + tess.startDrawing(GL11.GL_LINES); + tess.setColorOpaque_I(0x00ff00); + int range = highest - lowest; + for(int i = 0; i < console.fluxBuffer.length - 1; i++) { + for(int j = 0; j < 2; j++) { + int k = i + j; + int flux = console.fluxBuffer[k]; + double x = guiLeft + 7 + k * 74D / console.fluxBuffer.length; + double y = guiTop + 127 - (flux - lowest) * 24D / Math.max(range, 1); + tess.addVertex(x, y, this.zLevel + 10); + } + } + tess.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + + GL11.glPushMatrix(); + double scale = 0.5D; + GL11.glScaled(scale, scale, 1); + this.fontRendererObj.drawString(highest + "", (int) ((guiLeft + 8) / scale), (int) ((guiTop + 98) / scale), 0x00ff00); + this.fontRendererObj.drawString(highest + "", (int) ((guiLeft + 80 - this.fontRendererObj.getStringWidth(highest + "") * scale) / scale), (int) ((guiTop + 98) / scale), 0x00ff00); + this.fontRendererObj.drawString(lowest + "", (int) ((guiLeft + 8) / scale), (int) ((guiTop + 133 - this.fontRendererObj.FONT_HEIGHT * scale) / scale), 0x00ff00); + this.fontRendererObj.drawString(lowest + "", (int) ((guiLeft + 80 - this.fontRendererObj.getStringWidth(lowest + "") * scale) / scale), (int) ((guiTop + 133 - this.fontRendererObj.FONT_HEIGHT * scale) / scale), 0x00ff00); + GL11.glPopMatrix(); + this.field.drawTextBox(); } diff --git a/src/main/java/com/hbm/inventory/gui/GuiInfoContainer.java b/src/main/java/com/hbm/inventory/gui/GuiInfoContainer.java index 1ae9a28e9..51bc6d957 100644 --- a/src/main/java/com/hbm/inventory/gui/GuiInfoContainer.java +++ b/src/main/java/com/hbm/inventory/gui/GuiInfoContainer.java @@ -1,5 +1,6 @@ package com.hbm.inventory.gui; +import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; @@ -7,8 +8,11 @@ import java.util.List; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType; import com.hbm.lib.RefStrings; +import com.hbm.tileentity.IUpgradeInfoProvider; import com.hbm.util.BobMathUtil; +import com.hbm.util.I18nUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; @@ -18,6 +22,7 @@ import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; public abstract class GuiInfoContainer extends GuiContainer { @@ -45,6 +50,33 @@ public abstract class GuiInfoContainer extends GuiContainer { this.func_146283_a(Arrays.asList(text), x, y); } + /** Automatically grabs upgrade info out of the tile entity if it's a IUpgradeInfoProvider and crams the available info into a list for display. Automation, yeah! */ + public List getUpgradeInfo(TileEntity tile) { + List lines = new ArrayList(); + + if(tile instanceof IUpgradeInfoProvider) { + IUpgradeInfoProvider provider = (IUpgradeInfoProvider) tile; + + lines.add(I18nUtil.resolveKey("upgrade.gui.title")); + + for(UpgradeType type : UpgradeType.values()) { + if(provider.canProvideInfo(type, 0, false)) { + int maxLevel = provider.getMaxLevel(type); + switch(type) { + case SPEED: lines.add(I18nUtil.resolveKey("upgrade.gui.speed", maxLevel)); break; + case POWER: lines.add(I18nUtil.resolveKey("upgrade.gui.power", maxLevel)); break; + case EFFECT: lines.add(I18nUtil.resolveKey("upgrade.gui.effectiveness", maxLevel)); break; + case AFTERBURN: lines.add(I18nUtil.resolveKey("upgrade.gui.afterburner", maxLevel)); break; + case OVERDRIVE: lines.add(I18nUtil.resolveKey("upgrade.gui.overdrive", maxLevel)); break; + default: break; + } + } + } + } + + return lines; + } + @Deprecated public void drawCustomInfo(GuiInfoContainer gui, int mouseX, int mouseY, int x, int y, int width, int height, String[] text) { if(x <= mouseX && x + width > mouseX && y < mouseY && y + height >= mouseY) diff --git a/src/main/java/com/hbm/inventory/recipes/CompressorRecipes.java b/src/main/java/com/hbm/inventory/recipes/CompressorRecipes.java index c1cc077d9..9b5ef555d 100644 --- a/src/main/java/com/hbm/inventory/recipes/CompressorRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/CompressorRecipes.java @@ -25,6 +25,8 @@ public class CompressorRecipes extends SerializableRecipe { recipes.put(new Pair(Fluids.PETROLEUM, 0), new CompressorRecipe(2_000, new FluidStack(Fluids.PETROLEUM, 2_000, 1), 20)); recipes.put(new Pair(Fluids.PETROLEUM, 1), new CompressorRecipe(2_000, new FluidStack(Fluids.LPG, 1_000, 0), 20)); + + recipes.put(new Pair(Fluids.BLOOD, 3), new CompressorRecipe(1_000, new FluidStack(Fluids.OIL, 500, 0), 100)); } public static class CompressorRecipe { diff --git a/src/main/java/com/hbm/tileentity/IUpgradeInfoProvider.java b/src/main/java/com/hbm/tileentity/IUpgradeInfoProvider.java index 8c8396573..00ecd8ab1 100644 --- a/src/main/java/com/hbm/tileentity/IUpgradeInfoProvider.java +++ b/src/main/java/com/hbm/tileentity/IUpgradeInfoProvider.java @@ -3,9 +3,22 @@ package com.hbm.tileentity; import java.util.List; import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType; +import com.hbm.util.I18nUtil; + +import net.minecraft.block.Block; +import net.minecraft.util.EnumChatFormatting; public interface IUpgradeInfoProvider { + /** If any of the automated display stuff should be applied for this upgrade. A level of 0 is used by the GUI's indicator, as opposed to the item tooltips */ public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo); public void provideInfo(UpgradeType type, int level, List info, boolean extendedInfo); + public int getMaxLevel(UpgradeType type); + + public static String getStandardLabel(Block block) { + return EnumChatFormatting.GREEN.YELLOW + ">>> " + I18nUtil.resolveKey(block.getUnlocalizedName() + ".name") + " <<<"; + } + + public static final String KEY_CONSUMPTION = "upgrade.consumption"; + public static final String KEY_SPEED = "upgrade.speed"; } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityFurnaceIron.java b/src/main/java/com/hbm/tileentity/machine/TileEntityFurnaceIron.java index aafd90a83..920fd6458 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityFurnaceIron.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityFurnaceIron.java @@ -1,5 +1,8 @@ package com.hbm.tileentity.machine; +import java.util.List; + +import com.hbm.blocks.ModBlocks; import com.hbm.handler.pollution.PollutionHandler; import com.hbm.handler.pollution.PollutionHandler.PollutionType; import com.hbm.inventory.UpgradeManager; @@ -8,7 +11,9 @@ import com.hbm.inventory.gui.GUIFurnaceIron; import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType; import com.hbm.module.ModuleBurnTime; import com.hbm.tileentity.IGUIProvider; +import com.hbm.tileentity.IUpgradeInfoProvider; import com.hbm.tileentity.TileEntityMachineBase; +import com.hbm.util.I18nUtil; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -19,10 +24,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityFurnaceIron extends TileEntityMachineBase implements IGUIProvider { +public class TileEntityFurnaceIron extends TileEntityMachineBase implements IGUIProvider, IUpgradeInfoProvider { public int maxBurnTime; public int burnTime; @@ -234,4 +240,23 @@ public class TileEntityFurnaceIron extends TileEntityMachineBase implements IGUI public double getMaxRenderDistanceSquared() { return 65536.0D; } + + @Override + public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) { + return type == UpgradeType.SPEED; + } + + @Override + public void provideInfo(UpgradeType type, int level, List info, boolean extendedInfo) { + info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.furnace_iron)); + if(type == UpgradeType.SPEED) { + info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_SPEED, "-" + (level * 50 / 3) + "%")); + } + } + + @Override + public int getMaxLevel(UpgradeType type) { + if(type == UpgradeType.SPEED) return 3; + return 0; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineArcWelder.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineArcWelder.java index 669e4c71a..a2933ca1d 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineArcWelder.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineArcWelder.java @@ -1,6 +1,9 @@ package com.hbm.tileentity.machine; +import java.util.List; + import com.hbm.inventory.RecipesCommon.AStack; +import com.hbm.blocks.ModBlocks; import com.hbm.inventory.UpgradeManager; import com.hbm.inventory.container.ContainerMachineArcWelder; import com.hbm.inventory.fluid.Fluids; @@ -14,7 +17,9 @@ import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; import com.hbm.tileentity.IConditionalInvAccess; import com.hbm.tileentity.IGUIProvider; +import com.hbm.tileentity.IUpgradeInfoProvider; import com.hbm.tileentity.TileEntityMachineBase; +import com.hbm.util.I18nUtil; import com.hbm.util.fauxpointtwelve.BlockPos; import com.hbm.util.fauxpointtwelve.DirPos; @@ -30,10 +35,11 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityMachineArcWelder extends TileEntityMachineBase implements IEnergyUser, IFluidStandardReceiver, IConditionalInvAccess, IGUIProvider { +public class TileEntityMachineArcWelder extends TileEntityMachineBase implements IEnergyUser, IFluidStandardReceiver, IConditionalInvAccess, IGUIProvider, IUpgradeInfoProvider { public long power; public long maxPower = 2_000; @@ -340,4 +346,29 @@ public class TileEntityMachineArcWelder extends TileEntityMachineBase implements public double getMaxRenderDistanceSquared() { return 65536.0D; } + + @Override + public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) { + return type == UpgradeType.SPEED || type == UpgradeType.POWER; + } + + @Override + public void provideInfo(UpgradeType type, int level, List info, boolean extendedInfo) { + info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_electric_furnace_off)); + if(type == UpgradeType.SPEED) { + info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_SPEED, "-" + (level * 100 / 6) + "%")); + info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 100) + "%")); + } + if(type == UpgradeType.POWER) { + info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 100 / 6) + "%")); + info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_SPEED, "+" + (level * 100 / 3) + "%")); + } + } + + @Override + public int getMaxLevel(UpgradeType type) { + if(type == UpgradeType.SPEED) return 3; + if(type == UpgradeType.POWER) return 3; + return 0; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssembler.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssembler.java index 3c0893c5f..cddb1a40f 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssembler.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssembler.java @@ -1,5 +1,6 @@ package com.hbm.tileentity.machine; +import java.util.List; import java.util.Random; import com.hbm.blocks.BlockDummyable; @@ -14,6 +15,9 @@ import com.hbm.items.machine.ItemAssemblyTemplate; import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType; import com.hbm.main.MainRegistry; import com.hbm.sound.AudioWrapper; +import com.hbm.tileentity.IUpgradeInfoProvider; +import com.hbm.util.BobMathUtil; +import com.hbm.util.I18nUtil; import com.hbm.util.fauxpointtwelve.DirPos; import api.hbm.energy.IBatteryItem; @@ -25,10 +29,11 @@ import net.minecraft.inventory.Container; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityMachineAssembler extends TileEntityMachineAssemblerBase { +public class TileEntityMachineAssembler extends TileEntityMachineAssemblerBase implements IUpgradeInfoProvider { public int recipe = -1; @@ -265,4 +270,33 @@ public class TileEntityMachineAssembler extends TileEntityMachineAssemblerBase { public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIMachineAssembler(player.inventory, this); } + + @Override + public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) { + return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE; + } + + @Override + public void provideInfo(UpgradeType type, int level, List info, boolean extendedInfo) { + info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_assembler)); + if(type == UpgradeType.SPEED) { + info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_SPEED, "-" + (level * 25) + "%")); + info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 300) + "%")); + } + if(type == UpgradeType.POWER) { + info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 30) + "%")); + info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_SPEED, "+" + (level * 5) + "%")); + } + if(type == UpgradeType.OVERDRIVE) { + info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES"); + } + } + + @Override + public int getMaxLevel(UpgradeType type) { + if(type == UpgradeType.SPEED) return 3; + if(type == UpgradeType.POWER) return 3; + if(type == UpgradeType.OVERDRIVE) return 3; + return 0; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemfac.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemfac.java index 3f7413677..f838e1082 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemfac.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemfac.java @@ -88,7 +88,7 @@ public class TileEntityMachineChemfac extends TileEntityMachineChemplantBase { this.speed -= speedLevel * 15; this.consumption += speedLevel * 300; this.speed += powerLevel * 5; - this.consumption -= powerLevel * 30; + this.consumption -= powerLevel * 20; this.speed /= (overLevel + 1); this.consumption *= (overLevel + 1); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java index edc19ee83..d78b87c9f 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java @@ -124,7 +124,7 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements this.speed -= speedLevel * 25; this.consumption += speedLevel * 300; this.speed += powerLevel * 5; - this.consumption -= powerLevel * 30; + this.consumption -= powerLevel * 20; this.speed /= (overLevel + 1); this.consumption *= (overLevel + 1); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java index 89be677fc..fa99ad805 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java @@ -84,6 +84,7 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement if(rec != null) timeBase = rec.duration; //there is a reason to do this but i'm not telling you + // ^ a few months later i have to wonder what the fuck this guy was on about, and if i ever see him i will punch him in the nuts if(timeBase == this.processTimeBase) this.processTime = speedLevel == 3 ? 10 : speedLevel == 2 ? 20 : speedLevel == 1 ? 60 : timeBase; else this.processTime = timeBase / (speedLevel + 1); this.powerRequirement = this.powerRequirementBase / (powerLevel + 1); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineElectricFurnace.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineElectricFurnace.java index 4c546e019..8757970f5 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineElectricFurnace.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineElectricFurnace.java @@ -277,14 +277,21 @@ public class TileEntityMachineElectricFurnace extends TileEntityMachineBase impl @Override public void provideInfo(UpgradeType type, int level, List info, boolean extendedInfo) { - info.add(EnumChatFormatting.GREEN.YELLOW + ">>> " + I18nUtil.resolveKey(ModBlocks.machine_electric_furnace_off.getUnlocalizedName() + ".name") + " <<<"); + info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_electric_furnace_off)); if(type == UpgradeType.SPEED) { - info.add(EnumChatFormatting.GREEN + "Process time -" + (level * 25) + "%"); - info.add(EnumChatFormatting.RED + "Consumption +" + (level * 100) + "%"); + info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_SPEED, "-" + (level * 25) + "%")); + info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 100) + "%")); } if(type == UpgradeType.POWER) { - info.add(EnumChatFormatting.GREEN + "Consumption -" + (level * 30) + "%"); - info.add(EnumChatFormatting.RED + "Process time +" + (level * 10) + "%"); + info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 30) + "%")); + info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_SPEED, "+" + (level * 10) + "%")); } } + + @Override + public int getMaxLevel(UpgradeType type) { + if(type == UpgradeType.SPEED) return 3; + if(type == UpgradeType.POWER) return 3; + return 0; + } } \ No newline at end of file diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java index 44baadde9..9c96a4893 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java @@ -263,17 +263,21 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I public void receiveControl(NBTTagCompound data) { if(data.hasKey("compression")) { - - FluidType type = steam.getTankType(); - if(type == Fluids.STEAM) { steam.setTankType(Fluids.HOTSTEAM); steam.setFill(steam.getFill() / 10); } - if(type == Fluids.HOTSTEAM) { steam.setTankType(Fluids.SUPERHOTSTEAM); steam.setFill(steam.getFill() / 10); } - if(type == Fluids.SUPERHOTSTEAM) { steam.setTankType(Fluids.ULTRAHOTSTEAM); steam.setFill(steam.getFill() / 10); } - if(type == Fluids.ULTRAHOTSTEAM) { steam.setTankType(Fluids.STEAM); steam.setFill(Math.min(steam.getFill() * 1000, steam.getMaxFill())); } - - this.markDirty(); + this.cyceCompressor(); } } + public void cyceCompressor() { + + FluidType type = steam.getTankType(); + if(type == Fluids.STEAM) { steam.setTankType(Fluids.HOTSTEAM); steam.setFill(steam.getFill() / 10); } + if(type == Fluids.HOTSTEAM) { steam.setTankType(Fluids.SUPERHOTSTEAM); steam.setFill(steam.getFill() / 10); } + if(type == Fluids.SUPERHOTSTEAM) { steam.setTankType(Fluids.ULTRAHOTSTEAM); steam.setFill(steam.getFill() / 10); } + if(type == Fluids.ULTRAHOTSTEAM) { steam.setTankType(Fluids.STEAM); steam.setFill(Math.min(steam.getFill() * 1000, steam.getMaxFill())); } + + this.markDirty(); + } + @Override public void onMelt(int reduce) { diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKConsole.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKConsole.java index dce56b111..ee5690703 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKConsole.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKConsole.java @@ -12,6 +12,7 @@ import com.hbm.inventory.gui.GUIRBMKConsole; import com.hbm.tileentity.IGUIProvider; import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.tileentity.machine.rbmk.TileEntityRBMKControlManual.RBMKColor; +import com.hbm.util.EnumUtil; import com.hbm.util.I18nUtil; import cpw.mods.fml.relauncher.Side; @@ -33,7 +34,8 @@ public class TileEntityRBMKConsole extends TileEntityMachineBase implements ICon private int targetY; private int targetZ; - public int[] fluxBuffer = new int[20]; + public static final int fluxDisplayBuffer = 60; + public int[] fluxBuffer = new int[fluxDisplayBuffer]; //made this one-dimensional because it's a lot easier to serialize public RBMKColumn[] columns = new RBMKColumn[15 * 15]; @@ -104,7 +106,7 @@ public class TileEntityRBMKConsole extends TileEntityMachineBase implements ICon this.fluxBuffer[i] = this.fluxBuffer[i + 1]; } - this.fluxBuffer[19] = (int) flux; + this.fluxBuffer[this.fluxBuffer.length - 1] = (int) flux; } @SuppressWarnings("incomplete-switch") //shut up @@ -287,6 +289,40 @@ public class TileEntityRBMKConsole extends TileEntityMachineBase implements ICon Integer[] cols = list.toArray(new Integer[0]); this.screens[slot].columns = cols; } + + if(data.hasKey("assignColor")) { + int color = data.getByte("assignColor"); + int[] cols = data.getIntArray("cols"); + + for(int i : cols) { + int x = i % 15 - 7; + int z = i / 15 - 7; + + TileEntity te = worldObj.getTileEntity(targetX + x, targetY, targetZ + z); + + if(te instanceof TileEntityRBMKControlManual) { + TileEntityRBMKControlManual rod = (TileEntityRBMKControlManual) te; + rod.color = EnumUtil.grabEnumSafely(RBMKColor.class, color); + te.markDirty(); + } + } + } + + if(data.hasKey("compressor")) { + int[] cols = data.getIntArray("cols"); + + for(int i : cols) { + int x = i % 15 - 7; + int z = i / 15 - 7; + + TileEntity te = worldObj.getTileEntity(targetX + x, targetY, targetZ + z); + + if(te instanceof TileEntityRBMKBoiler) { + TileEntityRBMKBoiler rod = (TileEntityRBMKBoiler) te; + rod.cyceCompressor(); + } + } + } } @Override diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index 9cd2d7a8f..8edc158e4 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -4617,6 +4617,9 @@ turret.off=AUS turret.on=AN turret.players=Spieler anzielen: %s +upgrade.consumption=Verbrauch %s +upgrade.speed=Verarbeitungszeit %s + wavelengths.name.ir=Infrarot wavelengths.name.visible=Sichtbares Licht wavelengths.name.uv=Ultraviolett diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 101515558..5d2ef5a8d 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -885,16 +885,11 @@ desc.gui.template=§9Templates§r$Templates can be made by$using the Machine Tem desc.gui.turbinegas.automode=§2Automatic Turbine Throttling Mode§r$By clicking the "AUTO" button, the turbine$will automatically adjust the power production$based on the power required from the network desc.gui.turbinegas.fuels=§6Accepted fuels:§r desc.gui.turbinegas.warning=§cFuel or lubricant level low!§r -desc.gui.upgrade=§lAcceptable Upgrades:§r -desc.gui.upgrade.afterburner= * §dAfterburner§r: Stacks to level 3 -desc.gui.upgrade.effectiveness= * §aEffectiveness§r: Stacks to level 3 -desc.gui.upgrade.overdrive= * §7Overdrive§r: Stacks to level 3 -desc.gui.upgrade.power= * §1Power-Saving§r: Stacks to level 3 -desc.gui.upgrade.speed= * §4Speed§r: Stacks to level 3 desc.gui.zirnox.coolant=§3Coolant§r$CO2 transfers heat from the core to the water.$This will boil it into super dense steam.$The efficiency of cooling and steam production$is based on pressure. desc.gui.zirnox.pressure=§6Pressure§r$Pressure can be reduced by venting CO2.$However, too low a pressure, and cooling$efficiency and steam production will be reduced.$Look out for meltdowns! desc.gui.zirnox.warning1=§cError:§r Water is required for$the reactor to function properly! desc.gui.zirnox.warning2=§cError:§r CO2 is required for$the reactor to function properly! + desc.item.ammo.con_accuracy2=- Highly decreased accuracy desc.item.ammo.con_damage=- Highly decreased damage desc.item.ammo.con_heavy_wear=- Highly increased wear @@ -5624,6 +5619,16 @@ turret.off=OFF turret.on=ON turret.players=Target Players: %s +upgrade.consumption=Consumption %s +upgrade.speed=Process time %s + +upgrade.gui.title=§lAcceptable Upgrades:§r +upgrade.gui.afterburner= * §dAfterburner§r: Stacks to level %s +upgrade.gui.effectiveness= * §aEffectiveness§r: Stacks to level %s +upgrade.gui.overdrive= * §7Overdrive§r: Stacks to level %s +upgrade.gui.power= * §9Power-Saving§r: Stacks to level %s +upgrade.gui.speed= * §4Speed§r: Stacks to level %s + wavelengths.name.ir=Infrared wavelengths.name.visible=Visible Light wavelengths.name.uv=Ultraviolet diff --git a/src/main/resources/assets/hbm/textures/gui/processing/gui_arc_welder.png b/src/main/resources/assets/hbm/textures/gui/processing/gui_arc_welder.png index 14366acc3..82c982cfa 100644 Binary files a/src/main/resources/assets/hbm/textures/gui/processing/gui_arc_welder.png and b/src/main/resources/assets/hbm/textures/gui/processing/gui_arc_welder.png differ diff --git a/src/main/resources/assets/hbm/textures/gui/reactors/gui_rbmk_console.png b/src/main/resources/assets/hbm/textures/gui/reactors/gui_rbmk_console.png index 877132937..5222274f9 100644 Binary files a/src/main/resources/assets/hbm/textures/gui/reactors/gui_rbmk_console.png and b/src/main/resources/assets/hbm/textures/gui/reactors/gui_rbmk_console.png differ