fancynpcs: Only use minecraft usercache if fflag is enabled

This commit is contained in:
Oliver
2025-11-05 12:28:23 +01:00
parent 9774f57ea6
commit 7cd24f18f3
3 changed files with 6 additions and 1 deletions

View File

@@ -1 +1 @@
2.8.0.303
2.8.0.304

View File

@@ -81,6 +81,7 @@ public class FancyNpcs extends JavaPlugin implements FancyNpcsPlugin {
public static final FeatureFlag PLAYER_NPCS_FEATURE_FLAG = new FeatureFlag("player-npcs", "Every player can only manage the npcs they have created", false);
public static final FeatureFlag USE_NATIVE_THREADS_FEATURE_FLAG = new FeatureFlag("use-native-threads", "Use native threads instead of virtual threads.", false);
public static final FeatureFlag ENABLE_DEBUG_MODE_FEATURE_FLAG = new FeatureFlag("enable-debug-mode", "Enable debug mode", false);
public static final FeatureFlag USE_MINECRAFT_USERCACHE_FEATURE_FLAG = new FeatureFlag("use-minecraft-usercache", "Include the content of usercache.json to the username->uuid cache", false);
private static FancyNpcs instance;
private final ExtendedFancyLogger fancyLogger;

View File

@@ -55,6 +55,10 @@ public class UUIDFileCache implements UUIDCache {
}
private void loadMinecraftUsercache() {
if (!FancyNpcs.USE_MINECRAFT_USERCACHE_FEATURE_FLAG.isEnabled()) {
return;
}
if (!usercacheFile.exists()) {
FancyNpcs.getInstance().getFancyLogger().debug("Minecraft usercache file does not exist, skipping load.");
return;