mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-28 15:36:13 +00:00
46 lines
1.1 KiB
Java
46 lines
1.1 KiB
Java
package mantle.debug;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import static mantle.lib.CoreRepo.*;
|
|
import static mantle.lib.CoreConfig.*;
|
|
|
|
/**
|
|
* IDebuggable helper
|
|
*
|
|
* @author Sunstrike <[email protected]>
|
|
*/
|
|
public class DebugHelper {
|
|
|
|
private DebugHelper() {} //Singleton
|
|
|
|
public static void handleDebugData(DebugData data)
|
|
{
|
|
if (debug_enableChat)
|
|
handleChatDebug(data);
|
|
if (debug_enableConsole)
|
|
handleConsoleDebug(data);
|
|
}
|
|
|
|
private static void handleChatDebug(DebugData data)
|
|
{
|
|
EntityPlayer player = data.player;
|
|
String prefix = "[" + data.cl.getSimpleName() + "] ";
|
|
for (String str : data.strings)
|
|
{
|
|
player.addChatMessage(prefix + str);
|
|
}
|
|
}
|
|
|
|
private static void handleConsoleDebug(DebugData data)
|
|
{
|
|
String player = data.player.username;
|
|
String prefix = "[" + player + ":" + data.cl.getSimpleName() + "] ";
|
|
for (String str : data.strings)
|
|
{
|
|
logger.info(prefix + str);
|
|
}
|
|
}
|
|
|
|
}
|