This commit is contained in:
HbmMods 2026-07-22 23:23:52 +02:00
parent 5ac837125c
commit ba09553fff
9 changed files with 202 additions and 175 deletions

View File

@ -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 ## Changed
* Updated all oil well GUI textures * Updated all oil well GUI textures
* There's now only two upgrade slots instead of three * 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 * 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
* Fixed held block being placed when not sneaking when opening the cable diode's GUI * 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

View File

@ -9,6 +9,7 @@ import com.hbm.blocks.ITooltipProvider;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.main.NTMSounds; import com.hbm.main.NTMSounds;
import com.hbm.tileentity.machine.pile.TileEntityPileControl; 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.TileEntityPileLoader;
import com.hbm.tileentity.machine.pile.TileEntityPileVent; import com.hbm.tileentity.machine.pile.TileEntityPileVent;
import com.hbm.util.i18n.I18nUtil; import com.hbm.util.i18n.I18nUtil;
@ -156,20 +157,18 @@ public class BlockPileDevice extends BlockContainer implements IBlockMulti, ILoo
List<String> text = new ArrayList(); List<String> text = new ArrayList();
TileEntity tile = world.getTileEntity(x, y, z); TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof TileEntityPileLoader) { if(tile instanceof TileEntityPileDeviceBase) {
TileEntityPileLoader device = (TileEntityPileLoader) tile; TileEntityPileDeviceBase device = (TileEntityPileDeviceBase) tile;
text.add("Index: " + device.chanNum); text.add("#" + (device.chanNum + 1));
if(device.syncStack != null) text.add("Loading: " + device.syncStack.getDisplayName());
} }
if(tile instanceof TileEntityPileVent) { if(tile instanceof TileEntityPileLoader) {
TileEntityPileVent device = (TileEntityPileVent) tile; TileEntityPileLoader device = (TileEntityPileLoader) tile;
text.add("Index: " + device.chanNum); if(device.syncStack != null) text.add("Loading: " + device.syncStack.getDisplayName());
} }
if(tile instanceof TileEntityPileControl) { if(tile instanceof TileEntityPileControl) {
TileEntityPileControl device = (TileEntityPileControl) tile; TileEntityPileControl device = (TileEntityPileControl) tile;
text.add("Index: " + device.chanNum);
text.add("Extraction level: " + (int) + (device.level * 100) + "%"); text.add("Extraction level: " + (int) + (device.level * 100) + "%");
} }

View File

