コード例 #1
0
  @Override
  public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int p_149664_5_) {
    super.onBlockDestroyedByPlayer(world, x, y, z, p_149664_5_);

    if (world.isRemote) {
      FxSystemElectricArc.spawnArc(world, x + 0.5f, y + 0.5f, z + 0.5f, .3, 7);
      world.playSound(
          x,
          y,
          z,
          "advancedrocketry:ElectricShockSmall",
          .7f,
          0.975f + world.rand.nextFloat() * 0.05f,
          false);
    }
  }
コード例 #2
0
  @Override
  public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
    super.randomDisplayTick(world, x, y, z, rand);

    if (world.getTotalWorldTime() % 100 == 0
        && world.getBiomeGenForCoords(x, z) == AdvancedRocketryBiomes.stormLandsBiome) {
      FxSystemElectricArc.spawnArc(world, x + 0.5f, y + 0.5f, z + 0.5f, .3, 7);
      world.playSound(
          x,
          y,
          z,
          "advancedrocketry:ElectricShockSmall",
          .7f,
          0.975f + world.rand.nextFloat() * 0.05f,
          false);
    }
  }