SteamWar/FightSystem
Archiviert
13
1

Temporary only record if recording

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-11-01 16:17:00 +01:00
Ursprung 06960ffda7
Commit 014cee20a8
3 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -413,6 +413,6 @@ public class Config {
return CheckSchemID != 0; return CheckSchemID != 0;
} }
public static boolean recording(){ public static boolean recording(){
return event(); return event() && SpectateSystem;
} }
} }

Datei anzeigen

@ -52,7 +52,7 @@ public class EventRecordListener extends BasicListener {
private static final Random random = new Random(); private static final Random random = new Random();
public EventRecordListener() { public EventRecordListener() {
super(Config.event() ? EnumSet.allOf(FightState.class) : EnumSet.noneOf(FightState.class)); super(Config.recording() ? EnumSet.allOf(FightState.class) : EnumSet.noneOf(FightState.class));
} }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)

Datei anzeigen

@ -19,8 +19,8 @@
package de.steamwar.fightsystem.record; package de.steamwar.fightsystem.record;
import de.steamwar.fightsystem.FightSystem;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.World;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.File; import java.io.File;
@ -35,7 +35,8 @@ public class FileRecorder extends Recorder {
public FileRecorder(){ public FileRecorder(){
super(); super();
File file = new File(FightSystem.getPlugin().getDataFolder(), "recording.recording"); World world = Bukkit.getWorlds().get(0);
File file = new File(world.getWorldFolder(), world.getName() + ".recording");
try{ try{
file.createNewFile(); file.createNewFile();
outputStream = new DataOutputStream(new GZIPOutputStream(new FileOutputStream(file), 4096)); outputStream = new DataOutputStream(new GZIPOutputStream(new FileOutputStream(file), 4096));