SteamWar/BauSystem2.0
Archiviert
12
0

Update ViewFlag.FUSE
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2024-04-18 18:06:05 +02:00
Ursprung 8512a7bec5
Commit 83e5324986
2 geänderte Dateien mit 15 neuen und 4 gelöschten Zeilen

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));
}
}
}
};