mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
Added in option to remove effects on heal (#2754)
This commit is contained in:
parent
f20572b30c
commit
e3ec0f3b9b
4 changed files with 21 additions and 2 deletions
|
@ -338,5 +338,8 @@ public interface ISettings extends IConf {
|
||||||
|
|
||||||
double getMaxProjectileSpeed();
|
double getMaxProjectileSpeed();
|
||||||
|
|
||||||
|
boolean isRemovingEffectsOnHeal();
|
||||||
|
|
||||||
boolean isSpawnIfNoHome();
|
boolean isSpawnIfNoHome();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1625,6 +1625,17 @@ public class Settings implements net.ess3.api.ISettings {
|
||||||
return maxProjectileSpeed;
|
return maxProjectileSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean removeEffectsOnHeal;
|
||||||
|
|
||||||
|
private boolean _isRemovingEffectsOnHeal() {
|
||||||
|
return config.getBoolean("remove-effects-on-heal", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRemovingEffectsOnHeal() {
|
||||||
|
return removeEffectsOnHeal;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSpawnIfNoHome() {
|
public boolean isSpawnIfNoHome() {
|
||||||
return config.getBoolean("spawn-if-no-home", true);
|
return config.getBoolean("spawn-if-no-home", true);
|
||||||
|
|
|
@ -75,10 +75,12 @@ public class Commandheal extends EssentialsLoopCommand {
|
||||||
player.setFoodLevel(20);
|
player.setFoodLevel(20);
|
||||||
player.setFireTicks(0);
|
player.setFireTicks(0);
|
||||||
user.sendMessage(tl("heal"));
|
user.sendMessage(tl("heal"));
|
||||||
|
if (ess.getSettings().isRemovingEffectsOnHeal()) {
|
||||||
for (PotionEffect effect : player.getActivePotionEffects()) {
|
for (PotionEffect effect : player.getActivePotionEffects()) {
|
||||||
player.removePotionEffect(effect.getType());
|
player.removePotionEffect(effect.getType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<String> getTabCompleteOptions(Server server, User user, String commandLabel, String[] args) {
|
protected List<String> getTabCompleteOptions(Server server, User user, String commandLabel, String[] args) {
|
||||||
|
|
|
@ -94,6 +94,9 @@ teleport-to-center: true
|
||||||
# The delay, in seconds, required between /heal or /feed attempts.
|
# The delay, in seconds, required between /heal or /feed attempts.
|
||||||
heal-cooldown: 60
|
heal-cooldown: 60
|
||||||
|
|
||||||
|
# Do you want to remove potion effects when healing a player?
|
||||||
|
remove-effects-on-heal: true
|
||||||
|
|
||||||
# Near Radius
|
# Near Radius
|
||||||
# The default radius with /near
|
# The default radius with /near
|
||||||
# Used to use chat radius but we are going to make it separate.
|
# Used to use chat radius but we are going to make it separate.
|
||||||
|
|
Loading…
Reference in a new issue