Exemple #1
0
  /** Enable or disable a entity flag, see getEntityFlag to read the know flags. */
  protected void setFlag(int par1, boolean par2) {
    byte byte0 = dataWatcher.getWatchableObjectByte(0);

    if (par2) {
      dataWatcher.updateObject(0, Byte.valueOf((byte) (byte0 | 1 << par1)));
    } else {
      dataWatcher.updateObject(0, Byte.valueOf((byte) (byte0 & ~(1 << par1))));
    }
  }
Exemple #2
0
 /**
  * Return true if the flag is active for the entity. Know flags: 0) is burning; 1) is sneaking; 2)
  * is riding something
  */
 protected boolean getFlag(int par1) {
   return (dataWatcher.getWatchableObjectByte(0) & 1 << par1) != 0;
 }