Dieser Commit ist enthalten in:
Ursprung
7a9a2283a9
Commit
356b14d49c
@ -84,13 +84,28 @@ public class TraceManager implements Listener {
|
|||||||
* @return id of the created trace
|
* @return id of the created trace
|
||||||
*/
|
*/
|
||||||
protected int add(Trace trace) {
|
protected int add(Trace trace) {
|
||||||
showDataPerRegionPerPlayer.getOrDefault(trace.getRegion(), Collections.emptyMap()).forEach(trace::render);
|
showDataPerRegionPerPlayer.getOrDefault(trace.getRegion(), Collections.emptyMap()).forEach((player, playerTraceShowData) -> {
|
||||||
|
trace.render(player, playerTraceShowData);
|
||||||
|
followerMap.getOrDefault(player, Collections.emptySet()).forEach(follower -> {
|
||||||
|
trace.render(follower, playerTraceShowData);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
traces.put(nextOpenId, trace);
|
traces.put(nextOpenId, trace);
|
||||||
tracesByRegion.computeIfAbsent(trace.getRegion(), region -> new HashMap<>()).put(nextOpenId, trace);
|
tracesByRegion.computeIfAbsent(trace.getRegion(), region -> new HashMap<>()).put(nextOpenId, trace);
|
||||||
nextOpenId++;
|
nextOpenId++;
|
||||||
return nextOpenId;
|
return nextOpenId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void showPartial(Trace trace, List<TNTPoint> recordsToAdd) {
|
||||||
|
showDataPerRegionPerPlayer.getOrDefault(trace.getRegion(), Collections.emptyMap()).forEach((player, playerTraceShowData) -> {
|
||||||
|
trace.render(recordsToAdd, player, playerTraceShowData);
|
||||||
|
followerMap.getOrDefault(player, Collections.emptySet()).forEach(follower -> {
|
||||||
|
trace.render(recordsToAdd, follower, playerTraceShowData);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
protected Map<Player, PlayerTraceShowData> getTraceShowDataPlayerMapping(Region region) {
|
protected Map<Player, PlayerTraceShowData> getTraceShowDataPlayerMapping(Region region) {
|
||||||
return showDataPerRegionPerPlayer.getOrDefault(region, new HashMap<>());
|
return showDataPerRegionPerPlayer.getOrDefault(region, new HashMap<>());
|
||||||
}
|
}
|
||||||
@ -106,8 +121,7 @@ public class TraceManager implements Listener {
|
|||||||
.map(Map.Entry::getKey)
|
.map(Map.Entry::getKey)
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
if (traceId == null)
|
if (traceId == null) return false;
|
||||||
return false;
|
|
||||||
traces.remove(traceId);
|
traces.remove(traceId);
|
||||||
tracesByRegion.getOrDefault(trace.getRegion(), Collections.emptyMap()).remove(traceId);
|
tracesByRegion.getOrDefault(trace.getRegion(), Collections.emptyMap()).remove(traceId);
|
||||||
trace.hide();
|
trace.hide();
|
||||||
|
@ -72,7 +72,7 @@ public class TraceRecordingWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void commitRecorded() {
|
public void commitRecorded() {
|
||||||
TraceManager.instance.getTraceShowDataPlayerMapping(region).forEach((key, value) -> trace.render(recordsToAdd, key, value));
|
TraceManager.instance.showPartial(trace, recordsToAdd);
|
||||||
|
|
||||||
recordsToAdd.forEach(record -> {
|
recordsToAdd.forEach(record -> {
|
||||||
try {
|
try {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren