Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename IRecipeLogicMachine.dampingWhenWaiting to regressWhenWaiting. #2737

Open
wants to merge 1 commit into
base: 1.20.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static ModifierFunction recipeModifier(@NotNull MetaMachine machine, @Not
}

@Override
public boolean dampingWhenWaiting() {
public boolean regressWhenWaiting() {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ default void afterWorking() {
/**
* Whether progress decrease when machine is waiting for pertick ingredients. (e.g. lack of EU)
*/
default boolean dampingWhenWaiting() {
default boolean regressWhenWaiting() {
return self().getDefinition().isRegressWhenWaiting();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public void handleRecipeWorking() {
setWaiting(result.reason().get());
}
if (isWaiting()) {
doDamping();
doRegressing();
}
if (last == Status.WORKING && getStatus() != Status.WORKING) {
lastRecipe.postWorking(machine);
Expand All @@ -279,8 +279,8 @@ public void handleRecipeWorking() {
}
}

protected void doDamping() {
if (progress > 0 && machine.dampingWhenWaiting()) {
protected void doRegressing() {
if (progress > 0 && machine.regressWhenWaiting()) {
if (ConfigHolder.INSTANCE.machines.recipeProgressLowEnergy) {
this.progress = 1;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ public MultiblockMachineBuilder afterWorking(Consumer<IRecipeLogicMachine> after
}

@Override
public MultiblockMachineBuilder regressWhenWaiting(boolean dampingWhenWaiting) {
return (MultiblockMachineBuilder) super.regressWhenWaiting(dampingWhenWaiting);
public MultiblockMachineBuilder regressWhenWaiting(boolean regressWhenWaiting) {
return (MultiblockMachineBuilder) super.regressWhenWaiting(regressWhenWaiting);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public AirScrubberMachine(IMachineBlockEntity holder, int tier, Object... args)
}

@Override
public boolean dampingWhenWaiting() {
public boolean regressWhenWaiting() {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void onStructureInvalid() {
}

@Override
public boolean dampingWhenWaiting() {
public boolean regressWhenWaiting() {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public boolean onWorking() {
}

@Override
public boolean dampingWhenWaiting() {
public boolean regressWhenWaiting() {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static ModifierFunction recipeModifier(@NotNull MetaMachine machine, @Not
}

@Override
public boolean dampingWhenWaiting() {
public boolean regressWhenWaiting() {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void serverTick() {
if (maintenanceMachine == null || maintenanceMachine.getNumMaintenanceProblems() < 6 || zone != null) {
// drain the energy
if (!consumeEnergy()) {
if (progress > 0 && machine.dampingWhenWaiting()) {
if (progress > 0 && machine.regressWhenWaiting()) {
if (ConfigHolder.INSTANCE.machines.recipeProgressLowEnergy) {
this.progress = 1;
} else {
Expand Down
Loading