From 530a5bb9b8c57502234f355235041f7f891cb140 Mon Sep 17 00:00:00 2001 From: jhqwqmc <2110242767@qq.com> Date: Thu, 3 Apr 2025 17:50:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(api):=20=E6=B7=BB=E5=8A=A0=E7=A7=8D?= =?UTF-8?q?=E6=A4=8D=E4=BD=9C=E7=89=A9=E6=97=B6=E7=9A=84=E6=89=8B=E9=83=A8?= =?UTF-8?q?=E6=8C=A5=E5=8A=A8=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../net/momirealms/customcrops/api/core/item/SeedItem.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/src/main/java/net/momirealms/customcrops/api/core/item/SeedItem.java b/api/src/main/java/net/momirealms/customcrops/api/core/item/SeedItem.java index 3fd729f..6a04597 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/core/item/SeedItem.java +++ b/api/src/main/java/net/momirealms/customcrops/api/core/item/SeedItem.java @@ -35,6 +35,8 @@ import net.momirealms.customcrops.api.event.CropPlantEvent; import net.momirealms.customcrops.api.requirement.RequirementManager; import net.momirealms.customcrops.api.util.EventUtils; import net.momirealms.customcrops.api.util.LocationUtils; +import net.momirealms.sparrow.heart.SparrowHeart; +import net.momirealms.sparrow.heart.feature.inventory.HandSlot; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; @@ -43,6 +45,7 @@ import org.bukkit.block.BlockFace; import org.bukkit.entity.Entity; import org.bukkit.entity.Item; import org.bukkit.entity.Player; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import java.util.Collection; @@ -120,6 +123,7 @@ public class SeedItem extends AbstractCustomCropsItem { itemInHand.setAmount(itemInHand.getAmount() - 1); // place model BukkitCustomCropsPlugin.getInstance().getItemManager().place(LocationUtils.toSurfaceCenterLocation(seedLocation), form, stageID, cropConfig.rotation() ? FurnitureRotation.random() : FurnitureRotation.NONE); + SparrowHeart.getInstance().swingHand(player, event.hand() == EquipmentSlot.HAND ? HandSlot.MAIN : HandSlot.OFF); cropBlock.point(state, point); world.addBlockState(pos3, state).ifPresent(previous -> { BukkitCustomCropsPlugin.getInstance().debug(() -> "Overwrite old data with " + state +