Search in sources :

Example 1 with SlimefunGuideOpenEvent

use of io.github.thebusybiscuit.slimefun4.api.events.SlimefunGuideOpenEvent in project Slimefun4 by Slimefun.

the class SlimefunGuideListener method openGuide.

@ParametersAreNonnullByDefault
private void openGuide(Player p, PlayerRightClickEvent e, SlimefunGuideMode layout) {
    SlimefunGuideOpenEvent event = new SlimefunGuideOpenEvent(p, e.getItem(), layout);
    Bukkit.getPluginManager().callEvent(event);
    if (!event.isCancelled()) {
        e.cancel();
        SlimefunGuide.openGuide(p, event.getGuideLayout());
    }
}
Also used : SlimefunGuideOpenEvent(io.github.thebusybiscuit.slimefun4.api.events.SlimefunGuideOpenEvent) ParametersAreNonnullByDefault(javax.annotation.ParametersAreNonnullByDefault)

Aggregations

SlimefunGuideOpenEvent (io.github.thebusybiscuit.slimefun4.api.events.SlimefunGuideOpenEvent)1 ParametersAreNonnullByDefault (javax.annotation.ParametersAreNonnullByDefault)1