mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
cleanup
This commit is contained in:
parent
b15447d6eb
commit
866676f6f0
@ -21,3 +21,4 @@
|
||||
* WarTec should now be compatible again
|
||||
* Fixed the "Hold shift for more info" line appearing on fluid info when shift is held, and disappearing otherwise
|
||||
* Fixed smokestacks being able to void any fluid under certain conditions
|
||||
* Fixed the hydrotreater only using half as much crude oil per operation as it should
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
package com.hbm.calc;
|
||||
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
|
||||
public class UnionOfTileEntitiesAndBooleansForFluids {
|
||||
|
||||
public UnionOfTileEntitiesAndBooleansForFluids(IFluidSource tileentity, boolean bool)
|
||||
{
|
||||
source = tileentity;
|
||||
ticked = bool;
|
||||
}
|
||||
|
||||
public IFluidSource source;
|
||||
public boolean ticked = false;
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package com.hbm.calc;
|
||||
|
||||
import com.hbm.interfaces.IGasSource;
|
||||
|
||||
public class UnionOfTileEntitiesAndBooleansForGas {
|
||||
|
||||
public UnionOfTileEntitiesAndBooleansForGas(IGasSource tileentity, boolean bool)
|
||||
{
|
||||
source = tileentity;
|
||||
ticked = bool;
|
||||
}
|
||||
|
||||
public IGasSource source;
|
||||
public boolean ticked = false;
|
||||
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
package com.hbm.calc;
|
||||
|
||||
import com.hbm.interfaces.IOilSource;
|
||||
|
||||
public class UnionOfTileEntitiesAndBooleansForOil {
|
||||
|
||||
public UnionOfTileEntitiesAndBooleansForOil(IOilSource tileentity, boolean bool)
|
||||
{
|
||||
source = tileentity;
|
||||
ticked = bool;
|
||||
}
|
||||
|
||||
public IOilSource source;
|
||||
public boolean ticked = false;
|
||||
}
|
||||
@ -7,7 +7,6 @@ import java.util.Set;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.calc.UnionOfTileEntitiesAndBooleansForFluids;
|
||||
import com.hbm.entity.mob.EntityHunterChopper;
|
||||
import com.hbm.entity.projectile.EntityChopperMine;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
@ -16,10 +15,7 @@ import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.TileEntityProxyBase;
|
||||
import com.hbm.tileentity.TileEntityProxyInventory;
|
||||
import com.hbm.tileentity.conductor.TileEntityFluidDuctSimple;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyConnector;
|
||||
@ -182,19 +178,6 @@ public class Library {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean checkUnionListForFluids(List<UnionOfTileEntitiesAndBooleansForFluids> list, IFluidSource that) {
|
||||
|
||||
for(UnionOfTileEntitiesAndBooleansForFluids union : list)
|
||||
{
|
||||
if(union.source == that)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static EntityLivingBase getClosestEntityForChopper(World world, double x, double y, double z, double radius) {
|
||||
double d4 = -1.0D;
|
||||
@ -385,116 +368,7 @@ public class Library {
|
||||
*/
|
||||
}
|
||||
|
||||
public static void transmitFluid(int x, int y, int z, boolean newTact, IFluidSource that, World worldObj, FluidType type) {
|
||||
Block block = worldObj.getBlock(x, y, z);
|
||||
TileEntity tileentity = worldObj.getTileEntity(x, y, z);
|
||||
|
||||
//FWatz Reactor
|
||||
if(block == ModBlocks.fwatz_hatch && worldObj.getBlock(x, y + 11, z + 9) == ModBlocks.fwatz_core)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(x, y + 11, z + 9);
|
||||
}
|
||||
if(block == ModBlocks.fwatz_hatch && worldObj.getBlock(x, y + 11, z - 9) == ModBlocks.fwatz_core)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(x, y + 11, z - 9);
|
||||
}
|
||||
if(block == ModBlocks.fwatz_hatch && worldObj.getBlock(x + 9, y + 11, z) == ModBlocks.fwatz_core)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(x + 9, y + 11, z);
|
||||
}
|
||||
if(block == ModBlocks.fwatz_hatch && worldObj.getBlock(x - 9, y + 11, z) == ModBlocks.fwatz_core)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(x - 9, y + 11, z);
|
||||
}
|
||||
//AMS Limiter
|
||||
if(block == ModBlocks.dummy_port_ams_limiter)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ);
|
||||
}
|
||||
//AMS Limiter
|
||||
if(block == ModBlocks.dummy_port_ams_emitter)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ);
|
||||
}
|
||||
//AMS Base
|
||||
if(block == ModBlocks.dummy_port_ams_base)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ);
|
||||
}
|
||||
//Launchers
|
||||
if(block == ModBlocks.dummy_port_compact_launcher || block == ModBlocks.dummy_port_launch_table)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ);
|
||||
}
|
||||
|
||||
if(tileentity == that)
|
||||
tileentity = null;
|
||||
|
||||
if(tileentity instanceof TileEntityProxyBase) {
|
||||
TileEntityProxyBase proxy = (TileEntityProxyBase) tileentity;
|
||||
|
||||
if(proxy.getTE() == that)
|
||||
tileentity = null;
|
||||
}
|
||||
|
||||
if(tileentity instanceof IFluidDuct)
|
||||
{
|
||||
if(tileentity instanceof TileEntityFluidDuctSimple && ((TileEntityFluidDuctSimple)tileentity).getType().name().equals(type.name()))
|
||||
{
|
||||
if(Library.checkUnionListForFluids(((TileEntityFluidDuctSimple)tileentity).uoteab, that))
|
||||
{
|
||||
for(int i = 0; i < ((TileEntityFluidDuctSimple)tileentity).uoteab.size(); i++)
|
||||
{
|
||||
if(((TileEntityFluidDuctSimple)tileentity).uoteab.get(i).source == that)
|
||||
{
|
||||
if(((TileEntityFluidDuctSimple)tileentity).uoteab.get(i).ticked != newTact)
|
||||
{
|
||||
((TileEntityFluidDuctSimple)tileentity).uoteab.get(i).ticked = newTact;
|
||||
transmitFluid(x, y + 1, z, that.getTact(), that, worldObj, type);
|
||||
transmitFluid(x, y - 1, z, that.getTact(), that, worldObj, type);
|
||||
transmitFluid(x - 1, y, z, that.getTact(), that, worldObj, type);
|
||||
transmitFluid(x + 1, y, z, that.getTact(), that, worldObj, type);
|
||||
transmitFluid(x, y, z - 1, that.getTact(), that, worldObj, type);
|
||||
transmitFluid(x, y, z + 1, that.getTact(), that, worldObj, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
((TileEntityFluidDuctSimple)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleansForFluids(that, newTact));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(tileentity instanceof IFluidAcceptor && newTact && ((IFluidAcceptor)tileentity).getMaxFluidFillForReceive(type) > 0 &&
|
||||
((IFluidAcceptor)tileentity).getMaxFluidFillForReceive(type) - ((IFluidAcceptor)tileentity).getFluidFillForReceive(type) > 0) {
|
||||
that.getFluidList(type).add((IFluidAcceptor)tileentity);
|
||||
}
|
||||
|
||||
if(!newTact) {
|
||||
int size = that.getFluidList(type).size();
|
||||
|
||||
if(size > 0) {
|
||||
int part = that.getFluidFillForTransfer(type) / size;
|
||||
|
||||
for(IFluidAcceptor consume : that.getFluidList(type)) {
|
||||
|
||||
if(consume.getFluidFillForReceive(type) < consume.getMaxFluidFillForReceive(type)) {
|
||||
|
||||
if(consume.getMaxFluidFillForReceive(type) - consume.getFluidFillForReceive(type) >= part) {
|
||||
that.transferFluid(part, type);
|
||||
consume.receiveFluid(part, type);
|
||||
|
||||
} else {
|
||||
int transfer = consume.getMaxFluidFillForReceive(type) - consume.getFluidFillForReceive(type);
|
||||
that.transferFluid(transfer, type);
|
||||
consume.receiveFluid(transfer, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
that.clearFluidList(type);
|
||||
}
|
||||
}
|
||||
public static void transmitFluid(int x, int y, int z, boolean newTact, IFluidSource that, World worldObj, FluidType type) { }
|
||||
|
||||
public static boolean isArrayEmpty(Object[] array) {
|
||||
if(array == null)
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
package com.hbm.tileentity.conductor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.calc.UnionOfTileEntitiesAndBooleansForFluids;
|
||||
import com.hbm.interfaces.IFluidDuct;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -22,7 +18,6 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
public class TileEntityFluidDuctSimple extends TileEntity implements IFluidDuct {
|
||||
|
||||
protected FluidType type = Fluids.NONE;
|
||||
public List<UnionOfTileEntitiesAndBooleansForFluids> uoteab = new ArrayList<UnionOfTileEntitiesAndBooleansForFluids>();
|
||||
|
||||
|
||||
public ForgeDirection[] connections = new ForgeDirection[6];
|
||||
|
||||
@ -41,7 +41,7 @@ public class TileEntityMachineHydrotreater extends TileEntityMachineBase impleme
|
||||
this.tanks = new FluidTank[4];
|
||||
this.tanks[0] = new FluidTank(Fluids.OIL, 64_000);
|
||||
this.tanks[1] = new FluidTank(Fluids.HYDROGEN, 64_000).withPressure(1);
|
||||
this.tanks[2] = new FluidTank(Fluids.NONE, 24_000);
|
||||
this.tanks[2] = new FluidTank(Fluids.OIL_DS, 24_000);
|
||||
this.tanks[3] = new FluidTank(Fluids.SOURGAS, 24_000);
|
||||
}
|
||||
|
||||
@ -107,14 +107,14 @@ public class TileEntityMachineHydrotreater extends TileEntityMachineBase impleme
|
||||
tanks[3].setTankType(out.getZ().type);
|
||||
|
||||
if(power < 20_000) return;
|
||||
if(tanks[0].getFill() < 50) return;
|
||||
if(tanks[0].getFill() < 100) return;
|
||||
if(tanks[1].getFill() < out.getX().fill) return;
|
||||
if(slots[10] == null || slots[10].getItem() != ModItems.catalytic_converter) return;
|
||||
|
||||
if(tanks[2].getFill() + out.getY().fill > tanks[2].getMaxFill()) return;
|
||||
if(tanks[3].getFill() + out.getZ().fill > tanks[3].getMaxFill()) return;
|
||||
|
||||
tanks[0].setFill(tanks[0].getFill() - 50);
|
||||
tanks[0].setFill(tanks[0].getFill() - 100);
|
||||
tanks[1].setFill(tanks[1].getFill() - out.getX().fill);
|
||||
tanks[2].setFill(tanks[2].getFill() + out.getY().fill);
|
||||
tanks[3].setFill(tanks[3].getFill() + out.getZ().fill);
|
||||
|
||||
@ -4277,6 +4277,7 @@ tile.nuke_tsar.name=Tsar Bombe
|
||||
tile.oil_duct.name=Ölrohr
|
||||
tile.oil_duct_solid.name=Verstärktes Ölrohr
|
||||
tile.oil_pipe.name=Rohölrohr
|
||||
tile.oil_spill.name=Ölteppich
|
||||
tile.ore_alexandrite.name=Alexandriterz
|
||||
tile.ore_aluminium.name=Aluminiumerz
|
||||
tile.ore_asbestos.name=Asbesterz
|
||||
|
||||
@ -5291,6 +5291,7 @@ tile.nuke_tsar.name=Tsar Bomba
|
||||
tile.oil_duct.name=Oil Pipe
|
||||
tile.oil_duct_solid.name=Coated Oil Pipe
|
||||
tile.oil_pipe.name=Crude Oil Extraction Pipe
|
||||
tile.oil_spill.name=Oil Spill
|
||||
tile.ore_alexandrite.name=Alexandrite Ore
|
||||
tile.ore_aluminium.name=Aluminium Ore
|
||||
tile.ore_asbestos.name=Asbestos Ore
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/items/wire_carbon.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/wire_carbon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 332 B |
Loading…
x
Reference in New Issue
Block a user