mirror of
https://github.com/carm-outsource/TimeReward.git
synced 2026-06-05 01:08:10 +08:00
44 lines
1.3 KiB
Java
44 lines
1.3 KiB
Java
package cc.carm.plugin.timereward;
|
|
|
|
import cc.carm.lib.easyplugin.utils.ColorParser;
|
|
import cc.carm.lib.easyplugin.utils.MessageUtils;
|
|
import cc.carm.plugin.timereward.manager.ConfigManager;
|
|
import cc.carm.plugin.timereward.manager.RewardManager;
|
|
import cc.carm.plugin.timereward.manager.UserManager;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.entity.Player;
|
|
|
|
import java.util.List;
|
|
|
|
public class TimeRewardAPI {
|
|
|
|
public static UserManager getUserManager() {
|
|
return Main.getInstance().userManager;
|
|
}
|
|
|
|
public static ConfigManager getConfigManager() {
|
|
return Main.getInstance().configManager;
|
|
}
|
|
|
|
public static RewardManager getRewardManager() {
|
|
return Main.getInstance().rewardManager;
|
|
}
|
|
|
|
public static void executeCommands(Player player, List<String> commands) {
|
|
if (commands == null || commands.isEmpty()) return;
|
|
for (String command : commands) {
|
|
try {
|
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), parseCommand(player, command));
|
|
} catch (Exception exception) {
|
|
exception.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
private static String parseCommand(Player player, String command) {
|
|
return MessageUtils.setPlaceholders(player, ColorParser.parse(command));
|
|
}
|
|
|
|
|
|
}
|