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

Water source is still removed after BlockDispenseEvent is canceled

XMLWordPrintable

    • This server is running CraftBukkit version git-Spigot-69774b3-8592585 (MC: 1.13) (Implementing API version 1.13-R0.1-SNAPSHOT)
    • Yes

      When a BlockDispenseEvent involving a dispenser and an empty bucket is canceled, water sources are still removed.

      Steps:

      1. Run a server with the included plugin enabled
      2. Place a dispenser facing into a lone water source block
      3. Put an empty bucket in the dispenser
      4. Activate the dispenser with a redstone pulse
      5. Check console output and water source

      Expected: There should be a message in the console indicating the BlockDispenseEvent was fired and canceled, there should be an untouched water source block in front of the dispenser, and the bucket item should be empty, as before.

      Actual: While the bucket is unmodified as expected, the water source block has been removed.

      Notes: This only appears to be an issue with the empty bucket; specifically, events involving water buckets, flint & steel, and bonemeal were tested and work as expected. Dispenser orientation and location do not seem to make any difference. Tested on a newly installed Spigot server with only the included plugin enabled.

      Minimal Reproduction Plugin:

      package com.lesserhydra.quicktest;
      
      import org.bukkit.event.EventHandler;
      import org.bukkit.event.Listener;
      import org.bukkit.event.block.BlockDispenseEvent;
      import org.bukkit.plugin.java.JavaPlugin;
      
      public class QuickTest extends JavaPlugin implements Listener {
        
        @Override
        public void onEnable() {
          getServer().getPluginManager().registerEvents(this, this);
        }
        
        @EventHandler
        private void onBlockDispense(BlockDispenseEvent event) {
          event.setCancelled(true);
          getLogger().info("canceled event: " + event.getBlock().getType().name()
                           + " dispense " + event.getItem().getType());
        }
        
      }
      

       

      Bug reports which do not 1) contain a declaration of testing in Vanilla and without plugins, or 2) in the case of plugin API bugs, contain a minimal reproduction case (source + jar please) will be closed. Bug reports must contain step by step instructions to reproduce the bug from a clean server install with no assumptions or prior knowledge. Also make sure you include the full output of /version in your report. Please copy and paste this statement to the bottom of your report to indicate that you have read and understood it.

            Unassigned Unassigned
            Roboboy Justin Lawen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: