当前位置: 首页>>代码示例>>Java>>正文


Java ListenerPriority.NORMAL属性代码示例

本文整理汇总了Java中com.comphenix.protocol.events.ListenerPriority.NORMAL属性的典型用法代码示例。如果您正苦于以下问题:Java ListenerPriority.NORMAL属性的具体用法?Java ListenerPriority.NORMAL怎么用?Java ListenerPriority.NORMAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.comphenix.protocol.events.ListenerPriority的用法示例。


在下文中一共展示了ListenerPriority.NORMAL属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listenForPackets

private void listenForPackets()
{
	this.packetAdapter = new PacketAdapter(AnimulusLib.getInstance().getPlugin(), ListenerPriority.NORMAL,
			PacketType.Play.Client.USE_ENTITY)
	{
		@Override public void onPacketReceiving(PacketEvent packetEvent)
		{
			// taken from PacketWrapper
			EntityUseAction action = packetEvent.getPacket().getEntityUseActions().read(0);
			if(action == EntityUseAction.INTERACT_AT)
				return;

			Player player = packetEvent.getPlayer();
			int entityId = packetEvent.getPacket().getIntegers().read(0);
			StateNPC npc = AnimulusLib.getNPCManager().getNPC(entityId);

			// clicked actual player
			if(npc == null)
				return;

			if(action == EntityUseAction.INTERACT)
				npc.playerRightClick(player);
			else
				npc.playerLeftClick(player);
		}
	};

	ProtocolLibrary.getProtocolManager().addPacketListener(this.packetAdapter);
}
 
开发者ID:domisum,项目名称:AnimulusLib,代码行数:29,代码来源:NPCInteractPacketListener.java

示例2: BlockPlaceAdapter

public BlockPlaceAdapter(JavaPlugin plugin) {
    super(plugin, ListenerPriority.NORMAL, PacketType.Play.Client.BLOCK_PLACE);
}
 
开发者ID:IPVP-MC,项目名称:mirage,代码行数:3,代码来源:BlockPlaceAdapter.java

示例3: BlockDigAdapter

public BlockDigAdapter(JavaPlugin plugin) {
    super(plugin, ListenerPriority.NORMAL, PacketType.Play.Client.BLOCK_DIG);
}
 
开发者ID:IPVP-MC,项目名称:mirage,代码行数:3,代码来源:BlockDigAdapter.java

示例4: PlayerListManager

public PlayerListManager(RadarJammer plugin) {
	super(plugin, ListenerPriority.NORMAL, PacketType.Play.Server.PLAYER_INFO);
}
 
开发者ID:TealNerd,项目名称:RadarJammer,代码行数:3,代码来源:PlayerListManager.java

示例5: ServerListPacketListener

public ServerListPacketListener(SuperVanish plugin) {
    //noinspection deprecation
    super(plugin, ListenerPriority.NORMAL, PacketType.Status.Server.OUT_SERVER_INFO);
    this.plugin = plugin;
}
 
开发者ID:MyzelYam,项目名称:SuperVanish,代码行数:5,代码来源:ServerListPacketListener.java

示例6: HardcoreHeartsListener

/**
 * listens for login packets to edit
 *
 * @param bukkitPlugin the plugin
 */
HardcoreHeartsListener(Plugin bukkitPlugin)
{
    //listen for login packets on the normal priority
    super(bukkitPlugin, ListenerPriority.NORMAL, PacketType.Play.Server.LOGIN);
}
 
开发者ID:Eluinhost,项目名称:ultrahardcore,代码行数:10,代码来源:HardcoreHeartsFeature.java

示例7: SoundMufflerListener

public SoundMufflerListener(Plugin plugin) {
    super(plugin, ListenerPriority.NORMAL, PacketType.Play.Server.NAMED_SOUND_EFFECT);
}
 
开发者ID:desht,项目名称:sensibletoolbox,代码行数:3,代码来源:SoundMufflerListener.java

示例8: TabCompletePacketAdapter

TabCompletePacketAdapter(AuthMe plugin, PlayerCache playerCache) {
    super(plugin, ListenerPriority.NORMAL, PacketType.Play.Client.TAB_COMPLETE);
    this.playerCache = playerCache;
}
 
开发者ID:AuthMe,项目名称:AuthMeReloaded,代码行数:4,代码来源:TabCompletePacketAdapter.java


注:本文中的com.comphenix.protocol.events.ListenerPriority.NORMAL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。