Skip to content

Commit

Permalink
renamed cancel to onCancel
Browse files Browse the repository at this point in the history
  • Loading branch information
iTwins committed Aug 20, 2023
1 parent 65819d1 commit be3acf3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ default boolean isFinished() {
* This method is called when a {@link MachineOperation} is interrupted before finishing.
* Implement to specify behaviour that should happen in this case.
*/
default void cancel() {}
default void onCancel() {}

}
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public boolean endOperation(@Nonnull BlockPosition pos) {
Event event = new AsyncMachineOperationFinishEvent(pos, this, operation);
Bukkit.getPluginManager().callEvent(event);
} else {
operation.cancel();
operation.onCancel();
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public GEOMiningOperation(@Nonnull GEOResource resource, @Nonnull Block block, i
* when the {@link GEOMiningOperation} gets cancelled
*/
@Override
public void cancel() {
public void onCancel() {
ResourceManager resourceManager = Slimefun.getGPSNetwork().getResourceManager();
OptionalInt supplies = resourceManager.getSupplies(resource, block.getWorld(), block.getX() >> 4, block.getZ() >> 4);
supplies.ifPresent(s -> resourceManager.setSupplies(resource, block.getWorld(), block.getX() >> 4, block.getZ() >> 4, s + 1));
Expand Down

0 comments on commit be3acf3

Please sign in to comment.