mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-09-11 01:38:07 +02:00
Fix insentient watcher not using proper values, and added 'setEnraged'. Not sure if its the proper name, seems to only affect zombie and vindicator from quick tests
This commit is contained in:
parent
65ee3ed186
commit
54ea63a6c2
@ -9,15 +9,15 @@ public class InsentientWatcher extends LivingWatcher {
|
||||
super(disguise);
|
||||
}
|
||||
|
||||
public MainHand getMainHand() {
|
||||
return getInsentientFlag(2) ? MainHand.RIGHT : MainHand.LEFT;
|
||||
}
|
||||
|
||||
public void setMainHand(MainHand mainHand) {
|
||||
setInsentientFlag(2, mainHand == MainHand.RIGHT);
|
||||
sendData(MetaIndex.INSENTIENT_META);
|
||||
}
|
||||
|
||||
public MainHand getMainHand() {
|
||||
return getInsentientFlag(2) ? MainHand.RIGHT : MainHand.LEFT;
|
||||
}
|
||||
|
||||
public boolean isAI() {
|
||||
return getInsentientFlag(1);
|
||||
}
|
||||
@ -31,13 +31,22 @@ public class InsentientWatcher extends LivingWatcher {
|
||||
byte b0 = getData(MetaIndex.INSENTIENT_META);
|
||||
|
||||
if (flag) {
|
||||
setData(MetaIndex.INSENTIENT_META, (byte) (b0 | 1 << i));
|
||||
setData(MetaIndex.INSENTIENT_META, (byte) (b0 | i));
|
||||
} else {
|
||||
setData(MetaIndex.INSENTIENT_META, (byte) (b0 & (~1 << i)));
|
||||
setData(MetaIndex.INSENTIENT_META, (byte) (b0 & i));
|
||||
}
|
||||
}
|
||||
|
||||
private boolean getInsentientFlag(int i) {
|
||||
return (getData(MetaIndex.INSENTIENT_META) & 1 << i) != 0;
|
||||
return (getData(MetaIndex.INSENTIENT_META) & i) != 0;
|
||||
}
|
||||
|
||||
public boolean isEnraged() {
|
||||
return getInsentientFlag(4);
|
||||
}
|
||||
|
||||
public void setEnraged(boolean enraged) {
|
||||
setInsentientFlag(4, enraged);
|
||||
sendData(MetaIndex.INSENTIENT_META);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user