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

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

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

World.newExplosion介绍

暂无

代码示例

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

  1. @Override
  2. public void onUpdate() {
  3. super.onUpdate();
  4. liveTime++;
  5. int diffTime = Math.max(1, 30 - (int) (liveTime / 45f));
  6. if(burstsFired < TOTAL_BURSTS && liveTime % diffTime == 0) {
  7. if(!world.isRemote)
  8. spawnBurst();
  9. burstsFired++;
  10. }
  11. if(burstsFired >= TOTAL_BURSTS) {
  12. deathTime++;
  13. if(deathTime >= DEATH_TIME) {
  14. setDead();
  15. world.newExplosion(this, posX, posY, posZ, 8F, true, true);
  16. }
  17. }
  18. }

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

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

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

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

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

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

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

  1. @Override
  2. public void apply(@Nonnull EnumFacing side) {
  3. IBlockState neighbor = worldIn.getBlockState(pos.offset(side));
  4. if (neighbor.getBlock() instanceof BlockFire && neighbor.getBlock() != ModObject.blockColdFire.getBlock()) {
  5. if (worldIn.rand.nextFloat() < .5f) {
  6. List<BlockPos> explosions = new ArrayList<BlockPos>();
  7. explosions.add(pos);
  8. BlockPos up = pos.up();
  9. while (worldIn.getBlockState(up).getBlock() instanceof RocketFuel) {
  10. explosions.add(up);
  11. up = up.up();
  12. }
  13. if (isSourceBlock(worldIn, pos)) {
  14. worldIn.newExplosion(null, pos.getX() + .5f, pos.getY() + .5f, pos.getZ() + .5f, 2, true, true);
  15. }
  16. float strength = .5f;
  17. for (BlockPos explosion : explosions) {
  18. worldIn.newExplosion(null, explosion.getX() + .5f, explosion.getY() + .5f, explosion.getZ() + .5f, strength, true, true);
  19. strength = Math.min(strength * 1.05f, 7f);
  20. }
  21. return;
  22. }
  23. }
  24. }
  25. });

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

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

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

  1. /**
  2. * @see EntityFireball
  3. */
  4. @Override
  5. protected void onImpact(RayTraceResult movingObject) {
  6. if (!world.isRemote) {
  7. if (movingObject.entityHit != null) {
  8. movingObject.entityHit.attackEntityFrom(DamageSource.MAGIC, (EntityAttributes.ATTACK_DAMAGE_2 / 2));
  9. if (movingObject.entityHit instanceof EntityLivingBase) {
  10. int i = 0;
  11. if (world.getDifficulty() == EnumDifficulty.NORMAL) {
  12. i = 10;
  13. } else if (world.getDifficulty() == EnumDifficulty.HARD) {
  14. i = 20;
  15. }
  16. if (i > 0) {
  17. ((EntityLivingBase) movingObject.entityHit).addPotionEffect(new PotionEffect(MobEffects.MINING_FATIGUE, i * 20, 1));
  18. }
  19. }
  20. }
  21. this.world.newExplosion(this, this.posX, this.posY, this.posZ, 1.0F, false, false);
  22. this.setDead();
  23. }
  24. }

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

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

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

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

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

  1. public void generateMeteor(World world, BlockPos pos, IBlockState fillerBlock, double radiusModifier, double explosionModifier, double fillerChance) {
  2. world.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), (float) (explosionStrength * explosionModifier), true, true);
  3. int radius = (int) Math.ceil(getRadius() * radiusModifier);
  4. double floatingRadius = getRadius() * radiusModifier;
  5. for (int i = -radius; i <= radius; i++) {
  6. for (int j = -radius; j <= radius; j++) {
  7. for (int k = -radius; k <= radius; k++) {
  8. if (i * i + j * j + k * k > (floatingRadius + 0.5) * (floatingRadius + 0.5)) {
  9. continue;
  10. }
  11. BlockPos newPos = pos.add(i, j, k);
  12. IBlockState state = world.getBlockState(newPos);
  13. if (world.isAirBlock(newPos) || Utils.isBlockLiquid(state)) {
  14. IBlockState placedState = getRandomOreFromComponents(fillerBlock, fillerChance);
  15. if (placedState != null) {
  16. world.setBlockState(newPos, placedState);
  17. }
  18. }
  19. }
  20. }
  21. }
  22. }

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

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

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

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

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

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

相关文章

World类方法