[SPIGOT-2228] Invoking Dispenser.dispense or Dropper.drop will not spawn entity Created: 27/Apr/16  Updated: 03/May/16  Resolved: 02/May/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: mukiu Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: 1.9, Craftbukkit
Environment:

OS: Linux 3.19.0-22-generic
Java: 1.9.0-ea


Plugin: none

 Description   

I'm writing a plugin which invokes the method of BlockState.
When I invoke Dispenser.dispense and Dropper.drop, I found no entity (Like item, arrow, fireball, etc) is spawned, while its content has been consumed.



 Comments   
Comment by mukiu [ 03/May/16 ]

Confirmed asynchronous invocation in my code, sorry for disturbing.

Comment by md_5 [ 02/May/16 ]
    @EventHandler
    public void interact(PlayerInteractEvent event)
    {
        if ( event.getPlayer().getItemInHand().getType() != Material.BONE || event.getHand() != EquipmentSlot.HAND )
        {
            return;
        }
        BlockState b = event.getClickedBlock().getState();
        if ( b instanceof Dispenser )
        {
            ( (Dispenser) b ).dispense();
        } else if ( b instanceof Dropper )
        {
            ( (Dropper) b ).drop();
        }

Cannot reproduce with above code.

Comment by mukiu [ 27/Apr/16 ]

Please notice that Dispenser.dispense or Dropper.drop doesn't mean static methods of those classes, but methods of instances by calling block.getState() and checking cast.

Generated at Fri Apr 11 15:30:01 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.