2013-08-27 00:49:32 +02:00
|
|
|
package mekanism.api.transmitters;
|
2013-08-16 17:56:42 +02:00
|
|
|
|
2013-08-22 17:36:31 +02:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Collection;
|
2013-08-17 19:32:05 +02:00
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashSet;
|
2013-11-25 06:00:26 +01:00
|
|
|
import java.util.Iterator;
|
2013-12-21 21:58:59 +01:00
|
|
|
import java.util.LinkedHashSet;
|
2013-08-22 17:36:31 +02:00
|
|
|
import java.util.List;
|
2013-08-17 19:32:05 +02:00
|
|
|
import java.util.NoSuchElementException;
|
|
|
|
import java.util.Set;
|
2013-08-25 18:17:56 +02:00
|
|
|
|
2013-12-20 22:09:09 +01:00
|
|
|
import mekanism.api.Coord4D;
|
2013-12-21 21:58:59 +01:00
|
|
|
import mekanism.api.IClientTicker;
|
2013-11-25 06:00:26 +01:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2013-08-17 19:32:05 +02:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2013-08-22 17:36:31 +02:00
|
|
|
import net.minecraft.world.World;
|
2013-08-17 19:32:05 +02:00
|
|
|
import net.minecraftforge.common.ForgeDirection;
|
2013-11-30 06:28:02 +01:00
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
|
|
|
import net.minecraftforge.event.Event;
|
2013-11-29 03:43:53 +01:00
|
|
|
import cpw.mods.fml.common.FMLCommonHandler;
|
2013-08-17 19:32:05 +02:00
|
|
|
|
2013-12-06 13:57:26 +01:00
|
|
|
public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implements ITransmitterNetwork<A, N>, IClientTicker
|
2013-08-16 17:56:42 +02:00
|
|
|
{
|
2013-12-21 21:58:59 +01:00
|
|
|
public LinkedHashSet<IGridTransmitter<N>> transmitters = new LinkedHashSet<IGridTransmitter<N>>();
|
2013-08-17 19:32:05 +02:00
|
|
|
|
2013-11-13 02:19:06 +01:00
|
|
|
public HashSet<A> possibleAcceptors = new HashSet<A>();
|
|
|
|
public HashMap<A, ForgeDirection> acceptorDirections = new HashMap<A, ForgeDirection>();
|
2013-08-17 19:32:05 +02:00
|
|
|
|
2013-11-25 06:00:26 +01:00
|
|
|
private List<DelayQueue> updateQueue = new ArrayList<DelayQueue>();
|
|
|
|
|
2013-08-16 17:56:42 +02:00
|
|
|
protected int ticksSinceCreate = 0;
|
|
|
|
|
|
|
|
protected boolean fixed = false;
|
2013-08-17 19:32:05 +02:00
|
|
|
|
2013-11-25 06:00:26 +01:00
|
|
|
protected boolean needsUpdate = false;
|
|
|
|
|
2013-12-21 01:12:33 +01:00
|
|
|
protected abstract ITransmitterNetwork<A, N> create(IGridTransmitter<N>... varTransmitters);
|
2013-08-22 17:36:31 +02:00
|
|
|
|
2013-12-21 01:12:33 +01:00
|
|
|
protected abstract ITransmitterNetwork<A, N> create(Collection<IGridTransmitter<N>> collection);
|
2013-08-22 17:36:31 +02:00
|
|
|
|
2013-12-06 13:57:26 +01:00
|
|
|
protected abstract ITransmitterNetwork<A, N> create(Set<N> networks);
|
2013-08-22 17:36:31 +02:00
|
|
|
|
2013-12-21 01:12:33 +01:00
|
|
|
public void addAllTransmitters(Set<IGridTransmitter<N>> newTransmitters)
|
2013-08-17 19:32:05 +02:00
|
|
|
{
|
|
|
|
transmitters.addAll(newTransmitters);
|
|
|
|
}
|
|
|
|
|
2013-12-21 21:58:59 +01:00
|
|
|
public boolean isFirst(IGridTransmitter<N> transmitter)
|
|
|
|
{
|
|
|
|
return transmitters.iterator().next().equals(transmitter);
|
|
|
|
}
|
|
|
|
|
2013-08-18 22:51:47 +02:00
|
|
|
@Override
|
2013-12-21 01:12:33 +01:00
|
|
|
public void removeTransmitter(IGridTransmitter<N> transmitter)
|
2013-08-17 19:32:05 +02:00
|
|
|
{
|
|
|
|
transmitters.remove(transmitter);
|
|
|
|
|
|
|
|
if(transmitters.size() == 0)
|
|
|
|
{
|
|
|
|
deregister();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-18 22:51:47 +02:00
|
|
|
@Override
|
2013-08-17 19:32:05 +02:00
|
|
|
public void register()
|
|
|
|
{
|
|
|
|
try {
|
2013-12-21 01:12:33 +01:00
|
|
|
IGridTransmitter<N> aTransmitter = transmitters.iterator().next();
|
2013-08-17 19:32:05 +02:00
|
|
|
|
2013-11-29 03:43:53 +01:00
|
|
|
if(aTransmitter instanceof TileEntity)
|
2013-08-17 19:32:05 +02:00
|
|
|
{
|
2013-11-29 03:43:53 +01:00
|
|
|
if(!((TileEntity)aTransmitter).worldObj.isRemote)
|
|
|
|
{
|
|
|
|
TransmitterNetworkRegistry.getInstance().registerNetwork(this);
|
|
|
|
}
|
|
|
|
else {
|
2013-12-01 05:19:24 +01:00
|
|
|
MinecraftForge.EVENT_BUS.post(new ClientTickUpdate(this, (byte)1));
|
2013-11-29 03:43:53 +01:00
|
|
|
}
|
2013-08-17 19:32:05 +02:00
|
|
|
}
|
|
|
|
} catch(NoSuchElementException e) {}
|
|
|
|
}
|
|
|
|
|
2013-08-18 22:51:47 +02:00
|
|
|
@Override
|
2013-08-17 19:32:05 +02:00
|
|
|
public void deregister()
|
|
|
|
{
|
|
|
|
transmitters.clear();
|
2013-11-29 03:43:53 +01:00
|
|
|
|
|
|
|
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
|
|
|
|
{
|
|
|
|
TransmitterNetworkRegistry.getInstance().removeNetwork(this);
|
|
|
|
}
|
|
|
|
else {
|
2013-12-01 05:19:24 +01:00
|
|
|
MinecraftForge.EVENT_BUS.post(new ClientTickUpdate(this, (byte)0));
|
2013-11-29 03:43:53 +01:00
|
|
|
}
|
2013-08-17 19:32:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getSize()
|
|
|
|
{
|
|
|
|
return transmitters.size();
|
|
|
|
}
|
2013-08-18 22:51:47 +02:00
|
|
|
|
2013-08-23 20:23:08 +02:00
|
|
|
@Override
|
|
|
|
public int getAcceptorSize()
|
|
|
|
{
|
|
|
|
return possibleAcceptors.size();
|
|
|
|
}
|
2013-12-14 21:32:32 +01:00
|
|
|
|
|
|
|
public int getCapacity()
|
|
|
|
{
|
|
|
|
return (int)getMeanCapacity() * transmitters.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Override this if things can have variable capacity along the network.
|
|
|
|
* @return An 'average' value of capacity. Calculate it how you will.
|
|
|
|
*/
|
|
|
|
public double getMeanCapacity()
|
|
|
|
{
|
2013-12-16 16:53:46 +01:00
|
|
|
return transmitters.size() > 0 ? transmitters.iterator().next().getCapacity() : 0;
|
2013-12-14 21:32:32 +01:00
|
|
|
}
|
2013-08-23 20:23:08 +02:00
|
|
|
|
2013-08-18 22:51:47 +02:00
|
|
|
@Override
|
|
|
|
public void tick()
|
|
|
|
{
|
2013-12-21 20:54:12 +01:00
|
|
|
boolean didFix = false;
|
|
|
|
|
2013-08-18 22:51:47 +02:00
|
|
|
if(!fixed)
|
|
|
|
{
|
2013-12-16 23:54:27 +01:00
|
|
|
ticksSinceCreate++;
|
2013-08-18 22:51:47 +02:00
|
|
|
|
2014-02-04 14:15:20 +01:00
|
|
|
if(transmitters.size() == 0)
|
|
|
|
{
|
|
|
|
deregister();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-08-18 22:51:47 +02:00
|
|
|
if(ticksSinceCreate > 1200)
|
|
|
|
{
|
|
|
|
ticksSinceCreate = 0;
|
|
|
|
fixMessedUpNetwork(transmitters.iterator().next());
|
2013-12-21 20:54:12 +01:00
|
|
|
didFix = true;
|
2013-08-18 22:51:47 +02:00
|
|
|
}
|
|
|
|
}
|
2013-11-25 06:00:26 +01:00
|
|
|
|
2013-12-21 20:54:12 +01:00
|
|
|
if(!didFix)
|
|
|
|
{
|
|
|
|
onUpdate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onUpdate()
|
|
|
|
{
|
2013-11-25 06:00:26 +01:00
|
|
|
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
|
|
|
|
{
|
|
|
|
Iterator<DelayQueue> i = updateQueue.iterator();
|
|
|
|
|
2013-12-13 04:02:34 +01:00
|
|
|
try {
|
|
|
|
while(i.hasNext())
|
2013-11-25 06:00:26 +01:00
|
|
|
{
|
2013-12-13 04:02:34 +01:00
|
|
|
DelayQueue q = i.next();
|
|
|
|
|
|
|
|
if(q.delay > 0)
|
|
|
|
{
|
|
|
|
q.delay--;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
needsUpdate = true;
|
|
|
|
i.remove();
|
|
|
|
}
|
2013-11-25 06:00:26 +01:00
|
|
|
}
|
2013-12-13 04:02:34 +01:00
|
|
|
} catch(Exception e) {}
|
2013-11-25 06:00:26 +01:00
|
|
|
}
|
2013-08-18 22:51:47 +02:00
|
|
|
}
|
2013-08-22 17:36:31 +02:00
|
|
|
|
|
|
|
@Override
|
2013-12-21 01:12:33 +01:00
|
|
|
public synchronized void fixMessedUpNetwork(IGridTransmitter<N> transmitter)
|
2013-08-22 17:36:31 +02:00
|
|
|
{
|
|
|
|
if(transmitter instanceof TileEntity)
|
|
|
|
{
|
2013-12-20 22:09:09 +01:00
|
|
|
NetworkFinder finder = new NetworkFinder(((TileEntity)transmitter).getWorldObj(), getTransmissionType(), Coord4D.get((TileEntity)transmitter));
|
|
|
|
List<Coord4D> partNetwork = finder.exploreNetwork();
|
2013-12-21 01:12:33 +01:00
|
|
|
Set<IGridTransmitter<N>> newTransporters = new HashSet<IGridTransmitter<N>>();
|
2013-08-22 17:36:31 +02:00
|
|
|
|
2013-12-20 22:09:09 +01:00
|
|
|
for(Coord4D node : partNetwork)
|
2013-08-22 17:36:31 +02:00
|
|
|
{
|
|
|
|
TileEntity nodeTile = node.getTileEntity(((TileEntity)transmitter).worldObj);
|
|
|
|
|
2013-11-24 22:44:16 +01:00
|
|
|
if(TransmissionType.checkTransmissionType(nodeTile, getTransmissionType(), (TileEntity)transmitter))
|
2013-08-22 17:36:31 +02:00
|
|
|
{
|
2013-12-21 01:12:33 +01:00
|
|
|
((IGridTransmitter<N>)nodeTile).removeFromTransmitterNetwork();
|
|
|
|
newTransporters.add((IGridTransmitter<N>)nodeTile);
|
2013-08-22 17:36:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-06 13:57:26 +01:00
|
|
|
ITransmitterNetwork<A, N> newNetwork = create(newTransporters);
|
2013-08-22 17:36:31 +02:00
|
|
|
newNetwork.refresh();
|
|
|
|
newNetwork.setFixed(true);
|
|
|
|
deregister();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-25 18:17:56 +02:00
|
|
|
@Override
|
2013-12-21 01:12:33 +01:00
|
|
|
public synchronized void split(IGridTransmitter<N> splitPoint)
|
2013-08-25 18:17:56 +02:00
|
|
|
{
|
|
|
|
if(splitPoint instanceof TileEntity)
|
|
|
|
{
|
|
|
|
removeTransmitter(splitPoint);
|
|
|
|
|
|
|
|
TileEntity[] connectedBlocks = new TileEntity[6];
|
|
|
|
boolean[] dealtWith = {false, false, false, false, false, false};
|
2013-12-16 23:54:27 +01:00
|
|
|
List<ITransmitterNetwork<A, N>> newNetworks = new ArrayList<ITransmitterNetwork<A, N>>();
|
2013-08-25 18:17:56 +02:00
|
|
|
|
2013-12-16 21:00:57 +01:00
|
|
|
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
2013-08-25 18:17:56 +02:00
|
|
|
{
|
2013-12-20 22:09:09 +01:00
|
|
|
TileEntity sideTile = Coord4D.get((TileEntity)splitPoint).getFromSide(side).getTileEntity(((TileEntity)splitPoint).worldObj);
|
2013-08-25 18:17:56 +02:00
|
|
|
|
|
|
|
if(sideTile != null)
|
|
|
|
{
|
2013-12-16 21:00:57 +01:00
|
|
|
connectedBlocks[side.ordinal()] = sideTile;
|
2013-08-25 18:17:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-16 21:00:57 +01:00
|
|
|
for(int count = 0; count < connectedBlocks.length; count++)
|
2013-08-25 18:17:56 +02:00
|
|
|
{
|
2013-12-16 21:00:57 +01:00
|
|
|
TileEntity connectedBlockA = connectedBlocks[count];
|
2013-08-25 18:17:56 +02:00
|
|
|
|
2013-12-18 04:25:54 +01:00
|
|
|
if(TransmissionType.checkTransmissionType(connectedBlockA, getTransmissionType()) && !dealtWith[count])
|
2013-08-25 18:17:56 +02:00
|
|
|
{
|
2013-12-20 22:09:09 +01:00
|
|
|
NetworkFinder finder = new NetworkFinder(((TileEntity)splitPoint).worldObj, getTransmissionType(), Coord4D.get(connectedBlockA), Coord4D.get((TileEntity)splitPoint));
|
|
|
|
List<Coord4D> partNetwork = finder.exploreNetwork();
|
2013-08-25 18:17:56 +02:00
|
|
|
|
2013-12-16 21:00:57 +01:00
|
|
|
for(int check = count; check < connectedBlocks.length; check++)
|
2013-08-25 18:17:56 +02:00
|
|
|
{
|
2013-12-16 21:00:57 +01:00
|
|
|
if(check == count)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
TileEntity connectedBlockB = connectedBlocks[check];
|
2013-08-25 18:17:56 +02:00
|
|
|
|
2013-12-18 04:25:54 +01:00
|
|
|
if(TransmissionType.checkTransmissionType(connectedBlockB, getTransmissionType()) && !dealtWith[check])
|
2013-08-25 18:17:56 +02:00
|
|
|
{
|
2013-12-20 22:09:09 +01:00
|
|
|
if(partNetwork.contains(Coord4D.get(connectedBlockB)))
|
2013-08-25 18:17:56 +02:00
|
|
|
{
|
2013-12-16 21:00:57 +01:00
|
|
|
dealtWith[check] = true;
|
2013-08-25 18:17:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-21 01:12:33 +01:00
|
|
|
Set<IGridTransmitter<N>> newNetCables = new HashSet<IGridTransmitter<N>>();
|
2013-08-25 18:17:56 +02:00
|
|
|
|
2013-12-20 22:09:09 +01:00
|
|
|
for(Coord4D node : finder.iterated)
|
2013-08-25 18:17:56 +02:00
|
|
|
{
|
|
|
|
TileEntity nodeTile = node.getTileEntity(((TileEntity)splitPoint).worldObj);
|
2013-12-16 21:00:57 +01:00
|
|
|
|
2013-08-25 18:17:56 +02:00
|
|
|
if(TransmissionType.checkTransmissionType(nodeTile, getTransmissionType()))
|
|
|
|
{
|
|
|
|
if(nodeTile != splitPoint)
|
|
|
|
{
|
2013-12-21 01:12:33 +01:00
|
|
|
newNetCables.add((IGridTransmitter<N>)nodeTile);
|
2013-08-25 18:17:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-16 23:54:27 +01:00
|
|
|
newNetworks.add(create(newNetCables));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(newNetworks.size() > 0)
|
|
|
|
{
|
2013-12-27 02:21:03 +01:00
|
|
|
onNetworksCreated((List)newNetworks);
|
2013-12-16 23:54:27 +01:00
|
|
|
|
|
|
|
for(ITransmitterNetwork<A, N> network : newNetworks)
|
|
|
|
{
|
|
|
|
network.refresh();
|
2013-08-25 18:17:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
deregister();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-16 21:00:57 +01:00
|
|
|
@Override
|
2013-12-16 23:54:27 +01:00
|
|
|
public void onNetworksCreated(List<N> networks) {}
|
2013-12-16 21:00:57 +01:00
|
|
|
|
2013-08-22 17:36:31 +02:00
|
|
|
@Override
|
|
|
|
public void setFixed(boolean value)
|
|
|
|
{
|
|
|
|
fixed = value;
|
|
|
|
}
|
|
|
|
|
2013-11-29 03:43:53 +01:00
|
|
|
@Override
|
|
|
|
public boolean needsTicks()
|
|
|
|
{
|
|
|
|
return getSize() > 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void clientTick()
|
|
|
|
{
|
|
|
|
ticksSinceCreate++;
|
|
|
|
|
|
|
|
if(ticksSinceCreate == 5 && getSize() > 0)
|
|
|
|
{
|
|
|
|
TileEntity tile = (TileEntity)transmitters.iterator().next();
|
2013-11-30 06:28:02 +01:00
|
|
|
MinecraftForge.EVENT_BUS.post(new NetworkClientRequest(tile));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-18 02:28:25 +01:00
|
|
|
@Override
|
|
|
|
public boolean canMerge(List<ITransmitterNetwork<?, ?>> networks)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-12-01 05:19:24 +01:00
|
|
|
public static class ClientTickUpdate extends Event
|
|
|
|
{
|
|
|
|
public DynamicNetwork network;
|
|
|
|
public byte operation; /*0 remove, 1 add*/
|
|
|
|
|
|
|
|
public ClientTickUpdate(DynamicNetwork net, byte b)
|
|
|
|
{
|
|
|
|
network = net;
|
|
|
|
operation = b;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-30 06:28:02 +01:00
|
|
|
public static class NetworkClientRequest extends Event
|
|
|
|
{
|
|
|
|
public TileEntity tileEntity;
|
|
|
|
|
|
|
|
public NetworkClientRequest(TileEntity tile)
|
|
|
|
{
|
|
|
|
tileEntity = tile;
|
2013-11-29 03:43:53 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-25 06:00:26 +01:00
|
|
|
public void addUpdate(EntityPlayer player)
|
|
|
|
{
|
|
|
|
updateQueue.add(new DelayQueue(player));
|
|
|
|
}
|
|
|
|
|
2013-08-22 17:36:31 +02:00
|
|
|
public static class NetworkFinder
|
|
|
|
{
|
2013-08-22 20:07:28 +02:00
|
|
|
public TransmissionType transmissionType;
|
|
|
|
|
2013-08-22 17:36:31 +02:00
|
|
|
public World worldObj;
|
2013-12-20 22:09:09 +01:00
|
|
|
public Coord4D start;
|
2013-08-22 17:36:31 +02:00
|
|
|
|
2013-12-20 22:09:09 +01:00
|
|
|
public List<Coord4D> iterated = new ArrayList<Coord4D>();
|
|
|
|
public List<Coord4D> toIgnore = new ArrayList<Coord4D>();
|
2013-08-22 17:36:31 +02:00
|
|
|
|
2013-12-20 22:09:09 +01:00
|
|
|
public NetworkFinder(World world, TransmissionType type, Coord4D location, Coord4D... ignore)
|
2013-08-22 17:36:31 +02:00
|
|
|
{
|
|
|
|
worldObj = world;
|
|
|
|
start = location;
|
|
|
|
|
2013-08-22 20:07:28 +02:00
|
|
|
transmissionType = type;
|
2013-08-22 17:36:31 +02:00
|
|
|
|
|
|
|
if(ignore != null)
|
|
|
|
{
|
2013-10-20 06:04:11 +02:00
|
|
|
for(int i = 0; i < ignore.length; i++)
|
2013-08-25 07:34:45 +02:00
|
|
|
{
|
2013-11-29 03:43:53 +01:00
|
|
|
toIgnore.add(ignore[i]);
|
2013-08-25 07:34:45 +02:00
|
|
|
}
|
2013-08-22 17:36:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-20 22:09:09 +01:00
|
|
|
public void loopAll(Coord4D location)
|
2013-08-22 17:36:31 +02:00
|
|
|
{
|
2013-08-25 03:39:00 +02:00
|
|
|
if(TransmissionType.checkTransmissionType(location.getTileEntity(worldObj), transmissionType))
|
2013-08-22 17:36:31 +02:00
|
|
|
{
|
|
|
|
iterated.add(location);
|
|
|
|
}
|
2013-10-20 06:04:11 +02:00
|
|
|
else {
|
2013-08-25 07:34:45 +02:00
|
|
|
toIgnore.add(location);
|
|
|
|
}
|
2013-08-22 17:36:31 +02:00
|
|
|
|
|
|
|
for(ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
|
|
|
|
{
|
2013-12-20 22:09:09 +01:00
|
|
|
Coord4D obj = location.getFromSide(direction);
|
2013-08-22 17:36:31 +02:00
|
|
|
|
|
|
|
if(!iterated.contains(obj) && !toIgnore.contains(obj))
|
|
|
|
{
|
|
|
|
TileEntity tileEntity = obj.getTileEntity(worldObj);
|
2013-12-17 00:52:54 +01:00
|
|
|
|
|
|
|
if(!(tileEntity instanceof IBlockableConnection) || ((IBlockableConnection)tileEntity).canConnectMutual(direction.getOpposite()))
|
2013-08-22 17:36:31 +02:00
|
|
|
{
|
2013-12-17 00:52:54 +01:00
|
|
|
if(TransmissionType.checkTransmissionType(tileEntity, transmissionType, location.getTileEntity(worldObj)))
|
|
|
|
{
|
|
|
|
loopAll(obj);
|
|
|
|
}
|
2013-08-22 17:36:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-20 22:09:09 +01:00
|
|
|
public List<Coord4D> exploreNetwork()
|
2013-08-22 17:36:31 +02:00
|
|
|
{
|
|
|
|
loopAll(start);
|
|
|
|
|
|
|
|
return iterated;
|
|
|
|
}
|
|
|
|
}
|
2013-11-25 06:00:26 +01:00
|
|
|
|
|
|
|
public static class DelayQueue
|
|
|
|
{
|
|
|
|
public EntityPlayer player;
|
|
|
|
public int delay;
|
|
|
|
|
|
|
|
public DelayQueue(EntityPlayer p)
|
|
|
|
{
|
|
|
|
player = p;
|
|
|
|
delay = 5;
|
|
|
|
}
|
|
|
|
}
|
2013-08-16 17:56:42 +02:00
|
|
|
}
|