Skip to content

Commit 8c368e4

Browse files
committed
mark for reencode only if something was removed
1 parent 14768d2 commit 8c368e4

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/patches/AntiMapPlayerTracking.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ public void onPacketSend(PacketSendEvent event) {
5858
}
5959

6060
if (mapData.getDecorations() != null) {
61-
mapData.getDecorations().removeIf(mapDecoration -> blacklistedDecorationTypes.contains(mapDecoration.getType()));
62-
event.markForReEncode(true);
61+
for (WrapperPlayServerMapData.MapDecoration mapDecoration : mapData.getDecorations()) {
62+
if (blacklistedDecorationTypes.contains(mapDecoration.getType())) {
63+
mapData.getDecorations().remove(mapDecoration);
64+
event.markForReEncode(true);
65+
}
66+
}
6367
}
6468
}
6569
}

AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/patches/AntiMapPlayerTracking.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,12 @@ public void onPacketSend(PacketSendEvent event) {
6464
}
6565

6666
if (mapData.getDecorations() != null) {
67-
mapData.getDecorations().removeIf(mapDecoration -> blacklistedDecorationTypes.contains(mapDecoration.getType()));
68-
event.markForReEncode(true);
67+
for (WrapperPlayServerMapData.MapDecoration mapDecoration : mapData.getDecorations()) {
68+
if (blacklistedDecorationTypes.contains(mapDecoration.getType())) {
69+
mapData.getDecorations().remove(mapDecoration);
70+
event.markForReEncode(true);
71+
}
72+
}
6973
}
7074
}
7175
}

0 commit comments

Comments
 (0)