13
0

Fix to login event

Dieser Commit ist enthalten in:
Lixfel 2021-03-21 11:27:01 +01:00
Ursprung 6cbdb837d0
Commit ccc1388cc3

Datei anzeigen

@ -29,23 +29,27 @@ import de.steamwar.sql.SteamwarUser;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
public class JoinListener extends BasicListener { public class JoinListener extends BasicListener {
@EventHandler @EventHandler
public void onJoin(PlayerJoinEvent e){ public void onLogin(PlayerLoginEvent e){
e.setJoinMessage(null);
Player player = e.getPlayer(); Player player = e.getPlayer();
if(InspectCommand.inspecting){ if(InspectCommand.inspecting){
SteamwarUser user = SteamwarUser.get(player.getUniqueId()); SteamwarUser user = SteamwarUser.get(player.getUniqueId());
if(!SpectateSystem.allowedGroups.contains(user.getUserGroup())){ if(!SpectateSystem.allowedGroups.contains(user.getUserGroup())){
player.sendMessage("§eSteam§8War» §cDerzeit ist das Zuschauen nicht gestattet."); e.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, "§eSteam§8War» §cDerzeit ist das Zuschauen nicht gestattet.");
player.kickPlayer(null);
return;
} }
} }
}
@EventHandler
public void onJoin(PlayerJoinEvent e){
e.setJoinMessage(null);
Player player = e.getPlayer();
player.teleport(Config.SpecSpawn); player.teleport(Config.SpecSpawn);
REntity.playerJoins(player); REntity.playerJoins(player);