WorldType implements StringType<World> { @Override public World parse(StringReader reader) throws CommandSyntaxException { var name = reader.readString(); var world = Bukkit.getWorld(name); if (world == null) { throw WORLD.createWithContext(reader, name); } return world; }  @Override World parse(StringReader reader); @Override CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder); @Override List<String> getExamples();  }
@Test void parse() throws CommandSyntaxException { assertEquals(quoted, type.parse(new StringReader("\"world name\""))); }
@Test void parse_throws_exception() throws CommandSyntaxException { assertEquals( "Unknown world: \"something\" at position 9: something<--[HERE]", assertThrows(CommandSyntaxException.class, () -> type.parse(new StringReader("something"))).getMessage() ); }