Commits vergleichen
Keine gemeinsamen Commits. "7a9a2283a9f3fbbd5f4d7f7e25ba5cd50758ba96" und "163967483fd6ccf27ad1545f03254e02a0871ee4" haben vollständig unterschiedliche Historien.
7a9a2283a9
...
163967483f
@ -179,13 +179,8 @@ public class TNTPoint implements Externalizable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TNTPoint{" +
|
||||
"tntId=" + tntId +
|
||||
", explosion=" + explosion +
|
||||
", inWater=" + inWater +
|
||||
", afterFirstExplosion=" + afterFirstExplosion +
|
||||
", destroyedBuildArea=" + destroyedBuildArea +
|
||||
", destroyedTestBlock=" + destroyedTestBlock +
|
||||
return "TNTRecord{" +
|
||||
"explosion=" + explosion +
|
||||
", ticksSinceStart=" + ticksSinceStart +
|
||||
", fuse=" + fuse +
|
||||
", location=" + location +
|
||||
|
@ -279,6 +279,8 @@ public class Trace {
|
||||
records.add((TNTPoint) inputStream.readObject());
|
||||
}
|
||||
|
||||
System.out.println("Loaded... " + records);
|
||||
|
||||
Map<Integer, List<TNTPoint>> histories = new HashMap<>();
|
||||
for (TNTPoint record : records) {
|
||||
int tntId = record.getTntId();
|
||||
|
@ -68,7 +68,7 @@ public class TraceCommand extends SWCommand {
|
||||
|
||||
@Register(value = "show", description = "TRACE_COMMAND_HELP_SHOW")
|
||||
public void show(@Validator Player player, @OptionalValue("STRICT") BundleFilter bundleFilter, ViewFlag... flags) {
|
||||
showInternal(player, bundleFilter, flags);
|
||||
showInternal(player, 0, Integer.MAX_VALUE, bundleFilter, flags);
|
||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW", player);
|
||||
}
|
||||
|
||||
@ -95,6 +95,11 @@ public class TraceCommand extends SWCommand {
|
||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW_FROM_TO", player, from, to);
|
||||
}
|
||||
|
||||
private void showInternal(Player player, int from, int to, BundleFilter bundleFilter, ViewFlag... flags) {
|
||||
PlayerTraceShowData playerTraceShowData = new PlayerTraceShowData(bundleFilter, flags);
|
||||
playerTraceShowData.addViewFlag(new AtFlag(from, to));
|
||||
TraceManager.instance.show(player, playerTraceShowData);
|
||||
}
|
||||
|
||||
@Register(value = { "show", "at" }, description = "TRACE_COMMAND_HELP_SHOW_AT")
|
||||
public void showAt(@Validator Player player, @Min(intValue = 0) int time) {
|
||||
@ -114,17 +119,6 @@ public class TraceCommand extends SWCommand {
|
||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW_FROM_TO", player, from, to);
|
||||
}
|
||||
|
||||
private void showInternal(Player player, BundleFilter bundleFilter, ViewFlag... flags) {
|
||||
PlayerTraceShowData playerTraceShowData = new PlayerTraceShowData(bundleFilter, flags);
|
||||
TraceManager.instance.show(player, playerTraceShowData);
|
||||
}
|
||||
|
||||
private void showInternal(Player player, int from, int to, BundleFilter bundleFilter, ViewFlag... flags) {
|
||||
PlayerTraceShowData playerTraceShowData = new PlayerTraceShowData(bundleFilter, flags);
|
||||
playerTraceShowData.addViewFlag(new AtFlag(from, to));
|
||||
TraceManager.instance.show(player, playerTraceShowData);
|
||||
}
|
||||
|
||||
@Register(value = "hide", description = "TRACE_COMMAND_HELP_HIDE")
|
||||
public void hide(@Validator Player player) {
|
||||
TraceManager.instance.hide(player);
|
||||
|
@ -202,7 +202,8 @@ public class TraceManager implements Listener {
|
||||
unfollow(player);
|
||||
|
||||
Region region = Region.getRegion(player.getLocation());
|
||||
PlayerTraceShowData previous = showDataPerRegionPerPlayer.getOrDefault(region, Collections.emptyMap()).remove(player);
|
||||
PlayerTraceShowData previous = showDataPerRegionPerPlayer.getOrDefault(region, Collections.emptyMap())
|
||||
.remove(player);
|
||||
if (previous == null) return;
|
||||
tracesByRegion.getOrDefault(player, Collections.emptyMap()).forEach((integer, trace) -> {
|
||||
trace.hide(player);
|
||||
@ -220,7 +221,9 @@ public class TraceManager implements Listener {
|
||||
|
||||
showDataPerRegionPerPlayer.forEach((region, playerPlayerTraceShowDataMap) -> {
|
||||
if (playerPlayerTraceShowDataMap.containsKey(follower)) {
|
||||
tracesByRegion.getOrDefault(region, Collections.emptyMap()).forEach((integer, trace) -> trace.hide(follower));
|
||||
tracesByRegion.getOrDefault(region, Collections.emptyMap()).forEach((integer, trace) -> {
|
||||
trace.hide(follower);
|
||||
});
|
||||
}
|
||||
|
||||
PlayerTraceShowData playerTraceShowData = playerPlayerTraceShowDataMap.get(following);
|
||||
|
@ -168,7 +168,8 @@ public class TraceRecorder implements Listener {
|
||||
}
|
||||
boolean afterFirstExplosion = wrappedTrace.isExplosionRecorded();
|
||||
|
||||
TNTPoint record = new TNTPoint(tntID, tntPrimed, isExplosion, afterFirstExplosion, TPSUtils.currentTick.get() - wrappedTrace.getStartTick(), history, destroyedBlocks);
|
||||
TNTPoint record = new TNTPoint(tntID, tntPrimed, isExplosion, afterFirstExplosion,
|
||||
TPSUtils.currentTick.get() - wrappedTrace.getStartTick(), history, destroyedBlocks);
|
||||
history.add(record);
|
||||
|
||||
return record;
|
||||
@ -198,7 +199,8 @@ public class TraceRecorder implements Listener {
|
||||
|
||||
trackedTNT.get(region).add((TNTPrimed) event.getEntity());
|
||||
tntSpawnRegion.put((TNTPrimed) event.getEntity(), region);
|
||||
activeTraces.get(region).addRecord(record((TNTPrimed) event.getEntity(), activeTraces.get(region), Collections.emptyList()));
|
||||
activeTraces.get(region).addRecord(
|
||||
record((TNTPrimed) event.getEntity(), activeTraces.get(region), Collections.emptyList()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,6 +219,7 @@ public class TraceRecorder implements Listener {
|
||||
trackedTNT.get(region).remove((TNTPrimed) event.getEntity());
|
||||
tntSpawnRegion.remove((TNTPrimed) event.getEntity());
|
||||
|
||||
activeTraces.get(region).addRecord(record((TNTPrimed) event.getEntity(), activeTraces.get(region), event.blockList()));
|
||||
activeTraces.get(region)
|
||||
.addRecord(record((TNTPrimed) event.getEntity(), activeTraces.get(region), event.blockList()));
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class TraceRecordingWrapper {
|
||||
private final long startTick;
|
||||
private final List<TNTPoint> recordsToAdd;
|
||||
private final List<TNTPoint> recordList;
|
||||
private final ObjectOutputStream recordsOutputStream;
|
||||
private ObjectOutputStream recordsOutputStream;
|
||||
private int nextOpenRecordId = 0;
|
||||
@Getter
|
||||
private boolean explosionRecorded = false;
|
||||
|
@ -30,7 +30,7 @@ public class PlayerTraceShowData {
|
||||
@Setter
|
||||
private BundleFilter bundleFilter;
|
||||
|
||||
private final Map<Class<? extends ViewFlag>, ViewFlag> viewFlags = new HashMap<>();
|
||||
private Map<Class<? extends ViewFlag>, ViewFlag> viewFlags = new HashMap<>();
|
||||
|
||||
public PlayerTraceShowData(BundleFilter bundleFilter, ViewFlag... viewFlags) {
|
||||
this.bundleFilter = bundleFilter;
|
||||
@ -49,8 +49,6 @@ public class PlayerTraceShowData {
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println(flagList);
|
||||
|
||||
// Manage inverse flags
|
||||
ViewFlag.inverseFlags.forEach(viewFlag -> {
|
||||
if (!flagList.remove(viewFlag)) {
|
||||
@ -58,8 +56,6 @@ public class PlayerTraceShowData {
|
||||
}
|
||||
});
|
||||
|
||||
System.out.println(flagList);
|
||||
|
||||
return flagList;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ public abstract class ViewFlag {
|
||||
@Override
|
||||
public List<TNTPoint> filter(List<TNTPoint> records) {
|
||||
return records.stream()
|
||||
.filter(record -> record.isAfterFirstExplosion())
|
||||
.filter(record -> !record.isAfterFirstExplosion())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
};
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren