From ba09553fffbc39ee1dbc5bb0a4eda274f37ccdbc Mon Sep 17 00:00:00 2001 From: HbmMods Date: Wed, 22 Jul 2026 23:23:52 +0200 Subject: [PATCH] it snew --- changelog | 21 +- .../blocks/machine/pile/BlockPileDevice.java | 15 +- .../container/ContainerMachineDiesel.java | 71 +++---- .../hbm/inventory/gui/GUIMachineDiesel.java | 48 +++-- .../com/hbm/items/machine/ItemPileRodMK2.java | 14 ++ .../machine/TileEntityMachineDiesel.java | 192 ++++++++---------- .../machine/pile/TileEntityPileCore.java | 2 +- src/main/resources/assets/hbm/lang/en_US.lang | 14 ++ .../textures/gui/generators/gui_diesel.png | Bin 0 -> 3818 bytes 9 files changed, 202 insertions(+), 175 deletions(-) create mode 100644 src/main/resources/assets/hbm/textures/gui/generators/gui_diesel.png diff --git a/changelog b/changelog index 3e1f26717..c06d71eef 100644 --- a/changelog +++ b/changelog @@ -1,7 +1,26 @@ +## Added +* New Chicago Pile + * Assembled multiblock, similar to the PWR + * Requires new chicago pile graphite bricks + * Assembled with a hand drill out of a box made from graphite bricks, at least 5x5x5, and at most 15x15x15 blocks large + * Drilling the assembled reactor will add channels at the selected locations + * Drilling along the reactor's orientation will add a fuel channel + * Drilling perpendicular to fuel channels will add a ventilation channel + * Drilling vertically will add a control rod channel + * Fuel insertion is now done with a dedicated fuel loader which can be operated by hand or automated with hopper IO and redstone + * Ventilation channels need chicago pile vents which are powered with compressed air at 1 PU + * Chicago pile control rods can either be fully withdrawn with redstone or fine tuned with RoR + * Additionally, channels can be drilled by right clicking a pile addon device with the hand drill, the addon doesn't need to be removed beforehand + * This is mainly for convenience when disassembling and reassembling the reactor, which requires all channels to be drilled again + ## Changed * Updated all oil well GUI textures * There's now only two upgrade slots instead of three * All legacy pixel gauges have been replaced with smooth ones (watz, ZIRNOX, CCGT) making them more accurate +* Updated the diesel generator's GUI + * The diesel gen now also has an in-GUI button for turning it on and off like the industrial combustion engine ## Fixed -* Fixed held block being placed when not sneaking when opening the cable diode's GUI \ No newline at end of file +* Fixed held block being placed when not sneaking when opening the cable diode's GUI +* Fixed an issue where the diesel generator's fuel capacity is the original 4,000mB instead of the intended new 16,000mB + * This means that explosive barrels and universal barrels can now be loaded into the diesel generator \ No newline at end of file diff --git a/src/main/java/com/hbm/blocks/machine/pile/BlockPileDevice.java b/src/main/java/com/hbm/blocks/machine/pile/BlockPileDevice.java index b59090bce..443523846 100644 --- a/src/main/java/com/hbm/blocks/machine/pile/BlockPileDevice.java +++ b/src/main/java/com/hbm/blocks/machine/pile/BlockPileDevice.java @@ -9,6 +9,7 @@ import com.hbm.blocks.ITooltipProvider; import com.hbm.blocks.ModBlocks; import com.hbm.main.NTMSounds; import com.hbm.tileentity.machine.pile.TileEntityPileControl; +import com.hbm.tileentity.machine.pile.TileEntityPileDeviceBase; import com.hbm.tileentity.machine.pile.TileEntityPileLoader; import com.hbm.tileentity.machine.pile.TileEntityPileVent; import com.hbm.util.i18n.I18nUtil; @@ -156,20 +157,18 @@ public class BlockPileDevice extends BlockContainer implements IBlockMulti, ILoo List text = new ArrayList(); TileEntity tile = world.getTileEntity(x, y, z); - if(tile instanceof TileEntityPileLoader) { - TileEntityPileLoader device = (TileEntityPileLoader) tile; - text.add("Index: " + device.chanNum); - if(device.syncStack != null) text.add("Loading: " + device.syncStack.getDisplayName()); + if(tile instanceof TileEntityPileDeviceBase) { + TileEntityPileDeviceBase device = (TileEntityPileDeviceBase) tile; + text.add("#" + (device.chanNum + 1)); } - if(tile instanceof TileEntityPileVent) { - TileEntityPileVent device = (TileEntityPileVent) tile; - text.add("Index: " + device.chanNum); + if(tile instanceof TileEntityPileLoader) { + TileEntityPileLoader device = (TileEntityPileLoader) tile; + if(device.syncStack != null) text.add("Loading: " + device.syncStack.getDisplayName()); } if(tile instanceof TileEntityPileControl) { TileEntityPileControl device = (TileEntityPileControl) tile; - text.add("Index: " + device.chanNum); text.add("Extraction level: " + (int) + (device.level * 100) + "%"); } diff --git a/src/main/java/com/hbm/inventory/container/ContainerMachineDiesel.java b/src/main/java/com/hbm/inventory/container/ContainerMachineDiesel.java index a4539cf77..86406303b 100644 --- a/src/main/java/com/hbm/inventory/container/ContainerMachineDiesel.java +++ b/src/main/java/com/hbm/inventory/container/ContainerMachineDiesel.java @@ -10,68 +10,57 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class ContainerMachineDiesel extends Container { - + private TileEntityMachineDiesel diFurnace; - + public ContainerMachineDiesel(InventoryPlayer invPlayer, TileEntityMachineDiesel tedf) { - + diFurnace = tedf; - - this.addSlotToContainer(new Slot(tedf, 0, 44, 17)); - this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 44, 53)); - this.addSlotToContainer(new Slot(tedf, 2, 116, 53)); - this.addSlotToContainer(new Slot(tedf, 3, 8, 17)); - this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 8, 53)); - - for(int i = 0; i < 3; i++) - { - for(int j = 0; j < 9; j++) - { - this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + + this.addSlotToContainer(new Slot(tedf, 0, 17, 17)); + this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 17, 53)); + this.addSlotToContainer(new Slot(tedf, 2, 141, 71)); + this.addSlotToContainer(new Slot(tedf, 3, 35, 71)); + + for(int i = 0; i < 3; i++) { + for(int j = 0; j < 9; j++) { + this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 121 + i * 18)); } } - - for(int i = 0; i < 9; i++) - { - this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); + + for(int i = 0; i < 9; i++) { + this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 179)); } } - + @Override public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) { ItemStack var3 = null; Slot var4 = (Slot) this.inventorySlots.get(par2); - - if (var4 != null && var4.getHasStack()) - { + + if(var4 != null && var4.getHasStack()) { ItemStack var5 = var4.getStack(); var3 = var5.copy(); - - if (par2 <= 4) { - if (!this.mergeItemStack(var5, 5, this.inventorySlots.size(), true)) - { + + if(par2 <= 4) { + if(!this.mergeItemStack(var5, 5, this.inventorySlots.size(), true)) { return null; } + } else if(!this.mergeItemStack(var5, 0, 1, false)) { + if(!this.mergeItemStack(var5, 2, 3, false)) + if(!this.mergeItemStack(var5, 4, 5, false)) + return null; } - else if (!this.mergeItemStack(var5, 0, 1, false)) - { - if (!this.mergeItemStack(var5, 2, 3, false)) - if (!this.mergeItemStack(var5, 4, 5, false)) - return null; - } - - if (var5.stackSize == 0) - { + + if(var5.stackSize == 0) { var4.putStack((ItemStack) null); - } - else - { + } else { var4.onSlotChanged(); } } - + return var3; - } + } @Override public boolean canInteractWith(EntityPlayer player) { diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineDiesel.java b/src/main/java/com/hbm/inventory/gui/GUIMachineDiesel.java index a50cb1277..a7a3d900d 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineDiesel.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineDiesel.java @@ -4,16 +4,20 @@ import org.lwjgl.opengl.GL11; import com.hbm.inventory.container.ContainerMachineDiesel; import com.hbm.lib.RefStrings; +import com.hbm.packet.PacketDispatcher; +import com.hbm.packet.toserver.NBTControlPacket; import com.hbm.tileentity.machine.TileEntityMachineDiesel; import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; public class GUIMachineDiesel extends GuiInfoContainer { - private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/GUIDiesel.png"); + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/generators/gui_diesel.png"); private TileEntityMachineDiesel diesel; public GUIMachineDiesel(InventoryPlayer invPlayer, TileEntityMachineDiesel tedf) { @@ -21,35 +25,43 @@ public class GUIMachineDiesel extends GuiInfoContainer { diesel = tedf; this.xSize = 176; - this.ySize = 166; + this.ySize = 203; } @Override public void drawScreen(int mouseX, int mouseY, float f) { super.drawScreen(mouseX, mouseY, f); - diesel.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 69 - 52, 16, 52); - this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 69 - 52, 16, 52, diesel.power, diesel.powerCap); + diesel.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 35, guiTop + 69 - 52, 16, 52); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 141, guiTop + 69 - 52, 16, 52, diesel.power, diesel.powerCap); String[] text = new String[] { "Fuel consumption rate:", " 1 mB/t", " 20 mB/s", "(Consumption rate is constant)" }; - this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, text); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 8, guiTop + 36, 16, 16, guiLeft, guiTop + 36 + 16, text); if(!diesel.hasAcceptableFuel()) { - String[] text2 = new String[] { "Error: The currently set fuel type", "is not supported by this engine!" }; - this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36 + 32, 16, 16, guiLeft - 8, guiTop + 36 + 16 + 32, text2); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 8, guiTop + 36 + 32, 16, 16, guiLeft, guiTop + 36 + 16 + 32, text2); + } + } + + @Override + protected void mouseClicked(int x, int y, int i) { + super.mouseClicked(x, y, i); + + if(guiLeft + 89 <= x && guiLeft + 89 + 16 > x && guiTop + 61 < y && guiTop + 61 + 14 >= y) { + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + NBTTagCompound data = new NBTTagCompound(); + data.setBoolean("turnOn", true); + PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, diesel.xCoord, diesel.yCoord, diesel.zCoord)); } } @Override protected void drawGuiContainerForegroundLayer(int i, int j) { - String name = this.diesel.hasCustomInventoryName() ? this.diesel.getInventoryName() : I18n.format(this.diesel.getInventoryName()); - - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); } @@ -60,20 +72,18 @@ public class GUIMachineDiesel extends GuiInfoContainer { drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); if(diesel.power > 0) { - int i = (int)diesel.getPowerScaled(52); - drawTexturedModalRect(guiLeft + 152, guiTop + 69 - i, 176, 52 - i, 16, i); + int i = (int) diesel.getPowerScaled(52); + drawTexturedModalRect(guiLeft + 141, guiTop + 69 - i, 176, 52 - i, 16, i); } - if(diesel.tank.getFill() > 0 && diesel.hasAcceptableFuel()) - { - drawTexturedModalRect(guiLeft + 43 + 18 * 4, guiTop + 34, 208, 0, 18, 18); - } + if(diesel.isOn) drawTexturedModalRect(guiLeft + 79, guiTop + 61, 192, 16, 35, 14); + if(diesel.wasOn) drawTexturedModalRect(guiLeft + 89, guiTop + 42, 192, 0, 16, 16); - this.drawInfoPanel(guiLeft - 16, guiTop + 36, 16, 16, 2); + this.drawInfoPanel(guiLeft - 8, guiTop + 36, 16, 16, 2); if(!diesel.hasAcceptableFuel()) - this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 32, 16, 16, 6); + this.drawInfoPanel(guiLeft - 8, guiTop + 36 + 32, 16, 16, 6); - diesel.tank.renderTank(guiLeft + 80, guiTop + 69, this.zLevel, 16, 52); + diesel.tank.renderTank(guiLeft + 35, guiTop + 69, this.zLevel, 16, 52); } } diff --git a/src/main/java/com/hbm/items/machine/ItemPileRodMK2.java b/src/main/java/com/hbm/items/machine/ItemPileRodMK2.java index 7a0542ccc..cc9273223 100644 --- a/src/main/java/com/hbm/items/machine/ItemPileRodMK2.java +++ b/src/main/java/com/hbm/items/machine/ItemPileRodMK2.java @@ -1,11 +1,17 @@ package com.hbm.items.machine; +import java.util.List; + import com.hbm.items.ItemEnumMulti; import com.hbm.util.BobMathUtil; import com.hbm.util.EnumUtil; +import com.hbm.util.i18n.I18nUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; public class ItemPileRodMK2 extends ItemEnumMulti { @@ -57,6 +63,14 @@ public class ItemPileRodMK2 extends ItemEnumMulti { this.turnsInto = turnsInto; } } + + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { + + for(String loc : I18nUtil.autoBreak(Minecraft.getMinecraft().fontRenderer, I18nUtil.resolveKey(this.getUnlocalizedName(stack) + ".desc"), 225)) { + list.add(EnumChatFormatting.YELLOW + loc); + } + } @Override public boolean showDurabilityBar(ItemStack stack) { diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineDiesel.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineDiesel.java index e3ef0ab69..a0d77cf4e 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineDiesel.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineDiesel.java @@ -6,6 +6,7 @@ import java.util.HashMap; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.stream.JsonWriter; +import com.hbm.interfaces.IControlReceiver; import com.hbm.inventory.FluidContainerRegistry; import com.hbm.inventory.container.ContainerMachineDiesel; import com.hbm.inventory.fluid.FluidType; @@ -28,10 +29,8 @@ import com.hbm.util.CompatEnergyControl; import api.hbm.energymk2.IBatteryItem; import api.hbm.energymk2.IEnergyProviderMK2; -import api.hbm.fluid.IFluidStandardTransceiver; +import api.hbm.fluidmk2.IFluidStandardTransceiverMK2; import api.hbm.tile.IInfoProviderEC; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; @@ -40,8 +39,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityMachineDiesel extends TileEntityMachinePolluting implements IEnergyProviderMK2, IFluidStandardTransceiver, IConfigurableMachine, IGUIProvider, IInfoProviderEC, IFluidCopiable { +public class TileEntityMachineDiesel extends TileEntityMachinePolluting implements IEnergyProviderMK2, IFluidStandardTransceiverMK2, IControlReceiver, IConfigurableMachine, IGUIProvider, IInfoProviderEC, IFluidCopiable { + public boolean isOn = false; public long power; public long powerCap = maxPower; public FluidTank tank; @@ -50,8 +50,8 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen private AudioWrapper audio; /* CONFIGURABLE CONSTANTS */ - public static long maxPower = 50000; - public static int fluidCap = 16000; + public static long maxPower = 50_000; + public static int fuelCap = 16_000; public static HashMap fuelEfficiency = new HashMap(); static { fuelEfficiency.put(FuelGrade.MEDIUM, 0.5D); @@ -63,9 +63,45 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen private static final int[] slots_bottom = new int[] { 1, 2 }; private static final int[] slots_side = new int[] { 2 }; + @Override + public String getConfigName() { + return "dieselgen"; + } + + @Override + public void readIfPresent(JsonObject obj) { + maxPower = IConfigurableMachine.grab(obj, "L:powerCap", maxPower); + fuelCap = IConfigurableMachine.grab(obj, "I:fuelCap", fuelCap); + + if(obj.has("D[:efficiency")) { + JsonArray array = obj.get("D[:efficiency").getAsJsonArray(); + for(FuelGrade grade : FuelGrade.values()) { + fuelEfficiency.put(grade, array.get(grade.ordinal()).getAsDouble()); + } + } + } + + @Override + public void writeConfig(JsonWriter writer) throws IOException { + writer.name("L:powerCap").value(maxPower); + writer.name("I:fuelCap").value(fuelCap); + + String info = "Fuel grades in order: "; + for(FuelGrade grade : FuelGrade.values()) info += grade.name() + " "; + info = info.trim(); + writer.name("INFO").value(info); + + writer.name("D[:efficiency").beginArray().setIndent(""); + for(FuelGrade grade : FuelGrade.values()) { + double d = fuelEfficiency.containsKey(grade) ? fuelEfficiency.get(grade) : 0.0D; + writer.value(d); + } + writer.endArray().setIndent(" "); + } + public TileEntityMachineDiesel() { - super(5, 100); - tank = new FluidTank(Fluids.DIESEL, 4_000); + super(4, 100); + tank = new FluidTank(Fluids.DIESEL, fuelCap); } @Override @@ -84,6 +120,7 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); + this.isOn = nbt.getBoolean("isOn"); this.power = nbt.getLong("powerTime"); this.powerCap = nbt.getLong("powerCap"); tank.readFromNBT(nbt, "fuel"); @@ -92,7 +129,8 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen @Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); - + + nbt.setBoolean("isOn", isOn); nbt.setLong("powerTime", power); nbt.setLong("powerCap", powerCap); tank.writeToNBT(nbt, "fuel"); @@ -110,9 +148,7 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen return false; } - public long getPowerScaled(long i) { - return (power * i) / powerCap; - } + public long getPowerScaled(long i) { return (power * i) / powerCap; } @Override public void updateEntity() { @@ -120,29 +156,18 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen if(!worldObj.isRemote) { this.wasOn = false; + + tank.setType(3, slots); + tank.loadTank(0, 1, slots); for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { this.tryProvide(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir); this.sendSmoke(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir); + this.trySubscribe(tank.getTankType(), worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir); } - - //Tank Management - FluidType last = tank.getTankType(); - if(tank.setType(3, 4, slots)) this.unsubscribeToAllAround(last, this); - tank.loadTank(0, 1, slots); - this.subscribeToAllAround(tank.getTankType(), this); - - FluidType type = tank.getTankType(); - if(type == Fluids.NITAN) - powerCap = maxPower * 10; - else - powerCap = maxPower; - - // Battery Item power = Library.chargeItemsFromTE(slots, 2, power, powerCap); - - generate(); + if(isOn) generate(); this.networkPackNT(50); } else { @@ -196,6 +221,7 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen super.serialize(buf); buf.writeInt((int) power); buf.writeInt((int) powerCap); + buf.writeBoolean(isOn); buf.writeBoolean(wasOn); tank.serialize(buf); } @@ -205,17 +231,13 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen super.deserialize(buf); this.power = buf.readInt(); this.powerCap = buf.readInt(); + this.isOn = buf.readBoolean(); this.wasOn = buf.readBoolean(); tank.deserialize(buf); } - public boolean hasAcceptableFuel() { - return getHEFromFuel() > 0; - } - - public long getHEFromFuel() { - return getHEFromFuel(tank.getTankType()); - } + public boolean hasAcceptableFuel() { return getHEFromFuel() > 0; } + public long getHEFromFuel() { return getHEFromFuel(tank.getTankType()); } public static long getHEFromFuel(FluidType type) { @@ -234,28 +256,36 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen public void generate() { + if(!this.isOn) return; if(this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) return; + if(!hasAcceptableFuel()) return; + if(tank.getFill() <= 0) return; - if(hasAcceptableFuel()) { - if (tank.getFill() > 0) { - - this.wasOn = true; - - tank.setFill(tank.getFill() - 1); - if(tank.getFill() < 0) - tank.setFill(0); - - if(worldObj.getTotalWorldTime() % 5 == 0) { - super.pollute(tank.getTankType(), FluidReleaseType.BURN, 5F); - } - - if(power + getHEFromFuel() <= powerCap) { - power += getHEFromFuel(); - } else { - power = powerCap; - } - } + this.wasOn = true; + tank.setFill(tank.getFill() - 1); + + if(tank.getFill() < 0) tank.setFill(0); + + if(worldObj.getTotalWorldTime() % 5 == 0) { + super.pollute(tank.getTankType(), FluidReleaseType.BURN, 5F); } + + if(power + getHEFromFuel() <= powerCap) { + power += getHEFromFuel(); + } else { + power = powerCap; + } + } + + @Override + public boolean hasPermission(EntityPlayer player) { + return player.getDistance(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 25; + } + + @Override + public void receiveControl(NBTTagCompound data) { + if(data.hasKey("turnOn")) this.isOn = !this.isOn; + this.markChanged(); } @Override public long getPower() { return power; } @@ -265,57 +295,9 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen @Override public FluidTank[] getReceivingTanks() { return new FluidTank[] {tank}; } @Override public FluidTank[] getAllTanks() { return new FluidTank[] { tank }; } - @Override - public String getConfigName() { - return "dieselgen"; - } - - @Override - public void readIfPresent(JsonObject obj) { - maxPower = IConfigurableMachine.grab(obj, "L:powerCap", maxPower); - fluidCap = IConfigurableMachine.grab(obj, "I:fuelCap", fluidCap); - - if(obj.has("D[:efficiency")) { - JsonArray array = obj.get("D[:efficiency").getAsJsonArray(); - for(FuelGrade grade : FuelGrade.values()) { - fuelEfficiency.put(grade, array.get(grade.ordinal()).getAsDouble()); - } - } - } - - @Override - public void writeConfig(JsonWriter writer) throws IOException { - writer.name("L:powerCap").value(maxPower); - writer.name("I:fuelCap").value(fluidCap); - - String info = "Fuel grades in order: "; - for(FuelGrade grade : FuelGrade.values()) info += grade.name() + " "; - info = info.trim(); - writer.name("INFO").value(info); - - writer.name("D[:efficiency").beginArray().setIndent(""); - for(FuelGrade grade : FuelGrade.values()) { - double d = fuelEfficiency.containsKey(grade) ? fuelEfficiency.get(grade) : 0.0D; - writer.value(d); - } - writer.endArray().setIndent(" "); - } - - @Override - public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { - return new ContainerMachineDiesel(player.inventory, this); - } - - @Override - @SideOnly(Side.CLIENT) - public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { - return new GUIMachineDiesel(player.inventory, this); - } - - @Override - public FluidTank[] getSendingTanks() { - return this.getSmokeTanks(); - } + @Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return new ContainerMachineDiesel(player.inventory, this); } + @Override public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIMachineDiesel(player.inventory, this); } + @Override public FluidTank[] getSendingTanks() { return this.getSmokeTanks(); } @Override public void provideExtraInfo(NBTTagCompound data) { diff --git a/src/main/java/com/hbm/tileentity/machine/pile/TileEntityPileCore.java b/src/main/java/com/hbm/tileentity/machine/pile/TileEntityPileCore.java index b47823138..d8981f5ca 100644 --- a/src/main/java/com/hbm/tileentity/machine/pile/TileEntityPileCore.java +++ b/src/main/java/com/hbm/tileentity/machine/pile/TileEntityPileCore.java @@ -504,7 +504,7 @@ public class TileEntityPileCore extends TileEntityTickingBase { PileChannel chan = new PileChannel(x, y, z, dir); if(chan.type == chan.type.FUEL) { - NBTTagList list = nbt.getTagList("fuel", 10); + NBTTagList list = nbt.getTagList("items", 10); for(int i = 0; i < list.tagCount(); i++) { NBTTagCompound nbt1 = list.getCompoundTagAt(i); byte b0 = nbt1.getByte("slot"); diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 375d2c3c0..59fdcf7d7 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -3815,6 +3815,20 @@ item.pellet_rtg_weak.name=Weak Uranium RTG Pellet item.pellet_rtg_weak.desc=Cheaper and weaker pellet, now with more U238! item.pellet_schrabidium.name=Pure Schrabidium Watz Pellet item.photo_panel.name=Photovoltaic Panel +item.pile_rod.nu.name=Chicago Pile Natural Uranium Rod +item.pile_rod.nu.desc=Basic breeding target for making plutonium-239. +item.pile_rod.po210be.name=Chicago Pile Po210Be Neutron source +item.pile_rod.po210be.desc=Advanced polonium-beryllium neutron source for starting the Chicago Pile's reaction. +item.pile_rod.pu239.name=Chicago Pile Plutonium-239 Rod +item.pile_rod.pu239.desc=Plutonium bred from natural uranium, can be bred further into RGP. +item.pile_rod.ra226be.name=Chicago Pile Ra226Be Neutron source +item.pile_rod.ra226be.desc=Basic radium-beryllium neutron source for starting the Chicago Pile's reaction. +item.pile_rod.rgp.name=Chicago Pile RGP Rod +item.pile_rod.rgp.desc=Reactor-grade plutonium rod, mainly plutonium-239 with plutonium-240 impurities. +item.pile_rod.waste.name=Chicago Pile Nuclear Waste Rod +item.pile_rod.waste.desc=Highly reactive end product from leaving a Chicago Pile fuel rod in the reactor for too long. +item.pile_rod.zr.name=Chicago Pile Zirconium Rod +item.pile_rod.zr.desc=Inert zirconium rod which is transparent to neutrons. Ideal for safely pushing other rods safely out of the reactor. item.pile_rod_boron.name=Chicago Pile Control Rod item.pile_rod_boron.desc=§9[Neutron Absorber]$§eClick to toggle item.pile_rod_detector.name=Chicago Pile Control & Detector Rod diff --git a/src/main/resources/assets/hbm/textures/gui/generators/gui_diesel.png b/src/main/resources/assets/hbm/textures/gui/generators/gui_diesel.png new file mode 100644 index 0000000000000000000000000000000000000000..710d16891f6d7752b0a904d05a624dbf11eca1fe GIT binary patch literal 3818 zcmbtWc{J4f`+v_E5@P7el4VL#+_GdRGh_*gvW{$B`_>@JZbq(F6rv&|E*T2h3nS6B zM>H`Rlx>JH!;E#zZ~C6!J->UtzjM#`oZs*L$NPDI-p})Tw)1?R_jB9kyxBfJNj?C; zKJ&B27Xg59ju61h!yztVr9K=2yJ}=^$IDrDfH+mWm(5C##L!H$@X8 zMjj8B#vIhQongQI!uDCad6Cr6yjr4WO&lD2K%~CFqaDUFP1p6LNu=M#ckhZlha9>; zGQYA?SuLigtu6lIPxkCmjHw%&{3f3<6Vs|um#6%)-1)Mnm166WxR;@iMw+E%N^9tr zLri9!-E_h#GoZ2OJ>$&;g##$LlUE{)|MZvh3K_Vx5lYHS=VK*SUTqer%@=# zWzPPz(R>|g*_`%A+A?Rm1j(53d5xZu^%H}DR*4_bqNN`@QM0>Ii<|cVc7ojEzAQqC zJ3@&qo1dRg7**8H50;NiuLlwxT7QW%v9`V)glmR}{g&f3xauox-6 zR$|Y5C=~3_%m-Jya9bL9^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