diff --git a/.gitignore b/.gitignore index 41324e43..cc140cb9 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ /MAStaff-API/build/ /.idea/ +# Maven exclude paths +maven + # Ignore Gradle project-specific cache directory .gradle diff --git a/MAStaff-API/API-Publish/build.gradle.kts b/MAStaff-API/API-Publish/build.gradle.kts index d849f256..e1287366 100644 --- a/MAStaff-API/API-Publish/build.gradle.kts +++ b/MAStaff-API/API-Publish/build.gradle.kts @@ -3,6 +3,8 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { `maven-publish` id("com.github.johnrengelman.shadow") version "8.1.1" + id("org.ajoberstar.grgit") version "5.2.1" + id("org.ajoberstar.git-publish") version "4.2.1" } dependencies { @@ -29,12 +31,8 @@ dependencies { publishing { repositories { maven { - name = "nookureRepository" - url = uri("https://repo.nookure.com/releases") - credentials(PasswordCredentials::class) - authentication { - create("basic") - } + name = "local" + url = uri("${rootProject.rootDir}/maven") } } @@ -54,4 +52,19 @@ tasks.shadowJar { relocate(from, to) } exclude("META-INF/maven/**") +} + +gitPublish { + repoUri = "https://github.com/Nookure/maven.git" + branch = "main" + fetchDepth = null + commitMessage = "MAStaff-API ${parent!!.version}" + + contents { + from("${rootProject.rootDir}/maven") + } + + preserve { + include("**") + } } \ No newline at end of file diff --git a/MAStaff-API/build.gradle.kts b/MAStaff-API/build.gradle.kts index aa253e22..2542f8c7 100644 --- a/MAStaff-API/build.gradle.kts +++ b/MAStaff-API/build.gradle.kts @@ -4,7 +4,7 @@ import java.time.format.DateTimeFormatter plugins { id("java") id("net.kyori.blossom") version "1.3.1" - id("org.ajoberstar.grgit") version "4.1.0" + id("org.ajoberstar.grgit") version "5.2.1" } group = "es.angelillo15" diff --git a/MAStaff-API/src/main/java/com/nookure/mast/api/config/package-info.java b/MAStaff-API/src/main/java/com/nookure/mast/api/config/package-info.java new file mode 100644 index 00000000..ca216a37 --- /dev/null +++ b/MAStaff-API/src/main/java/com/nookure/mast/api/config/package-info.java @@ -0,0 +1,4 @@ +/** + * Here you will find the config files API. + */ +package com.nookure.mast.api.config; \ No newline at end of file diff --git a/MAStaff-API/src/main/java/com/nookure/mast/api/staff/package-info.java b/MAStaff-API/src/main/java/com/nookure/mast/api/staff/package-info.java new file mode 100644 index 00000000..ef7b165e --- /dev/null +++ b/MAStaff-API/src/main/java/com/nookure/mast/api/staff/package-info.java @@ -0,0 +1,4 @@ +/** + * This package contains the classes related to the staff. + */ +package com.nookure.mast.api.staff; \ No newline at end of file diff --git a/MAStaff-API/src/main/java/es/angelillo15/mast/api/IStaffPlayer.java b/MAStaff-API/src/main/java/es/angelillo15/mast/api/IStaffPlayer.java index 9a8db7c2..b98484ce 100644 --- a/MAStaff-API/src/main/java/es/angelillo15/mast/api/IStaffPlayer.java +++ b/MAStaff-API/src/main/java/es/angelillo15/mast/api/IStaffPlayer.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; +import net.kyori.adventure.text.Component; import org.bukkit.GameMode; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -208,4 +209,12 @@ default String getName() { default void sendMessage(String message) { TextUtils.sendMessage(getPlayer(), TextUtils.toMM(message)); } + + /** + * Send a message to the player + * @param component - message to send + */ + default void sendMessage(Component component) { + TextUtils.getAudience(getPlayer()).sendMessage(component); + } } diff --git a/MAStaff-API/src/main/java/es/angelillo15/mast/api/Replace.java b/MAStaff-API/src/main/java/es/angelillo15/mast/api/Replace.java new file mode 100644 index 00000000..1b2e77b0 --- /dev/null +++ b/MAStaff-API/src/main/java/es/angelillo15/mast/api/Replace.java @@ -0,0 +1,4 @@ +package es.angelillo15.mast.api; + +public record Replace(String search, String replace) { +} diff --git a/MAStaff-API/src/main/java/es/angelillo15/mast/api/config/bukkit/ConfigLoader.java b/MAStaff-API/src/main/java/es/angelillo15/mast/api/config/bukkit/ConfigLoader.java index 7611b98c..996e7766 100644 --- a/MAStaff-API/src/main/java/es/angelillo15/mast/api/config/bukkit/ConfigLoader.java +++ b/MAStaff-API/src/main/java/es/angelillo15/mast/api/config/bukkit/ConfigLoader.java @@ -18,6 +18,7 @@ public class ConfigLoader { @Getter private static ConfigManager en; @Getter private static ConfigManager customItems; @Getter private static ConfigManager punishmentsGUI; + @Getter private static ConfigManager commands; private final MAStaffInstance plugin; private final boolean isFree; @@ -41,6 +42,8 @@ public void load() { loadMessage(); logger.debug("Loading internal staff items..."); loadInternal(); + logger.debug("Loading commands..."); + loadCommands(); if (!isFree) { logger.debug("Loading glow module..."); @@ -134,6 +137,15 @@ public void loadCustomItems() { customItems.registerConfig(); } + public void loadCommands() { + commands = + new ConfigManager( + plugin.getPluginDataFolder().toPath(), + "Bukkit/commands.yml", + "/commands.yml"); + commands.registerConfig(); + } + public void loadGlowModule() { glow = new ConfigManager( diff --git a/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/MAStaff.java b/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/MAStaff.java index c8d9ee42..763c08cf 100644 --- a/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/MAStaff.java +++ b/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/MAStaff.java @@ -32,6 +32,8 @@ import es.angelillo15.mast.bukkit.cmd.VanishCMD; import es.angelillo15.mast.bukkit.cmd.mast.MASTParent; import es.angelillo15.mast.bukkit.cmd.staff.StaffParent; +import es.angelillo15.mast.bukkit.cmd.teleport.TpCommand; +import es.angelillo15.mast.bukkit.cmd.teleport.TphCommand; import es.angelillo15.mast.bukkit.cmd.utils.CommandManager; import es.angelillo15.mast.bukkit.cmd.utils.CommandTemplate; import es.angelillo15.mast.bukkit.inject.BukkitInjector; @@ -161,10 +163,12 @@ public void registerCommands() { registerCommand(injector.getInstance(StaffChat.class)); registerCommand(injector.getInstance(MASTParent.class)); registerCommand(injector.getInstance(HelpOP.class)); + registerCommand(injector.getInstance(TpCommand.class)); + registerCommand(injector.getInstance(TphCommand.class)); if (Config.Addons.vanish()) registerCommand(injector.getInstance(VanishCMD.class)); if (Config.Freeze.enabled()) - Objects.requireNonNull(getCommand("freeze")).setExecutor(injector.getInstance(FreezeCMD.class)); + registerCommand(injector.getInstance(FreezeCMD.class)); if (Config.Freeze.enabled() && Config.Freeze.freezeChat()) registerCommand(injector.getInstance(FreezeChat.class)); } diff --git a/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/FreezeCMD.java b/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/FreezeCMD.java index 43bdcd8f..8ed9fbe2 100644 --- a/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/FreezeCMD.java +++ b/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/FreezeCMD.java @@ -1,84 +1,102 @@ package es.angelillo15.mast.bukkit.cmd; import com.google.inject.Inject; +import com.nookure.mast.api.cmd.Command; +import com.nookure.mast.api.cmd.CommandData; +import com.nookure.mast.api.cmd.sender.CommandSender; +import com.nookure.mast.api.cmd.sender.PlayerCommandSender; import es.angelillo15.mast.api.IStaffPlayer; import es.angelillo15.mast.api.TextUtils; import es.angelillo15.mast.api.config.bukkit.Messages; import es.angelillo15.mast.api.managers.StaffManager; import com.nookure.mast.api.manager.FreezeManager; import es.angelillo15.mast.bukkit.gui.SelectTargetGUI; + +import java.util.List; import java.util.Objects; + import org.bukkit.Bukkit; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; -public class FreezeCMD implements CommandExecutor { - @Inject - private StaffManager staffManager; - @Inject - private FreezeManager freezeManager; - - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if(!(sender instanceof Player p)) return false; +@CommandData( + name = "freeze", + permission = "mast.freeze", + aliases = {"fr"}, + usage = "/freeze ", + description = "Freeze a player" +) +public class FreezeCMD extends Command { + @Inject + private StaffManager staffManager; + @Inject + private FreezeManager freezeManager; - if (!staffManager.isStaffPlayer(p.getName())) return false; + @Override + public void onCommand(@NotNull CommandSender sender, @NotNull String label, @NotNull String[] args) { + if (!(sender instanceof PlayerCommandSender pcs)) return; - IStaffPlayer staff = staffManager.getStaffPlayer(p.getName()); + Player p = pcs.getPlayer(); - assert staff != null; + if (!staffManager.isStaffPlayer(p.getName())) return; - if(!p.hasPermission("mast.freeze")){ - TextUtils.colorize(Messages.GET_NO_PERMISSION_MESSAGE(), p); - return true; - } + IStaffPlayer staff = staffManager.getStaffPlayer(p.getName()); - if(args.length < 1){ - new SelectTargetGUI(p).callback( (target) -> { - execute(staff, target); - p.closeInventory(); - }).open(); - return false; - } + assert staff != null; - if (args[0].equalsIgnoreCase("/remove")) { - if (freezeManager.isFrozen(args[1])) - staff.unfreezePlayer(args[1]); - return true; - } + if (!p.hasPermission("mast.freeze")) { + TextUtils.colorize(Messages.GET_NO_PERMISSION_MESSAGE(), p); + return; + } - if (args[0].equalsIgnoreCase("/exec")) { - if (freezeManager.isFrozen(args[1])) - staff.executeFreezedPunishments(args[1]); - return true; - } + if (args.length < 1) { + new SelectTargetGUI(p).callback((target) -> { + execute(staff, target); + p.closeInventory(); + }).open(); + return; + } - if (onlineCheck(p, args, 0)) return true; + if (args[0].equalsIgnoreCase("/remove")) { + if (freezeManager.isFrozen(args[1])) + staff.unfreezePlayer(args[1]); + return; + } - if (Objects.requireNonNull(Bukkit.getPlayer(args[0])).hasPermission("mast.freeze.bypass")) { - TextUtils.colorize(Messages.GET_FREEZE_CANNOT_FREEZE_THAT_PLAYER_MESSAGE(), p); - return true; - } + if (args[0].equalsIgnoreCase("/exec")) { + if (freezeManager.isFrozen(args[1])) + staff.executeFreezedPunishments(args[1]); + return; + } - execute(staff, Bukkit.getPlayer(args[0])); + if (onlineCheck(p, args, 0)) return; - return true; + if (Objects.requireNonNull(Bukkit.getPlayer(args[0])).hasPermission("mast.freeze.bypass")) { + TextUtils.colorize(Messages.GET_FREEZE_CANNOT_FREEZE_THAT_PLAYER_MESSAGE(), p); + return; } - public void execute(IStaffPlayer staff, Player target){ - if (staff.isFreezed(target)) staff.unfreezePlayer(target.getName()); - else staff.freezePlayer(target); - } + execute(staff, Bukkit.getPlayer(args[0])); + } + + public void execute(IStaffPlayer staff, Player target) { + if (staff.isFreezed(target)) staff.unfreezePlayer(target.getName()); + else staff.freezePlayer(target); + } - public boolean onlineCheck(Player p, String[] args, int index){ - Player target = Bukkit.getPlayer(args[index]); + public boolean onlineCheck(Player p, String[] args, int index) { + Player target = Bukkit.getPlayer(args[index]); - if(target == null){ - TextUtils.colorize(Messages.GET_NO_PLAYER_FOUND_MESSAGE(), p); - return true; - } - return false; + if (target == null) { + TextUtils.colorize(Messages.GET_NO_PLAYER_FOUND_MESSAGE(), p); + return true; } + return false; + } + + @NotNull + @Override + public List onTabComplete(@NotNull CommandSender sender, @NotNull String[] args) { + return Bukkit.getOnlinePlayers().stream().map(Player::getName).toList(); + } } \ No newline at end of file diff --git a/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/teleport/TpCommand.java b/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/teleport/TpCommand.java new file mode 100644 index 00000000..3dc0bae3 --- /dev/null +++ b/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/teleport/TpCommand.java @@ -0,0 +1,51 @@ +package es.angelillo15.mast.bukkit.cmd.teleport; + +import com.nookure.mast.api.cmd.CommandData; +import com.nookure.mast.api.cmd.StaffCommand; +import com.nookure.mast.api.cmd.sender.CommandSender; +import es.angelillo15.mast.api.IStaffPlayer; +import es.angelillo15.mast.api.Replace; +import es.angelillo15.mast.api.config.bukkit.Messages; +import io.papermc.lib.PaperLib; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +import static es.angelillo15.mast.bukkit.utils.ColorUtils.cmp; + +@CommandData( + name = "mtp", + permission = "mast.teleport.tp", + usage = "/mtp [target]", + description = "Teleport a player to another player" +) +public class TpCommand extends StaffCommand { + @Override + public void onStaffCommand(@NotNull IStaffPlayer sender, @NotNull String label, @NotNull String[] args) { + if (args.length < 1) { + sender.sendMessage(cmp("Teleport.tp.badUsage")); + return; + } + + Player target = Bukkit.getPlayer(args[0]); + + if (target == null) { + sender.sendMessage(cmp(Messages.GET_NO_PLAYER_FOUND_MESSAGE())); + return; + } + + PaperLib.teleportAsync(sender.getPlayer(), target.getLocation()); + + sender.sendMessage(cmp("Teleport.tp.teleported", + new Replace("player", target.getName())) + ); + } + + @NotNull + @Override + public List onTabComplete(@NotNull CommandSender sender, @NotNull String @NotNull [] args) { + return Bukkit.getOnlinePlayers().stream().map(Player::getName).toList(); + } +} diff --git a/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/teleport/TphCommand.java b/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/teleport/TphCommand.java new file mode 100644 index 00000000..cd24fb2b --- /dev/null +++ b/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/teleport/TphCommand.java @@ -0,0 +1,51 @@ +package es.angelillo15.mast.bukkit.cmd.teleport; + +import com.nookure.mast.api.cmd.CommandData; +import com.nookure.mast.api.cmd.StaffCommand; +import com.nookure.mast.api.cmd.sender.CommandSender; +import es.angelillo15.mast.api.IStaffPlayer; +import es.angelillo15.mast.api.Replace; +import es.angelillo15.mast.api.config.bukkit.Messages; +import io.papermc.lib.PaperLib; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +import static es.angelillo15.mast.bukkit.utils.ColorUtils.cmp; + +@CommandData( + name = "mtph", + permission = "mast.teleport.tph", + usage = "/mtph [target]", + description = "Teleport you to the player location" +) +public class TphCommand extends StaffCommand { + @Override + public void onStaffCommand(@NotNull IStaffPlayer sender, @NotNull String label, @NotNull String[] args) { + if (args.length < 1) { + sender.sendMessage(cmp("Teleport.tph.badUsage")); + return; + } + + Player target = Bukkit.getPlayer(args[0]); + + if (target == null) { + sender.sendMessage(cmp(Messages.GET_NO_PLAYER_FOUND_MESSAGE())); + return; + } + + PaperLib.teleportAsync(target, sender.getPlayer().getLocation()); + + sender.sendMessage(cmp("Teleport.tph.teleported", + new Replace("player", target.getName())) + ); + } + + @NotNull + @Override + public List onTabComplete(@NotNull CommandSender sender, @NotNull String @NotNull [] args) { + return Bukkit.getOnlinePlayers().stream().map(Player::getName).toList(); + } +} \ No newline at end of file diff --git a/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/utils/CommandTemplate.kt b/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/utils/CommandTemplate.kt index 964f3cb3..4679dca7 100644 --- a/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/utils/CommandTemplate.kt +++ b/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/cmd/utils/CommandTemplate.kt @@ -4,6 +4,7 @@ import es.angelillo15.mast.api.MAStaffInstance import com.nookure.mast.api.cmd.Command import com.nookure.mast.api.cmd.CommandData import com.nookure.mast.api.manager.cmd.CommandBukkitSenderManager +import es.angelillo15.mast.api.config.bukkit.ConfigLoader import es.angelillo15.mast.bukkit.MAStaff import org.bukkit.command.CommandSender import java.util.concurrent.ConcurrentHashMap @@ -11,9 +12,9 @@ import java.util.concurrent.ConcurrentHashMap class CommandTemplate : org.bukkit.command.Command { private val command: Command private val senderManager: CommandBukkitSenderManager = MAStaff - .getPlugin() - .injector - .getInstance(CommandBukkitSenderManager::class.java) + .getPlugin() + .injector + .getInstance(CommandBukkitSenderManager::class.java) constructor(name: String, command: Command) : super(name) { this.command = command @@ -33,7 +34,7 @@ class CommandTemplate : org.bukkit.command.Command { override fun execute(sender: CommandSender, commandLabel: String, args: Array): Boolean { val pluginSender = senderManager.getSender(sender) - command.onCommand(pluginSender!!, commandLabel, args); + command.onCommand(pluginSender, commandLabel, args); return true } @@ -46,7 +47,8 @@ class CommandTemplate : org.bukkit.command.Command { companion object { val commandMap = ConcurrentHashMap() fun registerCommand(command: Command) { - val commandData: CommandData? + MAStaffInstance.getLogger().debug("Registering command ${command.javaClass.simpleName}...") + var commandData: CommandData? try { commandData = command.javaClass.getDeclaredAnnotation(CommandData::class.java) @@ -55,6 +57,30 @@ class CommandTemplate : org.bukkit.command.Command { return } + val commands = ConfigLoader.getCommands().config + + if (commands.contains("Commands.${commandData.name}")) { + MAStaffInstance.getLogger().debug("Command ${command.javaClass.simpleName} has been found in config") + + if (!commands.getBoolean("Commands.${commandData.name}.enabled")) { + MAStaffInstance.getLogger().debug("Command ${command.javaClass.simpleName} has been disabled from config") + return + } + + commandData = CommandData( + name = commands.getString("Commands.${commandData.name}.name"), + aliases = commands.getStringList("Commands.${commandData.name}.aliases").toTypedArray(), + permission = commands.getString("Commands.${commandData.name}.permission"), + usage = commands.getString("Commands.${commandData.name}.usage"), + description = commands.getString("Commands.${commandData.name}.description") + ) + MAStaffInstance.getLogger().debug("Command ${command.javaClass.simpleName} has been edited from config") + } + + if (commandData != null) { + insertIntoCommandFileIfNot(commandData) + } + if (commandData == null) { MAStaffInstance.getLogger().warn("Command ${command.javaClass.simpleName} doesn't have CommandData annotation") return @@ -67,11 +93,12 @@ class CommandTemplate : org.bukkit.command.Command { if (commandData.aliases.isEmpty() && commandData.permission.isNotEmpty()) { CommandManager.registerIntoCommandMap(CommandTemplate(commandData.name, command, commandData.permission)) } + val commandTemplate = CommandTemplate( - commandData.name, - command, - commandData.permission, - *commandData.aliases + commandData.name, + command, + commandData.permission, + *commandData.aliases ) CommandManager.registerIntoCommandMap(commandTemplate) @@ -84,5 +111,23 @@ class CommandTemplate : org.bukkit.command.Command { commandMap.remove(command) CommandManager.getCommandMap()?.let { bukkitCommand.unregister(it) } } + + fun insertIntoCommandFileIfNot(commandData: CommandData) { + val commands = ConfigLoader.getCommands().config + + if (commands.contains("Commands.${commandData.name}")) { + MAStaffInstance.getLogger().debug("Command ${commandData.name} has been found in config") + return + } + + commands.set("Commands.${commandData.name}.name", commandData.name) + commands.set("Commands.${commandData.name}.aliases", commandData.aliases) + commands.set("Commands.${commandData.name}.permission", commandData.permission) + commands.set("Commands.${commandData.name}.usage", commandData.usage) + commands.set("Commands.${commandData.name}.description", commandData.description) + commands.set("Commands.${commandData.name}.enabled", true) + + ConfigLoader.getCommands().config.save() + } } } \ No newline at end of file diff --git a/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/utils/ColorUtils.java b/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/utils/ColorUtils.java index 3e4adc8b..cc5fda2d 100644 --- a/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/utils/ColorUtils.java +++ b/MAStaff-Bukkit/src/main/java/es/angelillo15/mast/bukkit/utils/ColorUtils.java @@ -1,7 +1,9 @@ package es.angelillo15.mast.bukkit.utils; +import es.angelillo15.mast.api.Replace; import es.angelillo15.mast.api.TextUtils; import es.angelillo15.mast.api.config.bukkit.ConfigLoader; +import es.angelillo15.mast.api.config.bukkit.Messages; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; @@ -13,13 +15,27 @@ public static String tl(String path) { } public static String raw(String path) { - return ConfigLoader.getMessages().getConfig().getString(path); + if (getMessages().contains(path)) { + return getMessages().getString(path).replace("{prefix}", Messages.PREFIX()); + } else { + return path; + } } public static Component cmp(String path) { return MiniMessage.miniMessage().deserialize(tl(path)); } + public static Component cmp(String path, Replace... replace) { + String text = tl(path); + for (Replace r : replace) { + text = text.replace( "{" + r.search() + "}", r.replace()); + } + + text = text.replace("{prefix}", Messages.PREFIX()); + return MiniMessage.miniMessage().deserialize(text); + } + public static String chc(String path) { return LegacyComponentSerializer.legacy('ยง').serialize(cmp(path)); } diff --git a/MAStaff-Bukkit/src/main/resources/Bukkit/commands.yml b/MAStaff-Bukkit/src/main/resources/Bukkit/commands.yml new file mode 100644 index 00000000..d5a9bc9c --- /dev/null +++ b/MAStaff-Bukkit/src/main/resources/Bukkit/commands.yml @@ -0,0 +1,18 @@ +Commands: + # Here you can modify the commands + # Here you have an example. + # ----------------------------------------------------------- + # freeze: + # # enable or disable the command. + # enabled: true + # # The name of the command. + # name: freeze + # # The permission required to execute the command. + # permission: mast.freeze + # # The aliases of the command. + # aliases: [fr] + # # The usage bukkit message. + # usage: /freeze + # # The description of the command. + # description: Freeze a player. + # ----------------------------------------------------------- \ No newline at end of file diff --git a/MAStaff-Bukkit/src/main/resources/Bukkit/lang/english.yml b/MAStaff-Bukkit/src/main/resources/Bukkit/lang/english.yml index 74236ecf..66d7e7a5 100644 --- a/MAStaff-Bukkit/src/main/resources/Bukkit/lang/english.yml +++ b/MAStaff-Bukkit/src/main/resources/Bukkit/lang/english.yml @@ -106,4 +106,12 @@ StaffVault: # Message sent when the Staff Vault is full. staffVaultFull: "{prefix} &7Your Staff Vault is full." # Message sent when the Staff tries to open the Staff Vault on StaffMode. - staffVaultInStaffMode: "{prefix} &7You can't open your Staff Vault while in Staff Mode." \ No newline at end of file + staffVaultInStaffMode: "{prefix} &7You can't open your Staff Vault while in Staff Mode." +# Teleport section. +Teleport: + tp: + badUsage: '{prefix} &7You must use &a/mtp ' + teleported: '{prefix} Teleporting to &a{player}' + tph: + badUsage: '{prefix} &7You must use &a/mtph ' + teleported: '{prefix} Teleporting &a{player} &7to you' \ No newline at end of file diff --git a/MAStaff-Bukkit/src/main/resources/Bukkit/lang/spanish.yml b/MAStaff-Bukkit/src/main/resources/Bukkit/lang/spanish.yml index 05ba7c4f..e82df6a3 100644 --- a/MAStaff-Bukkit/src/main/resources/Bukkit/lang/spanish.yml +++ b/MAStaff-Bukkit/src/main/resources/Bukkit/lang/spanish.yml @@ -106,4 +106,12 @@ StaffVault: # Mensaje que se manda cuando el inventario de staff esta lleno staffVaultFull: "{prefix} &7Tu inventario de staff esta lleno." # Mensaje que se manda cuando intentas abrir el vault en modo staff - staffVaultInStaffMode: "{prefix} &7No puedes abrir el vault en modo staff." \ No newline at end of file + staffVaultInStaffMode: "{prefix} &7No puedes abrir el vault en modo staff." +# Teleport section. +Teleport: + tp: + badUsage: '{prefix} &7Tienes que usar &a/mtp ' + teleported: '{prefix} Teletransportando a &a{player}' + tph: + badUsage: '{prefix} &7Tienes que usar &a/mtph ' + teleported: '{prefix} Teletransportando &a{player} &7hacia ti' \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 7e17501e..362494a4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -22,6 +22,9 @@ include("MAStaff-Velocity") include("MAStaff-Common") include("MAStaff-Lite") +include("MAStaff-API:API-Publish") +findProject(":MAStaff-API:API-Publish")?.name = "API-Publish" + // Disabled for now // include("MAStaff-Punishments") // include("MAStaff-Punishments:Punishments-Bukkit") @@ -51,8 +54,6 @@ if (MASTAFF_NMS.toBoolean()) { findProject(":MAStaff-NMS:NMS-1.12.2_R0")?.name = "NMS-1.12.2_R0" include("MAStaff-NMS:NMS-1.8.8_R0") findProject(":MAStaff-NMS:NMS-1.8.8_R0")?.name = "NMS-1.8.8_R0" - include("MAStaff-API:API-Publish") - findProject(":MAStaff-API:API-Publish")?.name = "API-Publish" include("MAStaff-NMS:NMS-1.20.2_R0") findProject(":MAStaff-NMS:NMS-1.20.2_R0")?.name = "NMS-1.20.2_R0" }