mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
tiny bit of more fluid IO stuff
This commit is contained in:
parent
3f02f23096
commit
9f7c95f79b
@ -21,7 +21,6 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
@ -5,6 +5,8 @@ import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
import com.hbm.world.feature.OilSpot;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@ -24,11 +26,6 @@ public class TileEntityMachineFrackingTower extends TileEntityOilDrillBase imple
|
||||
return "container.frackingTower";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateConnections() {
|
||||
this.updateStandardConnections(worldObj, xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return 5_000_000;
|
||||
@ -113,4 +110,32 @@ public class TileEntityMachineFrackingTower extends TileEntityOilDrillBase imple
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
return type == tanks[2].getTankType() ? tanks[2].getMaxFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] { tanks[0], tanks[1] };
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] { tanks[2] };
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirPos[] getConPos() {
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + 1, yCoord, zCoord, Library.POS_X),
|
||||
new DirPos(xCoord - 1, yCoord, zCoord, Library.NEG_X),
|
||||
new DirPos(xCoord, yCoord, zCoord + 1, Library.POS_Z),
|
||||
new DirPos(xCoord, yCoord, zCoord - 1, Library.NEG_Z)
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateConnections() {
|
||||
for(DirPos pos : getConPos()) {
|
||||
this.trySubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
this.trySubscribe(tanks[2].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,6 +16,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 cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -27,7 +28,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityMachineGasFlare extends TileEntityLoadedBase implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
public class TileEntityMachineGasFlare extends TileEntityLoadedBase implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor, IFluidStandardReceiver {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
@ -216,6 +217,11 @@ public class TileEntityMachineGasFlare extends TileEntityLoadedBase implements I
|
||||
this.sendPower(worldObj, xCoord - 2, yCoord, zCoord, Library.NEG_X);
|
||||
this.sendPower(worldObj, xCoord, yCoord, zCoord + 2, Library.POS_Z);
|
||||
this.sendPower(worldObj, xCoord, yCoord, zCoord - 2, Library.NEG_Z);
|
||||
|
||||
this.trySubscribe(tank.getTankType(), worldObj, xCoord + 2, yCoord, zCoord, Library.POS_X);
|
||||
this.trySubscribe(tank.getTankType(), worldObj, xCoord - 2, yCoord, zCoord, Library.NEG_X);
|
||||
this.trySubscribe(tank.getTankType(), worldObj, xCoord, yCoord, zCoord + 2, Library.POS_Z);
|
||||
this.trySubscribe(tank.getTankType(), worldObj, xCoord, yCoord, zCoord - 2, Library.NEG_Z);
|
||||
|
||||
tank.loadTank(1, 2, slots);
|
||||
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
@ -293,4 +299,9 @@ public class TileEntityMachineGasFlare extends TileEntityLoadedBase implements I
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] { tank };
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -17,14 +18,6 @@ public class TileEntityMachineOilWell extends TileEntityOilDrillBase {
|
||||
return "container.oilWell";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateConnections() {
|
||||
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord, Library.POS_X);
|
||||
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord, Library.NEG_X);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 2, Library.POS_Z);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 2, Library.NEG_Z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return 100_000;
|
||||
@ -108,4 +101,14 @@ public class TileEntityMachineOilWell extends TileEntityOilDrillBase {
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirPos[] getConPos() {
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + 2, yCoord, zCoord, Library.POS_X),
|
||||
new DirPos(xCoord - 2, yCoord, zCoord, Library.NEG_X),
|
||||
new DirPos(xCoord, yCoord, zCoord + 2, Library.POS_Z),
|
||||
new DirPos(xCoord, yCoord, zCoord - 2, Library.NEG_Z)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,8 @@ package com.hbm.tileentity.machine.oil;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -22,18 +24,6 @@ public class TileEntityMachinePumpjack extends TileEntityOilDrillBase {
|
||||
return "container.pumpjack";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateConnections() {
|
||||
this.getBlockMetadata();
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.blockMetadata - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
|
||||
|
||||
this.trySubscribe(worldObj, xCoord + rot.offsetX * 2 + dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 2 + dir.offsetZ * 2, ForgeDirection.UNKNOWN); //brain overheating, do this shit somewhen else
|
||||
this.trySubscribe(worldObj, xCoord + rot.offsetX * 2 + dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 4 - dir.offsetZ * 2, ForgeDirection.UNKNOWN);
|
||||
this.trySubscribe(worldObj, xCoord + rot.offsetX * 4 - dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 4 + dir.offsetZ * 2, ForgeDirection.UNKNOWN);
|
||||
this.trySubscribe(worldObj, xCoord + rot.offsetX * 4 - dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 2 - dir.offsetZ * 2, ForgeDirection.UNKNOWN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return 250_000;
|
||||
@ -158,4 +148,18 @@ public class TileEntityMachinePumpjack extends TileEntityOilDrillBase {
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirPos[] getConPos() {
|
||||
this.getBlockMetadata();
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.blockMetadata - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
|
||||
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + rot.offsetX * 2 + dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 2 + dir.offsetZ * 2, dir),
|
||||
new DirPos(xCoord + rot.offsetX * 2 + dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 4 - dir.offsetZ * 2, dir.getOpposite()),
|
||||
new DirPos(xCoord + rot.offsetX * 4 - dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 4 + dir.offsetZ * 2, dir),
|
||||
new DirPos(xCoord + rot.offsetX * 4 - dir.offsetX * 2, yCoord, zCoord + rot.offsetZ * 2 - dir.offsetZ * 2, dir.getOpposite())
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,8 +18,10 @@ import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.Tuple;
|
||||
import com.hbm.util.Tuple.Triplet;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
@ -29,7 +31,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public abstract class TileEntityOilDrillBase extends TileEntityMachineBase implements IEnergyUser, IFluidSource {
|
||||
public abstract class TileEntityOilDrillBase extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidStandardTransceiver {
|
||||
|
||||
public int indicator = 0;
|
||||
|
||||
@ -135,8 +137,6 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void updateConnections();
|
||||
|
||||
public void sendUpdate() {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
@ -329,4 +329,22 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[0];
|
||||
}
|
||||
|
||||
public abstract DirPos[] getConPos();
|
||||
|
||||
protected void updateConnections() {
|
||||
for(DirPos pos : getConPos()) {
|
||||
this.trySubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user