@ -10,68 +10,57 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
public class ContainerMachineDiesel extends Container { public class ContainerMachineDiesel extends Container {
private TileEntityMachineDiesel diFurnace; private TileEntityMachineDiesel diFurnace;
public ContainerMachineDiesel(InventoryPlayer invPlayer, TileEntityMachineDiesel tedf) { public ContainerMachineDiesel(InventoryPlayer invPlayer, TileEntityMachineDiesel tedf) {
diFurnace = tedf; diFurnace = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 44, 17)); this.addSlotToContainer(new Slot(tedf, 0, 17, 17));
this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 44, 53)); this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 17, 53));
this.addSlotToContainer(new Slot(tedf, 2, 116, 53)); this.addSlotToContainer(new Slot(tedf, 2, 141, 71));
this.addSlotToContainer(new Slot(tedf, 3, 8, 17)); this.addSlotToContainer(new Slot(tedf, 3, 35, 71));
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 8, 53));
for(int i = 0; i < 3; i++) {
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 j = 0; j < 9; j++)
{
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
} }
} }
for(int i = 0; i < 9; i++) for(int i = 0; i < 9; i++) {
{ this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 179));
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
} }
} }
@Override @Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) { public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
ItemStack var3 = null; ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2); Slot var4 = (Slot) this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack()) if(var4 != null && var4.getHasStack()) {
{
ItemStack var5 = var4.getStack(); ItemStack var5 = var4.getStack();
var3 = var5.copy(); var3 = var5.copy();
if (par2 <= 4) { if(par2 <= 4) {
if (!this.mergeItemStack(var5, 5, this.inventorySlots.size(), true)) if(!this.mergeItemStack(var5, 5, this.inventorySlots.size(), true)) {
{
return null; 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(var5.stackSize == 0) {
if (!this.mergeItemStack(var5, 2, 3, false))
if (!this.mergeItemStack(var5, 4, 5, false))
return null;
}
if (var5.stackSize == 0)
{
var4.putStack((ItemStack) null); var4.putStack((ItemStack) null);
} } else {
else
{
var4.onSlotChanged(); var4.onSlotChanged();
} }
} }
return var3; return var3;
} }
@Override @Override
public boolean canInteractWith(EntityPlayer player) { public boolean canInteractWith(EntityPlayer player) {

View File

@ -4,16 +4,20 @@ import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerMachineDiesel; import com.hbm.inventory.container.ContainerMachineDiesel;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toserver.NBTControlPacket;
import com.hbm.tileentity.machine.TileEntityMachineDiesel; import com.hbm.tileentity.machine.TileEntityMachineDiesel;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public class GUIMachineDiesel extends GuiInfoContainer { 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; private TileEntityMachineDiesel diesel;
public GUIMachineDiesel(InventoryPlayer invPlayer, TileEntityMachineDiesel tedf) { public GUIMachineDiesel(InventoryPlayer invPlayer, TileEntityMachineDiesel tedf) {
@ -21,35 +25,43 @@ public class GUIMachineDiesel extends GuiInfoContainer {
diesel = tedf; diesel = tedf;
this.xSize = 176; this.xSize = 176;
this.ySize = 166; this.ySize = 203;
} }
@Override @Override
public void drawScreen(int mouseX, int mouseY, float f) { public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f); super.drawScreen(mouseX, mouseY, f);
diesel.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 69 - 52, 16, 52); diesel.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 35, guiTop + 69 - 52, 16, 52);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 69 - 52, 16, 52, diesel.power, diesel.powerCap); this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 141, guiTop + 69 - 52, 16, 52, diesel.power, diesel.powerCap);
String[] text = new String[] { "Fuel consumption rate:", String[] text = new String[] { "Fuel consumption rate:",
" 1 mB/t", " 1 mB/t",
" 20 mB/s", " 20 mB/s",
"(Consumption rate is constant)" }; "(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()) { if(!diesel.hasAcceptableFuel()) {
String[] text2 = new String[] { "Error: The currently set fuel type", String[] text2 = new String[] { "Error: The currently set fuel type",
"is not supported by this engine!" }; "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 @Override
protected void drawGuiContainerForegroundLayer(int i, int j) { 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); 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); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(diesel.power > 0) { if(diesel.power > 0) {
int i = (int)diesel.getPowerScaled(52); int i = (int) diesel.getPowerScaled(52);
drawTexturedModalRect(guiLeft + 152, guiTop + 69 - i, 176, 52 - i, 16, i); drawTexturedModalRect(guiLeft + 141, guiTop + 69 - i, 176, 52 - i, 16, i);
} }
if(diesel.tank.getFill() > 0 && diesel.hasAcceptableFuel()) if(diesel.isOn) drawTexturedModalRect(guiLeft + 79, guiTop + 61, 192, 16, 35, 14);
{ if(diesel.wasOn) drawTexturedModalRect(guiLeft + 89, guiTop + 42, 192, 0, 16, 16);
drawTexturedModalRect(guiLeft + 43 + 18 * 4, guiTop + 34, 208, 0, 18, 18);
}
this.drawInfoPanel(guiLeft - 16, guiTop + 36, 16, 16, 2); this.drawInfoPanel(guiLeft - 8, guiTop + 36, 16, 16, 2);
if(!diesel.hasAcceptableFuel()) 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);
} }
} }

View File

