mirror of
https://github.com/5vl/CorePlugin.git
synced 2025-05-23 19:56:58 +00:00
Added /discord
This commit is contained in:
parent
081bbb9393
commit
8cd662280c
@ -1,5 +1,6 @@
|
||||
package coreplugin.coreplugin;
|
||||
|
||||
import coreplugin.coreplugin.commands.discord;
|
||||
import coreplugin.coreplugin.commands.fly;
|
||||
import coreplugin.coreplugin.commands.gamemodes.GMA;
|
||||
import coreplugin.coreplugin.commands.gamemodes.GMC;
|
||||
@ -16,7 +17,7 @@ public final class Core extends JavaPlugin {
|
||||
private static Core instance;
|
||||
@Override
|
||||
public void onEnable() {
|
||||
System.out.println("Core Plugin has been enabled.");
|
||||
System.out.println("Enabed Core Plugin 1.0.0");
|
||||
instance = this;
|
||||
this.getConfig().options().copyDefaults();
|
||||
saveDefaultConfig();
|
||||
@ -36,5 +37,6 @@ public final class Core extends JavaPlugin {
|
||||
getCommand("kick").setExecutor(new kick());
|
||||
getCommand("ban").setExecutor(new ban());
|
||||
getCommand("unban").setExecutor(new unban());
|
||||
getCommand("discord").setExecutor(new discord());
|
||||
}
|
||||
}
|
21
java/coreplugin/coreplugin/commands/discord.java
Normal file
21
java/coreplugin/coreplugin/commands/discord.java
Normal file
@ -0,0 +1,21 @@
|
||||
package coreplugin.coreplugin.commands;
|
||||
|
||||
import coreplugin.coreplugin.Core;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class discord implements CommandExecutor {
|
||||
private String color(String string) {
|
||||
return ChatColor.translateAlternateColorCodes('&', string);
|
||||
}
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
String Discord = Core.getInstance().getConfig().getString("Discord");
|
||||
Player p = (Player) sender;
|
||||
p.sendMessage(color(Discord));
|
||||
return false;
|
||||
}
|
||||
}
|
@ -43,3 +43,4 @@ CannotFindPlayer: '&4Error: Cannot find the specified player.'
|
||||
MissingPermission: '&4&lYou do not have permission to execute this command!'
|
||||
Console: '&cYou can only run this command as a player.'
|
||||
InvalidArgument: '&4Error: Invalid argument.'
|
||||
Discord: '&bhttps://discord.gg/YourDiscordLinkHere' # Please put in your discord link.
|
@ -23,3 +23,5 @@ commands:
|
||||
description: You can ban people with this!
|
||||
unban:
|
||||
description: You can unban people with this!
|
||||
discord:
|
||||
description: Send your discord link in chat!
|
Loading…
x
Reference in New Issue
Block a user