net.minecraft.world.World.setEntityState()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中net.minecraft.world.World.setEntityState()方法的一些代码示例,展示了World.setEntityState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.setEntityState()方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:setEntityState

World.setEntityState介绍

暂无

代码示例

代码示例来源:origin: Vazkii/Botania

@Override
protected void onImpact(@Nonnull RayTraceResult var1) {
  if(!world.isRemote) {
    if(var1 != null) {
      EnumFacing dir = var1.sideHit;
      if(dir != null && dir.getAxis() != EnumFacing.Axis.Y) {
        BlockPos pos = var1.getBlockPos().offset(dir);
        while(pos.getY() > 0) {
          IBlockState state = world.getBlockState(pos);
          Block block = state.getBlock();
          if(block.isAir(state, world, pos)) {
            IBlockState stateSet = ModBlocks.solidVines.getDefaultState().withProperty(propMap.get(dir.getOpposite()), true);
            world.setBlockState(pos, stateSet, 1 | 2);
            world.playEvent(2001, pos, Block.getStateId(stateSet));
            pos = pos.down();
          } else break;
        }
      }
    }
    this.world.setEntityState(this, (byte)3);
    setDead();
  }
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public void setEntityState(@Nonnull Entity entityIn, byte state) {
 wrapped.setEntityState(entityIn, state);
}

代码示例来源:origin: amadornes/MCMultiPart

@Override
public void setEntityState(Entity entityIn, byte state) {
  getActualWorld().setEntityState(entityIn, state);
}

代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition

@Override
public boolean processInteract(EntityPlayer player, EnumHand hand) {
  if (getOwnerId() != null) {
    if (!world.isRemote) {
      setOwnerId(player.getUniqueID());
      this.world.setEntityState(this, (byte) 7);
    } else {
      this.world.setEntityState(this, (byte) 6);
    }
    return true;
  }
  return false;
}

代码示例来源:origin: WayofTime/BloodMagic

/**
 * Execute a one shot task or start executing a continuous task
 */
@Override
public void startExecuting() {
  this.castTimer = 100;
  this.world.setEntityState(this.entity, (byte) 53);
  this.entity.getNavigator().clearPath();
}

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

private void setOpeningStatus(byte op) {
  this.gateStatus = op;
  if (!this.world.isRemote) {
    this.world.setEntityState(this, op);
  }
  if (op == -1) {
    this.gateType.onGateStartClose(this);
  } else if (op == 1) {
    this.gateType.onGateStartOpen(this);
  }
}

代码示例来源:origin: WayofTime/BloodMagic

/**
 * Execute a one shot task or start executing a continuous task
 */
public void startExecuting() {
  this.eatingGrassTimer = 40;
  this.world.setEntityState(this.grassEaterEntity, (byte) 10);
  this.grassEaterEntity.getNavigator().clearPath();
}

代码示例来源:origin: Silentine/GrimoireOfGaia

private void setBuff() {
  world.setEntityState(this, (byte) 7);
  addPotionEffect(new PotionEffect(MobEffects.SPEED, 20 * 60, 0));
}

代码示例来源:origin: Silentine/GrimoireOfGaia

private void setBuff() {
  world.setEntityState(this, (byte) 7);
  addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 20 * 60, 0));
}

代码示例来源:origin: Vazkii/Botania

@Override
public void onUpdate() {
  super.onUpdate();
  if(!supertile.getWorld().isRemote) {
    int manaCost = 12;
    List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
    List<EntityAnimal> animals = supertile.getWorld().getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
    int slowdown = getSlowdownFactor();
    for(EntityAnimal animal : animals) {
      if(mana < manaCost)
        break;
      if(animal.getGrowingAge() == 0 && !animal.isInLove()) {
        for(EntityItem item : items) {
          if(item.age < 60 + slowdown || item.isDead)
            continue;
          ItemStack stack = item.getItem();
          if(!stack.isEmpty() && animal.isBreedingItem(stack)) {
            stack.shrink(1);
            mana -= manaCost;
            animal.inLove = 1200;
            supertile.getWorld().setEntityState(animal, (byte)18);
          }
        }
      }
    }
  }
}

代码示例来源:origin: Silentine/GrimoireOfGaia

@Override
public boolean attackEntityAsMob(Entity entityIn) {
  attackTimer = 10;
  world.setEntityState(this, (byte) 4);
  boolean var2 = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), (float) 7 + rand.nextInt(15));
  if (var2) {
    entityIn.motionY += 0.2D;
  }
  playSound(SoundEvents.ENTITY_IRONGOLEM_ATTACK, 1.0F, 1.0F);
  return var2;
}

代码示例来源:origin: Silentine/GrimoireOfGaia

@Override
public boolean attackEntityAsMob(Entity entityIn) {
  attackTimer = 10;
  world.setEntityState(this, (byte) 4);
  boolean var2 = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), 7F + rand.nextInt(15));
  if (var2) {
    entityIn.motionY += 0.6000000059604645D;
  }
  playSound(SoundEvents.ENTITY_IRONGOLEM_ATTACK, 1.0F, 1.0F);
  return var2;
}

代码示例来源:origin: Silentine/GrimoireOfGaia

@Override
public boolean attackEntityFrom(DamageSource source, float damage) {
  Entity entity = source.getImmediateSource();
  if (entity instanceof EntityArrow) {
    world.setEntityState(this, (byte) 8);
    heal(EntityAttributes.MAX_HEALTH_2 * 0.10F);
  }
  return super.attackEntityFrom(source, Math.min(damage, EntityAttributes.BASE_DEFENSE_2));
}

代码示例来源:origin: vadis365/TheErebus

public void setIsBoss(byte boss) {
  dataManager.set(IS_BOSS, Byte.valueOf(boss));
  getEntityWorld().setEntityState(this, (byte) 25);
  if (areAttributesSetup)
    updateBossAttributes();
}

代码示例来源:origin: vadis365/TheErebus

@Override
protected void jump() {
  super.jump();
  double moveSpeed = moveHelper.getSpeed();
  if (moveSpeed > 0.0D) {
    double moveSpeedSq = motionX * motionX + motionZ * motionZ;
    if (moveSpeedSq < 0.010000000000000002D)
      moveRelative(0.0F, 0.0F, 1.0F, 0.1F);
  }
  if (!world.isRemote)
    world.setEntityState(this, (byte) 1);
}

代码示例来源:origin: ata4/dragon-mounts

public void tamedFor(EntityPlayer player, boolean successful) {       
  if (successful) {
    setTamed(true);
    navigator.clearPathEntity();  // replacement for setPathToEntity(null);
    setAttackTarget(null);
    setOwnerId(player.getUniqueID());
    playTameEffect(true);
    worldObj.setEntityState(this, (byte) 7);
  } else {
    playTameEffect(false);
    worldObj.setEntityState(this, (byte) 6);
  }
}

代码示例来源:origin: Silentine/GrimoireOfGaia

private void setBuff() {
  world.setEntityState(this, (byte) 7);
  addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 20 * 60, 0));
  addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 20 * 60, 0));
}

代码示例来源:origin: Silentine/GrimoireOfGaia

private void setBuff() {
  world.setEntityState(this, (byte) 7);
  addPotionEffect(new PotionEffect(MobEffects.SPEED, 20 * 60, 0));
  addPotionEffect(new PotionEffect(MobEffects.HASTE, 20 * 60, 0));
}

代码示例来源:origin: Silentine/GrimoireOfGaia

private void setBuff() {
  world.setEntityState(this, (byte) 7);
  addPotionEffect(new PotionEffect(MobEffects.SPEED, 20 * 60, 0));
  addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 20 * 60, 0));
}

代码示例来源:origin: Silentine/GrimoireOfGaia

@Override
public void onLivingUpdate() {
  beaconDebuff(4, MobEffects.SLOWNESS, 100, 1);
  if (getHealth() < EntityAttributes.MAX_HEALTH_2) {
    if (hasItem()) {
      setItemStackToSlot(EntityEquipmentSlot.MAINHAND, ItemStack.EMPTY);
      world.setEntityState(this, (byte) 8);
      heal(EntityAttributes.MAX_HEALTH_2 * 0.20F);
    }
  }
  super.onLivingUpdate();
}

相关文章

微信公众号

最新文章

更多

World类方法