mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-30 12:00:34 +08:00
Added in option to remove effects on heal (#2754)
This commit is contained in:
parent
f20572b30c
commit
e3ec0f3b9b
@ -338,5 +338,8 @@ public interface ISettings extends IConf {
|
||||
|
||||
double getMaxProjectileSpeed();
|
||||
|
||||
boolean isRemovingEffectsOnHeal();
|
||||
|
||||
boolean isSpawnIfNoHome();
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user