Skip to content

Commit 4041678

Browse files
masmc05lynxplay
andauthored
[ci-skip] Mention missing World#regenerateChunk implementation in jd (#12109)
* Mention missing impl * Clean the implementation out of years old code * Change the jd comment * Move to default method --------- Co-authored-by: Bjarne Koll <[email protected]>
1 parent c62252e commit 4041678

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

paper-api/src/main/java/org/bukkit/World.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,15 @@ default boolean isChunkGenerated(long chunkKey) {
476476
* @param z Z-coordinate of the chunk
477477
* @return Whether the chunk was actually regenerated
478478
*
479+
* @throws UnsupportedOperationException not implemented
479480
* @deprecated regenerating a single chunk is not likely to produce the same
480481
* chunk as before as terrain decoration may be spread across chunks. It may
481482
* or may not change blocks in the adjacent chunks as well.
482483
*/
483-
@Deprecated(since = "1.13")
484-
public boolean regenerateChunk(int x, int z);
484+
@Deprecated(since = "1.13", forRemoval = true)
485+
default boolean regenerateChunk(int x, int z) {
486+
throw new UnsupportedOperationException("Not supported in this Minecraft version! This is not a bug.");
487+
}
485488

486489
/**
487490
* Resends the {@link Chunk} to all clients

paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -470,33 +470,6 @@ private boolean unloadChunk0(int x, int z, boolean save) {
470470
return !this.isChunkLoaded(x, z);
471471
}
472472

473-
@Override
474-
public boolean regenerateChunk(int x, int z) {
475-
org.spigotmc.AsyncCatcher.catchOp("chunk regenerate"); // Spigot
476-
throw new UnsupportedOperationException("Not supported in this Minecraft version! Unless you can fix it, this is not a bug :)");
477-
/*
478-
if (!unloadChunk0(x, z, false)) {
479-
return false;
480-
}
481-
warnUnsafeChunk("regenerating a faraway chunk", x, z); // Paper
482-
483-
final long chunkKey = ChunkCoordIntPair.pair(x, z);
484-
world.getChunkProvider().unloadQueue.remove(chunkKey);
485-
486-
net.minecraft.server.Chunk chunk = world.getChunkProvider().generateChunk(x, z);
487-
PlayerChunk playerChunk = world.getPlayerChunkMap().getChunk(x, z);
488-
if (playerChunk != null) {
489-
playerChunk.chunk = chunk;
490-
}
491-
492-
if (chunk != null) {
493-
refreshChunk(x, z);
494-
}
495-
496-
return chunk != null;
497-
*/
498-
}
499-
500473
@Override
501474
public boolean refreshChunk(int x, int z) {
502475
ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));

0 commit comments

Comments
 (0)