浏览代码

upstream changes

nossr50 4 年之前
父节点
当前提交
4d8a57d119
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/main/java/com/gmail/nossr50/util/input/AbilityActivationProcessor.java

+ 2 - 1
src/main/java/com/gmail/nossr50/util/input/AbilityActivationProcessor.java

@@ -110,7 +110,8 @@ public class AbilityActivationProcessor {
         FakePlayerAnimationEvent fakeSwing = new FakePlayerAnimationEvent(playerInteractEvent.getPlayer()); //PlayerAnimationEvent compat
         FakePlayerAnimationEvent fakeSwing = new FakePlayerAnimationEvent(playerInteractEvent.getPlayer()); //PlayerAnimationEvent compat
         if (herbalismManager.canGreenThumbBlock(blockState)) {
         if (herbalismManager.canGreenThumbBlock(blockState)) {
             Bukkit.getPluginManager().callEvent(fakeSwing);
             Bukkit.getPluginManager().callEvent(fakeSwing);
-            player.getInventory().setItemInMainHand(new ItemStack(Material.WHEAT_SEEDS, getHeldItem().getAmount() - 1));
+            player.getInventory().getItemInMainHand().setAmount(player.getInventory().getItemInMainHand().getAmount() - 1);
+            player.updateInventory();
             if (herbalismManager.processGreenThumbBlocks(blockState) && EventUtils.simulateBlockBreak(block, player, false)) {
             if (herbalismManager.processGreenThumbBlocks(blockState) && EventUtils.simulateBlockBreak(block, player, false)) {
                 blockState.update(true);
                 blockState.update(true);
             }
             }