SteamWar/FightSystem
Archiviert
13
1

Fix some replay bugs
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2022-01-14 18:08:59 +01:00
Ursprung faba352a80
Commit e9e01febd1
3 geänderte Dateien mit 12 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -31,7 +31,7 @@ public class SpectateOverCountdown extends Countdown {
public SpectateOverCountdown() { public SpectateOverCountdown() {
super(Config.SpectatorDuration, new Message("SPECTATE_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, false); super(Config.SpectatorDuration, new Message("SPECTATE_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, false);
new StateDependentCountdown(ArenaMode.Restartable, FightState.Spectate, this); new StateDependentCountdown(ArenaMode.Restartable.contains(Config.mode) || Config.replayserver(), FightState.Spectate, this);
} }
@Override @Override

Datei anzeigen

@ -21,11 +21,9 @@ package de.steamwar.fightsystem.record;
import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.Clipboard;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import de.steamwar.fightsystem.ArenaMode;
import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem; import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.countdown.Countdown; import de.steamwar.fightsystem.countdown.Countdown;
import de.steamwar.fightsystem.countdown.EventSpectateCountdown;
import de.steamwar.fightsystem.fight.Fight; import de.steamwar.fightsystem.fight.Fight;
import de.steamwar.fightsystem.fight.FightTeam; import de.steamwar.fightsystem.fight.FightTeam;
import de.steamwar.fightsystem.fight.FreezeWorld; import de.steamwar.fightsystem.fight.FreezeWorld;
@ -463,17 +461,13 @@ public class PacketProcessor {
p.resetTitle(); p.resetTitle();
WorldOfColorWrapper.impl.sendTitle(p, title, subtitle, 5, 40, 5); WorldOfColorWrapper.impl.sendTitle(p, title, subtitle, 5, 40, 5);
}); });
if(Config.replayserver() || ArenaMode.AntiReplay.contains(Config.mode)) {
FightState.setFightState(FightState.SPECTATE);
}else{
new EventSpectateCountdown().enable();
}
} }
private void endReplay() { private void endReplay() {
REntity.dieAll(); REntity.dieAll();
freezer.disable(); freezer.disable();
FightSystem.getMessage().broadcast("REPLAY_ENDS"); FightSystem.getMessage().broadcast("REPLAY_ENDS");
FightState.setFightState(FightState.SPECTATE);
replaying = false; replaying = false;
} }

Datei anzeigen

@ -23,6 +23,7 @@ import com.comphenix.tinyprotocol.Reflection;
import com.comphenix.tinyprotocol.TinyProtocol; import com.comphenix.tinyprotocol.TinyProtocol;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.fight.Fight; import de.steamwar.fightsystem.fight.Fight;
import de.steamwar.fightsystem.listener.FightScoreboard; import de.steamwar.fightsystem.listener.FightScoreboard;
import de.steamwar.fightsystem.utils.BlockIdWrapper; import de.steamwar.fightsystem.utils.BlockIdWrapper;
@ -39,6 +40,7 @@ import org.bukkit.scoreboard.NameTagVisibility;
import org.bukkit.scoreboard.Team; import org.bukkit.scoreboard.Team;
import java.util.*; import java.util.*;
import java.util.logging.Level;
public class REntity { public class REntity {
@ -133,7 +135,14 @@ public class REntity {
this.entityType = EntityType.PLAYER; this.entityType = EntityType.PLAYER;
this.entityId = entityCount--; this.entityId = entityCount--;
SteamwarUser user = SteamwarUser.get(userId); SteamwarUser user;
try {
user = SteamwarUser.get(userId);
} catch (SecurityException e) {
FightSystem.getPlugin().getLogger().log(Level.SEVERE, "Could not load user " + userId);
throw e;
}
this.uuid = user.getUUID(); this.uuid = user.getUUID();
this.name = user.getUserName(); this.name = user.getUserName();
entities.put(internalId, this); entities.put(internalId, this);