From f9a1437129c70c58248e3cc9a077a7bc91711c1c Mon Sep 17 00:00:00 2001 From: XiaoMoMi <70987828+Xiao-MoMi@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:55:33 +0800 Subject: [PATCH] Run grow actions at last --- .../customcrops/api/core/block/CropBlock.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/src/main/java/net/momirealms/customcrops/api/core/block/CropBlock.java b/api/src/main/java/net/momirealms/customcrops/api/core/block/CropBlock.java index 150f134..c5cef05 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/core/block/CropBlock.java +++ b/api/src/main/java/net/momirealms/customcrops/api/core/block/CropBlock.java @@ -361,18 +361,18 @@ public class CropBlock extends AbstractCustomCropsBlock { CropStageConfig nextStage = config.stageWithModelByPoint(afterPoints); BukkitCustomCropsPlugin.getInstance().getScheduler().sync().run(() -> { - for (int i = previousPoint + 1; i <= afterPoints; i++) { - CropStageConfig stage = config.stageByPoint(i); - if (stage != null) { - ActionManager.trigger(context, stage.growActions()); - } - } if (currentStage == nextStage) return; FurnitureRotation rotation = BukkitCustomCropsPlugin.getInstance().getItemManager().remove(bukkitLocation, ExistenceForm.ANY); if (rotation == FurnitureRotation.NONE && config.rotation()) { rotation = FurnitureRotation.random(); } BukkitCustomCropsPlugin.getInstance().getItemManager().place(bukkitLocation, nextStage.existenceForm(), Objects.requireNonNull(nextStage.stageID()), rotation); + for (int i = previousPoint + 1; i <= afterPoints; i++) { + CropStageConfig stage = config.stageByPoint(i); + if (stage != null) { + ActionManager.trigger(context, stage.growActions()); + } + } }, bukkitLocation); }