Fix to login event
Dieser Commit ist enthalten in:
Ursprung
6cbdb837d0
Commit
ccc1388cc3
@ -29,23 +29,27 @@ import de.steamwar.sql.SteamwarUser;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
public class JoinListener extends BasicListener {
|
||||
|
||||
@EventHandler
|
||||
public void onJoin(PlayerJoinEvent e){
|
||||
e.setJoinMessage(null);
|
||||
public void onLogin(PlayerLoginEvent e){
|
||||
Player player = e.getPlayer();
|
||||
|
||||
if(InspectCommand.inspecting){
|
||||
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
|
||||
if(!SpectateSystem.allowedGroups.contains(user.getUserGroup())){
|
||||
player.sendMessage("§eSteam§8War» §cDerzeit ist das Zuschauen nicht gestattet.");
|
||||
player.kickPlayer(null);
|
||||
return;
|
||||
e.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, "§eSteam§8War» §cDerzeit ist das Zuschauen nicht gestattet.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onJoin(PlayerJoinEvent e){
|
||||
e.setJoinMessage(null);
|
||||
Player player = e.getPlayer();
|
||||
|
||||
player.teleport(Config.SpecSpawn);
|
||||
REntity.playerJoins(player);
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren