w pull - #3
Conversation
do a shit
Added permission check for launch command execution.
|
Comments have been made, please read them and make changes accordingly. |
| { | ||
| sender.sendMessage(miniMessage.deserialize("<red>You do not have permission to use this command!</red>")); | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Unnecessary permission check
| { | ||
| sender.sendMessage(miniMessage.deserialize("<red>Usage: /" + commandLabel + " <player></red>")); | ||
| return false; | ||
| } |
There was a problem hiding this comment.
This can just return false, no need for the usage message. By default it returns the command usage
| @CommandParameters(name = "Launch", description = "Launch a player backwards 50 blocks") | ||
| public class LaunchCommand extends KoolCommand | ||
| { | ||
| private final MiniMessage miniMessage = MiniMessage.miniMessage(); |
There was a problem hiding this comment.
A MiniMessage method exists somewhere else. Find it, remove this and use it instead in this command
| import org.bukkit.entity.Player; | ||
| import org.bukkit.util.Vector; | ||
|
|
||
| @CommandParameters(name = "Launch", description = "Launch a player backwards 50 blocks") |
There was a problem hiding this comment.
Add a usage parameter to this. Also the command name does not need to be capitalized.
|
|
||
| if (target == null) | ||
| { | ||
| sender.sendMessage(miniMessage.deserialize("<red>Player <yellow>" + args[0] + "</yellow> is not online!</red>")); |
There was a problem hiding this comment.
Please use msg(sender, playerNotFound) for this
| sender.sendMessage(miniMessage.deserialize("<green>Launched: <yellow>" + target.getName() + "</yellow></green>")); | ||
| } | ||
|
|
||
| target.sendMessage(miniMessage.deserialize("<bold><red>Whoosh!</red></bold>")); |
There was a problem hiding this comment.
You do not need to include /yellow or anything like that for single line MiniMessage strings.
Please also utilize Placeholders.
Also, a MiniMessage deserialize method already exists somewhere in this plugin, find it and use that instead.
| target.setVelocity(launchVelocity); | ||
|
|
||
|
|
||
| // Send tuff messages. |
There was a problem hiding this comment.
try not to add useless comments like this. i really appreciate it when the code doesn't look like it was written by a 9 year old
| Placeholder.unparsed("name", sender.getName())); | ||
| return true; | ||
| } | ||
| } |
| { | ||
| broadcast("<#823d08><name> Has done a big wet sloppy shit", Placeholder.unparsed("name", sender.getName())); | ||
| return true; | ||
| } |
your wish is my command
Your wish is my command :D JAVA IS SO EASY WITH THIS
i sad
Removed commented code and updated message formatting.
Removed the 'shit' case from the ReactionCommand. ):
|
I do not see how But, regardless of what the command was, I will say that you did a nice job with programming the command + other changes to the plugin. Your knowledge of the Java programming language have gotten better! |
|
i will remove /launch and add other things i get what you mean |
yes i might've copy pasted the satisfyall command but im coding on a slow laptop rn
|
Hello, I see that this has been re-opened. I want to make you aware of a new policy that I have made, you can find it @ https://koolfreedom.eu.org/d/4-koolfreedom-developer-information This is important to when editing this PR and also making future ones. I highly recommend you read it. |
I have added /launch!
well tried too it might not work...
THERE IS A PROBLEM WITH THE RELEASE IM FORKING OFF
I WILL UPDATE SOON