add missing synchronized blocks
This commit is contained in:
parent
043d6ffd20
commit
6f7729e34e
@ -280,11 +280,13 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void softCancelIfSafe() {
|
public void softCancelIfSafe() {
|
||||||
|
synchronized (pathPlanLock) {
|
||||||
if (!isSafeToCancel()) {
|
if (!isSafeToCancel()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
current = null;
|
current = null;
|
||||||
next = null;
|
next = null;
|
||||||
|
}
|
||||||
cancelRequested = true;
|
cancelRequested = true;
|
||||||
getInProgress().ifPresent(AbstractNodeCostSearch::cancel); // only cancel ours
|
getInProgress().ifPresent(AbstractNodeCostSearch::cancel); // only cancel ours
|
||||||
// do everything BUT clear keys
|
// do everything BUT clear keys
|
||||||
@ -293,8 +295,10 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
|
|||||||
// just cancel the current path
|
// just cancel the current path
|
||||||
public void secretInternalSegmentCancel() {
|
public void secretInternalSegmentCancel() {
|
||||||
queuePathEvent(PathEvent.CANCELED);
|
queuePathEvent(PathEvent.CANCELED);
|
||||||
|
synchronized (pathPlanLock) {
|
||||||
current = null;
|
current = null;
|
||||||
next = null;
|
next = null;
|
||||||
|
}
|
||||||
baritone.getInputOverrideHandler().clearAllKeys();
|
baritone.getInputOverrideHandler().clearAllKeys();
|
||||||
getInProgress().ifPresent(AbstractNodeCostSearch::cancel);
|
getInProgress().ifPresent(AbstractNodeCostSearch::cancel);
|
||||||
baritone.getInputOverrideHandler().getBlockBreakHelper().stopBreakingBlock();
|
baritone.getInputOverrideHandler().getBlockBreakHelper().stopBreakingBlock();
|
||||||
@ -334,8 +338,10 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void secretCursedFunctionDoNotCall(IPath path) {
|
public void secretCursedFunctionDoNotCall(IPath path) {
|
||||||
|
synchronized (pathPlanLock) {
|
||||||
current = new PathExecutor(this, path);
|
current = new PathExecutor(this, path);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See issue #209
|
* See issue #209
|
||||||
|
Loading…
Reference in New Issue
Block a user