Search in sources :

Example 1 with CraftDisplayDestroyEvent

use of io.github.bananapuncher714.crafters.events.CraftDisplayDestroyEvent in project PublicCrafters by BananaPuncher714.

the class CraftDisplay method stop.

/**
 * Simply stops each of the 9 ItemDisplays this is responsible for
 */
public void stop() {
    Bukkit.getPluginManager().callEvent(new CraftDisplayDestroyEvent(this));
    for (ItemDisplay display : displays) {
        if (display != null) {
            ItemDisplayDestroyEvent event = new ItemDisplayDestroyEvent(display);
            Bukkit.getPluginManager().callEvent(event);
            display.remove();
        }
    }
    if (resultDisplay != null) {
        resultDisplay.remove();
    }
}
Also used : CraftDisplayDestroyEvent(io.github.bananapuncher714.crafters.events.CraftDisplayDestroyEvent) ItemDisplayDestroyEvent(io.github.bananapuncher714.crafters.events.ItemDisplayDestroyEvent)

Aggregations

CraftDisplayDestroyEvent (io.github.bananapuncher714.crafters.events.CraftDisplayDestroyEvent)1 ItemDisplayDestroyEvent (io.github.bananapuncher714.crafters.events.ItemDisplayDestroyEvent)1