mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
get offline player data file from the right folder
This commit is contained in:
parent
dce53e05b8
commit
c71ada60db
5 changed files with 4 additions and 14 deletions
|
@ -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;
|
|
|
@ -13,7 +13,7 @@
|
||||||
+
|
+
|
||||||
+ i = event.getNewCurrent();
|
+ 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
|
+ // CraftBukkit end
|
||||||
int i1 = 2;
|
int i1 = 2;
|
||||||
if (!updateShape || !flag) {
|
if (!updateShape || !flag) {
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
|
|
||||||
public Path getDimensionPath(ResourceKey<Level> dimensionPath) {
|
public Path getDimensionPath(ResourceKey<Level> dimensionPath) {
|
||||||
- return DimensionType.getStorageFolder(dimensionPath, this.levelDirectory.path());
|
- 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() {
|
private void checkLock() {
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
+ // Spigot start
|
+ // Spigot start
|
||||||
+ boolean usingWrongFile = false;
|
+ boolean usingWrongFile = false;
|
||||||
+ if (org.bukkit.Bukkit.getOnlineMode() && !file.exists()) { // Paper - Check online mode first
|
+ 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()) {
|
+ if (file.exists()) {
|
||||||
+ usingWrongFile = true;
|
+ usingWrongFile = true;
|
||||||
+ LOGGER.warn("Using offline mode UUID file for player {} as it is the only copy we can find.", name);
|
+ LOGGER.warn("Using offline mode UUID file for player {} as it is the only copy we can find.", name);
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class PaperPathfinder implements com.destroystokyo.paper.entity.Pathfinde
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public Location getNextPoint() {
|
public Location getNextPoint() {
|
||||||
if (!path.hasNext()) {
|
if (path.isDone()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return toLoc(path.nodes.get(path.getNextNodeIndex()));
|
return toLoc(path.nodes.get(path.getNextNodeIndex()));
|
||||||
|
|
Loading…
Reference in a new issue