From c71ada60db618f56d7614243a16d1ba5f8f97040 Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Wed, 18 Dec 2024 21:54:15 +0100 Subject: [PATCH] get offline player data file from the right folder --- .../minecraft/world/level/pathfinder/Path.java.patch | 10 ---------- .../ExperimentalRedstoneWireEvaluator.java.patch | 2 +- .../world/level/storage/LevelStorageSource.java.patch | 2 +- .../world/level/storage/PlayerDataStorage.java.patch | 2 +- .../destroystokyo/paper/entity/PaperPathfinder.java | 2 +- 5 files changed, 4 insertions(+), 14 deletions(-) delete mode 100644 paper-server/patches/sources/net/minecraft/world/level/pathfinder/Path.java.patch diff --git a/paper-server/patches/sources/net/minecraft/world/level/pathfinder/Path.java.patch b/paper-server/patches/sources/net/minecraft/world/level/pathfinder/Path.java.patch deleted file mode 100644 index 7238ea6726..0000000000 --- a/paper-server/patches/sources/net/minecraft/world/level/pathfinder/Path.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/world/level/pathfinder/Path.java -+++ b/net/minecraft/world/level/pathfinder/Path.java -@@ -18,6 +_,7 @@ - private final BlockPos target; - private final float distToTarget; - private final boolean reached; -+ public boolean hasNext() { return getNextNodeIndex() < this.nodes.size(); } // Paper - Mob Pathfinding API - - public Path(List nodes, BlockPos target, boolean reached) { - this.nodes = nodes; diff --git a/paper-server/patches/sources/net/minecraft/world/level/redstone/ExperimentalRedstoneWireEvaluator.java.patch b/paper-server/patches/sources/net/minecraft/world/level/redstone/ExperimentalRedstoneWireEvaluator.java.patch index a5eebb497d..b83293fbd0 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/redstone/ExperimentalRedstoneWireEvaluator.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/redstone/ExperimentalRedstoneWireEvaluator.java.patch @@ -13,7 +13,7 @@ + + i = event.getNewCurrent(); + } -+ if (blockState.is((net.minecraft.world.level.block.Block) this.wireBlock) && oldPower != i) { ++ if (blockState.is(this.wireBlock) && oldPower != i) { + // CraftBukkit end int i1 = 2; if (!updateShape || !flag) { diff --git a/paper-server/patches/sources/net/minecraft/world/level/storage/LevelStorageSource.java.patch b/paper-server/patches/sources/net/minecraft/world/level/storage/LevelStorageSource.java.patch index 599d60a432..1c0cac272a 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/storage/LevelStorageSource.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/storage/LevelStorageSource.java.patch @@ -72,7 +72,7 @@ public Path getDimensionPath(ResourceKey dimensionPath) { - return DimensionType.getStorageFolder(dimensionPath, this.levelDirectory.path()); -+ return getStorageFolder(this.levelDirectory.path(), this.dimensionType); // CraftBukkit ++ return LevelStorageSource.getStorageFolder(this.levelDirectory.path(), this.dimensionType); // CraftBukkit } private void checkLock() { diff --git a/paper-server/patches/sources/net/minecraft/world/level/storage/PlayerDataStorage.java.patch b/paper-server/patches/sources/net/minecraft/world/level/storage/PlayerDataStorage.java.patch index 23c6073c85..e452ec4ba4 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/storage/PlayerDataStorage.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/storage/PlayerDataStorage.java.patch @@ -52,7 +52,7 @@ + // Spigot start + boolean usingWrongFile = false; + if (org.bukkit.Bukkit.getOnlineMode() && !file.exists()) { // Paper - Check online mode first -+ file = new File(file, java.util.UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(java.nio.charset.StandardCharsets.UTF_8)).toString() + suffix); ++ file = new File(this.playerDir, java.util.UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(java.nio.charset.StandardCharsets.UTF_8)).toString() + suffix); + if (file.exists()) { + usingWrongFile = true; + LOGGER.warn("Using offline mode UUID file for player {} as it is the only copy we can find.", name); diff --git a/paper-server/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java b/paper-server/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java index 946cbc9556..3e43beaaa2 100644 --- a/paper-server/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java +++ b/paper-server/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java @@ -135,7 +135,7 @@ public class PaperPathfinder implements com.destroystokyo.paper.entity.Pathfinde @Nullable @Override public Location getNextPoint() { - if (!path.hasNext()) { + if (path.isDone()) { return null; } return toLoc(path.nodes.get(path.getNextNodeIndex()));