@ -1,11 +1,17 @@
package com.hbm.items.machine; package com.hbm.items.machine;
import java.util.List;
import com.hbm.items.ItemEnumMulti; import com.hbm.items.ItemEnumMulti;
import com.hbm.util.BobMathUtil; import com.hbm.util.BobMathUtil;
import com.hbm.util.EnumUtil; 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.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
public class ItemPileRodMK2 extends ItemEnumMulti { public class ItemPileRodMK2 extends ItemEnumMulti {
@ -57,6 +63,14 @@ public class ItemPileRodMK2 extends ItemEnumMulti {
this.turnsInto = turnsInto; 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 @Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack) {

View File

@ -6,6 +6,7 @@ import java.util.HashMap;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter; import com.google.gson.stream.JsonWriter;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.inventory.FluidContainerRegistry; import com.hbm.inventory.FluidContainerRegistry;
import com.hbm.inventory.container.ContainerMachineDiesel; import com.hbm.inventory.container.ContainerMachineDiesel;
import com.hbm.inventory.fluid.FluidType; import com.hbm.inventory.fluid.FluidType;
@ -28,10 +29,8 @@ import com.hbm.util.CompatEnergyControl;
import api.hbm.energymk2.IBatteryItem; import api.hbm.energymk2.IBatteryItem;
import api.hbm.energymk2.IEnergyProviderMK2; import api.hbm.energymk2.IEnergyProviderMK2;
import api.hbm.fluid.IFluidStandardTransceiver; import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
import api.hbm.tile.IInfoProviderEC; import api.hbm.tile.IInfoProviderEC;
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.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
@ -40,8 +39,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; 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 power;
public long powerCap = maxPower; public long powerCap = maxPower;
public FluidTank tank; public FluidTank tank;
@ -50,8 +50,8 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
private AudioWrapper audio; private AudioWrapper audio;
/* CONFIGURABLE CONSTANTS */ /* CONFIGURABLE CONSTANTS */
public static long maxPower = 50000; public static long maxPower = 50_000;
public static int fluidCap = 16000; public static int fuelCap = 16_000;
public static HashMap<FuelGrade, Double> fuelEfficiency = new HashMap(); public static HashMap<FuelGrade, Double> fuelEfficiency = new HashMap();
static { static {
fuelEfficiency.put(FuelGrade.MEDIUM, 0.5D); 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_bottom = new int[] { 1, 2 };
private static final int[] slots_side = new int[] { 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() { public TileEntityMachineDiesel() {
super(5, 100); super(4, 100);
tank = new FluidTank(Fluids.DIESEL, 4_000); tank = new FluidTank(Fluids.DIESEL, fuelCap);
} }
@Override @Override
@ -84,6 +120,7 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
this.isOn = nbt.getBoolean("isOn");
this.power = nbt.getLong("powerTime"); this.power = nbt.getLong("powerTime");
this.powerCap = nbt.getLong("powerCap"); this.powerCap = nbt.getLong("powerCap");
tank.readFromNBT(nbt, "fuel"); tank.readFromNBT(nbt, "fuel");
@ -92,7 +129,8 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
@Override @Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setBoolean("isOn", isOn);
nbt.setLong("powerTime", power); nbt.setLong("powerTime", power);
nbt.setLong("powerCap", powerCap); nbt.setLong("powerCap", powerCap);
tank.writeToNBT(nbt, "fuel"); tank.writeToNBT(nbt, "fuel");
@ -110,9 +148,7 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
return false; return false;
} }
public long getPowerScaled(long i) { public long getPowerScaled(long i) { return (power * i) / powerCap; }
return (power * i) / powerCap;
}
@Override @Override
public void updateEntity() { public void updateEntity() {
@ -120,29 +156,18 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
if(!worldObj.isRemote) { if(!worldObj.isRemote) {
this.wasOn = false; this.wasOn = false;
tank.setType(3, slots);
tank.loadTank(0, 1, slots);
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
this.tryProvide(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir); 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.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); power = Library.chargeItemsFromTE(slots, 2, power, powerCap);
if(isOn) generate();
generate();
this.networkPackNT(50); this.networkPackNT(50);
} else { } else {
@ -196,6 +221,7 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
super.serialize(buf); super.serialize(buf);
buf.writeInt((int) power); buf.writeInt((int) power);
buf.writeInt((int) powerCap); buf.writeInt((int) powerCap);
buf.writeBoolean(isOn);
buf.writeBoolean(wasOn); buf.writeBoolean(wasOn);
tank.serialize(buf); tank.serialize(buf);
} }
@ -205,17 +231,13 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
super.deserialize(buf); super.deserialize(buf);
this.power = buf.readInt(); this.power = buf.readInt();
this.powerCap = buf.readInt(); this.powerCap = buf.readInt();
this.isOn = buf.readBoolean();
this.wasOn = buf.readBoolean(); this.wasOn = buf.readBoolean();
tank.deserialize(buf); tank.deserialize(buf);
} }
public boolean hasAcceptableFuel() { public boolean hasAcceptableFuel() { return getHEFromFuel() > 0; }
return getHEFromFuel() > 0; public long getHEFromFuel() { return getHEFromFuel(tank.getTankType()); }
}
public long getHEFromFuel() {
return getHEFromFuel(tank.getTankType());
}
public static long getHEFromFuel(FluidType type) { public static long getHEFromFuel(FluidType type) {
@ -234,28 +256,36 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
public void generate() { public void generate() {
if(!this.isOn) return;
if(this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) return; if(this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) return;
if(!hasAcceptableFuel()) return;
if(tank.getFill() <= 0) return;
if(hasAcceptableFuel()) { this.wasOn = true;
if (tank.getFill() > 0) { tank.setFill(tank.getFill() - 1);
this.wasOn = true; if(tank.getFill() < 0) tank.setFill(0);
tank.setFill(tank.getFill() - 1); if(worldObj.getTotalWorldTime() % 5 == 0) {
if(tank.getFill() < 0) super.pollute(tank.getTankType(), FluidReleaseType.BURN, 5F);
tank.setFill(0);
if(worldObj.getTotalWorldTime() % 5 == 0) {
super.pollute(tank.getTankType(), FluidReleaseType.BURN, 5F);
}
if(power + getHEFromFuel() <= powerCap) {
power += getHEFromFuel();
} else {
power = powerCap;
}
}
} }
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; } @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[] getReceivingTanks() { return new FluidTank[] {tank}; }
@Override public FluidTank[] getAllTanks() { return new FluidTank[] { tank }; } @Override public FluidTank[] getAllTanks() { return new FluidTank[] { tank }; }
@Override @Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return new ContainerMachineDiesel(player.inventory, this); }
public String getConfigName() { @Override public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIMachineDiesel(player.inventory, this); }
return "dieselgen"; @Override public FluidTank[] getSendingTanks() { return this.getSmokeTanks(); }
}
@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 @Override
public void provideExtraInfo(NBTTagCompound data) { public void provideExtraInfo(NBTTagCompound data) {

View File

@ -504,7 +504,7 @@ public class TileEntityPileCore extends TileEntityTickingBase {
PileChannel chan = new PileChannel(x, y, z, dir); PileChannel chan = new PileChannel(x, y, z, dir);
if(chan.type == chan.type.FUEL) { 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++) { for(int i = 0; i < list.tagCount(); i++) {
NBTTagCompound nbt1 = list.getCompoundTagAt(i); NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot"); byte b0 = nbt1.getByte("slot");

View File

@ -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_rtg_weak.desc=Cheaper and weaker pellet, now with more U238!
item.pellet_schrabidium.name=Pure Schrabidium Watz Pellet item.pellet_schrabidium.name=Pure Schrabidium Watz Pellet
item.photo_panel.name=Photovoltaic Panel 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.name=Chicago Pile Control Rod
item.pile_rod_boron.desc=§9[Neutron Absorber]$§eClick to toggle item.pile_rod_boron.desc=§9[Neutron Absorber]$§eClick to toggle
item.pile_rod_detector.name=Chicago Pile Control & Detector Rod item.pile_rod_detector.name=Chicago Pile Control & Detector Rod

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB