mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-26 05:28:33 +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());
|
PipeNetwork network = PipeNetwork.get(tile.getWorld());
|
||||||
// process crafting ingredient requests
|
// process crafting ingredient requests
|
||||||
if (!tile.craftIngredientRequests.isEmpty()) {
|
if (!tile.craftIngredientRequests.isEmpty()) {
|
||||||
|
network.startProfile("crafting_ingredients");
|
||||||
NetworkLock request = tile.craftIngredientRequests.peek();
|
NetworkLock request = tile.craftIngredientRequests.peek();
|
||||||
Pair<BlockPos, ItemStack> dest = tile.getAvailableDestination(request.stack, true, true);
|
Pair<BlockPos, ItemStack> dest = tile.getAvailableDestination(request.stack, true, true);
|
||||||
if (dest != null) {
|
if (dest != null) {
|
||||||
|
@ -95,9 +96,11 @@ public class CraftingModuleItem extends ModuleItem {
|
||||||
network.createNetworkLock(remainRequest);
|
network.createNetworkLock(remainRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
network.endProfile();
|
||||||
}
|
}
|
||||||
// pull requested crafting results from the network once they are stored
|
// pull requested crafting results from the network once they are stored
|
||||||
if (!tile.craftResultRequests.isEmpty()) {
|
if (!tile.craftResultRequests.isEmpty()) {
|
||||||
|
network.startProfile("crafting_results");
|
||||||
List<NetworkLocation> items = network.getOrderedNetworkItems(tile.getPos());
|
List<NetworkLocation> items = network.getOrderedNetworkItems(tile.getPos());
|
||||||
ItemEqualityType[] equalityTypes = ItemFilter.getEqualityTypes(tile);
|
ItemEqualityType[] equalityTypes = ItemFilter.getEqualityTypes(tile);
|
||||||
for (Pair<BlockPos, ItemStack> request : tile.craftResultRequests) {
|
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 we couldn't pull everything, log a new request
|
||||||
if (!remain.isEmpty())
|
if (!remain.isEmpty())
|
||||||
tile.craftResultRequests.add(Pair.of(request.getLeft(), remain));
|
tile.craftResultRequests.add(Pair.of(request.getLeft(), remain));
|
||||||
|
network.endProfile();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
network.endProfile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue