mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
it snew
This commit is contained in:
parent
5ac837125c
commit
ba09553fff
21
changelog
21
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
|
||||
* 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
|
||||
@ -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<String> 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) + "%");
|
||||
}
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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<FuelGrade, Double> 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) {
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
Loading…
x
Reference in New Issue
Block a user