当前位置: 首页>>代码示例>>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;未经允许,请勿转载。