refactor: relocate packages

This commit is contained in:
ineanto 2023-12-06 22:53:51 +01:00
parent 8d1c80a5fb
commit fc2be7c7a4
4 changed files with 21 additions and 14 deletions

View file

@ -149,7 +149,7 @@ public class AppearanceManager {
player.teleport(player.getLocation(), PlayerTeleportEvent.TeleportCause.PLUGIN);
player.setAllowFlight(wasAllowedToFly);
player.setFlying(wasFlying);
player.updateInventory(); // Marked as unstable.
player.updateInventory();
}
@SuppressWarnings("deprecation")

View file

@ -16,9 +16,12 @@ import xyz.ineanto.nicko.storage.PlayerDataStore;
import xyz.ineanto.nicko.storage.name.PlayerNameStore;
import java.util.Optional;
import java.util.logging.Logger;
import java.util.stream.Collectors;
public class PlayerJoinListener implements Listener {
private final Logger logger = Logger.getLogger("PlayerJoinListener");
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
public void onPlayerJoin(PlayerJoinEvent event) {
final Player player = event.getPlayer();
@ -51,7 +54,10 @@ public class PlayerJoinListener implements Listener {
optionalOnlinePlayerProfile.ifPresent(profile -> {
final AppearanceManager appearanceManager = new AppearanceManager(online);
final boolean needsASkinChange = profile.getSkin() != null && !profile.getSkin().equals(online.getName());
appearanceManager.updateForOthers(needsASkinChange, false);
final ActionResult actionResult = appearanceManager.updateForOthers(needsASkinChange, false);
if (actionResult.isError()) {
logger.warning("Something wrong happened while updating players to joining player (" + actionResult.getErrorKey() + ")");
}
});
}
}, 20L);