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

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

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

World.newExplosion介绍

暂无

代码示例

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

@Override
public void onUpdate() {
  super.onUpdate();
  liveTime++;
  int diffTime = Math.max(1, 30 - (int) (liveTime / 45f));
  if(burstsFired < TOTAL_BURSTS && liveTime % diffTime == 0) {
    if(!world.isRemote)
      spawnBurst();
    burstsFired++;
  }
  if(burstsFired >= TOTAL_BURSTS) {
    deathTime++;
    if(deathTime >= DEATH_TIME) {
      setDead();
      world.newExplosion(this, posX, posY, posZ, 8F, true, true);
    }
  }
}

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

protected void createExplosion(World world, @Nullable MissileBase missile, float x, float y, float z, float power) {
  boolean destroyBlocks = AWVehicleStatics.blockDestruction;
  boolean fires = AWVehicleStatics.blockFires;
  world.newExplosion(missile, x, y, z, power, fires, destroyBlocks);
}

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

@Override
public @Nonnull Explosion newExplosion(@Nullable Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking) {
 return wrapped.newExplosion(entityIn, x, y, z, strength, isFlaming, isSmoking);
}

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

@Override
public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking) {
  return getActualWorld().newExplosion(entityIn, x, y, z, strength, isFlaming, isSmoking);
}

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

@Override
 public void apply(@Nonnull EnumFacing side) {
  IBlockState neighbor = worldIn.getBlockState(pos.offset(side));
  if (neighbor.getBlock() instanceof BlockFire && neighbor.getBlock() != ModObject.blockColdFire.getBlock()) {
   if (worldIn.rand.nextFloat() < .5f) {
    List<BlockPos> explosions = new ArrayList<BlockPos>();
    explosions.add(pos);
    BlockPos up = pos.up();
    while (worldIn.getBlockState(up).getBlock() instanceof RocketFuel) {
     explosions.add(up);
     up = up.up();
    }
    if (isSourceBlock(worldIn, pos)) {
     worldIn.newExplosion(null, pos.getX() + .5f, pos.getY() + .5f, pos.getZ() + .5f, 2, true, true);
    }
    float strength = .5f;
    for (BlockPos explosion : explosions) {
     worldIn.newExplosion(null, explosion.getX() + .5f, explosion.getY() + .5f, explosion.getZ() + .5f, strength, true, true);
     strength = Math.min(strength * 1.05f, 7f);
    }
    return;
   }
  }
 }
});

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

private void spawnBurst(World world, float maxVelocity, IAmmo type, int count, float minPitch, Entity shooter, EnumFacing sideHit, float x, float y, float z) {
  world.newExplosion(null, x, y, z, 0.25f, false, true);
  createExplosion(world, null, x, y, z, 1.f);
  float randRange = 90 - minPitch;

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

/**
 * @see EntityFireball
 */
@Override
protected void onImpact(RayTraceResult movingObject) {
  if (!world.isRemote) {
    if (movingObject.entityHit != null) {
      movingObject.entityHit.attackEntityFrom(DamageSource.MAGIC, (EntityAttributes.ATTACK_DAMAGE_2 / 2));
      if (movingObject.entityHit instanceof EntityLivingBase) {
        int i = 0;
        if (world.getDifficulty() == EnumDifficulty.NORMAL) {
          i = 10;
        } else if (world.getDifficulty() == EnumDifficulty.HARD) {
          i = 20;
        }
        if (i > 0) {
          ((EntityLivingBase) movingObject.entityHit).addPotionEffect(new PotionEffect(MobEffects.MINING_FATIGUE, i * 20, 1));
        }
      }
    }
    this.world.newExplosion(this, this.posX, this.posY, this.posZ, 1.0F, false, false);
    this.setDead();
  }
}

代码示例来源:origin: Ellpeck/ActuallyAdditions

@Override
public boolean invoke(IBlockState state, BlockPos hitBlock, IAtomicReconstructor tile){
  if(hitBlock != null && !state.getBlock().isAir(state, tile.getWorldObject(), hitBlock)){
    if(tile.getEnergy() >= ENERGY_USE){
      tile.getWorldObject().newExplosion(null, hitBlock.getX()+0.5, hitBlock.getY()+0.5, hitBlock.getZ()+0.5, 10F, true, true);
      tile.extractEnergy(ENERGY_USE);
    }
    return true;
  }
  return false;
}

代码示例来源:origin: Alex-the-666/Ice_and_Fire

if (this.willExplode) {
  if (this.ticksTillExplosion == 0) {
    world.newExplosion(null, this.posX, this.posY, this.posZ, 2.5F * this.getScaleForAge(), false, net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.world, this));
  } else {
    this.ticksTillExplosion--;

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

public void generateMeteor(World world, BlockPos pos, IBlockState fillerBlock, double radiusModifier, double explosionModifier, double fillerChance) {
  world.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), (float) (explosionStrength * explosionModifier), true, true);
  int radius = (int) Math.ceil(getRadius() * radiusModifier);
  double floatingRadius = getRadius() * radiusModifier;
  for (int i = -radius; i <= radius; i++) {
    for (int j = -radius; j <= radius; j++) {
      for (int k = -radius; k <= radius; k++) {
        if (i * i + j * j + k * k > (floatingRadius + 0.5) * (floatingRadius + 0.5)) {
          continue;
        }
        BlockPos newPos = pos.add(i, j, k);
        IBlockState state = world.getBlockState(newPos);
        if (world.isAirBlock(newPos) || Utils.isBlockLiquid(state)) {
          IBlockState placedState = getRandomOreFromComponents(fillerBlock, fillerChance);
          if (placedState != null) {
            world.setBlockState(newPos, placedState);
          }
        }
      }
    }
  }
}

代码示例来源:origin: ForestryMC/ForestryMC

if (explosionSize > 1.0 && isNearFire(world, pos.getX(), pos.getY(), pos.getZ())) {
  world.setBlockState(pos, Blocks.FIRE.getDefaultState());
  world.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), explosionSize, true, true);

代码示例来源:origin: ForestryMC/Binnie

if (explosionSize > 1.0 && isNearFire(world, pos.getX(), pos.getY(), pos.getZ())) {
  world.setBlockState(pos, Blocks.FIRE.getDefaultState());
  world.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), explosionSize, true, true);

代码示例来源:origin: MrCrayfish/MrCrayfishFurnitureMod

worldIn.newExplosion(null, (double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, 5.0F, true, true);
return true;

相关文章

微信公众号

最新文章

更多

World类方法