Created
July 16, 2017 16:44
-
-
Save JamiesWhiteShirt/52775b5ccc96847dd36058de446369af to your computer and use it in GitHub Desktop.
Correct command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CommandPing extends CommandBase { | |
@Override | |
public String getCommandName() { | |
return "ping"; | |
} | |
@Override | |
public String getCommandUsage(ICommandSender sender) { | |
return "commands.ping.usage"; | |
} | |
@Override | |
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { | |
if (args.length == 1) { | |
sender.addChatMessage(new TextComponentTranslation("commands.ping.success")); | |
} else { | |
throw new WrongUsageException(this.getCommandUsage(sender)); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commands.ping.success=The server says pong | |
commands.ping.usage=/ping <something> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commands.ping.success=El servidor dice pong | |
commands.ping.usage=/ping <algo> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment