mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-22 19:58:35 +01:00
parent
ac0c456196
commit
ccc1547292
2 changed files with 17 additions and 13 deletions
|
@ -153,6 +153,8 @@ public class PipeItem implements INBTSerializable<CompoundNBT>, ILiquidContainer
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onPathObstructed(PipeTileEntity currPipe, boolean tryReturn) {
|
private void onPathObstructed(PipeTileEntity currPipe, boolean tryReturn) {
|
||||||
|
if (currPipe.getWorld().isRemote)
|
||||||
|
return;
|
||||||
if (!this.dropOnObstruction && tryReturn) {
|
if (!this.dropOnObstruction && tryReturn) {
|
||||||
PipeNetwork network = PipeNetwork.get(currPipe.getWorld());
|
PipeNetwork network = PipeNetwork.get(currPipe.getWorld());
|
||||||
if (network.routeItemToLocation(currPipe.getPos(), this.destInventory, this.getStartPipe(), this.startInventory, speed -> this)) {
|
if (network.routeItemToLocation(currPipe.getPos(), this.destInventory, this.getStartPipe(), this.startInventory, speed -> this)) {
|
||||||
|
|
|
@ -94,20 +94,22 @@ public class PipeTileEntity extends TileEntity implements INamedContainerProvide
|
||||||
return;
|
return;
|
||||||
IProfiler profiler = this.world.getProfiler();
|
IProfiler profiler = this.world.getProfiler();
|
||||||
|
|
||||||
profiler.startSection("ticking_modules");
|
if (!this.world.isRemote) {
|
||||||
int prio = 0;
|
profiler.startSection("ticking_modules");
|
||||||
Iterator<Pair<ItemStack, IModule>> modules = this.streamModules().iterator();
|
int prio = 0;
|
||||||
while (modules.hasNext()) {
|
Iterator<Pair<ItemStack, IModule>> modules = this.streamModules().iterator();
|
||||||
Pair<ItemStack, IModule> module = modules.next();
|
while (modules.hasNext()) {
|
||||||
module.getRight().tick(module.getLeft(), this);
|
Pair<ItemStack, IModule> module = modules.next();
|
||||||
prio += module.getRight().getPriority(module.getLeft(), this);
|
module.getRight().tick(module.getLeft(), this);
|
||||||
|
prio += module.getRight().getPriority(module.getLeft(), this);
|
||||||
|
}
|
||||||
|
if (prio != this.priority) {
|
||||||
|
this.priority = prio;
|
||||||
|
// clear the cache so that it's reevaluated based on priority
|
||||||
|
PipeNetwork.get(this.world).clearDestinationCache(this.pos);
|
||||||
|
}
|
||||||
|
profiler.endSection();
|
||||||
}
|
}
|
||||||
if (prio != this.priority) {
|
|
||||||
this.priority = prio;
|
|
||||||
// clear the cache so that it's reevaluated based on priority
|
|
||||||
PipeNetwork.get(this.world).clearDestinationCache(this.pos);
|
|
||||||
}
|
|
||||||
profiler.endSection();
|
|
||||||
|
|
||||||
profiler.startSection("ticking_items");
|
profiler.startSection("ticking_items");
|
||||||
List<PipeItem> items = this.getItems();
|
List<PipeItem> items = this.getItems();
|
||||||
|
|
Loading…
Reference in a new issue