Merge pull request 'Fix post clear behaviour' (#154) from fixClear into master
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Commit
bdb575b9c6
@ -86,4 +86,9 @@ public class RecordStateMachine {
|
||||
if (recorder == null) return 0;
|
||||
return recorder.getStartTime();
|
||||
}
|
||||
|
||||
public static void postClear(){
|
||||
if (recorder == null) return;
|
||||
recorder.postClear();
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ package de.steamwar.bausystem.tracer.record;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.tracer.show.Record;
|
||||
import de.steamwar.bausystem.tracer.show.StoredRecords;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
@ -63,6 +64,12 @@ public class Recorder implements Listener {
|
||||
return record.getStartTime();
|
||||
}
|
||||
|
||||
void postClear() {
|
||||
record.clear();
|
||||
recordMap.clear();
|
||||
StoredRecords.add(record);
|
||||
}
|
||||
|
||||
private void run() {
|
||||
world.getEntitiesByClass(TNTPrimed.class).forEach(tntPrimed -> get(tntPrimed).add(tntPrimed));
|
||||
}
|
||||
|
@ -55,6 +55,10 @@ public class Record {
|
||||
return record;
|
||||
}
|
||||
|
||||
public void clear(){
|
||||
tnt.clear();
|
||||
}
|
||||
|
||||
public static class TNTRecord {
|
||||
private final List<TNTPosition> positions = new ArrayList<>(41);
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package de.steamwar.bausystem.tracer.show;
|
||||
|
||||
import de.steamwar.bausystem.tracer.record.RecordStateMachine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -37,6 +39,7 @@ public class StoredRecords {
|
||||
public static void clear() {
|
||||
records.clear();
|
||||
TraceShowManager.clear();
|
||||
RecordStateMachine.postClear();
|
||||
}
|
||||
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren