-
Notifications
You must be signed in to change notification settings - Fork 4
w pull #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Axdmaz
wants to merge
21
commits into
KoolFreedom:main
Choose a base branch
from
Axdmaz:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
w pull #3
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
66965ae
Create shit.java
Axdmaz e78b10f
Rename shit.java to ShitCommand.java
Axdmaz 4e62bd8
Update package declaration in LaunchCommand.java
Axdmaz 0515b6d
Implement permission check in LaunchCommand
Axdmaz 324b86c
Update message formatting in LaunchCommand
Axdmaz 57cc319
almost forgot x2
Axdmaz 067250c
Add imports for KoolCommand and CommandParameters
Axdmaz 2db88b6
Merge branch 'KoolFreedom:main' into main
Axdmaz a426a41
Add reaction for 'shit' command in ReactionCommand
Axdmaz b603726
Made it so the plugin will start
Axdmaz 9d7de18
tuff
Axdmaz 0b7fbf9
Change command name to lowercase 'launch' with usage
Axdmaz 6020d7c
Refactor LaunchCommand permission checks and messages
Axdmaz 76e92ef
Merge branch 'KoolFreedom:main' into main
Axdmaz 294600f
): deleted /shit
Axdmaz e083061
make code better
Axdmaz ce57a32
Remove 'shit' case from ReactionCommand
Axdmaz a16e221
Add kfchelp command for KoolSmpCore help
Axdmaz d370e26
A
Axdmaz 6c20f7a
Update kfchelp command description and usage
Axdmaz 0b9f969
Rename kfchelp.java to KfcHelpCommand.java
Axdmaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
20 changes: 20 additions & 0 deletions
20
src/main/java/eu/koolfreedom/command/impl/KfcHelpCommand.java
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package eu.koolfreedom.command.impl; | ||
|
|
||
| import eu.koolfreedom.command.KoolCommand; | ||
| import eu.koolfreedom.command.annotation.CommandParameters; | ||
| import org.bukkit.command.Command; | ||
| import org.bukkit.command.CommandSender; | ||
| import org.bukkit.entity.Player; | ||
|
|
||
| @CommandParameters(name = "kfchelp", description = "Sends a help message about KoolSmpCore", usage = "/kfchelp") | ||
|
|
||
| public class KfcHelpCommand extends KoolCommand { | ||
|
|
||
| @Override | ||
| public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args) { | ||
| msg(sender, "<red>If you need help setting up KoolSmpCore, please visit our discord here: https://discord.gg/MTYrSgVkmd"); | ||
| msg(sender, "<red>Or run /help KoolSmpCore"); | ||
|
|
||
| return true; | ||
| } | ||
| } |
51 changes: 51 additions & 0 deletions
51
src/main/java/eu/koolfreedom/command/impl/LaunchCommand.java
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package eu.koolfreedom.command.impl; | ||
|
|
||
| import eu.koolfreedom.command.KoolCommand; | ||
| import eu.koolfreedom.command.annotation.CommandParameters; | ||
| import net.kyori.adventure.text.minimessage.MiniMessage; | ||
| import org.bukkit.Bukkit; | ||
| import org.bukkit.command.Command; | ||
| import org.bukkit.command.CommandSender; | ||
| import org.bukkit.entity.Player; | ||
| import org.bukkit.util.Vector; | ||
|
|
||
| @CommandParameters(name = "launch", description = "Launch a player backwards 50 blocks", usage = "/launch <player>") | ||
| public class LaunchCommand extends KoolCommand | ||
| { | ||
| private final MiniMessage miniMessage = MiniMessage.miniMessage(); | ||
|
|
||
| @Override | ||
| public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args) | ||
| { | ||
|
|
||
| if (args.length == 0) | ||
| { | ||
| return false; | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can just return false, no need for the usage message. By default it returns the command usage |
||
|
|
||
| Player target = Bukkit.getPlayer(args[0]); | ||
|
|
||
| if (target == null) | ||
| { | ||
| msg(sender, playerNotFound) | ||
| return true; | ||
| } | ||
|
|
||
| Vector backwardDirection = target.getLocation().getDirection().multiply(-1); | ||
| Vector launchVelocity = backwardDirection.multiply(3.8); | ||
| launchVelocity.setY(1.2); | ||
|
|
||
| target.setVelocity(launchVelocity); | ||
|
|
||
|
|
||
| if (sender != target) | ||
| { | ||
| msg(sender, "<green>Your wish is my command."); | ||
| msg(sender, "<green>Player has been launched" | ||
| } | ||
|
|
||
| msg(target, "<red>Woosh!"); | ||
| return true; | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -226,4 +226,4 @@ public boolean run(CommandSender sender, Player playerSender, Command cmd, Strin | |
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A MiniMessage method exists somewhere else. Find it, remove this and use it instead in this command