mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
fancynpcs: Only use minecraft usercache if fflag is enabled
This commit is contained in:
@@ -1 +1 @@
|
|||||||
2.8.0.303
|
2.8.0.304
|
||||||
@@ -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 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 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 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 static FancyNpcs instance;
|
||||||
private final ExtendedFancyLogger fancyLogger;
|
private final ExtendedFancyLogger fancyLogger;
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ public class UUIDFileCache implements UUIDCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadMinecraftUsercache() {
|
private void loadMinecraftUsercache() {
|
||||||
|
if (!FancyNpcs.USE_MINECRAFT_USERCACHE_FEATURE_FLAG.isEnabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!usercacheFile.exists()) {
|
if (!usercacheFile.exists()) {
|
||||||
FancyNpcs.getInstance().getFancyLogger().debug("Minecraft usercache file does not exist, skipping load.");
|
FancyNpcs.getInstance().getFancyLogger().debug("Minecraft usercache file does not exist, skipping load.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user