mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
fancynpcs: Update logger to 0.0.7
This commit is contained in:
@@ -77,7 +77,7 @@ dependencies {
|
||||
compileOnly("org.lushplugins:ChatColorHandler:6.0.0")
|
||||
implementation("de.oliver.FancyAnalytics:java-sdk:0.0.4")
|
||||
implementation("de.oliver.FancyAnalytics:mc-api:0.1.9")
|
||||
implementation("de.oliver.FancyAnalytics:logger:0.0.6")
|
||||
implementation("de.oliver.FancyAnalytics:logger:0.0.7")
|
||||
implementation("org.incendo:cloud-core:2.1.0-SNAPSHOT")
|
||||
implementation("org.incendo:cloud-paper:2.0.0-beta.11")
|
||||
implementation("org.incendo:cloud-annotations:2.1.0-SNAPSHOT")
|
||||
|
||||
@@ -10,6 +10,7 @@ import de.oliver.fancyanalytics.logger.LogLevel;
|
||||
import de.oliver.fancyanalytics.logger.appender.Appender;
|
||||
import de.oliver.fancyanalytics.logger.appender.ConsoleAppender;
|
||||
import de.oliver.fancyanalytics.logger.appender.JsonAppender;
|
||||
import de.oliver.fancyanalytics.logger.properties.ThrowableProperty;
|
||||
import de.oliver.fancyanalytics.sdk.events.Event;
|
||||
import de.oliver.fancylib.FancyLib;
|
||||
import de.oliver.fancylib.Metrics;
|
||||
@@ -323,12 +324,7 @@ public class FancyNpcs extends JavaPlugin implements FancyNpcsPlugin {
|
||||
npc.spawnForAll();
|
||||
}
|
||||
} catch (final Throwable thr) {
|
||||
fancyLogger.error(
|
||||
"An error occurred while updating '" + npc.getData().getName() + "' NPC."
|
||||
+ System.lineSeparator() + " (1) " + thr.getClass().getName() + ": " + thr.getMessage()
|
||||
+ (thr.getCause() != null ? System.lineSeparator() + " (2) " + thr.getCause().getClass().getName() + ": " + thr.getCause().getMessage() : "")
|
||||
);
|
||||
fancyLogger.error(thr);
|
||||
fancyLogger.error("An error occurred while updating '" + npc.getData().getName() + "' NPC.", ThrowableProperty.of(thr));
|
||||
}
|
||||
}
|
||||
}, 30, npcUpdateInterval, TimeUnit.SECONDS);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package de.oliver.fancynpcs;
|
||||
|
||||
import de.oliver.fancyanalytics.logger.ExtendedFancyLogger;
|
||||
import de.oliver.fancyanalytics.logger.properties.ThrowableProperty;
|
||||
import de.oliver.fancylib.serverSoftware.ServerSoftware;
|
||||
import de.oliver.fancynpcs.api.Npc;
|
||||
import de.oliver.fancynpcs.api.NpcAttribute;
|
||||
@@ -66,8 +67,7 @@ public class NpcManagerImpl implements NpcManager {
|
||||
try {
|
||||
npcConfig.save(npcConfigFile);
|
||||
} catch (IOException e) {
|
||||
logger.error("Could not save npc config file");
|
||||
logger.error(e);
|
||||
logger.error("Could not save npc config file", ThrowableProperty.of(e));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,8 +129,7 @@ public class NpcManagerImpl implements NpcManager {
|
||||
try {
|
||||
npcConfigFile.createNewFile();
|
||||
} catch (IOException e) {
|
||||
logger.error("Could not create npc config file");
|
||||
logger.error(e);
|
||||
logger.error("Could not create npc config file", ThrowableProperty.of(e));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -441,7 +440,7 @@ public class NpcManagerImpl implements NpcManager {
|
||||
this.setLoaded();
|
||||
}
|
||||
|
||||
private void setLoaded(){
|
||||
private void setLoaded() {
|
||||
isLoaded = true;
|
||||
new NpcsLoadedEvent().callEvent();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package de.oliver.fancynpcs.skins.cache;
|
||||
|
||||
import de.oliver.fancyanalytics.logger.properties.ThrowableProperty;
|
||||
import de.oliver.fancynpcs.FancyNpcs;
|
||||
import de.oliver.fancynpcs.api.skins.SkinData;
|
||||
import de.oliver.jdb.JDB;
|
||||
@@ -23,8 +24,7 @@ public class SkinCacheFile implements SkinCache {
|
||||
try {
|
||||
skinCacheData = this.storage.get("skins/" + b64ID, SkinCacheData.class);
|
||||
} catch (IOException e) {
|
||||
FancyNpcs.getInstance().getFancyLogger().error("Failed to load skin cache");
|
||||
FancyNpcs.getInstance().getFancyLogger().error(e);
|
||||
FancyNpcs.getInstance().getFancyLogger().error("Failed to load skin cache", ThrowableProperty.of(e));
|
||||
}
|
||||
|
||||
if (skinCacheData == null) {
|
||||
@@ -47,8 +47,7 @@ public class SkinCacheFile implements SkinCache {
|
||||
String b64ID = Base64.getEncoder().encodeToString(skin.getIdentifier().getBytes());
|
||||
this.storage.set("skins/" + b64ID, skinCacheData);
|
||||
} catch (IOException e) {
|
||||
FancyNpcs.getInstance().getFancyLogger().error("Failed to save skin cache");
|
||||
FancyNpcs.getInstance().getFancyLogger().error(e);
|
||||
FancyNpcs.getInstance().getFancyLogger().error("Failed to save skin cache", ThrowableProperty.of(e));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package de.oliver.fancynpcs.skins.mojang;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import de.oliver.fancyanalytics.logger.properties.ThrowableProperty;
|
||||
import de.oliver.fancynpcs.api.FancyNpcsPlugin;
|
||||
import de.oliver.fancynpcs.api.skins.SkinData;
|
||||
import de.oliver.fancynpcs.skins.mineskin.RatelimitException;
|
||||
@@ -51,8 +52,7 @@ public class MojangAPI {
|
||||
} catch (RatelimitException e) {
|
||||
throw e; // rethrow
|
||||
} catch (Exception e) {
|
||||
FancyNpcsPlugin.get().getFancyLogger().warn("Failed to fetch skin from Mojang API for " + uuid);
|
||||
FancyNpcsPlugin.get().getFancyLogger().warn(e);
|
||||
FancyNpcsPlugin.get().getFancyLogger().warn("Failed to fetch skin from Mojang API for " + uuid, ThrowableProperty.of(e));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package de.oliver.fancynpcs.skins.uuidcache;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import de.oliver.fancyanalytics.logger.properties.ThrowableProperty;
|
||||
import de.oliver.fancynpcs.FancyNpcs;
|
||||
import de.oliver.jdb.JDB;
|
||||
|
||||
@@ -34,8 +35,7 @@ public class UUIDFileCache implements UUIDCache {
|
||||
try {
|
||||
uuids = this.storage.get("uuids", UUIDCacheData[].class);
|
||||
} catch (IOException e) {
|
||||
FancyNpcs.getInstance().getFancyLogger().error("Failed to load UUID cache");
|
||||
FancyNpcs.getInstance().getFancyLogger().error(e);
|
||||
FancyNpcs.getInstance().getFancyLogger().error("Failed to load UUID cache", ThrowableProperty.of(e));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user