mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
new fluid net test
This commit is contained in:
parent
62f819daca
commit
ded8b00310
@ -80,5 +80,5 @@ public interface IFluidConnector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final boolean particleDebug = false;
|
public static final boolean particleDebug = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,4 +37,14 @@ public interface IFluidStandardSender extends IFluidUser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public default long transferFluid(FluidType type, long fluid) {
|
||||||
|
return fluid;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public default long getDemand(FluidType type) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,9 +25,10 @@ import com.hbm.tileentity.TileEntityLoadedBase;
|
|||||||
|
|
||||||
import api.hbm.energy.IBatteryItem;
|
import api.hbm.energy.IBatteryItem;
|
||||||
import api.hbm.energy.IEnergyGenerator;
|
import api.hbm.energy.IEnergyGenerator;
|
||||||
|
import api.hbm.fluid.IFluidStandardReceiver;
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
|
|
||||||
public class TileEntityMachineCoal extends TileEntityLoadedBase implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
public class TileEntityMachineCoal extends TileEntityLoadedBase implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor, IFluidStandardReceiver {
|
||||||
|
|
||||||
private ItemStack slots[];
|
private ItemStack slots[];
|
||||||
|
|
||||||
@ -225,6 +226,8 @@ public class TileEntityMachineCoal extends TileEntityLoadedBase implements ISide
|
|||||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||||
this.sendPower(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
|
this.sendPower(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
|
||||||
|
|
||||||
|
this.updateStandardPipes(Fluids.WATER, worldObj, xCoord, yCoord, zCoord);
|
||||||
|
|
||||||
//Water
|
//Water
|
||||||
tank.loadTank(0, 3, slots);
|
tank.loadTank(0, 3, slots);
|
||||||
|
|
||||||
@ -335,4 +338,9 @@ public class TileEntityMachineCoal extends TileEntityLoadedBase implements ISide
|
|||||||
public void setTypeForSync(FluidType type, int index) {
|
public void setTypeForSync(FluidType type, int index) {
|
||||||
tank.setTankType(type);
|
tank.setTankType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FluidTank[] getReceivingTanks() {
|
||||||
|
return new FluidTank[] {tank};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,12 +14,14 @@ import com.hbm.lib.Library;
|
|||||||
import com.hbm.main.ModEventHandler;
|
import com.hbm.main.ModEventHandler;
|
||||||
import com.hbm.tileentity.TileEntityMachineBase;
|
import com.hbm.tileentity.TileEntityMachineBase;
|
||||||
|
|
||||||
|
import api.hbm.fluid.IFluidStandardSender;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.EnumSkyBlock;
|
import net.minecraft.world.EnumSkyBlock;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcceptor, IFluidSource {
|
public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcceptor, IFluidSource, IFluidStandardSender {
|
||||||
|
|
||||||
public FluidTank tank;
|
public FluidTank tank;
|
||||||
public short mode = 0;
|
public short mode = 0;
|
||||||
@ -52,6 +54,8 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
|||||||
tank.unloadTank(4, 5, slots);
|
tank.unloadTank(4, 5, slots);
|
||||||
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||||
|
|
||||||
|
this.sendFluid(tank.getTankType(), worldObj, xCoord, yCoord - 1, zCoord, ForgeDirection.DOWN);
|
||||||
|
|
||||||
age++;
|
age++;
|
||||||
if(age >= 20)
|
if(age >= 20)
|
||||||
age = 0;
|
age = 0;
|
||||||
@ -200,4 +204,9 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
|||||||
nbt.setShort("mode", mode);
|
nbt.setShort("mode", mode);
|
||||||
tank.writeToNBT(nbt, "tank");
|
tank.writeToNBT(nbt, "tank");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FluidTank[] getSendingTanks() {
|
||||||
|
return new FluidTank[] {tank};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||||||
public class TileEntityPipeBaseNT extends TileEntity implements IFluidConductor {
|
public class TileEntityPipeBaseNT extends TileEntity implements IFluidConductor {
|
||||||
|
|
||||||
private IPipeNet network;
|
private IPipeNet network;
|
||||||
protected FluidType type = Fluids.NONE;
|
protected FluidType type = Fluids.WATER;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity() {
|
public void updateEntity() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user