forked from Upstream/mmocore
Removed useless debug/log
This commit is contained in:
parent
cb2da5abb2
commit
79fb516f2e
@ -13,7 +13,6 @@ import net.Indyuce.mmocore.api.PlayerActionBar;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.api.player.attribute.AttributeModifier;
|
||||
import net.Indyuce.mmocore.api.player.profess.resource.PlayerResource;
|
||||
import net.Indyuce.mmocore.api.util.debug.DebugMode;
|
||||
import net.Indyuce.mmocore.command.*;
|
||||
import net.Indyuce.mmocore.comp.placeholder.DefaultParser;
|
||||
import net.Indyuce.mmocore.comp.placeholder.PlaceholderAPIParser;
|
||||
@ -227,12 +226,6 @@ public class MMOCore extends JavaPlugin {
|
||||
if (getConfig().getBoolean("vanilla-exp-redirection.enabled"))
|
||||
Bukkit.getPluginManager().registerEvents(new RedirectVanillaExp(getConfig().getDouble("vanilla-exp-redirection.ratio")), this);
|
||||
|
||||
// Enable debug mode for extra debug tools
|
||||
if (getConfig().contains("debug")) {
|
||||
DebugMode.setLevel(getConfig().getInt("debug", 0));
|
||||
DebugMode.enableActionBar();
|
||||
}
|
||||
|
||||
// Load quest module
|
||||
try {
|
||||
String questPluginName = UtilityMethods.enumName(getConfig().getString("quest-plugin"));
|
||||
@ -451,18 +444,10 @@ public class MMOCore extends JavaPlugin {
|
||||
log(Level.INFO, message);
|
||||
}
|
||||
|
||||
public static void debug(int value, String message) {
|
||||
debug(value, Level.INFO, message);
|
||||
}
|
||||
|
||||
public static void log(Level level, String message) {
|
||||
plugin.getLogger().log(level, message);
|
||||
}
|
||||
|
||||
public static void debug(int value, Level level, String message) {
|
||||
if (DebugMode.level > (value - 1)) plugin.getLogger().log(level, message);
|
||||
}
|
||||
|
||||
public File getJarFile() {
|
||||
return getFile();
|
||||
}
|
||||
|
@ -110,13 +110,9 @@ public class PlayerQuests implements Closable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (jo.has("finished"))
|
||||
for (Entry<String, JsonElement> entry : jo.getAsJsonObject("finished").entrySet())
|
||||
finished.put(entry.getKey(), entry.getValue().getAsLong());
|
||||
|
||||
for (Entry<String, Long> entry : finished.entrySet())
|
||||
MMOCore.log("Finished: (" + entry.getKey() + ") - at: " + entry.getValue());
|
||||
}
|
||||
|
||||
public QuestProgress getCurrent() {
|
||||
|
@ -1,32 +0,0 @@
|
||||
package net.Indyuce.mmocore.api.util.debug;
|
||||
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
|
||||
public class ActionBarRunnable extends BukkitRunnable {
|
||||
|
||||
/*
|
||||
* how to enable it: set 'debug' to true in the config and use the
|
||||
* 'debug-action-bar' string parameter. hot changes, only need /mmocore
|
||||
* reload.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Bukkit.getOnlinePlayers().forEach(this::sendActionBar);
|
||||
}
|
||||
|
||||
private void sendActionBar(Player player) {
|
||||
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(MMOCore.plugin.placeholderParser.parse(player, getMessage())));
|
||||
}
|
||||
|
||||
private String getMessage() {
|
||||
String str = MMOCore.plugin.getConfig().getString("debug-action-bar.format");
|
||||
return str == null ? "" : str;
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package net.Indyuce.mmocore.api.util.debug;
|
||||
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
|
||||
public class DebugMode {
|
||||
/*
|
||||
* Debug Levels:
|
||||
* 1:
|
||||
* - Print WorldGuard Flag Registry
|
||||
* 2:
|
||||
* - Print Profession Trigger Things
|
||||
* 3:
|
||||
* - Debug Action Bar
|
||||
*/
|
||||
public static int level = 0;
|
||||
|
||||
public static void setLevel(int i) {
|
||||
level = i;
|
||||
}
|
||||
|
||||
public static void enableActionBar() {
|
||||
if (level > 2 && MMOCore.plugin.getConfig().getBoolean("debug-action-bar.enabled"))
|
||||
new ActionBarRunnable().runTaskTimer(MMOCore.plugin, 0, 10);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user