Refactored logging calls.
This commit is contained in:
@@ -79,12 +79,12 @@ public abstract class LegacyTinyProtocol {
|
|||||||
registerBukkitEvents();
|
registerBukkitEvents();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
System.out.println("[NPCLib] Attempting to inject into netty.");
|
plugin.getLogger().info("[NPCLib] Attempting to inject into netty.");
|
||||||
registerChannelHandler();
|
registerChannelHandler();
|
||||||
registerPlayers(plugin);
|
registerPlayers(plugin);
|
||||||
} catch (IllegalArgumentException ex) {
|
} catch (IllegalArgumentException ex) {
|
||||||
// Damn you, late bind
|
// Damn you, late bind
|
||||||
plugin.getLogger().info("[NPCLib] Attempting to delay injection.");
|
plugin.getLogger().log(Level.WARNING, "[NPCLib] Attempting to delay injection.");
|
||||||
|
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -198,7 +198,7 @@ public abstract class LegacyTinyProtocol {
|
|||||||
serverChannels.add(serverChannel);
|
serverChannels.add(serverChannel);
|
||||||
|
|
||||||
serverChannel.pipeline().addFirst(serverChannelHandler);
|
serverChannel.pipeline().addFirst(serverChannelHandler);
|
||||||
System.out.println("[NPCLib] Server channel handler injected (" + serverChannel + ")");
|
plugin.getLogger().info("[NPCLib] Server channel handler injected (" + serverChannel + ")");
|
||||||
looking = false;
|
looking = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,12 +76,12 @@ public abstract class TinyProtocol {
|
|||||||
registerBukkitEvents();
|
registerBukkitEvents();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
System.out.println("[NPCLib] Attempting to inject into netty.");
|
plugin.getLogger().info("[NPCLib] Attempting to inject into netty.");
|
||||||
registerChannelHandler();
|
registerChannelHandler();
|
||||||
registerPlayers(plugin);
|
registerPlayers(plugin);
|
||||||
} catch (IllegalArgumentException ex) {
|
} catch (IllegalArgumentException ex) {
|
||||||
// Damn you, late bind
|
// Damn you, late bind
|
||||||
plugin.getLogger().info("[NPCLib] Attempting to delay injection.");
|
plugin.getLogger().log(Level.WARNING, "[NPCLib] Attempting to delay injection.");
|
||||||
|
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.bukkit.plugin.PluginManager;
|
|||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Jitse Boonstra
|
* @author Jitse Boonstra
|
||||||
@@ -34,6 +35,9 @@ public class NPCLib {
|
|||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.server = plugin.getServer();
|
this.server = plugin.getServer();
|
||||||
|
|
||||||
|
// TODO: Change this to a more dynamic variable (maven file filtering?).
|
||||||
|
plugin.getLogger().info("[NPCLib] Initiating NPCLib v1.4.");
|
||||||
|
|
||||||
String versionName = server.getClass().getPackage().getName().split("\\.")[3];
|
String versionName = server.getClass().getPackage().getName().split("\\.")[3];
|
||||||
|
|
||||||
Class<?> npcClass = null;
|
Class<?> npcClass = null;
|
||||||
@@ -47,13 +51,13 @@ public class NPCLib {
|
|||||||
this.npcClass = npcClass;
|
this.npcClass = npcClass;
|
||||||
|
|
||||||
if (npcClass == null) {
|
if (npcClass == null) {
|
||||||
server.getConsoleSender().sendMessage(ChatColor.RED + "NPCLib failed to initiate. Your server's version ("
|
plugin.getLogger().log(Level.SEVERE, "NPCLib failed to initiate. Your server's version ("
|
||||||
+ versionName + ") is not supported.");
|
+ versionName + ") is not supported.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message) {
|
if (message) {
|
||||||
server.getConsoleSender().sendMessage(ChatColor.BLUE + "[NPCLib] " + ChatColor.WHITE + "Enabled for version " + versionName + ".");
|
plugin.getLogger().info("[NPCLib] Enabled for version " + versionName + ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
registerInternal();
|
registerInternal();
|
||||||
|
|||||||
Reference in New Issue
Block a user