Revert changes to PlayerListener

- This reverts the changes to PlayerListener.java in 5d6f3e1 to make spawn and first spawn working again
This commit is contained in:
ljacqu 2016-08-04 18:55:56 +02:00
parent 3534f680f7
commit 306160e675

View File

@ -193,9 +193,10 @@ public class PlayerListener implements Listener {
} }
} }
@EventHandler(priority = EventPriority.NORMAL) @EventHandler(priority = EventPriority.LOW)
public void onPlayerJoin(PlayerJoinEvent event) { public void onPlayerJoin(PlayerJoinEvent event) {
final Player player = event.getPlayer(); final Player player = event.getPlayer();
teleportationService.teleportNewPlayerToFirstSpawn(player);
management.performJoin(player); management.performJoin(player);
} }
@ -205,7 +206,7 @@ public class PlayerListener implements Listener {
// event caused by "logged in from another location". The nicer way, but only for Spigot, would be // event caused by "logged in from another location". The nicer way, but only for Spigot, would be
// to check in the AsyncPlayerPreLoginEvent. To support all servers, we use the less nice way. // to check in the AsyncPlayerPreLoginEvent. To support all servers, we use the less nice way.
@EventHandler(priority = EventPriority.LOW) @EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerLogin(PlayerLoginEvent event) { public void onPlayerLogin(PlayerLoginEvent event) {
final Player player = event.getPlayer(); final Player player = event.getPlayer();
final String name = player.getName(); final String name = player.getName();
@ -238,7 +239,6 @@ public class PlayerListener implements Listener {
} }
antiBot.handlePlayerJoin(player); antiBot.handlePlayerJoin(player);
teleportationService.teleportNewPlayerToFirstSpawn(player);
teleportationService.teleportOnJoin(player); teleportationService.teleportOnJoin(player);
} }
@ -261,13 +261,11 @@ public class PlayerListener implements Listener {
public void onPlayerKick(PlayerKickEvent event) { public void onPlayerKick(PlayerKickEvent event) {
// Note #831: Especially for offline CraftBukkit, we need to catch players being kicked because of // Note #831: Especially for offline CraftBukkit, we need to catch players being kicked because of
// "logged in from another location" and to cancel their kick // "logged in from another location" and to cancel their kick
if(settings.getProperty(RestrictionSettings.FORCE_SINGLE_SESSION)) { if (settings.getProperty(RestrictionSettings.FORCE_SINGLE_SESSION)
String reason = event.getReason(); && event.getReason().contains("You logged in from another location")) {
if (reason.contains("You logged in from another location")) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
}
final Player player = event.getPlayer(); final Player player = event.getPlayer();
if (!antiBot.wasPlayerKicked(player.getName())) { if (!antiBot.wasPlayerKicked(player.getName())) {