Skip to content

Commit f74d4bb

Browse files
committed
folia fix
1 parent 5f3bba0 commit f74d4bb

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<groupId>com.griefprevention</groupId>
1010
<artifactId>GriefPrevention</artifactId>
11-
<version>17.2.5</version>
11+
<version>17.2.6</version>
1212

1313
<name>GriefPrevention</name>
1414
<description>The official self-service anti-griefing Bukkit plugin for Minecraft servers since 2011.</description>

src/main/java/com/griefprevention/visualization/impl/GlowingVisualization.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,13 @@ public void revert(@NotNull Player player) {
277277
t.keyByEntity.clear();
278278
}
279279
for (BlockDisplay d : toRemove) {
280+
if (d == null) continue;
280281
try {
281-
if (d != null && d.isValid()) d.remove();
282+
SchedulerUtil.runLaterEntity(plugin, d, () -> {
283+
try {
284+
if (d.isValid()) d.remove();
285+
} catch (Exception ignored) {}
286+
}, 0L);
282287
} catch (Exception ignored) {}
283288
}
284289
}
@@ -289,7 +294,13 @@ public void revert(@NotNull Player player) {
289294
try {
290295
for (Entity entity : player.getWorld().getNearbyEntities(player.getLocation(), 32, 32, 32)) {
291296
if (entity instanceof BlockDisplay && entity.getScoreboardTags().contains(playerTag)) {
292-
entity.remove();
297+
try {
298+
SchedulerUtil.runLaterEntity(plugin, entity, () -> {
299+
try {
300+
if (entity.isValid()) entity.remove();
301+
} catch (Exception ignored) {}
302+
}, 0L);
303+
} catch (Exception ignored) {}
293304
}
294305
}
295306
} catch (Exception ignored) {}

0 commit comments

Comments
 (0)