use of com.solinia.solinia.Events.SoliniaPlayerJoinEvent in project solinia3-core by mixxit.
the class Solinia3CorePlayerListener method onPlayerJoin.
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
SoliniaPlayerJoinEvent soliniaevent;
try {
ISoliniaPlayer solplayer = SoliniaPlayerAdapter.Adapt(event.getPlayer());
soliniaevent = new SoliniaPlayerJoinEvent(event, solplayer);
solplayer.updateDisplayName();
solplayer.updateMaxHp();
Bukkit.getPluginManager().callEvent(soliniaevent);
// patch
if (solplayer.getClassObj() != null)
solplayer.setChosenClass(true);
else
solplayer.setChosenClass(false);
// patch
if (solplayer.getRace() != null)
solplayer.setChosenRace(true);
else
solplayer.setChosenRace(false);
StateManager.getInstance().getChannelManager().sendToDiscordMC(solplayer, StateManager.getInstance().getChannelManager().getDefaultDiscordChannel(), event.getPlayer().getName() + "(" + solplayer.getFullName() + ") has joined the game");
} catch (CoreStateInitException e) {
event.getPlayer().kickPlayer("Server initialising");
}
}
Aggregations