net.minecraft.entity.Entity.onEntityUpdate()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(242)

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

Entity.onEntityUpdate介绍

暂无

代码示例

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

@Override
public void onEntityUpdate() {
  super.onEntityUpdate();

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

@Override
public void onEntityUpdate() {
  super.onEntityUpdate();
  if(ticksExisted++ >= 100)
    setDead();
  if(!isDead) {
    if(ticksExisted % 10 == 0)
      playSound(SoundEvents.ENTITY_CREEPER_PRIMED, 1F, 1F);
    int color = getColor();
    if(color < 16 && color >= 0) {
      int hex = EnumDyeColor.byMetadata(color).colorValue;
      int r = (hex & 0xFF0000) >> 16;
      int g = (hex & 0xFF00) >> 8;
      int b = hex & 0xFF;
      Botania.proxy.setWispFXDistanceLimit(false);
      for(int i = 0; i < 3; i++)
        Botania.proxy.wispFX(posX, posY, posZ + 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random() * 5 + 1F, (float) (Math.random() - 0.5F), 10F * (float) Math.sqrt(256F / (256F - (float) posY)), (float) (Math.random() - 0.5F));
      for(int i = 0; i < 4; i++)
        Botania.proxy.wispFX(posX + 0.5, Math.min(256, getFiredAt() + Botania.proxy.getClientRenderDistance() * 16), posZ + 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random() * 15 + 8F, (float) (Math.random() - 0.5F) * 8F, 0F, (float) (Math.random() - 0.5F) * 8F);
      Botania.proxy.setWispFXDistanceLimit(true);
    }
  }
}

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

@Override
public void onEntityUpdate() {
  super.onEntityUpdate();
  if(isDead)
    return;
  
  if(TotemOfHolding.darkSoulsMode) {
    EntityPlayer owner = getOwnerEntity();
    if(owner != null && !world.isRemote) {
      String ownerTotem = TotemOfHolding.getTotemUUID(owner);
      if(!getUniqueID().toString().equals(ownerTotem))
        dropEverythingAndDie();
    }
  }
  
  if(storedItems.isEmpty() && !world.isRemote)
    dataManager.set(DYING, true);
  
  if(isDying()) {
    if(deathTicks > DEATH_TIME)
      setDead();
    else deathTicks++;
  }
  
  else if(world.isRemote)
    world.spawnParticle(EnumParticleTypes.PORTAL, posX, posY + (Math.random() - 0.5) * 0.2, posZ, Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);
}

代码示例来源:origin: MightyPirates/TIS-3D

@Override
public void onEntityUpdate() {
  // Enforce lifetime, fail-safe, should be tracked in updateLifetime().
  if (lifetime < 1) {
    setDead();
    return;
  }
  // Do general update logic.
  super.onEntityUpdate();
  // Check for collisions and handle them.
  final RayTraceResult hit = checkCollisions();
  // Emit some particles.
  emitParticles(hit);
  // Update position.
  posX += motionX;
  posY += motionY;
  posZ += motionZ;
  // Update bounding box.
  setPosition(posX, posY, posZ);
}

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

super.onEntityUpdate();
  return;
super.onEntityUpdate();

相关文章

Entity类方法