コード例 #1
0
  public void setState(BossState state) {
    dataWatcher.updateObject(STATE, state.ordinal());

    if (state == BossState.CHARGING) {
      getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.00001);
    } else {
      if (getState() == BossState.ATTACKING) {
        setCharge(0);
        setCurrentAttack(BossAttack.getRandom(this, rand));
      }
      getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.075);
    }
  }
コード例 #2
0
  @Override
  public void readEntityFromNBT(NBTTagCompound data) {
    super.readEntityFromNBT(data);

    setState(BossState.values()[data.getInteger("state")]);

    setCharge(data.getInteger("charge"));

    setCurrentAttack(
        data.getInteger("curattack") == -1
            ? null
            : BossAttack.values()[data.getInteger("curattack")]);
  }
コード例 #3
0
 public BossState getState() {
   return BossState.values()[dataWatcher.getWatchableObjectInt(STATE)];
 }