SteamWar/FightSystem
Archiviert
13
1

Fix player despawn

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-11-02 12:13:57 +01:00
Ursprung d9dede725b
Commit 5b12e10b98
2 geänderte Dateien mit 9 neuen und 16 gelöschten Zeilen

Datei anzeigen

@ -55,22 +55,6 @@ public class EventRecordListener extends BasicListener {
super(Config.recording() ? EnumSet.allOf(FightState.class) : EnumSet.noneOf(FightState.class));
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerJoin(PlayerJoinEvent e){
if(isNotSent(e.getPlayer()))
return;
RecordSystem.playerJoins(e.getPlayer());
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerLeave(PlayerQuitEvent e) {
if(isNotSent(e.getPlayer()))
return;
RecordSystem.entityDespawns(e.getPlayer());
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerMove(PlayerMoveEvent e){
if(isNotSent(e.getPlayer()))

Datei anzeigen

@ -27,6 +27,7 @@ import de.steamwar.fightsystem.countdown.SWSound;
import de.steamwar.fightsystem.fight.Fight;
import de.steamwar.fightsystem.fight.FightPlayer;
import de.steamwar.fightsystem.fight.FightTeam;
import de.steamwar.fightsystem.record.RecordSystem;
import de.steamwar.fightsystem.states.FightState;
import de.steamwar.sql.SteamwarUser;
import net.md_5.bungee.api.chat.TextComponent;
@ -89,6 +90,8 @@ public class PlayerStateListener extends BasicListener{
Fight.setPlayerGamemode(player, GameMode.SPECTATOR);
player.teleport(fightTeam.getSpawn());
Fight.playSound(Countdown.getSound(SWSound.ENTITY_WITHER_DEATH), 100.0F, 1.0F);
if(Config.recording())
RecordSystem.entityDespawns(player);
}
@EventHandler(priority = EventPriority.HIGH)
@ -103,11 +106,17 @@ public class PlayerStateListener extends BasicListener{
FightState fightState = FightSystem.getFightState();
if(fightState.setup()){
fightTeam.removePlayer(player);
if(Config.recording())
RecordSystem.entityDespawns(player);
}else if(fightState.ingame()){
FightPlayer fightPlayer = fightTeam.getFightPlayer(player);
if(fightPlayer.isLiving()) {
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Spieler " + fightTeam.getPrefix() + player.getName() + " §chat den Kampf verlassen!");
fightTeam.getFightPlayer(player).setOut();
if(Config.recording())
RecordSystem.entityDespawns(player);
}
}