Added in option to remove effects on heal (#2754)

This commit is contained in:
Glare 2020-03-13 03:24:29 -06:00 committed by GitHub
parent f20572b30c
commit e3ec0f3b9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 2 deletions

View File

@ -338,5 +338,8 @@ public interface ISettings extends IConf {
double getMaxProjectileSpeed();
boolean isRemovingEffectsOnHeal();
boolean isSpawnIfNoHome();
}

View File

@ -1625,6 +1625,17 @@ public class Settings implements net.ess3.api.ISettings {
return maxProjectileSpeed;
}
private boolean removeEffectsOnHeal;
private boolean _isRemovingEffectsOnHeal() {
return config.getBoolean("remove-effects-on-heal", true);
}
@Override
public boolean isRemovingEffectsOnHeal() {
return removeEffectsOnHeal;
}
@Override
public boolean isSpawnIfNoHome() {
return config.getBoolean("spawn-if-no-home", true);

View File

@ -75,8 +75,10 @@ public class Commandheal extends EssentialsLoopCommand {
player.setFoodLevel(20);
player.setFireTicks(0);
user.sendMessage(tl("heal"));
for (PotionEffect effect : player.getActivePotionEffects()) {
player.removePotionEffect(effect.getType());
if (ess.getSettings().isRemovingEffectsOnHeal()) {
for (PotionEffect effect : player.getActivePotionEffects()) {
player.removePotionEffect(effect.getType());
}
}
}

View File

@ -94,6 +94,9 @@ teleport-to-center: true
# The delay, in seconds, required between /heal or /feed attempts.
heal-cooldown: 60
# Do you want to remove potion effects when healing a player?
remove-effects-on-heal: true
# Near Radius
# The default radius with /near
# Used to use chat radius but we are going to make it separate.