Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6895

Trees grown with applyBoneMeal() don't fire the StructureGrowthEvent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • This server is running CraftBukkit version 3397-Spigot-f4ff00f-f3828bb (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT)
    • Yes

      public class TestPlugin extends JavaPlugin implements Listener {
      
      
          @Override
          public void onEnable() {
              getLogger().info("Test plugin loaded");
              Bukkit.getPluginManager().registerEvents(this, this);
      
      
          }
      
      
          @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
          public void onSaplingPlace(BlockPlaceEvent e) {
              Block b = e.getBlock();
              if (Tag.SAPLINGS.isTagged(b.getType())) {
                  for (int i = 0; i < 100; i++) {
                      b.applyBoneMeal(BlockFace.UP); // Just do it enough to induce growth
                  }
              }
          }
      
      
          @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
          public void onTreeGrow(StructureGrowEvent e) {
              getLogger().info("This never gets called as a result of the growth even though the bonemeal works");
          }
      } 

      It'd be useful to have structures grown using the applyBoneMeal() method fire the StructureGrowthEvent.

       

            Unassigned Unassigned
            tastybento tastybento
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: