mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-19 15:09:25 +00:00
Run grow actions at last
This commit is contained in:
@@ -361,18 +361,18 @@ public class CropBlock extends AbstractCustomCropsBlock {
|
|||||||
CropStageConfig nextStage = config.stageWithModelByPoint(afterPoints);
|
CropStageConfig nextStage = config.stageWithModelByPoint(afterPoints);
|
||||||
|
|
||||||
BukkitCustomCropsPlugin.getInstance().getScheduler().sync().run(() -> {
|
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;
|
if (currentStage == nextStage) return;
|
||||||
FurnitureRotation rotation = BukkitCustomCropsPlugin.getInstance().getItemManager().remove(bukkitLocation, ExistenceForm.ANY);
|
FurnitureRotation rotation = BukkitCustomCropsPlugin.getInstance().getItemManager().remove(bukkitLocation, ExistenceForm.ANY);
|
||||||
if (rotation == FurnitureRotation.NONE && config.rotation()) {
|
if (rotation == FurnitureRotation.NONE && config.rotation()) {
|
||||||
rotation = FurnitureRotation.random();
|
rotation = FurnitureRotation.random();
|
||||||
}
|
}
|
||||||
BukkitCustomCropsPlugin.getInstance().getItemManager().place(bukkitLocation, nextStage.existenceForm(), Objects.requireNonNull(nextStage.stageID()), rotation);
|
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);
|
}, bukkitLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user