1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

renamed cancel to onCancel

This commit is contained in:
iTwins 2023-08-20 16:46:41 +02:00
parent 65819d1784
commit be3acf3edc
3 changed files with 3 additions and 3 deletions

View File

@ -61,6 +61,6 @@ public interface MachineOperation {
* This method is called when a {@link MachineOperation} is interrupted before finishing. * This method is called when a {@link MachineOperation} is interrupted before finishing.
* Implement to specify behaviour that should happen in this case. * Implement to specify behaviour that should happen in this case.
*/ */
default void cancel() {} default void onCancel() {}
} }

View File

@ -231,7 +231,7 @@ public class MachineProcessor<T extends MachineOperation> {
Event event = new AsyncMachineOperationFinishEvent(pos, this, operation); Event event = new AsyncMachineOperationFinishEvent(pos, this, operation);
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
} else { } else {
operation.cancel(); operation.onCancel();
} }
return true; return true;

View File

@ -37,7 +37,7 @@ public class GEOMiningOperation extends MiningOperation {
* when the {@link GEOMiningOperation} gets cancelled * when the {@link GEOMiningOperation} gets cancelled
*/ */
@Override @Override
public void cancel() { public void onCancel() {
ResourceManager resourceManager = Slimefun.getGPSNetwork().getResourceManager(); ResourceManager resourceManager = Slimefun.getGPSNetwork().getResourceManager();
OptionalInt supplies = resourceManager.getSupplies(resource, block.getWorld(), block.getX() >> 4, block.getZ() >> 4); 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)); supplies.ifPresent(s -> resourceManager.setSupplies(resource, block.getWorld(), block.getX() >> 4, block.getZ() >> 4, s + 1));