From 460040b39ce9b047c9cfa453881de7aad808e532 Mon Sep 17 00:00:00 2001 From: jmp Date: Fri, 16 Oct 2020 14:22:41 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9A=20Fix=20readme=20code=20examples?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 100 +++++++++++++++++++++++++++--------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 1654af85..74b228ea 100644 --- a/README.md +++ b/README.md @@ -19,18 +19,18 @@ of using the framework is like floating on a fluffy cloud in heaven. Its feature Cloud allows for commands to be defined using builder patterns, like this: ```java manager.command( - manager.commandBuilder("command", Description.of("Test cloud command using a builder"), "alias") - .argument(StringArgument.of("input")) - .argument(IntegerArgument.newBuilder("number").withMin(1).withMax(100).build()) - .handler(context -> { - String input = context.get("input"); - int number = context.get("number"); - context.getSender().sendMessage(String.format( - "I am %d%% hyped for %s!" - number, - input - ); - }) + manager.commandBuilder("command", Description.of("Test cloud command using a builder"), "alias") + .argument(StringArgument.of("input")) + .argument(IntegerArgument.newBuilder("number").withMin(1).withMax(100).build()) + .handler(context -> { + String input = context.get("input"); + int number = context.get("number"); + context.getSender().sendMessage(String.format( + "I am %d%% hyped for %s!", + number, + input + )); + }) ); ``` or using annotated methods, like this: @@ -38,14 +38,14 @@ or using annotated methods, like this: @CommandDescription("Test cloud command using @CommandMethod") @CommandMethod("command|alias ") private void yourCommand( - Player sender, - @Argument("input") String input, - @Argument("number") @Range(min = "1", max = "100") int number) + CommandSender sender, + @Argument("input") String input, + @Argument("number") @Range(min = "1", max = "100") int number ) { - player.sendMessage(String.format( - "I am %d%% hyped for %s!" - number, - input + sender.sendMessage(String.format( + "I am %d%% hyped for %s!", + number, + input )); } ``` @@ -141,37 +141,37 @@ with conflicting dependencies: ```xml - - - org.apache.maven.plugins - maven-shade-plugin - 3.2.4 - - - package - - shade - - - false - - - - - ${project.build.directory}/dependency-reduced-pom.xml - - - cloud.commandframework - YOUR.PACKAGE.HERE.shaded.cloud - - - io.leangen.geantyref - YOUR.PACKAGE.HERE.shaded.typetoken - - - - - + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + package + + shade + + + false + + + + + ${project.build.directory}/dependency-reduced-pom.xml + + + cloud.commandframework + YOUR.PACKAGE.HERE.shaded.cloud + + + io.leangen.geantyref + YOUR.PACKAGE.HERE.shaded.typetoken + + + + + ```