Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Rothes <449181985@qq.com>
Date: Thu, 19 Mar 2026 10:12:55 +0800
Subject: [PATCH] Fix vanish api sync error


diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java b/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
index d94c0d15f62b67378669d4ce7252d99b8f743fa5..1574ead80189fbd4e4f6d677992f3ea5671bf844 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
@@ -307,6 +307,7 @@ public final class RegionizedPlayerChunkLoader {
TickThread.ensureTickThread("Cannot tick player chunk loader async");
long currTime = System.nanoTime();
for (final ServerPlayer player : new java.util.ArrayList<>(this.world.getLocalPlayers())) { // Folia - region threding
+ player.getBukkitEntity().onTick(); // Folia - Fix vanish api sync error
final PlayerChunkLoaderData loader = ((ChunkSystemServerPlayer)player).moonrise$getChunkLoader();
if (loader == null || loader.removed || loader.world != this.world) {
// not our problem anymore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Rothes <449181985@qq.com>
Date: Thu, 19 Mar 2026 10:12:55 +0800
Subject: [PATCH] Fix vanish api sync error


diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0d26a26d15de61031c6277e1671a3992dbf52f2d..0099c2caff180df81604ea5091afe4bd851a5733 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -248,6 +248,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
private long lastSaveTime; // Paper - getLastPlayed replacement API
private @Nullable CraftScoreboard scoreboardOverride;
public final net.minecraft.network.PacketProcessor packetProcessor = new net.minecraft.network.PacketProcessor(null); // Folia
+ private final java.util.concurrent.ConcurrentLinkedDeque<UUID> removedEntities = new java.util.concurrent.ConcurrentLinkedDeque<>(); // Folia - Fix vanish api sync error

// Folia start - region threading
// used only to notify tasks for packets
@@ -2086,9 +2087,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
// Paper end

public void onEntityRemove(Entity entity) {
- this.invertedVisibilityEntities.remove(entity.getUUID());
+ // Folia start - Fix vanish api sync error
+ if (this.invertedVisibilityEntities.isEmpty()) return; // Nothing hidden
+ this.removedEntities.add(entity.getUUID());
}

+ public void onTick() {
+ for (int i = 0; i < this.removedEntities.size(); i++) {
+ this.invertedVisibilityEntities.remove(this.removedEntities.removeFirst());
+ }
+ }
+ // Folia end - Fix vanish api sync error
+
@Override
public boolean canSee(Player player) {
return this.canSee((org.bukkit.entity.Entity) player);