5e379f052a
Conflicts: common/mekanism/api/GasNetwork.java common/mekanism/common/EnergyNetwork.java common/mekanism/common/FluidNetwork.java common/mekanism/common/InventoryNetwork.java common/mekanism/common/TileEntityEnergyCube.java common/mekanism/generators/common/TileEntityGenerator.java
41 lines
954 B
Java
41 lines
954 B
Java
package mekanism.client;
|
|
|
|
import java.util.List;
|
|
|
|
import mekanism.api.DynamicNetwork.NetworkFinder;
|
|
import mekanism.api.Object3D;
|
|
import mekanism.api.TransmissionType;
|
|
import mekanism.common.TileEntityUniversalCable;
|
|
import net.minecraft.tileentity.TileEntity;
|
|
import net.minecraft.world.World;
|
|
|
|
public class EnergyClientUpdate
|
|
{
|
|
public NetworkFinder finder;
|
|
|
|
public World worldObj;
|
|
|
|
public double energyScale;
|
|
|
|
public EnergyClientUpdate(TileEntity head, double power)
|
|
{
|
|
worldObj = head.worldObj;
|
|
energyScale = power;
|
|
finder = new NetworkFinder(head.worldObj, TransmissionType.ENERGY, Object3D.get(head));
|
|
}
|
|
|
|
public void clientUpdate()
|
|
{
|
|
List<Object3D> found = finder.exploreNetwork();
|
|
|
|
for(Object3D object : found)
|
|
{
|
|
TileEntity tileEntity = object.getTileEntity(worldObj);
|
|
|
|
if(tileEntity instanceof TileEntityUniversalCable)
|
|
{
|
|
((TileEntityUniversalCable)tileEntity).setCachedEnergy(energyScale);
|
|
}
|
|
}
|
|
}
|
|
}
|