|
143 | 143 | } |
144 | 144 | }, this.unloadQueue::add).whenComplete((ignored, throwable) -> { |
145 | 145 | if (throwable != null) { |
146 | | -@@ -839,7 +_,7 @@ |
| 146 | +@@ -842,7 +_,7 @@ |
147 | 147 | } |
148 | 148 |
|
149 | 149 | public int size() { |
|
152 | 152 | } |
153 | 153 |
|
154 | 154 | public net.minecraft.server.level.DistanceManager getDistanceManager() { |
155 | | -@@ -866,10 +_,10 @@ |
| 155 | +@@ -869,10 +_,10 @@ |
156 | 156 | .addColumn("fluid_ticks") |
157 | 157 | .build(output); |
158 | 158 |
|
|
167 | 167 | Optional<ChunkAccess> chunk = Optional.ofNullable(holder.getLatestChunk()); |
168 | 168 | Optional<LevelChunk> fullChunk = chunk.flatMap( |
169 | 169 | chunkAccess -> chunkAccess instanceof LevelChunk levelChunk ? Optional.of(levelChunk) : Optional.empty() |
170 | | -@@ -918,14 +_,15 @@ |
| 170 | +@@ -921,14 +_,15 @@ |
171 | 171 | return this.upgradeChunkTag( |
172 | 172 | tag, |
173 | 173 | -1, |
|
186 | 186 | generatorIdentifier.ifPresent(identifier -> contextTag.putString("generator", identifier.toString())); |
187 | 187 | return contextTag; |
188 | 188 | } |
189 | | -@@ -937,7 +_,7 @@ |
| 189 | +@@ -940,7 +_,7 @@ |
190 | 190 | ChunkHolder holder = this.visibleChunkMap.get(spawnCandidateChunks.nextLong()); |
191 | 191 | if (holder != null) { |
192 | 192 | LevelChunk chunk = holder.getTickingChunk(); |
|
195 | 195 | output.add(chunk); |
196 | 196 | } |
197 | 197 | } |
198 | | -@@ -957,8 +_,14 @@ |
| 198 | +@@ -960,8 +_,14 @@ |
199 | 199 | } |
200 | 200 |
|
201 | 201 | public boolean anyPlayerCloseEnoughForSpawning(final ChunkPos pos) { |
|
211 | 211 | } |
212 | 212 |
|
213 | 213 | public boolean anyPlayerCloseEnoughTo(final BlockPos pos, final int maxDistance) { |
214 | | -@@ -974,8 +_,24 @@ |
| 214 | +@@ -977,8 +_,24 @@ |
215 | 215 | } |
216 | 216 |
|
217 | 217 | private boolean anyPlayerCloseEnoughForSpawningInternal(final ChunkPos pos) { |
|
237 | 237 | return true; |
238 | 238 | } |
239 | 239 | } |
240 | | -@@ -992,7 +_,7 @@ |
| 240 | +@@ -995,7 +_,7 @@ |
241 | 241 | Builder<ServerPlayer> builder = ImmutableList.builder(); |
242 | 242 |
|
243 | 243 | for (ServerPlayer player : this.playerMap.getAllPlayers()) { |
|
246 | 246 | builder.add(player); |
247 | 247 | } |
248 | 248 | } |
249 | | -@@ -1000,13 +_,13 @@ |
| 249 | +@@ -1003,13 +_,13 @@ |
250 | 250 | return builder.build(); |
251 | 251 | } |
252 | 252 |
|
|
262 | 262 | } |
263 | 263 |
|
264 | 264 | private boolean playerIsCloseEnoughTo(final ServerPlayer player, final Vec3 pos, final int maxDistance) { |
265 | | -@@ -1138,9 +_,19 @@ |
| 265 | +@@ -1141,9 +_,19 @@ |
266 | 266 | } |
267 | 267 |
|
268 | 268 | protected void addEntity(final Entity entity) { |
|
282 | 282 | if (range != 0) { |
283 | 283 | if (this.entityMap.containsKey(entity.getId())) { |
284 | 284 | throw (IllegalStateException)Util.pauseInIde(new IllegalStateException("Entity is already tracked!")); |
285 | | -@@ -1164,6 +_,7 @@ |
| 285 | +@@ -1167,6 +_,7 @@ |
286 | 286 | } |
287 | 287 |
|
288 | 288 | protected void removeEntity(final Entity entity) { |
289 | 289 | + org.spigotmc.AsyncCatcher.catchOp("entity untrack"); // Spigot |
290 | 290 | if (entity instanceof ServerPlayer player) { |
291 | 291 | this.updatePlayerStatus(player, false); |
292 | 292 |
|
293 | | -@@ -1320,10 +_,10 @@ |
| 293 | +@@ -1323,10 +_,10 @@ |
294 | 294 | private final Entity entity; |
295 | 295 | private final int range; |
296 | 296 | private SectionPos lastSectionPos; |
|
303 | 303 | this.entity = entity; |
304 | 304 | this.range = range; |
305 | 305 | this.lastSectionPos = SectionPos.of(entity); |
306 | | -@@ -1370,6 +_,7 @@ |
| 306 | +@@ -1373,6 +_,7 @@ |
307 | 307 | } |
308 | 308 |
|
309 | 309 | public void removePlayer(final ServerPlayer player) { |
310 | 310 | + org.spigotmc.AsyncCatcher.catchOp("player tracker clear"); // Spigot |
311 | 311 | if (this.seenBy.remove(player.connection)) { |
312 | 312 | this.serverEntity.removePairing(player); |
313 | 313 | if (this.seenBy.isEmpty()) { |
314 | | -@@ -1379,23 +_,47 @@ |
| 314 | +@@ -1382,23 +_,47 @@ |
315 | 315 | } |
316 | 316 |
|
317 | 317 | public void updatePlayer(final ServerPlayer player) { |
|
362 | 362 | } |
363 | 363 | } else { |
364 | 364 | this.removePlayer(player); |
365 | | -@@ -1412,6 +_,7 @@ |
| 365 | +@@ -1415,6 +_,7 @@ |
366 | 366 |
|
367 | 367 | for (Entity passenger : this.entity.getIndirectPassengers()) { |
368 | 368 | int passengerRange = passenger.getType().clientTrackingRange() * 16; |
|
0 commit comments