當前位置: 首頁>>代碼示例>>Java>>正文


Java HandlerList類代碼示例

本文整理匯總了Java中org.bukkit.event.HandlerList的典型用法代碼示例。如果您正苦於以下問題:Java HandlerList類的具體用法?Java HandlerList怎麽用?Java HandlerList使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HandlerList類屬於org.bukkit.event包,在下文中一共展示了HandlerList類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onPlayerPickupItem

import org.bukkit.event.HandlerList; //導入依賴的package包/類
@EventHandler
private void onPlayerPickupItem(PlayerPickupItemEvent event)
{
    if (event.getItem().getItemStack() != null && event.getItem().getItemStack().getItemMeta() != null && event.getItem().getItemStack().getItemMeta().getDisplayName() != null)
    {
        if (this.alive && event.getItem().getItemStack().getItemMeta().getDisplayName().equals(this.uuid.toString()))
        {
            event.setCancelled(true);

            HandlerList.unregisterAll(this);

            this.remove(true);
            this.parent.onPickup(event.getPlayer());
        }
    }
}
 
開發者ID:SamaGames,項目名稱:SamaGamesAPI,代碼行數:17,代碼來源:ActivePowerup.java

示例2: onClose

import org.bukkit.event.HandlerList; //導入依賴的package包/類
@EventHandler
public void onClose( InventoryCloseEvent event ) {
    if ( event.getInventory().equals( gui.getInventory() ) ) {
        gui.getEvents().forEach( e -> e.onClose( new ContainerCloseEvent( gui, event.getPlayer() ) ) );
        HandlerList.unregisterAll(this);
        gui.setNativeListenerRegistered(false);
    }
}
 
開發者ID:LegendOnline,項目名稱:InventoryAPI,代碼行數:9,代碼來源:GuiAnvilListener.java

示例3: disable

import org.bukkit.event.HandlerList; //導入依賴的package包/類
/**
 * Clear the list and stop listening for events. This map should not be used after this method is called.
 */
public void disable() {
    if(this.enabled) {
        this.clear();
        HandlerList.unregisterAll(this);
    }
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:10,代碼來源:ListeningMapAdapter.java

示例4: doComplete

import org.bukkit.event.HandlerList; //導入依賴的package包/類
private void doComplete() {
    countDown--;
    if (countDown == -1) {
        bar.setProgress(1.0);
        if (yes > no) {
            bar.setTitle(ChatColor.GREEN + "Vote passed!");
            bar.setColor(BarColor.GREEN);
            updateAll(voters, Messages.votePassed());
            world.setTime(0);
            if (world.hasStorm()) world.setStorm(false);
        }
        else {
            bar.setTitle(ChatColor.DARK_RED + "Vote failed!");
            bar.setColor(BarColor.RED);
            updateAll(voters, Messages.voteFailed());
        }
        plugin.getServer().getScheduler().runTaskLater(plugin, this, 20);
    }

    if (countDown == -2) plugin.getServer().getScheduler().runTaskLater(plugin, this, 20);

    if (countDown == -3) {
        HandlerList.unregisterAll(this);
        bar.removeAll();
        bar = null;
        voters = null;
    }
}
 
開發者ID:mattboy9921,項目名稱:SkipNight,代碼行數:29,代碼來源:Vote.java

示例5: loadEntityProtectionListener

import org.bukkit.event.HandlerList; //導入依賴的package包/類
/**
 * load / reload a new instance of EntityProtectionListener and register it
 */
public void loadEntityProtectionListener() {
    if (entityProtectionListener != null) {
        HandlerList.unregisterAll(entityProtectionListener);
    }
    entityProtectionListener = new EntityProtectionListener();
    manager.registerEvents(entityProtectionListener, this);
}
 
開發者ID:DRE2N,項目名稱:FactionsXL,代碼行數:11,代碼來源:FactionsXL.java

示例6: loadPlayerListener

import org.bukkit.event.HandlerList; //導入依賴的package包/類
/**
 * load / reload a new instance of PlayerListener and register it
 */
public void loadPlayerListener() {
    if (playerListener != null) {
        HandlerList.unregisterAll(playerListener);
    }
    playerListener = new PlayerListener(this);
    manager.registerEvents(playerListener, this);
}
 
開發者ID:DRE2N,項目名稱:FactionsXL,代碼行數:11,代碼來源:FactionsXL.java

示例7: onClose

import org.bukkit.event.HandlerList; //導入依賴的package包/類
@EventHandler
public void onClose(InventoryCloseEvent event) {
    if(gui == null || gui.getPlayer() == null || !event.getPlayer().getUniqueId().equals(gui.getPlayer().getUniqueId())) return;

    globalEvents.forEach(e -> e.onClose(new ContainerCloseEvent(gui, event.getPlayer())));
    if (event.getInventory().equals(gui.getInventory())) {
        gui.getEvents().forEach(e -> e.onClose(new ContainerCloseEvent(gui, event.getPlayer())));

        HandlerList.unregisterAll(this);
        gui.setNativeListenerRegistered(false);
    }
}
 
開發者ID:LegendOnline,項目名稱:InventoryAPI,代碼行數:13,代碼來源:McGuiListener.java

示例8: getHandlerList

import org.bukkit.event.HandlerList; //導入依賴的package包/類
public static HandlerList getHandlerList() {
    return handlers;
}
 
開發者ID:ArcadiaPlugins,項目名稱:Arcadia-Spigot,代碼行數:4,代碼來源:GameStateUpdateEvent.java

示例9: getHandlers

import org.bukkit.event.HandlerList; //導入依賴的package包/類
public HandlerList getHandlers() {
    return handlers;
}
 
開發者ID:dracnis,項目名稱:VanillaPlus,代碼行數:4,代碼來源:VPPLoginEvent.java

示例10: getHandlerList

import org.bukkit.event.HandlerList; //導入依賴的package包/類
public static HandlerList getHandlerList() {
    return HANDLERS;
}
 
開發者ID:Dragovorn,項目名稱:OpenRPG,代碼行數:4,代碼來源:RegionEvent.java

示例11: getHandlerList

import org.bukkit.event.HandlerList; //導入依賴的package包/類
public static HandlerList getHandlerList() {
	return handlers;
}
 
開發者ID:ThEWiZ76,項目名稱:KingdomFactions,代碼行數:4,代碼來源:ChannelPasswordSetEvent.java

示例12: getHandlers

import org.bukkit.event.HandlerList; //導入依賴的package包/類
@Override
public HandlerList getHandlers() {
	return handlers;
}
 
開發者ID:ThEWiZ76,項目名稱:KingdomFactions,代碼行數:5,代碼來源:ChannelEvent.java

示例13: getHandlerList

import org.bukkit.event.HandlerList; //導入依賴的package包/類
public static HandlerList getHandlerList() {
  return handlers;
}
 
開發者ID:btk5h,項目名稱:skript-mirror,代碼行數:4,代碼來源:CustomExpression.java

示例14: getHandlers

import org.bukkit.event.HandlerList; //導入依賴的package包/類
@Override
  public HandlerList getHandlers() {
return handlers;
  }
 
開發者ID:Borlea,項目名稱:EchoPet,代碼行數:5,代碼來源:PetTeleportEvent.java

示例15: getHandlers

import org.bukkit.event.HandlerList; //導入依賴的package包/類
@Override
public HandlerList getHandlers() {
    return handlers;
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:5,代碼來源:PvpClassEquipEvent.java


注:本文中的org.bukkit.event.HandlerList類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。