Handle subworld player proxies properly

This commit is contained in:
Fabian Maurer committed 2026-09-20 22:53:45 +02:00
1 parent 471da2192b
commit 92dec60858
1 file changed
+7 -3
@@ -286,12 +286,16 @@ object MultipartSPH
}
def onChunkWatch(p: EntityPlayerMP, c: ChunkCoordIntPair) {
newWatchers.getOrElseUpdate(p.worldObj, newWatchMap).addBinding(p, c)
val hostPlayer = WorldContextRegistry.getHostPlayer(p.worldObj, p)
newWatchers
.getOrElseUpdate(p.worldObj, newWatchMap)
.addBinding(hostPlayer, c)
}
def onChunkUnWatch(p: EntityPlayerMP, c: ChunkCoordIntPair) {
removeBinding(newWatchers, p.worldObj, p, c)
removeBinding(chunkWatchers, p.worldObj, p, c)
val hostPlayer = WorldContextRegistry.getHostPlayer(p.worldObj, p)
removeBinding(newWatchers, p.worldObj, hostPlayer, c)
removeBinding(chunkWatchers, p.worldObj, hostPlayer, c)
}
private def removeBinding(