mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-12-16 15:38:14 +01:00
Added setHideCape to PlayerWatcher
This commit is contained in:
parent
288882a427
commit
abc0be8bae
@ -35,6 +35,28 @@ public class PlayerWatcher extends LivingWatcher {
|
||||
return isInBed;
|
||||
}
|
||||
|
||||
public void setHideCape(boolean hideCape) {
|
||||
setValue16(1, hideCape);
|
||||
sendData(16);
|
||||
}
|
||||
|
||||
public boolean isHideCape() {
|
||||
return getValue16(1);
|
||||
}
|
||||
|
||||
private boolean getValue16(int i) {
|
||||
return ((Byte) getValue(16, (byte) 0) & 1 << i) != 0;
|
||||
}
|
||||
|
||||
private void setValue16(int i, boolean flag) {
|
||||
byte b0 = (Byte) getValue(16, (byte) 0);
|
||||
if (flag) {
|
||||
setValue(16, Byte.valueOf((byte) (b0 | 1 << i)));
|
||||
} else {
|
||||
setValue(16, Byte.valueOf((byte) (b0 & (1 << i ^ 0xFFFFFFFF))));
|
||||
}
|
||||
}
|
||||
|
||||
public void setArrowsSticking(int arrowsNo) {
|
||||
setValue(9, (byte) arrowsNo);
|
||||
sendData(9);
|
||||
|
Loading…
Reference in New Issue
Block a user