Add option to remove vanishing items from keepinv users (#3328)

This commit is contained in:
Josh Roy 2020-06-15 19:22:00 -04:00 committed by GitHub
parent 846043e9a0
commit 2ab4dcbc11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 109 additions and 0 deletions

View file

@ -571,6 +571,8 @@ public class Settings implements net.ess3.api.ISettings {
nickBlacklist = _getNickBlacklist();
maxProjectileSpeed = _getMaxProjectileSpeed();
removeEffectsOnHeal = _isRemovingEffectsOnHeal();
vanishingItemPolicy = _getVanishingItemsPolicy();
bindingItemPolicy = _getBindingItemsPolicy();
}
void _lateLoadItemSpawnBlacklist() {
@ -977,6 +979,38 @@ public class Settings implements net.ess3.api.ISettings {
return config.getBoolean("death-messages", true);
}
private KeepInvPolicy vanishingItemPolicy;
public KeepInvPolicy _getVanishingItemsPolicy() {
String value = config.getString("vanishing-items-policy", "keep").toLowerCase(Locale.ENGLISH);
try {
return KeepInvPolicy.valueOf(value.toUpperCase(Locale.ENGLISH));
} catch (IllegalArgumentException e) {
return KeepInvPolicy.KEEP;
}
}
@Override
public KeepInvPolicy getVanishingItemsPolicy() {
return vanishingItemPolicy;
}
private KeepInvPolicy bindingItemPolicy;
public KeepInvPolicy _getBindingItemsPolicy() {
String value = config.getString("binding-items-policy", "keep").toLowerCase(Locale.ENGLISH);
try {
return KeepInvPolicy.valueOf(value.toUpperCase(Locale.ENGLISH));
} catch (IllegalArgumentException e) {
return KeepInvPolicy.KEEP;
}
}
@Override
public KeepInvPolicy getBindingItemsPolicy() {
return bindingItemPolicy;
}
private Set<String> noGodWorlds = new HashSet<>();
@Override