From 404167841dcf3ac78792ffbd45c683a2173b4b08 Mon Sep 17 00:00:00 2001 From: masmc05 <63639746+masmc05@users.noreply.github.com> Date: Sun, 16 Feb 2025 00:31:42 +0200 Subject: [PATCH] [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 --- paper-api/src/main/java/org/bukkit/World.java | 7 +++-- .../org/bukkit/craftbukkit/CraftWorld.java | 27 ------------------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/World.java b/paper-api/src/main/java/org/bukkit/World.java index 2729f71ac..27c4fcba6 100644 --- a/paper-api/src/main/java/org/bukkit/World.java +++ b/paper-api/src/main/java/org/bukkit/World.java @@ -476,12 +476,15 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient * @param z Z-coordinate of the chunk * @return Whether the chunk was actually regenerated * + * @throws UnsupportedOperationException not implemented * @deprecated regenerating a single chunk is not likely to produce the same * chunk as before as terrain decoration may be spread across chunks. It may * or may not change blocks in the adjacent chunks as well. */ - @Deprecated(since = "1.13") - public boolean regenerateChunk(int x, int z); + @Deprecated(since = "1.13", forRemoval = true) + default boolean regenerateChunk(int x, int z) { + throw new UnsupportedOperationException("Not supported in this Minecraft version! This is not a bug."); + } /** * Resends the {@link Chunk} to all clients diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 600a0f423..1439d2821 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -470,33 +470,6 @@ public class CraftWorld extends CraftRegionAccessor implements World { return !this.isChunkLoaded(x, z); } - @Override - public boolean regenerateChunk(int x, int z) { - org.spigotmc.AsyncCatcher.catchOp("chunk regenerate"); // Spigot - throw new UnsupportedOperationException("Not supported in this Minecraft version! Unless you can fix it, this is not a bug :)"); - /* - if (!unloadChunk0(x, z, false)) { - return false; - } - warnUnsafeChunk("regenerating a faraway chunk", x, z); // Paper - - final long chunkKey = ChunkCoordIntPair.pair(x, z); - world.getChunkProvider().unloadQueue.remove(chunkKey); - - net.minecraft.server.Chunk chunk = world.getChunkProvider().generateChunk(x, z); - PlayerChunk playerChunk = world.getPlayerChunkMap().getChunk(x, z); - if (playerChunk != null) { - playerChunk.chunk = chunk; - } - - if (chunk != null) { - refreshChunk(x, z); - } - - return chunk != null; - */ - } - @Override public boolean refreshChunk(int x, int z) { ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));