SteamWar/FightSystem
Archiviert
13
1

RecordSystem (Beta) #199

Manuell gemergt
Lixfel hat 40 Commits von recordSystem nach master 2020-11-01 20:11:45 +01:00 zusammengeführt
3 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen
Nur Änderungen aus Commit 014cee20a8 werden angezeigt - Alle Commits anzeigen

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));