Search in sources :

Example 1 with ServerRouter

use of logisticspipes.routing.ServerRouter in project LogisticsPipes by RS485.

the class CoreRoutedPipe method doDebugStuff.

private void doDebugStuff(EntityPlayer entityplayer) {
    //entityplayer.worldObj.setWorldTime(4951);
    IRouter r = getRouter();
    if (!(r instanceof ServerRouter)) {
        return;
    }
    System.out.println("***");
    System.out.println("---------Interests---------------");
    for (Entry<ItemIdentifier, Set<IRouter>> i : ServerRouter.getInterestedInSpecifics().entrySet()) {
        System.out.print(i.getKey().getFriendlyName() + ":");
        for (IRouter j : i.getValue()) {
            System.out.print(j.getSimpleID() + ",");
        }
        System.out.println();
    }
    System.out.print("ALL ITEMS:");
    for (IRouter j : ServerRouter.getInterestedInGeneral()) {
        System.out.print(j.getSimpleID() + ",");
    }
    System.out.println();
    ServerRouter sr = (ServerRouter) r;
    System.out.println(r.toString());
    System.out.println("---------CONNECTED TO---------------");
    for (CoreRoutedPipe adj : sr._adjacent.keySet()) {
        System.out.println(adj.getRouter().getSimpleID());
    }
    System.out.println();
    System.out.println("========DISTANCE TABLE==============");
    for (ExitRoute n : r.getIRoutersByCost()) {
        System.out.println(n.destination.getSimpleID() + " @ " + n.distanceToDestination + " -> " + n.connectionDetails + "(" + n.destination.getId() + ")");
    }
    System.out.println();
    System.out.println("*******EXIT ROUTE TABLE*************");
    List<List<ExitRoute>> table = r.getRouteTable();
    for (int i = 0; i < table.size(); i++) {
        if (table.get(i) != null) {
            if (table.get(i).size() > 0) {
                System.out.println(i + " -> " + table.get(i).get(0).destination.getSimpleID());
                for (ExitRoute route : table.get(i)) {
                    System.out.println("\t\t via " + route.exitOrientation + "(" + route.distanceToDestination + " distance)");
                }
            }
        }
    }
    System.out.println();
    System.out.println("++++++++++CONNECTIONS+++++++++++++++");
    System.out.println(Arrays.toString(ForgeDirection.VALID_DIRECTIONS));
    System.out.println(Arrays.toString(sr.sideDisconnected));
    System.out.println(Arrays.toString(container.pipeConnectionsBuffer));
    System.out.println();
    System.out.println("~~~~~~~~~~~~~~~POWER~~~~~~~~~~~~~~~~");
    System.out.println(r.getPowerProvider());
    System.out.println();
    System.out.println("~~~~~~~~~~~SUBSYSTEMPOWER~~~~~~~~~~~");
    System.out.println(r.getSubSystemPowerProvider());
    System.out.println();
    if (_orderItemManager != null) {
        System.out.println("################ORDERDUMP#################");
        _orderItemManager.dump();
    }
    System.out.println("################END#################");
    refreshConnectionAndRender(true);
    System.out.print("");
    sr.CreateRouteTable(Integer.MAX_VALUE);
}
Also used : ItemIdentifier(logisticspipes.utils.item.ItemIdentifier) Set(java.util.Set) BitSet(java.util.BitSet) IRouter(logisticspipes.routing.IRouter) ArrayList(java.util.ArrayList) PlayerCollectionList(logisticspipes.utils.PlayerCollectionList) NBTTagList(net.minecraft.nbt.NBTTagList) List(java.util.List) LinkedList(java.util.LinkedList) ServerRouter(logisticspipes.routing.ServerRouter) ExitRoute(logisticspipes.routing.ExitRoute)

Aggregations

ArrayList (java.util.ArrayList)1 BitSet (java.util.BitSet)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Set (java.util.Set)1 ExitRoute (logisticspipes.routing.ExitRoute)1 IRouter (logisticspipes.routing.IRouter)1 ServerRouter (logisticspipes.routing.ServerRouter)1 PlayerCollectionList (logisticspipes.utils.PlayerCollectionList)1 ItemIdentifier (logisticspipes.utils.item.ItemIdentifier)1 NBTTagList (net.minecraft.nbt.NBTTagList)1