mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2024-11-11 01:17:16 +00:00
Messy fix for setEnraged, fixes #506
This commit is contained in:
parent
6505d7530f
commit
687f47e22e
1 changed files with 10 additions and 0 deletions
|
@ -2,6 +2,7 @@ package me.libraryaddict.disguise.disguisetypes.watchers;
|
||||||
|
|
||||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
||||||
import me.libraryaddict.disguise.disguisetypes.MetaIndex;
|
import me.libraryaddict.disguise.disguisetypes.MetaIndex;
|
||||||
|
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
||||||
import me.libraryaddict.disguise.utilities.reflection.NmsAddedIn;
|
import me.libraryaddict.disguise.utilities.reflection.NmsAddedIn;
|
||||||
import me.libraryaddict.disguise.utilities.reflection.NmsVersion;
|
import me.libraryaddict.disguise.utilities.reflection.NmsVersion;
|
||||||
import org.bukkit.inventory.MainHand;
|
import org.bukkit.inventory.MainHand;
|
||||||
|
@ -50,6 +51,15 @@ public class InsentientWatcher extends LivingWatcher {
|
||||||
|
|
||||||
@NmsAddedIn(NmsVersion.v1_14)
|
@NmsAddedIn(NmsVersion.v1_14)
|
||||||
public void setEnraged(boolean enraged) {
|
public void setEnraged(boolean enraged) {
|
||||||
|
if (hasValue(MetaIndex.INSENTIENT_META) && getInsentientFlag(4) == enraged) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setInsentientFlag(4, enraged);
|
setInsentientFlag(4, enraged);
|
||||||
|
|
||||||
|
// TODO Check if a less hacky fix is possible
|
||||||
|
if (!enraged) {
|
||||||
|
DisguiseUtilities.refreshTrackers(getDisguise());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue