本文整理了Java中net.md_5.bungee.event.EventHandler.<init>()
方法的一些代码示例,展示了EventHandler.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EventHandler.<init>()
方法的具体详情如下:
包路径:net.md_5.bungee.event.EventHandler
类名称:EventHandler
方法名:<init>
暂无
代码示例来源:origin: CodeCrafter47/BungeeTabListPlus
@EventHandler
public void onReload(ProxyReloadEvent event) {
plugin.reload();
}
}
代码示例来源:origin: aikar/commands
@EventHandler
public void onDisconnect(PlayerDisconnectEvent disconnectEvent) {
//cleanup
ProxiedPlayer player = disconnectEvent.getPlayer();
manager.issuersLocale.remove(player.getUniqueId());
}
}
代码示例来源:origin: wacossusca34/Consoles
@EventHandler
@SuppressWarnings("unused")
public void onPlayerDisconnect(PlayerDisconnectEvent event) {
connected.remove(event.getPlayer().getUniqueId());
}
@EventHandler
代码示例来源:origin: minecrafter/RedisBungee
@EventHandler
public void onPostLogin(final PostLoginEvent event) {
plugin.getProxy().getScheduler().runAsync(plugin, new RedisCallable<Void>(plugin) {
@Override
protected Void call(Jedis jedis) {
jedis.publish("redisbungee-data", RedisBungee.getGson().toJson(new DataManager.DataManagerMessage<>(
event.getPlayer().getUniqueId(), DataManager.DataManagerMessage.Action.JOIN,
new DataManager.LoginPayload(event.getPlayer().getAddress().getAddress()))));
return null;
}
});
}
代码示例来源:origin: minecrafter/RedisBungee
@EventHandler
public void onPostLogin(PostLoginEvent event) {
// Invalidate all entries related to this player, since they now lie.
invalidate(event.getPlayer().getUniqueId());
}
代码示例来源:origin: minecrafter/RedisBungee
@EventHandler
public void onPlayerDisconnect(PlayerDisconnectEvent event) {
// Invalidate all entries related to this player, since they now lie.
invalidate(event.getPlayer().getUniqueId());
}
代码示例来源:origin: MylesIsCool/ViaVersion
@EventHandler(priority = EventPriority.LOWEST)
public void onServerConnected(ServerConnectedEvent e) {
try {
checkServerChange(e, Via.getManager().getConnection(e.getPlayer().getUniqueId()));
} catch (Exception e1) {
e1.printStackTrace();
}
}
代码示例来源:origin: BuycraftPlugin/BuycraftX
@EventHandler
public void onPostLogin(final PostLoginEvent event) {
if (event.getPlayer().hasPermission("buycraft.admin") && !upToDate) {
plugin.getPlatform().executeAsyncLater(new Runnable() {
@Override
public void run() {
event.getPlayer().sendMessage(ChatColor.YELLOW + plugin.getI18n().get("update_available", lastKnownVersion.getVersion()));
}
}, 3, TimeUnit.SECONDS);
}
}
}
代码示例来源:origin: games647/ChangeSkin
@EventHandler
public void onDisconnect(PlayerDisconnectEvent disconnectEvent) {
PendingConnection pendingConnection = disconnectEvent.getPlayer().getPendingConnection();
UserPreference preference = plugin.endSession(pendingConnection);
if (preference != null) {
save(preference);
}
}
代码示例来源:origin: wacossusca34/Consoles
@EventHandler
@SuppressWarnings("unused")
public void onPlayerConnect(final ServerConnectedEvent event) {
if (!connected.contains(event.getPlayer().getUniqueId())) {
connected.add(event.getPlayer().getUniqueId());
execute(event.getPlayer(), event.getServer(), "clear");
}
}
public boolean execute(ProxiedPlayer player, String command, Object... args) {
代码示例来源:origin: TimoCloud/TimoCloud
@EventHandler
public void onPlayerConnect(PostLoginEvent event) {
if (! TimoCloudBungee.getInstance().getFileManager().getConfig().getBoolean("useFallback")) {
return;
}
pending.add(event.getPlayer().getUniqueId());
}
代码示例来源:origin: aikar/commands
@EventHandler
public void onPlayerJoin(PostLoginEvent loginEvent) {
ProxiedPlayer player = loginEvent.getPlayer();
//the client settings are sent after a successful login
Runnable task = () -> manager.readLocale(player);
plugin.getProxy().getScheduler().schedule(plugin, task, 1, TimeUnit.SECONDS);
}
代码示例来源:origin: MylesIsCool/ViaVersion
@EventHandler
public void onQuit(PlayerDisconnectEvent e) {
UserConnection userConnection = Via.getManager().getPortedPlayers().get(e.getPlayer().getUniqueId());
if (userConnection != null) {
// Only remove if the connection is disconnected (eg. relogin)
if (userConnection.getChannel() == null || !userConnection.getChannel().isOpen()) {
Via.getManager().removePortedClient(e.getPlayer().getUniqueId());
}
}
}
}
代码示例来源:origin: Rsl1122/Plan-PlayerAnalytics
@EventHandler
public void onLogout(PlayerDisconnectEvent event) {
try {
ProxiedPlayer player = event.getPlayer();
UUID uuid = player.getUniqueId();
sessionCache.endSession(uuid, System.currentTimeMillis());
processing.submit(processors.info().playerPageUpdateProcessor(uuid));
ResponseCache.clearResponse(PageId.SERVER.of(serverInfo.getServerUUID()));
} catch (Exception e) {
errorHandler.log(L.WARN, this.getClass(), e);
}
}
代码示例来源:origin: games647/ChangeSkin
@EventHandler(priority = EventPriority.HIGH)
public void onPostLogin(LoginEvent loginEvent) {
if (loginEvent.isCancelled() || isBlacklistEnabled()) {
return;
}
PendingConnection connection = loginEvent.getConnection();
String playerName = connection.getName().toLowerCase();
loginEvent.registerIntent(plugin);
Runnable task = () -> loadProfile(loginEvent, connection, playerName);
ProxyServer.getInstance().getScheduler().runAsync(plugin, task);
}
代码示例来源:origin: MylesIsCool/ViaVersion
@EventHandler
public void onJoin(PostLoginEvent e) {
if (e.getPlayer().hasPermission("viaversion.update")
&& Via.getConfig().isCheckForUpdates()) {
UpdateUtil.sendUpdateMessage(e.getPlayer().getUniqueId());
}
}
}
代码示例来源:origin: BuycraftPlugin/BuycraftX
@EventHandler
public void onPostLogin(PostLoginEvent event) {
if (plugin.getApiClient() == null) {
return;
}
QueuedPlayer qp = plugin.getDuePlayerFetcher().fetchAndRemoveDuePlayer(event.getPlayer().getName());
if (qp != null) {
plugin.getPlayerJoinCheckTask().queue(qp);
}
}
}
代码示例来源:origin: TimoCloud/TimoCloud
@EventHandler
public void onServerKick(ServerKickEvent event) {
event.setCancelled(true);
event.setCancelServer(TimoCloudBungee.getInstance().getLobbyManager().getFreeLobby(event.getPlayer().getUniqueId()));
}
}
代码示例来源:origin: Dytanic/CloudNet
@EventHandler
public void handleChat(ChatEvent e)
{
if (e.getMessage().startsWith(NetworkUtils.SLASH_STRING))
{
if (e.getSender() instanceof ProxiedPlayer)
CloudAPI.getInstance().getNetworkConnection().sendPacket(new PacketOutCommandExecute(new PlayerCommandExecution(((ProxiedPlayer) e.getSender()).getName(), e.getMessage())));
}
}
代码示例来源:origin: TimoCloud/TimoCloud
@EventHandler
public void onPlayerQuitEvent(net.md_5.bungee.api.event.PlayerDisconnectEvent event) {
TimoCloudBungee.getInstance().sendPlayerCount();
TimoCloudBungee.getInstance().getEventManager().sendEvent(new PlayerDisconnectEvent(getPlayer(event.getPlayer())));
}
内容来源于网络,如有侵权,请联系作者删除!