fix: the server compiles

Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>
This commit is contained in:
Mariell Hoversholm
2021-06-11 20:33:36 +02:00
parent 041a42e0e4
commit ceecde4a32
4 changed files with 186 additions and 10 deletions

View File

@@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ private static boolean testPermission(CommandSender commandSender, String permission) {
+ if (commandSender.hasPermission(BASE_PERM + permission) || commandSender.hasPermission("bukkit.command.paper")) return true;
+ commandSender.sendMessage(Bukkit.getPermissionMessage());
+ commandSender.sendMessage(ChatColor.RED + "I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error."); // Sorry, kashike
+ return false;
+ }
+
@@ -151,7 +151,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ case "ver":
+ if (!testPermission(sender, "version")) break; // "ver" needs a special check because it's an alias. All other commands are checked up before the switch statement (because they are present in the SUBCOMMANDS set)
+ case "version":
+ Command ver = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version");
+ Command ver = MinecraftServer.getServer().server.getCommandMap().getCommand("version");
+ if (ver != null) {
+ ver.execute(sender, commandLabel, new String[0]);
+ break;
@@ -219,12 +219,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ Map<ResourceLocation, Integer> nonEntityTicking = Maps.newHashMap();
+ ServerChunkCache chunkProviderServer = world.getChunkSource();
+
+ Collection<Entity> entities = world.entitiesById.values();
+ entities.forEach(e -> {
+ world.getAllEntities().forEach(e -> {
+ ResourceLocation key = new ResourceLocation(""); // TODO: update in next patch
+
+ MutablePair<Integer, Map<ChunkPos, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap()));
+ ChunkPos chunk = new ChunkPos(e.xChunk, e.zChunk);
+ ChunkPos chunk = e.chunkPosition();
+ info.left++;
+ info.right.put(chunk, info.right.getOrDefault(chunk, 0) + 1);
+ if (!chunkProviderServer.isPositionTicking(e)) {