mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-25 21:18:34 +01:00
added profiling for the crafting module
This commit is contained in:
parent
362a601e0a
commit
1f0c3952f3
1 changed files with 5 additions and 0 deletions
|
@ -79,6 +79,7 @@ public class CraftingModuleItem extends ModuleItem {
|
|||
PipeNetwork network = PipeNetwork.get(tile.getWorld());
|
||||
// process crafting ingredient requests
|
||||
if (!tile.craftIngredientRequests.isEmpty()) {
|
||||
network.startProfile("crafting_ingredients");
|
||||
NetworkLock request = tile.craftIngredientRequests.peek();
|
||||
Pair<BlockPos, ItemStack> dest = tile.getAvailableDestination(request.stack, true, true);
|
||||
if (dest != null) {
|
||||
|
@ -95,9 +96,11 @@ public class CraftingModuleItem extends ModuleItem {
|
|||
network.createNetworkLock(remainRequest);
|
||||
}
|
||||
}
|
||||
network.endProfile();
|
||||
}
|
||||
// pull requested crafting results from the network once they are stored
|
||||
if (!tile.craftResultRequests.isEmpty()) {
|
||||
network.startProfile("crafting_results");
|
||||
List<NetworkLocation> items = network.getOrderedNetworkItems(tile.getPos());
|
||||
ItemEqualityType[] equalityTypes = ItemFilter.getEqualityTypes(tile);
|
||||
for (Pair<BlockPos, ItemStack> request : tile.craftResultRequests) {
|
||||
|
@ -133,10 +136,12 @@ public class CraftingModuleItem extends ModuleItem {
|
|||
// if we couldn't pull everything, log a new request
|
||||
if (!remain.isEmpty())
|
||||
tile.craftResultRequests.add(Pair.of(request.getLeft(), remain));
|
||||
network.endProfile();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
network.endProfile();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue