From 0cf8030f72baef336e98230d4bd7b32222aefa5b Mon Sep 17 00:00:00 2001 From: Jason <11360596+jpenilla@users.noreply.github.com> Date: Thu, 16 Sep 2021 19:46:18 -0500 Subject: [PATCH] bukkit: Make KeyedWorldArgument fallback to normal WorldParser when World does not implement Keyed (#298) --- .../paper/argument/KeyedWorldArgument.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/argument/KeyedWorldArgument.java b/cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/argument/KeyedWorldArgument.java index 25ef4642..0f83bac5 100644 --- a/cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/argument/KeyedWorldArgument.java +++ b/cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/argument/KeyedWorldArgument.java @@ -27,6 +27,7 @@ import cloud.commandframework.ArgumentDescription; import cloud.commandframework.arguments.CommandArgument; import cloud.commandframework.arguments.parser.ArgumentParseResult; import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.bukkit.internal.CraftBukkitReflection; import cloud.commandframework.bukkit.parsers.WorldArgument; import cloud.commandframework.context.CommandContext; import cloud.commandframework.exceptions.parsing.NoInputProvidedException; @@ -44,6 +45,9 @@ import java.util.function.BiFunction; /** * Argument type that parses Bukkit {@link World worlds} from a {@link NamespacedKey}. * + *
Falls back to parsing by name, using the {@link WorldArgument.WorldParser} on server implementations where {@link World} + * does not implement {@link org.bukkit.Keyed}.
+ * * @param