This commit is contained in:
Leijurv
2018-09-07 21:32:25 -07:00
parent 9052781889
commit 132e277388
27 changed files with 114 additions and 68 deletions
@@ -70,8 +70,9 @@ public abstract class Movement implements Helper, MovementHelper {
public double getCost(CalculationContext context) {
if (cost == null) {
if (context == null)
if (context == null) {
context = new CalculationContext();
}
cost = calculateCost(context);
}
return cost;
@@ -128,13 +129,15 @@ public abstract class Movement implements Helper, MovementHelper {
});
latestState.getInputStates().replaceAll((input, forced) -> false);
if (!this.didBreakLastTick)
if (!this.didBreakLastTick) {
BlockBreakHelper.stopBreakingBlock();
}
currentState = latestState;
if (isFinished())
if (isFinished()) {
onFinish(latestState);
}
return currentState.getStatus();
}