Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/main/java/eu/koolfreedom/KoolSMPCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ public void onLoad()
@Override
public void onEnable()
{
FLog.info("Created by gamingto12 and 0x7694C9");
FLog.info("Version {}.{}", buildMeta.getVersion(), buildMeta.getNumber());
FLog.info("Compiled {} by {}", buildMeta.getDate(), buildMeta.getAuthor());
if (this.buildMeta != null) {
FLog.info("Loading version: " + this.buildMeta.getVersion());
FLog.info("Version {}.{}", this.buildMeta.getVersion(), this.buildMeta.getNumber());
FLog.info("Compiled {} by {}", this.buildMeta.getDate(), this.buildMeta.getAuthor());
} else {
FLog.warning("BuildProperties could not be loaded");
FLog.warning("Please report this.");
}

// Load the configurations
MainConfig.load();
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/eu/koolfreedom/command/impl/KfcHelpCommand.java
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 src/main/java/eu/koolfreedom/command/impl/LaunchCommand.java
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();

Copy link
Copy Markdown
Collaborator

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


@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args)
{

if (args.length == 0)
{
return false;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,4 @@ public boolean run(CommandSender sender, Player playerSender, Command cmd, Strin
}
}
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ permissions:
default: op
children:
- kfc.member
- kfc.command.launch
- kfc.command.adminchat
- kfc.command.alts
- kfc.command.ban
Expand Down