SteamWar/BauSystem2.0
Archiviert
12
0

Used Compute if absent
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
D4rkr34lm 2024-04-22 20:27:34 +02:00
Ursprung fd17b8315f
Commit b602fb06d0

Datei anzeigen

@ -188,18 +188,17 @@ public class Trace {
* @param playerTraceShowData The showData for modifying the rendering
*/
protected void render(List<TNTPoint> records, Player player, PlayerTraceShowData playerTraceShowData) {
REntityServer entityServer = entityServerMap.get(player);
if (entityServer == null) {
entityServer = new REntityServer();
entityServer.addPlayer(player);
entityServer.setCallback((p, rEntity, entityAction) -> {
REntityServer entityServer = entityServerMap.computeIfAbsent(player, k -> {
REntityServer newEntityServer = new REntityServer();
newEntityServer.addPlayer(k);
newEntityServer.setCallback((p, rEntity, entityAction) -> {
if (entityAction != REntityServer.EntityAction.INTERACT) return;
if (rEntity instanceof TraceEntity) {
((TraceEntity) rEntity).printIntoChat(p);
}
});
entityServerMap.put(player, entityServer);
}
return newEntityServer;
});
render(records, entityServer, playerTraceShowData);
}