Fix minor codestyle issues #1341

This commit is contained in:
Gabriele C 2017-10-02 09:40:37 +02:00
parent d6e2f35efd
commit 816e751fe7
2 changed files with 8 additions and 8 deletions

View File

@ -79,7 +79,7 @@ public class PlayerListener implements Listener {
@Inject
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)
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
@ -193,7 +193,7 @@ public class PlayerListener implements Listener {
public void onPlayerJoin(PlayerJoinEvent event) {
final Player player = event.getPlayer();
if (!PlayerListener19Spigot.isIsPlayerSpawnLocationEventCalled()) {
if (!PlayerListener19Spigot.isPlayerSpawnLocationEventCalled()) {
teleportationService.teleportOnJoin(player);
management.performJoin(player, player.getLocation());
}
@ -224,7 +224,7 @@ public class PlayerListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST)
public void onAsyncPlayerPreLoginEvent(AsyncPlayerPreLoginEvent event) {
IS_ASYNC_PLAYER_PRE_LOGIN_EVENT_CALLED = true;
isAsyncPlayerPreLoginEventCalled = true;
final String name = event.getName();
@ -259,7 +259,7 @@ public class PlayerListener implements Listener {
return;
}
if (!IS_ASYNC_PLAYER_PRE_LOGIN_EVENT_CALLED) {
if (!isAsyncPlayerPreLoginEventCalled) {
try {
runOnJoinChecks(name, event.getAddress().getHostAddress());
} catch (FailedVerificationException e) {

View File

@ -19,16 +19,16 @@ public class PlayerListener19Spigot implements Listener {
@Inject
private TeleportationService teleportationService;
private static boolean IS_PLAYER_SPAWN_LOCATION_EVENT_CALLED = false;
private static boolean isPlayerSpawnLocationEventCalled = false;
public static boolean isIsPlayerSpawnLocationEventCalled() {
return IS_PLAYER_SPAWN_LOCATION_EVENT_CALLED;
public static boolean isPlayerSpawnLocationEventCalled() {
return isPlayerSpawnLocationEventCalled;
}
// Note: the following event is called since MC1.9, in older versions we have to fallback on the PlayerJoinEvent
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerSpawn(PlayerSpawnLocationEvent event) {
IS_PLAYER_SPAWN_LOCATION_EVENT_CALLED = true;
isPlayerSpawnLocationEventCalled = true;
final Player player = event.getPlayer();
management.performJoin(player, event.getSpawnLocation());