removes retained player references, Fixes #953

This commit is contained in:
gnembon committed 2021-06-25 22:44:01 -03:00
1 parent 448fde1f36
commit 096e62b865
3 files changed
+16 -11

No files matched your search

@@ -551,7 +551,7 @@ public class Auxiliary {
else title = null; // Will never happen, just to make lambda happy
if (action == null)
{
Map<ServerPlayerEntity, BaseText> map;
Map<String, BaseText> map;
if (actionString.equals("player_list_header"))
map = HUDController.scarpet_headers;
else
@@ -561,12 +561,12 @@ public class Auxiliary {
List<ServerPlayerEntity> targetList = targets.collect(Collectors.toList());
if (!soundsTrue) // null or empty string
targetList.forEach(target -> {
map.remove(target);
map.remove(target.getEntityName());
total.getAndIncrement();
});
else
targetList.forEach(target -> {
map.put(target, (BaseText) title);
map.put(target.getEntityName(), (BaseText) title);
total.getAndIncrement();
});
HUDController.update_hud(((CarpetContext)c).s.getMinecraftServer(), targetList);