From be3acf3edca66aba8b91a6dd9946f2a697e8f6a4 Mon Sep 17 00:00:00 2001 From: iTwins Date: Sun, 20 Aug 2023 16:46:41 +0200 Subject: [PATCH] renamed cancel to onCancel --- .../slimefun4/core/machines/MachineOperation.java | 2 +- .../slimefun4/core/machines/MachineProcessor.java | 2 +- .../slimefun4/implementation/operations/GEOMiningOperation.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/machines/MachineOperation.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/machines/MachineOperation.java index 67fda66d29..ff211b4594 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/machines/MachineOperation.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/machines/MachineOperation.java @@ -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() {} } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/machines/MachineProcessor.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/machines/MachineProcessor.java index 4ccf41192c..f8064c5c78 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/machines/MachineProcessor.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/machines/MachineProcessor.java @@ -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; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/operations/GEOMiningOperation.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/operations/GEOMiningOperation.java index ee981eac83..664f4d669a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/operations/GEOMiningOperation.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/operations/GEOMiningOperation.java @@ -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));