Commits vergleichen
2 Commits
add259788d
...
7502270b96
Autor | SHA1 | Datum | |
---|---|---|---|
|
7502270b96 | ||
|
0c91261d55 |
@ -149,8 +149,13 @@ public class TraceRecorder implements Listener {
|
||||
private TNTPoint record(TNTPrimed tntPrimed, TraceRecordingWrapper wrappedTrace, List<Block> destroyedBlocks) {
|
||||
List<TNTPoint> history = historyMap.getOrDefault(tntPrimed, new ArrayList<>());
|
||||
// Failsave for tnt entering unloaded chunks
|
||||
if (history.size() > 0 && history.get(history.size() - 1).getFuse() == tntPrimed.getFuseTicks()) {
|
||||
removeFromRecording(tntPrimed);
|
||||
if (tntPrimed.isDead() || history.size() > 0 && history.get(history.size() - 1).getFuse() == tntPrimed.getFuseTicks() &&) {
|
||||
Region region = tntSpawnRegion.get(tntPrimed);
|
||||
if (region == null) return null;
|
||||
trackedTNT.get(region).remove(tntPrimed);
|
||||
tntSpawnRegion.remove(tntPrimed);
|
||||
historyMap.remove(tntPrimed);
|
||||
tntSpawnRegion.remove(tntPrimed);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -249,20 +254,6 @@ public class TraceRecorder implements Listener {
|
||||
tntSpawnRegion.remove((TNTPrimed) event.getEntity());
|
||||
|
||||
activeTraces.get(region).addRecord(record((TNTPrimed) event.getEntity(), activeTraces.get(region), event.blockList()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Methode to be used if a tnt should be removed for internal or technical reasons
|
||||
*
|
||||
* @param tnt tnt to remove
|
||||
* @return whether the tnt was tracked beforehand or not
|
||||
*/
|
||||
public boolean removeFromRecording(TNTPrimed tnt) {
|
||||
Region region = tntSpawnRegion.getOrDefault(tnt, null);
|
||||
if (region == null) return false;
|
||||
trackedTNT.get(region).remove(tnt);
|
||||
tntSpawnRegion.remove(tnt);
|
||||
historyMap.remove(tnt);
|
||||
return true;
|
||||
tntSpawnRegion.remove((TNTPrimed) event.getEntity());
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren