Refactor to simplify API usage and improve compatibility by replacing legacy methods and adapting to updated libraries.

Signed-off-by: Chaoscaot <max@maxsp.de>
This commit is contained in:
2026-05-16 14:08:28 +02:00
parent 2d679028c0
commit 136b0f5b97
8 changed files with 25 additions and 24 deletions
@@ -27,9 +27,9 @@ import de.steamwar.towerrun.config.WorldConfig;
import de.steamwar.towerrun.state.GameState;
import de.steamwar.towerrun.state.GameStates;
import lombok.experimental.UtilityClass;
import net.minecraft.world.level.chunk.Chunk;
import net.minecraft.world.level.chunk.LevelChunk;
import org.bukkit.*;
import org.bukkit.craftbukkit.v1_19_R2.CraftWorld;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
@@ -187,10 +187,10 @@ public class TowerRunGame {
}
private static void resetChunk(World backup, int x, int z) {
Chunk chunk = ((CraftWorld) world).getHandle().d(x, z);
Chunk backupChunk = ((CraftWorld) backup).getHandle().d(x, z);
LevelChunk chunk = ((CraftWorld) world).getHandle().getChunk(x, z);
LevelChunk backupChunk = ((CraftWorld) backup).getHandle().getChunk(x, z);
System.arraycopy(backupChunk.d(), 0, chunk.d(), 0, chunk.d().length);
System.arraycopy(backupChunk.getSections(), 0, chunk.getSections(), 0, chunk.getSections().length);
for (Player p : Bukkit.getOnlinePlayers())
CraftbukkitWrapper.impl.sendChunk(p, x, z);