mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 18:24:43 +02:00
new config persistentdata.yml
This commit is contained in:
@ -0,0 +1,37 @@
|
||||
package com.gmail.nossr50.config;
|
||||
|
||||
import com.gmail.nossr50.util.compat.layers.persistentdata.MobMetaFlagType;
|
||||
|
||||
public class PersistentDataConfig extends AutoUpdateConfigLoader {
|
||||
private static PersistentDataConfig instance;
|
||||
|
||||
private PersistentDataConfig() {
|
||||
super("persistentdata.yml");
|
||||
validate();
|
||||
}
|
||||
|
||||
public static PersistentDataConfig getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new PersistentDataConfig();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadKeys() {
|
||||
//Sigh this old config system...
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean validateKeys() {
|
||||
return true;
|
||||
}
|
||||
|
||||
//Persistent Data Toggles
|
||||
|
||||
public boolean isMobPersistent(MobMetaFlagType mobMetaFlagType) {
|
||||
String key = "Persistent_Data.Mobs.Flags." + mobMetaFlagType.toString() + ".Saved_To_Disk";
|
||||
return config.getBoolean(key, false);
|
||||
}
|
||||
}
|
@ -21,10 +21,12 @@ import java.util.UUID;
|
||||
public class SpigotPersistentDataLayer_1_14 extends AbstractPersistentDataLayer {
|
||||
|
||||
private final @NotNull EnumMap<MobMetaFlagType, NamespacedKey> mobFlagKeyMap;
|
||||
private final @NotNull SpigotPersistentDataLayer_1_13 transientLayer;
|
||||
|
||||
public SpigotPersistentDataLayer_1_14() {
|
||||
mobFlagKeyMap = new EnumMap<>(MobMetaFlagType.class);
|
||||
initMobFlagKeyMap();
|
||||
transientLayer = new SpigotPersistentDataLayer_1_13(); //For disabled persistent types
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user