mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-11-24 02:08:48 +00:00
feat: 添加代理方法
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
73eeac2484
commit
1a7e967826
@ -4,6 +4,9 @@ import java.util.logging.Handler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
/**
|
||||
* 插件日志输出类
|
||||
*
|
||||
@ -12,11 +15,19 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class Log {
|
||||
private static Logger logger = P.instance.getLogger();
|
||||
private static String prefix = String.format("§6[§b%s§6]§r ", P.instance.getName());
|
||||
private static CommandSender console = Bukkit.getConsoleSender();
|
||||
|
||||
public static void addHandler(final Handler handler) throws SecurityException {
|
||||
logger.addHandler(handler);
|
||||
}
|
||||
|
||||
public static void console(final String... msg) {
|
||||
for (final String str : msg) {
|
||||
console.sendMessage(prefix + str);
|
||||
}
|
||||
}
|
||||
|
||||
public static void info(final String msg) {
|
||||
logger.info(msg);
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
package pw.yumc.YumCore.bukkit;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
/**
|
||||
@ -26,4 +29,20 @@ public class P {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public PluginCommand getCommand(final String name) {
|
||||
return instance.getCommand(name);
|
||||
}
|
||||
|
||||
public FileConfiguration getConfig() {
|
||||
return instance.getConfig();
|
||||
}
|
||||
|
||||
public final Logger getLogger() {
|
||||
return instance.getLogger();
|
||||
}
|
||||
|
||||
public final String getName() {
|
||||
return instance.getName();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user