SteamWar/BauSystem2.0
Archiviert
12
0

Trace Refactor #233

Zusammengeführt
YoyoNow hat 121 Commits von TracerGUI nach master 2024-04-21 16:03:26 +02:00 zusammengeführt
2 geänderte Dateien mit 15 neuen und 4 gelöschten Zeilen
Nur Änderungen aus Commit 83e5324986 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -285,7 +285,7 @@ public class TraceManager implements Listener {
Region region = Region.getRegion(player.getLocation());
PlayerTraceShowData playerTraceShowData = showDataPerRegionPerPlayer
.computeIfAbsent(region, ignored -> new HashMap<>())
.computeIfAbsent(player, ignored -> new PlayerTraceShowData(BundleFilter.STRICT));
.computeIfAbsent(player, ignored -> new PlayerTraceShowData(BundleFilter.DEFAULT));
AtFlag atFlag = playerTraceShowData.getViewFlag(AtFlag.class);
if (atFlag == null) {
@ -315,7 +315,7 @@ public class TraceManager implements Listener {
Region region = Region.getRegion(player.getLocation());
PlayerTraceShowData playerTraceShowData = showDataPerRegionPerPlayer
.computeIfAbsent(region, ignored -> new HashMap<>())
.computeIfAbsent(player, ignored -> new PlayerTraceShowData(BundleFilter.STRICT));
.computeIfAbsent(player, ignored -> new PlayerTraceShowData(BundleFilter.DEFAULT));
IsolateFlag isolateFlag;
if (playerTraceShowData.hasViewFlagOnly(IsolateFlag.class)) {
@ -324,7 +324,7 @@ public class TraceManager implements Listener {
isolateFlag = new IsolateFlag();
playerTraceShowData.addViewFlag(isolateFlag);
} else {
playerTraceShowData = new PlayerTraceShowData(BundleFilter.STRICT);
playerTraceShowData = new PlayerTraceShowData(BundleFilter.DEFAULT);
isolateFlag = new IsolateFlag();
playerTraceShowData.addViewFlag(isolateFlag);
showDataPerRegionPerPlayer.get(region).put(player, playerTraceShowData);

Datei anzeigen

@ -163,7 +163,18 @@ public abstract class ViewFlag {
@Override
public void modify(REntityServer server, List<TraceEntity> entities) {
for (TraceEntity entity : entities) {
entity.setDisplayName(String.valueOf(entity.getRecords().get(0).getFuse()));
List<String> fuses = entity.getRecords()
.stream()
.map(TNTPoint::getFuse)
.distinct()
.sorted()
.map(i -> i + "")
.collect(Collectors.toList());
if (fuses.size() <= 5) {
entity.setDisplayName(String.join(",", fuses));
} else {
entity.setDisplayName(fuses.stream().limit(5).collect(Collectors.joining(",")) + ", +" + (fuses.size() - 5));
}
}
}
};