ME P2P tunnels

This commit is contained in:
AlgorithmX2
2014-01-21 22:52:33 -06:00
parent 34976a4ac8
commit 0016857b03
4 changed files with 250 additions and 12 deletions
+21
View File
@@ -3,6 +3,7 @@ package appeng.helpers;
import java.util.EnumSet;
import java.util.LinkedList;
import java.util.Queue;
import java.util.concurrent.Callable;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.world.WorldEvent;
@@ -33,6 +34,8 @@ public class TickHandler implements ITickHandler
final public static TickHandler instance = new TickHandler();
final private Queue<Callable> callQueue = new LinkedList();
final private HandlerRep server = new HandlerRep();
final private HandlerRep client = new HandlerRep();
@@ -43,6 +46,11 @@ public class TickHandler implements ITickHandler
return client;
}
public void addCallable(Callable c)
{
callQueue.add( c );
}
public void addInit(AEBaseTile tile)
{
getRepo().tiles.add( tile );
@@ -107,6 +115,19 @@ public class TickHandler implements ITickHandler
{
g.update();
}
Callable c = null;
while ((c = callQueue.poll()) != null)
{
try
{
c.call();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
@Override