mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
a ton of new fluid API users
This commit is contained in:
parent
3b858df7ba
commit
f7bdf1d632
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
@ -32,9 +33,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineReactorLarge extends TileEntity
|
||||
implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource {
|
||||
public class TileEntityMachineReactorLarge extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource, IFluidStandardTransceiver {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
@ -401,9 +402,8 @@ public class TileEntityMachineReactorLarge extends TileEntity
|
||||
if (age >= 20) {
|
||||
age = 0;
|
||||
}
|
||||
|
||||
if (age == 9 || age == 19)
|
||||
fillFluidInit(tanks[2].getTankType());
|
||||
|
||||
fillFluidInit(tanks[2].getTankType());
|
||||
|
||||
caluclateSize();
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, size, 3), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
@ -758,30 +758,27 @@ public class TileEntityMachineReactorLarge extends TileEntity
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
|
||||
if(worldObj.getBlock(xCoord - 2, yCoord, zCoord) == ModBlocks.reactor_hatch)
|
||||
fillFluid(this.xCoord - 3, this.yCoord, this.zCoord, getTact(), type);
|
||||
|
||||
if(worldObj.getBlock(xCoord + 2, yCoord, zCoord) == ModBlocks.reactor_hatch)
|
||||
fillFluid(this.xCoord + 3, this.yCoord, this.zCoord, getTact(), type);
|
||||
|
||||
if(worldObj.getBlock(xCoord, yCoord, zCoord - 2) == ModBlocks.reactor_hatch)
|
||||
fillFluid(this.xCoord, this.yCoord, this.zCoord - 3, getTact(), type);
|
||||
|
||||
if(worldObj.getBlock(xCoord, yCoord, zCoord + 2) == ModBlocks.reactor_hatch)
|
||||
fillFluid(this.xCoord, this.yCoord, this.zCoord + 3, getTact(), type);
|
||||
for(ForgeDirection dir : new ForgeDirection[] {Library.POS_X, Library.NEG_X, Library.POS_Z, Library.NEG_Z}) {
|
||||
|
||||
if(worldObj.getBlock(xCoord + dir.offsetX * 2, yCoord, zCoord + dir.offsetZ * 2) == ModBlocks.reactor_hatch) {
|
||||
fillFluid(this.xCoord + dir.offsetX * 3, this.yCoord, this.zCoord + dir.offsetZ * 3, getTact(), type);
|
||||
for(int i = 0; i < 2; i++) this.trySubscribe(tanks[i].getTankType(), worldObj, this.xCoord + dir.offsetX * 3, this.yCoord, this.zCoord + dir.offsetZ * 3, Library.NEG_X);
|
||||
this.sendFluid(tanks[2].getTankType(), worldObj, this.xCoord + dir.offsetX * 3, this.yCoord, this.zCoord + dir.offsetZ * 3, Library.NEG_X);
|
||||
} else {
|
||||
for(int i = 0; i < 2; i++) this.tryUnsubscribe(tanks[i].getTankType(), worldObj, this.xCoord + dir.offsetX * 3, this.yCoord, this.zCoord + dir.offsetZ * 3);
|
||||
}
|
||||
}
|
||||
|
||||
fillFluid(this.xCoord, this.yCoord + height + 1, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord, this.yCoord - depth - 1, this.zCoord, getTact(), type);
|
||||
|
||||
fillFluid(this.xCoord, this.yCoord - depth - 1, this.zCoord + 3, getTact(), type);
|
||||
this.sendFluid(tanks[2].getTankType(), worldObj, this.xCoord, this.yCoord + height + 1, this.zCoord, Library.POS_Y);
|
||||
this.sendFluid(tanks[2].getTankType(), worldObj, this.xCoord, this.yCoord - depth - 1, this.zCoord, Library.NEG_Y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
if (age >= 0 && age < 10) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return this.worldObj.getTotalWorldTime() % 2 == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -983,4 +980,19 @@ public class TileEntityMachineReactorLarge extends TileEntity
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] {tanks[2]};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {tanks[0], tanks[1]};
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@ import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -32,7 +33,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineSeleniumEngine extends TileEntityLoadedBase implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor, IConfigurableMachine {
|
||||
public class TileEntityMachineSeleniumEngine extends TileEntityLoadedBase implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor, IFluidStandardReceiver, IConfigurableMachine {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
@ -231,6 +232,7 @@ public class TileEntityMachineSeleniumEngine extends TileEntityLoadedBase implem
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
|
||||
this.subscribeToAllAround(tank.getTankType(), this);
|
||||
this.sendPower(worldObj, xCoord, yCoord - 1, zCoord, ForgeDirection.DOWN);
|
||||
|
||||
pistonCount = countPistons();
|
||||
@ -401,4 +403,14 @@ public class TileEntityMachineSeleniumEngine extends TileEntityLoadedBase implem
|
||||
writer.endArray().setIndent(" ");
|
||||
writer.name("B:shutUp").value(shutUp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return new FluidTank[] {tank};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {tank};
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,11 +45,11 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
|
||||
public TileEntityMachineRefinery() {
|
||||
super(12);
|
||||
tanks = new FluidTank[5];
|
||||
tanks[0] = new FluidTank(Fluids.HOTOIL, 64000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.HEAVYOIL, 16000, 1);
|
||||
tanks[2] = new FluidTank(Fluids.NAPHTHA, 16000, 2);
|
||||
tanks[3] = new FluidTank(Fluids.LIGHTOIL, 16000, 3);
|
||||
tanks[4] = new FluidTank(Fluids.PETROLEUM, 16000, 4);
|
||||
tanks[0] = new FluidTank(Fluids.HOTOIL, 64_000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.HEAVYOIL, 24_000, 1);
|
||||
tanks[2] = new FluidTank(Fluids.NAPHTHA, 24_000, 2);
|
||||
tanks[3] = new FluidTank(Fluids.LIGHTOIL, 24_000, 3);
|
||||
tanks[4] = new FluidTank(Fluids.PETROLEUM, 24_000, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine.rbmk;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -14,7 +15,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityHeatex extends TileEntity implements IFluidAcceptor, IFluidSource {
|
||||
public class TileEntityHeatex extends TileEntity implements IFluidAcceptor, IFluidSource, IFluidStandardTransceiver {
|
||||
|
||||
public List<IFluidAcceptor> coolantList = new ArrayList();
|
||||
public List<IFluidAcceptor> waterList = new ArrayList();
|
||||
@ -37,6 +38,11 @@ public class TileEntityHeatex extends TileEntity implements IFluidAcceptor, IFlu
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
this.subscribeToAllAround(waterIn.getTankType(), this);
|
||||
this.subscribeToAllAround(coolantIn.getTankType(), this);
|
||||
}
|
||||
|
||||
/* Cool input */
|
||||
double heatCap = maxHeat - heatBuffer;
|
||||
int fillCap = coolantOut.getMaxFill() - coolantOut.getFill();
|
||||
@ -68,6 +74,9 @@ public class TileEntityHeatex extends TileEntity implements IFluidAcceptor, IFlu
|
||||
|
||||
this.fillFluidInit(coolantOut.getTankType());
|
||||
this.fillFluidInit(waterOut.getTankType());
|
||||
|
||||
this.sendFluidToAll(waterOut.getTankType(), this);
|
||||
this.sendFluidToAll(coolantOut.getTankType(), this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,4 +173,19 @@ public class TileEntityHeatex extends TileEntity implements IFluidAcceptor, IFlu
|
||||
if(type == waterIn.getTankType()) return waterIn.getMaxFill();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return new FluidTank[] {waterIn, waterOut, coolantIn, coolantOut};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] {waterOut, coolantOut};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {waterIn, coolantIn};
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine.rbmk;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
@ -13,12 +14,13 @@ import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource, IControlReceiver {
|
||||
public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource, IControlReceiver, IFluidStandardTransceiver {
|
||||
|
||||
public FluidTank feed;
|
||||
public FluidTank steam;
|
||||
@ -76,6 +78,11 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
}
|
||||
|
||||
fillFluidInit(steam.getTankType());
|
||||
|
||||
this.trySubscribe(feed.getTankType(), worldObj, xCoord, yCoord - 1, zCoord, Library.NEG_Y);
|
||||
for(DirPos pos : getOutputPos()) {
|
||||
if(this.steam.getFill() > 0) this.sendFluid(steam.getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
|
||||
super.updateEntity();
|
||||
@ -121,6 +128,33 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
fillFluid(this.xCoord, this.yCoord - 3, this.zCoord, getTact(), type);
|
||||
}
|
||||
}
|
||||
|
||||
protected DirPos[] getOutputPos() {
|
||||
|
||||
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.rbmk_loader) {
|
||||
return new DirPos[] {
|
||||
new DirPos(this.xCoord + 1, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, Library.POS_Y),
|
||||
new DirPos(this.xCoord + 1, this.yCoord - 1, this.zCoord, Library.POS_X),
|
||||
new DirPos(this.xCoord - 1, this.yCoord - 1, this.zCoord, Library.NEG_X),
|
||||
new DirPos(this.xCoord, this.yCoord - 1, this.zCoord + 1, Library.POS_Z),
|
||||
new DirPos(this.xCoord, this.yCoord - 1, this.zCoord - 1, Library.NEG_Z),
|
||||
new DirPos(this.xCoord, this.yCoord - 2, this.zCoord, Library.NEG_Y)
|
||||
};
|
||||
} else if(worldObj.getBlock(xCoord, yCoord - 2, zCoord) == ModBlocks.rbmk_loader) {
|
||||
return new DirPos[] {
|
||||
new DirPos(this.xCoord + 1, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, Library.POS_Y),
|
||||
new DirPos(this.xCoord + 1, this.yCoord - 2, this.zCoord, Library.POS_X),
|
||||
new DirPos(this.xCoord - 1, this.yCoord - 2, this.zCoord, Library.NEG_X),
|
||||
new DirPos(this.xCoord, this.yCoord - 2, this.zCoord + 1, Library.POS_Z),
|
||||
new DirPos(this.xCoord, this.yCoord - 2, this.zCoord - 1, Library.NEG_Z),
|
||||
new DirPos(this.xCoord, this.yCoord - 3, this.zCoord, Library.NEG_Y)
|
||||
};
|
||||
} else {
|
||||
return new DirPos[] {
|
||||
new DirPos(this.xCoord + 1, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, Library.POS_Y)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
||||
@ -253,4 +287,19 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
data.setShort("type", (short)this.steam.getTankType().getID());
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return new FluidTank[] {feed, steam};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] {steam};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {feed};
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine.rbmk;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
@ -12,10 +13,11 @@ import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource {
|
||||
public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource, IFluidStandardTransceiver {
|
||||
|
||||
public FluidTank feed;
|
||||
public FluidTank steam;
|
||||
@ -58,11 +60,43 @@ public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements I
|
||||
}
|
||||
|
||||
fillFluidInit(steam.getTankType());
|
||||
|
||||
this.trySubscribe(feed.getTankType(), worldObj, xCoord, yCoord - 1, zCoord, Library.NEG_Y);
|
||||
for(DirPos pos : getOutputPos()) {
|
||||
if(this.steam.getFill() > 0) this.sendFluid(steam.getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
|
||||
super.updateEntity();
|
||||
}
|
||||
|
||||
protected DirPos[] getOutputPos() {
|
||||
|
||||
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.rbmk_loader) {
|
||||
return new DirPos[] {
|
||||
new DirPos(this.xCoord + 1, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, Library.POS_Y),
|
||||
new DirPos(this.xCoord + 1, this.yCoord - 1, this.zCoord, Library.POS_X),
|
||||
new DirPos(this.xCoord - 1, this.yCoord - 1, this.zCoord, Library.NEG_X),
|
||||
new DirPos(this.xCoord, this.yCoord - 1, this.zCoord + 1, Library.POS_Z),
|
||||
new DirPos(this.xCoord, this.yCoord - 1, this.zCoord - 1, Library.NEG_Z),
|
||||
new DirPos(this.xCoord, this.yCoord - 2, this.zCoord, Library.NEG_Y)
|
||||
};
|
||||
} else if(worldObj.getBlock(xCoord, yCoord - 2, zCoord) == ModBlocks.rbmk_loader) {
|
||||
return new DirPos[] {
|
||||
new DirPos(this.xCoord + 1, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, Library.POS_Y),
|
||||
new DirPos(this.xCoord + 1, this.yCoord - 2, this.zCoord, Library.POS_X),
|
||||
new DirPos(this.xCoord - 1, this.yCoord - 2, this.zCoord, Library.NEG_X),
|
||||
new DirPos(this.xCoord, this.yCoord - 2, this.zCoord + 1, Library.POS_Z),
|
||||
new DirPos(this.xCoord, this.yCoord - 2, this.zCoord - 1, Library.NEG_Z),
|
||||
new DirPos(this.xCoord, this.yCoord - 3, this.zCoord, Library.NEG_Y)
|
||||
};
|
||||
} else {
|
||||
return new DirPos[] {
|
||||
new DirPos(this.xCoord + 1, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, Library.POS_Y)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static double getConversionHeat(FluidType type) {
|
||||
return getConversion(type).temperature;
|
||||
}
|
||||
@ -210,4 +244,19 @@ public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements I
|
||||
data.setShort("hottype", (short)this.steam.getTankType().getID());
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return new FluidTank[] {feed, steam};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] {steam};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {feed};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import com.hbm.blocks.machine.rbmk.RBMKBase;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -11,7 +12,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityRBMKInlet extends TileEntity implements IFluidAcceptor {
|
||||
public class TileEntityRBMKInlet extends TileEntity implements IFluidAcceptor, IFluidStandardReceiver {
|
||||
|
||||
public FluidTank water;
|
||||
|
||||
@ -28,6 +29,8 @@ public class TileEntityRBMKInlet extends TileEntity implements IFluidAcceptor {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||
Block b = worldObj.getBlock(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
|
||||
|
||||
this.trySubscribe(water.getTankType(), worldObj, xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ, dir);
|
||||
|
||||
if(b instanceof RBMKBase) {
|
||||
int[] pos = ((RBMKBase)b).findCore(worldObj, xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
|
||||
|
||||
@ -86,4 +89,14 @@ public class TileEntityRBMKInlet extends TileEntity implements IFluidAcceptor {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return new FluidTank[] {water};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {water};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardSender;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
@ -16,13 +17,14 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implements IRBMKFluxReceiver, IFluidSource {
|
||||
public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implements IRBMKFluxReceiver, IFluidSource, IFluidStandardSender {
|
||||
|
||||
public List<IFluidAcceptor> list = new ArrayList();
|
||||
public FluidTank gas;
|
||||
@ -51,10 +53,40 @@ public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implement
|
||||
if(!canProcess()) {
|
||||
this.progress = 0;
|
||||
}
|
||||
for(DirPos pos : getOutputPos()) {
|
||||
if(this.gas.getFill() > 0) this.sendFluid(gas.getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
|
||||
super.updateEntity();
|
||||
}
|
||||
|
||||
protected DirPos[] getOutputPos() {
|
||||
|
||||
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.rbmk_loader) {
|
||||
return new DirPos[] {
|
||||
new DirPos(this.xCoord + 1, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, Library.POS_Y),
|
||||
new DirPos(this.xCoord + 1, this.yCoord - 1, this.zCoord, Library.POS_X),
|
||||
new DirPos(this.xCoord - 1, this.yCoord - 1, this.zCoord, Library.NEG_X),
|
||||
new DirPos(this.xCoord, this.yCoord - 1, this.zCoord + 1, Library.POS_Z),
|
||||
new DirPos(this.xCoord, this.yCoord - 1, this.zCoord - 1, Library.NEG_Z),
|
||||
new DirPos(this.xCoord, this.yCoord - 2, this.zCoord, Library.NEG_Y)
|
||||
};
|
||||
} else if(worldObj.getBlock(xCoord, yCoord - 2, zCoord) == ModBlocks.rbmk_loader) {
|
||||
return new DirPos[] {
|
||||
new DirPos(this.xCoord + 1, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, Library.POS_Y),
|
||||
new DirPos(this.xCoord + 1, this.yCoord - 2, this.zCoord, Library.POS_X),
|
||||
new DirPos(this.xCoord - 1, this.yCoord - 2, this.zCoord, Library.NEG_X),
|
||||
new DirPos(this.xCoord, this.yCoord - 2, this.zCoord + 1, Library.POS_Z),
|
||||
new DirPos(this.xCoord, this.yCoord - 2, this.zCoord - 1, Library.NEG_Z),
|
||||
new DirPos(this.xCoord, this.yCoord - 3, this.zCoord, Library.NEG_Y)
|
||||
};
|
||||
} else {
|
||||
return new DirPos[] {
|
||||
new DirPos(this.xCoord + 1, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, Library.POS_Y)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveFlux(NType type, double flux) {
|
||||
@ -280,4 +312,14 @@ public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implement
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return new int[] {0, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return new FluidTank[] {gas};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] {gas};
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine.rbmk;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardSender;
|
||||
import com.hbm.blocks.machine.rbmk.RBMKBase;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
@ -16,7 +17,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityRBMKOutlet extends TileEntity implements IFluidSource {
|
||||
public class TileEntityRBMKOutlet extends TileEntity implements IFluidSource, IFluidStandardSender {
|
||||
|
||||
public List<IFluidAcceptor> list = new ArrayList();
|
||||
public FluidTank steam;
|
||||
@ -52,6 +53,7 @@ public class TileEntityRBMKOutlet extends TileEntity implements IFluidSource {
|
||||
}
|
||||
|
||||
fillFluidInit(this.steam.getTankType());
|
||||
this.sendFluidToAll(steam.getTankType(), this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,4 +114,14 @@ public class TileEntityRBMKOutlet extends TileEntity implements IFluidSource {
|
||||
this.list.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return new FluidTank[] {steam};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] {steam};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user