2013-06-26 23:49:47 +02:00
|
|
|
package mekanism.client;
|
|
|
|
|
2013-08-06 00:58:24 +02:00
|
|
|
import java.util.List;
|
2013-06-26 23:49:47 +02:00
|
|
|
|
2013-08-22 17:36:31 +02:00
|
|
|
import mekanism.api.DynamicNetwork.NetworkFinder;
|
2013-08-06 00:58:24 +02:00
|
|
|
import mekanism.api.Object3D;
|
2013-08-22 20:07:28 +02:00
|
|
|
import mekanism.api.TransmissionType;
|
2013-08-19 03:32:47 +02:00
|
|
|
import mekanism.common.TileEntityMechanicalPipe;
|
2013-06-26 23:49:47 +02:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2013-08-06 00:58:24 +02:00
|
|
|
import net.minecraft.world.World;
|
2013-07-20 18:10:14 +02:00
|
|
|
import net.minecraftforge.fluids.FluidStack;
|
2013-06-26 23:49:47 +02:00
|
|
|
|
2013-07-20 18:10:14 +02:00
|
|
|
public class FluidClientUpdate
|
2013-06-26 23:49:47 +02:00
|
|
|
{
|
2013-08-06 00:58:24 +02:00
|
|
|
public NetworkFinder finder;
|
2013-06-26 23:49:47 +02:00
|
|
|
|
2013-08-06 00:58:24 +02:00
|
|
|
public World worldObj;
|
2013-06-26 23:49:47 +02:00
|
|
|
|
2013-08-06 00:58:24 +02:00
|
|
|
public FluidStack fluidStack;
|
2013-06-26 23:49:47 +02:00
|
|
|
|
2013-07-20 18:10:14 +02:00
|
|
|
public FluidClientUpdate(TileEntity head, FluidStack fluid)
|
2013-06-26 23:49:47 +02:00
|
|
|
{
|
2013-08-06 00:58:24 +02:00
|
|
|
worldObj = head.worldObj;
|
|
|
|
fluidStack = fluid;
|
2013-08-22 20:07:28 +02:00
|
|
|
finder = new NetworkFinder(head.worldObj, TransmissionType.FLUID, Object3D.get(head));
|
2013-06-26 23:49:47 +02:00
|
|
|
}
|
2013-08-06 00:58:24 +02:00
|
|
|
|
2013-06-26 23:49:47 +02:00
|
|
|
public void clientUpdate()
|
|
|
|
{
|
2013-08-06 00:58:24 +02:00
|
|
|
List<Object3D> found = finder.exploreNetwork();
|
2013-06-26 23:49:47 +02:00
|
|
|
|
2013-08-06 00:58:24 +02:00
|
|
|
for(Object3D object : found)
|
2013-06-26 23:49:47 +02:00
|
|
|
{
|
2013-08-06 00:58:24 +02:00
|
|
|
TileEntity tileEntity = object.getTileEntity(worldObj);
|
|
|
|
|
2013-08-19 03:32:47 +02:00
|
|
|
if(tileEntity instanceof TileEntityMechanicalPipe)
|
2013-06-26 23:49:47 +02:00
|
|
|
{
|
2013-08-19 03:32:47 +02:00
|
|
|
((TileEntityMechanicalPipe)tileEntity).onTransfer(fluidStack);
|
2013-06-26 23:49:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|