3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-24 15:20:11 +01:00
Paper/nms-patches/CommandSpreadPlayers.patch

52 Zeilen
2.0 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/CommandSpreadPlayers.java
+++ b/net/minecraft/server/CommandSpreadPlayers.java
2016-06-09 03:43:49 +02:00
@@ -240,9 +240,16 @@
2016-02-29 22:32:46 +01:00
}
2016-05-10 13:47:39 +02:00
public List<String> tabComplete(MinecraftServer minecraftserver, ICommandListener icommandlistener, String[] astring, @Nullable BlockPosition blockposition) {
2016-02-29 22:32:46 +01:00
- return astring.length >= 1 && astring.length <= 2 ? b(astring, 0, blockposition) : Collections.emptyList();
+ return astring.length >= 1 && astring.length <= 2 ? b(astring, 0, blockposition) : Collections.<String>emptyList(); // CraftBukkit - decompile error
2015-02-26 23:41:06 +01:00
}
+ // CraftBukkit start - fix decompile error
+ @Override
+ public int compareTo(ICommand o) {
+ return a(o);
+ }
+ // CraftBukkit end
+
static class Location2D {
double a;
2016-06-09 03:43:49 +02:00
@@ -309,7 +316,7 @@
2015-02-26 23:41:06 +01:00
}
blockposition = blockposition.down();
2016-02-29 22:32:46 +01:00
- } while (world.getType(blockposition).getMaterial() == Material.AIR);
+ } while (getType(world, blockposition).getMaterial() == Material.AIR); // CraftBukkit
2015-02-26 23:41:06 +01:00
return blockposition.getY() + 1;
}
2016-06-09 03:43:49 +02:00
@@ -325,7 +332,7 @@
2015-02-26 23:41:06 +01:00
}
blockposition = blockposition.down();
2016-02-29 22:32:46 +01:00
- material = world.getType(blockposition).getMaterial();
+ material = getType(world, blockposition).getMaterial(); // CraftBukkit
2015-02-26 23:41:06 +01:00
} while (material == Material.AIR);
return !material.isLiquid() && material != Material.FIRE;
2016-06-09 03:43:49 +02:00
@@ -335,5 +342,12 @@
2015-02-26 23:41:06 +01:00
this.a = MathHelper.a(random, d0, d2);
this.b = MathHelper.a(random, d1, d3);
}
+
+ // CraftBukkit start - add a version of getType which force loads chunks
+ private static IBlockData getType(World world, BlockPosition position) {
+ ((ChunkProviderServer) world.chunkProvider).getChunkAt(position.getX() >> 4, position.getZ() >> 4);
+ return world.getType(position);
+ }
+ // CraftBukkit end
}
}