get offline player data file from the right folder

This commit is contained in:
Lulu13022002 2024-12-18 21:54:15 +01:00
parent dce53e05b8
commit c71ada60db
No known key found for this signature in database
GPG key ID: 491C8F0B8ACDEB01
5 changed files with 4 additions and 14 deletions

View file

@ -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<Node> nodes, BlockPos target, boolean reached) {
this.nodes = nodes;

View file

@ -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) {

View file

@ -72,7 +72,7 @@
public Path getDimensionPath(ResourceKey<Level> 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() {

View file

@ -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);

View file

@ -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()));