Trace Refactor #233
@ -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);
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren