mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-26 23:03:18 +00:00
Simple Cleanup
This commit is contained in:
1 parent
09df969bcf
commit
e2fff11ea8
141 files changed
+545
-859
No files matched your search
@@ -14,12 +14,12 @@ public class EnergyManager implements IEnergyHandler {
|
||||
}
|
||||
|
||||
private final int energyPerWork;
|
||||
protected EnergyStorage energyStorage;
|
||||
private final EnergyStorage energyStorage;
|
||||
private EnergyTransferMode mode = EnergyTransferMode.BOTH;
|
||||
|
||||
public EnergyManager(int maxTransfer, int energyPerWork, int capacity) {
|
||||
this.energyPerWork = scaleForDifficulty(energyPerWork);
|
||||
energyStorage = new EnergyStorage(scaleForDifficulty(capacity), scaleForDifficulty(maxTransfer), scaleForDifficulty(maxTransfer));
|
||||
this.energyStorage = new EnergyStorage(scaleForDifficulty(capacity), scaleForDifficulty(maxTransfer), scaleForDifficulty(maxTransfer));
|
||||
}
|
||||
|
||||
private static int scaleForDifficulty(int energyPerUse) {
|
||||
@@ -143,8 +143,6 @@ public class EnergyManager implements IEnergyHandler {
|
||||
/**
|
||||
* Sends as much energy as it can to the tile at orientation.
|
||||
* For power sources. Ignores canExtract()
|
||||
* @param orientation
|
||||
* @param tile
|
||||
* @return amount sent
|
||||
*/
|
||||
public int sendEnergy(ForgeDirection orientation, TileEntity tile) {
|
||||
@@ -154,9 +152,6 @@ public class EnergyManager implements IEnergyHandler {
|
||||
/**
|
||||
* Sends amount of energy to the tile at orientation.
|
||||
* For power sources. Ignores canExtract()
|
||||
* @param orientation
|
||||
* @param tile
|
||||
* @param amount
|
||||
* @return amount sent
|
||||
*/
|
||||
public int sendEnergy(ForgeDirection orientation, TileEntity tile, int amount) {
|
||||
@@ -175,7 +170,6 @@ public class EnergyManager implements IEnergyHandler {
|
||||
|
||||
/**
|
||||
* Drains an amount of energy, due to decay from lack of work or other factors
|
||||
* @param amount
|
||||
*/
|
||||
public void drainEnergy(int amount) {
|
||||
energyStorage.modifyEnergyStored(-amount);
|
||||
@@ -183,7 +177,6 @@ public class EnergyManager implements IEnergyHandler {
|
||||
|
||||
/**
|
||||
* Creates an amount of energy, generated by engines
|
||||
* @param amount
|
||||
*/
|
||||
public void generateEnergy(int amount) {
|
||||
energyStorage.modifyEnergyStored(amount);
|
||||
|
||||
@@ -62,13 +62,10 @@ public class EngineBronze extends Engine implements ISidedInventory, ILiquidTank
|
||||
public void fromPacketPayload(PacketPayload payload) {
|
||||
super.fromPacketPayload(payload);
|
||||
|
||||
if (payload.intPayload[3] > 0)
|
||||
shutdown = true;
|
||||
else
|
||||
shutdown = false;
|
||||
shutdown = payload.intPayload[3] > 0;
|
||||
}
|
||||
public FilteredTank fuelTank;
|
||||
public FilteredTank heatingTank;
|
||||
private final FilteredTank fuelTank;
|
||||
private final FilteredTank heatingTank;
|
||||
private final TankManager tankManager;
|
||||
public int burnTime;
|
||||
public int totalTime;
|
||||
@@ -214,11 +211,7 @@ public class EngineBronze extends Engine implements ISidedInventory, ILiquidTank
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the fuel value (power per cycle) an item of the passed ItemStack
|
||||
* provides
|
||||
*
|
||||
* @param fluid
|
||||
* @return
|
||||
* Returns the fuel value (power per cycle) an item of the passed fluid
|
||||
*/
|
||||
private int determineFuelValue(Fluid fluid) {
|
||||
if (FuelManager.bronzeEngineFuel.containsKey(fluid))
|
||||
@@ -228,8 +221,6 @@ public class EngineBronze extends Engine implements ISidedInventory, ILiquidTank
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param fluid
|
||||
* @return Duration of burn cycle of one bucket
|
||||
*/
|
||||
private int determineBurnTime(Fluid fluid) {
|
||||
@@ -280,10 +271,6 @@ public class EngineBronze extends Engine implements ISidedInventory, ILiquidTank
|
||||
return (heatingTank.getFluidAmount() * i) / Defaults.ENGINE_TANK_CAPACITY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads saved data
|
||||
* @param nbt
|
||||
*/
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
@@ -301,10 +288,6 @@ public class EngineBronze extends Engine implements ISidedInventory, ILiquidTank
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes data to save
|
||||
* @param nbt
|
||||
*/
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
@@ -199,9 +199,6 @@ public class EngineCopper extends Engine implements ISidedInventory {
|
||||
|
||||
/**
|
||||
* Returns the fuel value (power per cycle) an item of the passed ItemStack provides
|
||||
*
|
||||
* @param fuel
|
||||
* @return
|
||||
*/
|
||||
private int determineFuelValue(ItemStack fuel) {
|
||||
if (FuelManager.copperEngineFuel.containsKey(fuel))
|
||||
@@ -212,9 +209,6 @@ public class EngineCopper extends Engine implements ISidedInventory {
|
||||
|
||||
/**
|
||||
* Returns the fuel value (power per cycle) an item of the passed ItemStack provides
|
||||
*
|
||||
* @param fuel
|
||||
* @return
|
||||
*/
|
||||
private int determineBurnDuration(ItemStack fuel) {
|
||||
if (FuelManager.copperEngineFuel.containsKey(fuel))
|
||||
@@ -275,10 +269,6 @@ public class EngineCopper extends Engine implements ISidedInventory {
|
||||
}
|
||||
|
||||
// / LOADING AND SAVING
|
||||
/**
|
||||
* Reads saved data
|
||||
* @param nbttagcompound
|
||||
*/
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
@@ -295,10 +285,6 @@ public class EngineCopper extends Engine implements ISidedInventory {
|
||||
ashProduction = nbttagcompound.getInteger("AshProduction");
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes data to save
|
||||
* @param nbttagcompound
|
||||
*/
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
|
||||
@@ -50,7 +50,7 @@ public class EngineTin extends Engine implements ISocketable, IInventory {
|
||||
}
|
||||
}
|
||||
|
||||
private final short batterySlot = 0;
|
||||
private static final short batterySlot = 0;
|
||||
private final InventoryAdapter sockets = new InventoryAdapter(1, "sockets");
|
||||
private final EuConfig euConfig = new EuConfig(Defaults.ENGINE_TIN_EU_FOR_CYCLE, Defaults.ENGINE_TIN_ENERGY_PER_CYCLE, Defaults.ENGINE_TIN_MAX_EU_STORED);
|
||||
|
||||
|
||||
@@ -24,17 +24,17 @@ public class ContainerEngineBronze extends ContainerLiquidTanks {
|
||||
super(engine, engine);
|
||||
|
||||
this.engine = engine;
|
||||
this.addSlot(new SlotLiquidContainer(engine, EngineBronze.SLOT_CAN, 143, 40));
|
||||
this.addSlotToContainer(new SlotLiquidContainer(engine, EngineBronze.SLOT_CAN, 143, 40));
|
||||
|
||||
int i;
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int var4 = 0; var4 < 9; ++var4) {
|
||||
this.addSlot(new Slot(player, var4 + i * 9 + 9, 8 + var4 * 18, 84 + i * 18));
|
||||
this.addSlotToContainer(new Slot(player, var4 + i * 9 + 9, 8 + var4 * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlot(new Slot(player, i, 8 + i * 18, 142));
|
||||
this.addSlotToContainer(new Slot(player, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,21 +25,21 @@ public class ContainerEngineCopper extends ContainerForestry {
|
||||
super(tile);
|
||||
|
||||
this.engine = tile;
|
||||
this.addSlot(new Slot(tile, 0, 44, 46));
|
||||
this.addSlotToContainer(new Slot(tile, 0, 44, 46));
|
||||
|
||||
this.addSlot(new SlotClosed(tile, 1, 98, 35));
|
||||
this.addSlot(new SlotClosed(tile, 2, 98, 53));
|
||||
this.addSlot(new SlotClosed(tile, 3, 116, 35));
|
||||
this.addSlot(new SlotClosed(tile, 4, 116, 53));
|
||||
this.addSlotToContainer(new SlotClosed(tile, 1, 98, 35));
|
||||
this.addSlotToContainer(new SlotClosed(tile, 2, 98, 53));
|
||||
this.addSlotToContainer(new SlotClosed(tile, 3, 116, 35));
|
||||
this.addSlotToContainer(new SlotClosed(tile, 4, 116, 53));
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlot(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
this.addSlotToContainer(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlot(new Slot(player, i, 8 + i * 18, 142));
|
||||
this.addSlotToContainer(new Slot(player, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,15 +24,15 @@ public class ContainerEngineTin extends ContainerSocketed {
|
||||
super(tile, tile);
|
||||
|
||||
this.tile = tile;
|
||||
this.addSlot(new Slot(tile, 0, 84, 53));
|
||||
this.addSlotToContainer(new Slot(tile, 0, 84, 53));
|
||||
|
||||
int i;
|
||||
for (i = 0; i < 3; ++i)
|
||||
for (int j = 0; j < 9; ++j)
|
||||
this.addSlot(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
this.addSlotToContainer(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
this.addSlot(new Slot(player, i, 8 + i * 18, 142));
|
||||
this.addSlotToContainer(new Slot(player, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,16 +24,16 @@ public class ContainerGenerator extends ContainerLiquidTanks {
|
||||
super(tile, tile);
|
||||
|
||||
this.tile = tile;
|
||||
this.addSlot(new SlotLiquidContainer(tile, MachineGenerator.SLOT_CAN, 22, 38));
|
||||
this.addSlotToContainer(new SlotLiquidContainer(tile, MachineGenerator.SLOT_CAN, 22, 38));
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int var4 = 0; var4 < 9; ++var4) {
|
||||
this.addSlot(new Slot(player, var4 + i * 9 + 9, 8 + var4 * 18, 84 + i * 18));
|
||||
this.addSlotToContainer(new Slot(player, var4 + i * 9 + 9, 8 + var4 * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlot(new Slot(player, i, 8 + i * 18, 142));
|
||||
this.addSlotToContainer(new Slot(player, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class GuiEngineBronze extends GuiEngine {
|
||||
|
||||
protected class BiogasSlot extends Widget {
|
||||
|
||||
EngineBronze engine;
|
||||
private final EngineBronze engine;
|
||||
|
||||
public BiogasSlot(WidgetManager manager, int xPos, int yPos, EngineBronze engine) {
|
||||
super(manager, xPos, yPos);
|
||||
@@ -60,7 +60,7 @@ public class GuiEngineBronze extends GuiEngine {
|
||||
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F);
|
||||
while (true) {
|
||||
int x = 0;
|
||||
int x;
|
||||
|
||||
if (squaled > 16) {
|
||||
x = 16;
|
||||
@@ -87,8 +87,7 @@ public class GuiEngineBronze extends GuiEngine {
|
||||
if (fluid == null)
|
||||
return StringUtil.localize("gui.empty");
|
||||
|
||||
String tooltip = fluid.getLocalizedName(new FluidStack(fluid, 1));
|
||||
return tooltip;
|
||||
return fluid.getLocalizedName(new FluidStack(fluid, 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user