Fix minor codestyle issues #1341
This commit is contained in:
parent
d6e2f35efd
commit
816e751fe7
@ -79,7 +79,7 @@ public class PlayerListener implements Listener {
|
|||||||
@Inject
|
@Inject
|
||||||
private JoinMessageService joinMessageService;
|
private JoinMessageService joinMessageService;
|
||||||
|
|
||||||
private static boolean IS_ASYNC_PLAYER_PRE_LOGIN_EVENT_CALLED = false;
|
private static boolean isAsyncPlayerPreLoginEventCalled = false;
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
|
||||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
||||||
@ -193,7 +193,7 @@ public class PlayerListener implements Listener {
|
|||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
|
||||||
if (!PlayerListener19Spigot.isIsPlayerSpawnLocationEventCalled()) {
|
if (!PlayerListener19Spigot.isPlayerSpawnLocationEventCalled()) {
|
||||||
teleportationService.teleportOnJoin(player);
|
teleportationService.teleportOnJoin(player);
|
||||||
management.performJoin(player, player.getLocation());
|
management.performJoin(player, player.getLocation());
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ public class PlayerListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onAsyncPlayerPreLoginEvent(AsyncPlayerPreLoginEvent event) {
|
public void onAsyncPlayerPreLoginEvent(AsyncPlayerPreLoginEvent event) {
|
||||||
IS_ASYNC_PLAYER_PRE_LOGIN_EVENT_CALLED = true;
|
isAsyncPlayerPreLoginEventCalled = true;
|
||||||
|
|
||||||
final String name = event.getName();
|
final String name = event.getName();
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ public class PlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IS_ASYNC_PLAYER_PRE_LOGIN_EVENT_CALLED) {
|
if (!isAsyncPlayerPreLoginEventCalled) {
|
||||||
try {
|
try {
|
||||||
runOnJoinChecks(name, event.getAddress().getHostAddress());
|
runOnJoinChecks(name, event.getAddress().getHostAddress());
|
||||||
} catch (FailedVerificationException e) {
|
} catch (FailedVerificationException e) {
|
||||||
|
|||||||
@ -19,16 +19,16 @@ public class PlayerListener19Spigot implements Listener {
|
|||||||
@Inject
|
@Inject
|
||||||
private TeleportationService teleportationService;
|
private TeleportationService teleportationService;
|
||||||
|
|
||||||
private static boolean IS_PLAYER_SPAWN_LOCATION_EVENT_CALLED = false;
|
private static boolean isPlayerSpawnLocationEventCalled = false;
|
||||||
|
|
||||||
public static boolean isIsPlayerSpawnLocationEventCalled() {
|
public static boolean isPlayerSpawnLocationEventCalled() {
|
||||||
return IS_PLAYER_SPAWN_LOCATION_EVENT_CALLED;
|
return isPlayerSpawnLocationEventCalled;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: the following event is called since MC1.9, in older versions we have to fallback on the PlayerJoinEvent
|
// Note: the following event is called since MC1.9, in older versions we have to fallback on the PlayerJoinEvent
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
public void onPlayerSpawn(PlayerSpawnLocationEvent event) {
|
public void onPlayerSpawn(PlayerSpawnLocationEvent event) {
|
||||||
IS_PLAYER_SPAWN_LOCATION_EVENT_CALLED = true;
|
isPlayerSpawnLocationEventCalled = true;
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
|
||||||
management.performJoin(player, event.getSpawnLocation());
|
management.performJoin(player, event.getSpawnLocation());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user