Compare commits
No commits in common. "0f3b06a596f5cb774d4a90dd8375f13ec5fe9def" and "5d51ae33b07c8ec58c43449cc4d82074b338ad6c" have entirely different histories.
0f3b06a596
...
5d51ae33b0
22 changed files with 39 additions and 72 deletions
|
@ -16,9 +16,8 @@
|
|||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package de.pickshadow.plugin.base;
|
||||
package de.pickshadow.plugin;
|
||||
|
||||
import de.pickshadow.plugin.BuildConfiguration;
|
||||
import de.pickshadow.plugin.classes.logger.LoggerInstanceImpl;
|
||||
import de.pickshadow.plugin.classes.logger.implementations.ExtendedBukkitLogger;
|
||||
import de.pickshadow.plugin.loaders.ConfigLoader;
|
|
@ -16,7 +16,7 @@
|
|||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package de.pickshadow.plugin.base;
|
||||
package de.pickshadow.plugin;
|
||||
|
||||
import de.pickshadow.plugin.classes.logger.LoggerImpl;
|
||||
import de.pickshadow.plugin.loaders.ConfigLoader;
|
|
@ -16,7 +16,7 @@
|
|||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package de.pickshadow.plugin.base;
|
||||
package de.pickshadow.plugin;
|
||||
|
||||
import de.pickshadow.plugin.classes.logger.LoggerInstanceImpl;
|
||||
import de.pickshadow.plugin.commands.*;
|
|
@ -16,9 +16,8 @@
|
|||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package de.pickshadow.plugin.base;
|
||||
package de.pickshadow.plugin;
|
||||
|
||||
import de.pickshadow.plugin.BuildConfiguration;
|
||||
import de.pickshadow.plugin.classes.Configuration;
|
||||
import de.pickshadow.plugin.classes.logger.LoggerInstanceImpl;
|
||||
import de.pickshadow.plugin.utils.Miscellaneous;
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
package de.pickshadow.plugin.classes;
|
||||
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.logger.LoggerInstanceImpl;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.*;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
package de.pickshadow.plugin.classes;
|
||||
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
|
|
@ -16,10 +16,11 @@
|
|||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package de.pickshadow.plugin.base;
|
||||
package de.pickshadow.plugin.classes;
|
||||
|
||||
import de.pickshadow.plugin.BuildConfiguration;
|
||||
import de.pickshadow.plugin.GitHead;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
|
@ -52,9 +53,6 @@ public class Translation {
|
|||
public static String PLUGINCOMMAND_RELOAD_DATA_SUCCESS = "Alle Spielerdaten wurden erfolgreich neugeladen.";
|
||||
public static String PLUGINCOMMAND_RELOAD_DATA_FAIL = "Nicht alle Spielerdaten konnten erfolgreich neugeladen werden, folgende UUIDs sind betroffen:\n%uuids%";
|
||||
public static String PLUGINCOMMAND_GARBAGECOLLECT = "Starte Garbage Collector, der Server könnte für ein paar Millisekunden einfrieren.";
|
||||
public static String PLUGINCOMMAND_GARBAGECOLLECT_FINISHED = "Der Garbage Collector wurde gestartet und hat erfolgreich den Arbeitsspeicher entleert.";
|
||||
public static String PLUGINCOMMAND_SCHEDULER = "Der Scheduler \"%timeframe%\" wurde gestartet und führt seine Hintergrundaufgaben aus, bitte warten.";
|
||||
public static String PLUGINCOMMAND_SCHEDULER_DONE = "Der Scheduler \"%timeframe%\" wurde ausgeführt. Für eventuelle Fehler gucken sie sich bitte die Serverkonsole an.";
|
||||
public static String PLUGINCOMMAND_PLAYERINFO = "Deine Spielerinformationen:\n%playerdata%";
|
||||
|
||||
// Command: /sysinfo
|
|
@ -19,7 +19,7 @@
|
|||
package de.pickshadow.plugin.classes.logger;
|
||||
|
||||
import de.pickshadow.plugin.BuildConfiguration;
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.Types;
|
||||
import de.pickshadow.plugin.utils.Miscellaneous;
|
||||
import org.bukkit.Bukkit;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
package de.pickshadow.plugin.classes.logger.implementations;
|
||||
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.Types;
|
||||
import de.pickshadow.plugin.classes.logger.LoggerImpl;
|
||||
import org.bukkit.Bukkit;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
package de.pickshadow.plugin.commands;
|
||||
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.CommandBase;
|
||||
import de.pickshadow.plugin.classes.Types;
|
||||
import de.pickshadow.plugin.utils.Miscellaneous;
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
package de.pickshadow.plugin.commands;
|
||||
|
||||
import de.pickshadow.plugin.classes.CommandBase;
|
||||
import de.pickshadow.plugin.base.Translation;
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.Translation;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.Types;
|
||||
import de.pickshadow.plugin.utils.Miscellaneous;
|
||||
import de.pickshadow.plugin.utils.TabCompletionHelper;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
package de.pickshadow.plugin.commands;
|
||||
|
||||
import de.pickshadow.plugin.classes.CommandBase;
|
||||
import de.pickshadow.plugin.base.Translation;
|
||||
import de.pickshadow.plugin.classes.Translation;
|
||||
import de.pickshadow.plugin.classes.Types;
|
||||
import de.pickshadow.plugin.utils.Miscellaneous;
|
||||
import de.pickshadow.plugin.utils.TabCompletionHelper;
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
package de.pickshadow.plugin.commands;
|
||||
|
||||
import de.pickshadow.plugin.BuildConfiguration;
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.CommandBase;
|
||||
import de.pickshadow.plugin.classes.PlayerData;
|
||||
import de.pickshadow.plugin.base.Translation;
|
||||
import de.pickshadow.plugin.classes.Translation;
|
||||
import de.pickshadow.plugin.classes.Types;
|
||||
import de.pickshadow.plugin.utils.Miscellaneous;
|
||||
import de.pickshadow.plugin.utils.TabCompletionHelper;
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
package de.pickshadow.plugin.commands;
|
||||
|
||||
import de.pickshadow.plugin.classes.CommandBase;
|
||||
import de.pickshadow.plugin.base.Translation;
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.Translation;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.Types;
|
||||
import de.pickshadow.plugin.classes.Configuration;
|
||||
import de.pickshadow.plugin.utils.Miscellaneous;
|
||||
|
@ -47,7 +47,6 @@ public class PluginCommand extends CommandBase {
|
|||
sender.sendMessage(Miscellaneous.format(Translation.PLUGINCOMMAND_INFO));
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args[0]) {
|
||||
case "reloadconfig":
|
||||
sender.sendMessage(Miscellaneous.format(Translation.PLUGINCOMMAND_RELOAD_CONFIG));
|
||||
|
@ -69,45 +68,19 @@ public class PluginCommand extends CommandBase {
|
|||
}
|
||||
break;
|
||||
case "gc":
|
||||
Thread gcThread = new Thread(() -> {
|
||||
sender.sendMessage(Miscellaneous.format(Translation.PLUGINCOMMAND_GARBAGECOLLECT));
|
||||
Miscellaneous.gc();
|
||||
sender.sendMessage(Miscellaneous.format(Translation.PLUGINCOMMAND_GARBAGECOLLECT_FINISHED));
|
||||
});
|
||||
gcThread.start();
|
||||
sender.sendMessage(Miscellaneous.format(Translation.PLUGINCOMMAND_GARBAGECOLLECT));
|
||||
Miscellaneous.gc();
|
||||
break;
|
||||
case "playerinfo":
|
||||
if (sender instanceof ConsoleCommandSender) {
|
||||
sender.sendMessage(Miscellaneous.format(Translation.GLOBAL_NOT_A_PLAYER, Types.FormatType.ERROR));
|
||||
break;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
sender.sendMessage(Miscellaneous.format(Translation.PLUGINCOMMAND_PLAYERINFO.replace("%playerdata%", ObjHolder.playerDataLoader.getPlayerData(player.getUniqueId()).convertToString())));
|
||||
break;
|
||||
case "scheduler":
|
||||
if (args.length < 2) {
|
||||
sender.sendMessage(Miscellaneous.format(Translation.GLOBAL_NOT_ENOUGH_ARGUMENTS.replace("%usage%", command.getUsage()), Types.FormatType.ERROR));
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args[1]) {
|
||||
case "minutely":
|
||||
case "minute":
|
||||
sender.sendMessage(Miscellaneous.format(Translation.PLUGINCOMMAND_SCHEDULER.replace("%timeframe%", "minutely")));
|
||||
ObjHolder.scheduler.runMinuteTasks(ObjHolder.scheduler.execsMinutely);
|
||||
sender.sendMessage(Miscellaneous.format(Translation.PLUGINCOMMAND_SCHEDULER_DONE.replace("%timeframe%", "minutely")));
|
||||
break;
|
||||
case "hourly":
|
||||
case "hour":
|
||||
sender.sendMessage(Miscellaneous.format(Translation.PLUGINCOMMAND_SCHEDULER.replace("%timeframe%", "hourly")));
|
||||
ObjHolder.scheduler.runHourTasks(ObjHolder.scheduler.execsHourly);
|
||||
sender.sendMessage(Miscellaneous.format(Translation.PLUGINCOMMAND_SCHEDULER_DONE.replace("%timeframe%", "hourly")));
|
||||
break;
|
||||
default: sender.sendMessage(Miscellaneous.format(Translation.GLOBAL_INVALID_ARGUMENT.replace("%usage%", command.getUsage()), Types.FormatType.ERROR));
|
||||
}
|
||||
break;
|
||||
default: sender.sendMessage(Miscellaneous.format(Translation.GLOBAL_INVALID_ARGUMENT.replace("%usage%", command.getUsage()), Types.FormatType.ERROR));
|
||||
default:
|
||||
sender.sendMessage(Miscellaneous.format(Translation.GLOBAL_INVALID_ARGUMENT.replace("%usage%", command.getUsage()), Types.FormatType.ERROR));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -116,12 +89,7 @@ public class PluginCommand extends CommandBase {
|
|||
return (commandSender, command, name, args) -> {
|
||||
if (commandSender.hasPermission("atc.commands.pickshadow")) {
|
||||
ArrayList<String[]> completion = new ArrayList<>();
|
||||
completion.add(new String[]{ "reloadconfig", "reloaddata", "gc", "scheduler", "playerinfo" });
|
||||
if (args.length > 2) {
|
||||
if (args[0].equals("scheduler")) {
|
||||
completion.add(new String[]{"minutely", "hourly"});
|
||||
}
|
||||
}
|
||||
completion.add(new String[]{ "reloadconfig", "reloaddata", "gc", "playerinfo" });
|
||||
return TabCompletionHelper.processDynamicCompletion(completion, args);
|
||||
} else {
|
||||
return TabCompletionHelper.processEmptyCompletion(args);
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
package de.pickshadow.plugin.commands;
|
||||
|
||||
import de.pickshadow.plugin.classes.CommandBase;
|
||||
import de.pickshadow.plugin.base.Translation;
|
||||
import de.pickshadow.plugin.classes.Translation;
|
||||
import de.pickshadow.plugin.utils.Miscellaneous;
|
||||
import de.pickshadow.plugin.utils.TabCompletionHelper;
|
||||
import net.kyori.adventure.text.Component;
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
*/
|
||||
package de.pickshadow.plugin.commands;
|
||||
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.CommandBase;
|
||||
import de.pickshadow.plugin.base.Translation;
|
||||
import de.pickshadow.plugin.classes.Translation;
|
||||
import de.pickshadow.plugin.classes.Types;
|
||||
import de.pickshadow.plugin.utils.Miscellaneous;
|
||||
import de.pickshadow.plugin.utils.TabCompletionHelper;
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
*/
|
||||
package de.pickshadow.plugin.listeners;
|
||||
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.base.Translation;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.Translation;
|
||||
import de.pickshadow.plugin.utils.Miscellaneous;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
|
|
|
@ -18,10 +18,13 @@
|
|||
*/
|
||||
package de.pickshadow.plugin.loaders;
|
||||
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.Main;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.Configuration;
|
||||
import de.pickshadow.plugin.classes.logger.LoggerImpl;
|
||||
import de.pickshadow.plugin.classes.logger.LoggerInstanceImpl;
|
||||
import de.pickshadow.plugin.utils.FileOperations;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.yaml.snakeyaml.LoaderOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.composer.ComposerException;
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
*/
|
||||
package de.pickshadow.plugin.loaders;
|
||||
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.PlayerData;
|
||||
import de.pickshadow.plugin.base.Translation;
|
||||
import de.pickshadow.plugin.classes.Translation;
|
||||
import de.pickshadow.plugin.classes.Types;
|
||||
import de.pickshadow.plugin.classes.logger.LoggerInstanceImpl;
|
||||
import de.pickshadow.plugin.utils.FileOperations;
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
*/
|
||||
package de.pickshadow.plugin.utils;
|
||||
|
||||
import de.pickshadow.plugin.base.Translation;
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.Translation;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.Types;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
|
|
|
@ -20,7 +20,7 @@ package de.pickshadow.plugin.utils;
|
|||
|
||||
import com.nikialeksey.hunspell.Hunspell;
|
||||
import de.pickshadow.plugin.BuildConfiguration;
|
||||
import de.pickshadow.plugin.base.ObjHolder;
|
||||
import de.pickshadow.plugin.ObjHolder;
|
||||
import de.pickshadow.plugin.classes.logger.LoggerInstanceImpl;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
name: PSSP
|
||||
version: '${version}'
|
||||
main: de.pickshadow.plugin.base.Main
|
||||
main: de.pickshadow.plugin.Main
|
||||
api-version: '1.20'
|
||||
prefix: PSSP
|
||||
depend: [ FreedomChat ]
|
||||
|
@ -35,7 +35,7 @@ commands:
|
|||
permission: pickshadow.commands.home
|
||||
pssp:
|
||||
description: Verwaltet das PickShadow Server Plugin.
|
||||
usage: /pssp <reloadconfig|reloaddata|gc <minutely|hourly>|playerinfo>
|
||||
usage: /pssp <reloadconfig|reloaddata|gc|playerinfo>
|
||||
aliases: [ "pickshadow" ]
|
||||
sysinfo:
|
||||
description: Zeigt Informationen zum Server an.
|
||||
|
|
Loading…
Reference in a new issue