Un-register the hotbar page listener on disable.
This commit is contained in:
parent
231b8cb19a
commit
d44d4c2278
@ -9,6 +9,8 @@ import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
@ -37,6 +39,7 @@ public class HotbarEditor extends MiniPlugin
|
||||
{
|
||||
private Gladiators _host;
|
||||
private ItemStack _item;
|
||||
private Listener _pageListener;
|
||||
|
||||
public HotbarEditor(JavaPlugin plugin, Gladiators gladiators)
|
||||
{
|
||||
@ -46,7 +49,14 @@ public class HotbarEditor extends MiniPlugin
|
||||
_item = new ItemBuilder(Material.NAME_TAG).setTitle(C.cGold + "Hotbar Editor")
|
||||
.addLore(C.cGray + "Right click to edit your Gladiators hotbar").build();
|
||||
|
||||
getPluginManager().registerEvents(new HotbarPageListener(this), getPlugin());
|
||||
_pageListener = new HotbarPageListener(this);
|
||||
getPluginManager().registerEvents(_pageListener, getPlugin());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disable()
|
||||
{
|
||||
HandlerList.unregisterAll(_pageListener);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
Loading…
Reference in New Issue
Block a user