diff --git a/nms-patches/net/minecraft/world/item/ItemStack.patch b/nms-patches/net/minecraft/world/item/ItemStack.patch index 42587826d..529e86545 100644 --- a/nms-patches/net/minecraft/world/item/ItemStack.patch +++ b/nms-patches/net/minecraft/world/item/ItemStack.patch @@ -123,16 +123,16 @@ + Location location = new Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()); + TreeType treeType = BlockSapling.treeType; + BlockSapling.treeType = null; -+ List blocks = new java.util.ArrayList<>(world.capturedBlockStates.values()); ++ List blocks = new java.util.ArrayList<>(world.capturedBlockStates.values()); + world.capturedBlockStates.clear(); + StructureGrowEvent structureEvent = null; + if (treeType != null) { + boolean isBonemeal = getItem() == Items.BONE_MEAL; -+ structureEvent = new StructureGrowEvent(location, treeType, isBonemeal, (Player) entityhuman.getBukkitEntity(), blocks); ++ structureEvent = new StructureGrowEvent(location, treeType, isBonemeal, (Player) entityhuman.getBukkitEntity(), (List< BlockState>) (List) blocks); + org.bukkit.Bukkit.getPluginManager().callEvent(structureEvent); + } + -+ BlockFertilizeEvent fertilizeEvent = new BlockFertilizeEvent(CraftBlock.at(world, blockposition), (Player) entityhuman.getBukkitEntity(), blocks); ++ BlockFertilizeEvent fertilizeEvent = new BlockFertilizeEvent(CraftBlock.at(world, blockposition), (Player) entityhuman.getBukkitEntity(), (List< BlockState>) (List) blocks); + fertilizeEvent.setCancelled(structureEvent != null && structureEvent.isCancelled()); + org.bukkit.Bukkit.getPluginManager().callEvent(fertilizeEvent); + @@ -142,8 +142,8 @@ + this.setTag(newData); + this.setCount(newCount); + } -+ for (BlockState blockstate : blocks) { -+ blockstate.update(true); ++ for (CraftBlockState blockstate : blocks) { ++ world.setBlock(blockstate.getPosition(),blockstate.getHandle(), blockstate.getFlag()); // SPIGOT-7248 - manual update to avoid physics where appropriate + } + entityhuman.awardStat(StatisticList.ITEM_USED.get(item)); // SPIGOT-7236 - award stat + }