Examples of ChunkPosition


Examples of com.comphenix.protocol.wrappers.ChunkPosition

    StructureModifier<List<ChunkPosition>> positionAccessor = explosionPacket.getPositionCollectionModifier();
   
    assertNull(positionAccessor.read(0));
   
    List<ChunkPosition> positions = Lists.newArrayList();
    positions.add(new ChunkPosition(1, 2, 3));
    positions.add(new ChunkPosition(3, 4, 5));
 
    // Insert and read back
    positionAccessor.write(0, positions);
    List<ChunkPosition> cloned = positionAccessor.read(0);
   
View Full Code Here

Examples of net.minecraft.server.ChunkPosition

  public static boolean isCoord(Object chunkCoordinates) {
    return chunkCoordinates instanceof ChunkCoordinates;
  }

  public static Object newPosition(int x, int y, int z) {
    return new ChunkPosition(x, y, z);
  }
View Full Code Here

Examples of net.minecraft.server.ChunkPosition

  public static Object newPosition(int x, int y, int z) {
    return new ChunkPosition(x, y, z);
  }

  public static IntVector3 getPosition(Object chunkPosition) {
    ChunkPosition position = (ChunkPosition) chunkPosition;
    return new IntVector3(position.x, position.y, position.z);
  }
View Full Code Here

Examples of net.minecraft.server.v1_7_R4.ChunkPosition

        int m = paramInt2 + paramInt3 >> 2;

        int n = k - i + 1;
        int i1 = m - j + 1;
        int[] arrayOfInt = this.biomeGenerator.getBiomesUnZoomed(null, i, j, n, i1, OutputType.DEFAULT_FOR_WORLD);
        ChunkPosition localChunkPosition = null;
        int i2 = 0;
        for (int i3 = 0; i3 < arrayOfInt.length; i3++)
        {
            if (arrayOfInt[i3] >= DefaultBiome.values().length)
                continue;
            int i4 = i + i3 % n << 2;
            int i5 = j + i3 / n << 2;
            BiomeBase localBiomeBase = BiomeBase.getBiome(arrayOfInt[i3]);
            if ((!paramList.contains(localBiomeBase)) || ((localChunkPosition != null) && (paramRandom.nextInt(i2 + 1) != 0)))
                continue;
            localChunkPosition = new ChunkPosition(i4, 0, i5);
            i2++;
        }

        return localChunkPosition;
    }
View Full Code Here

Examples of net.minecraft.src.ChunkPosition

              f1 -= (Block.blocksList[k3].getExplosionResistance(exploder) + 0.3F)
                  * f2;
            }

            if (f1 > 0.0F) {
               destroyedBlockPositions.add(new ChunkPosition(l2,
               i3, j3));
            }

            d5 += d * (double) f2;
            d7 += d1 * (double) f2;
View Full Code Here

Examples of net.minecraft.src.ChunkPosition

        0.0D);
    ArrayList arraylist = new ArrayList();
    arraylist.addAll(destroyedBlockPositions);

    for (int i = arraylist.size() - 1; i >= 0; i--) {
      ChunkPosition chunkposition = (ChunkPosition) arraylist.get(i);
      int k = chunkposition.x;
      int i1 = chunkposition.y;
      int k1 = chunkposition.z;
      int i2 = worldObj.getBlockId(k, i1, k1);

      if (par1) {
        double d = (float) k + worldObj.rand.nextFloat();
        double d1 = (float) i1 + worldObj.rand.nextFloat();
        double d2 = (float) k1 + worldObj.rand.nextFloat();
        double d3 = d - explosionX;
        double d4 = d1 - explosionY;
        double d5 = d2 - explosionZ;
        double d6 = MathHelper.sqrt_double(d3 * d3 + d4 * d4 + d5 * d5);
        d3 /= d6;
        d4 /= d6;
        d5 /= d6;
        double d7 = 0.5D / (d6 / (double) explosionSize + 0.1D);
        d7 *= worldObj.rand.nextFloat() * worldObj.rand.nextFloat() + 0.3F;
        d3 *= d7;
        d4 *= d7;
        d5 *= d7;
        worldObj.spawnParticle("explode", (d + explosionX * 1.0D) / 2D,
            (d1 + explosionY * 1.0D) / 2D, (d2 + explosionZ * 1.0D) / 2D, d3, d4, d5);
        worldObj.spawnParticle("smoke", d, d1, d2, d3, d4, d5);
      }

      if (i2 > 0) {
//        Block.blocksList[i2].dropBlockAsItemWithChance(worldObj, k, i1, k1,
//            worldObj.getBlockMetadata(k, i1, k1), 0.3F, 0);
//        worldObj.setBlockWithNotify(k, i1, k1, 0);
//        Block.blocksList[i2].onBlockDestroyedByExplosion(worldObj, k, i1, k1);
      }
    }
    for (int j = arraylist.size() - 1; j >= 0; j--) {
      ChunkPosition chunkposition1 = (ChunkPosition) arraylist.get(j);
      int l = chunkposition1.x;
      int j1 = chunkposition1.y;
      int l1 = chunkposition1.z;
      int j2 = worldObj.getBlockId(l, j1, l1);
      int k2 = worldObj.getBlockId(l, j1 - 1, l1);
View Full Code Here

Examples of net.minecraft.src.ChunkPosition

            }

            if (f1 > 0.0F
                || (Block.blocksList[k3] == Block.waterMoving ||
                Block.blocksList[k3] == Block.waterStill)) {
              destroyedBlockPositions.add(new ChunkPosition(l2, i3, j3));
            }

            d5 += d * (double) f2;
            d7 += d1 * (double) f2;
            d9 += d2 * (double) f2;
View Full Code Here

Examples of net.minecraft.src.ChunkPosition

        0.0D);
    ArrayList arraylist = new ArrayList();
    arraylist.addAll(destroyedBlockPositions);

    for (int i = arraylist.size() - 1; i >= 0; i--) {
      ChunkPosition chunkposition = (ChunkPosition) arraylist.get(i);
      int k = chunkposition.x;
      int i1 = chunkposition.y;
      int k1 = chunkposition.z;
      int i2 = worldObj.getBlockId(k, i1, k1);

      if (par1) {
        double d = (float) k + worldObj.rand.nextFloat();
        double d1 = (float) i1 + worldObj.rand.nextFloat();
        double d2 = (float) k1 + worldObj.rand.nextFloat();
        double d3 = d - explosionX;
        double d4 = d1 - explosionY;
        double d5 = d2 - explosionZ;
        double d6 = MathHelper.sqrt_double(d3 * d3 + d4 * d4 + d5 * d5);
        d3 /= d6;
        d4 /= d6;
        d5 /= d6;
        double d7 = 0.5D / (d6 / (double) explosionSize + 0.1D);
        d7 *= worldObj.rand.nextFloat() * worldObj.rand.nextFloat() + 0.3F;
        d3 *= d7;
        d4 *= d7;
        d5 *= d7;
        worldObj.spawnParticle("explode", (d + explosionX * 1.0D) / 2D,
            (d1 + explosionY * 1.0D) / 2D, (d2 + explosionZ * 1.0D) / 2D, d3, d4, d5);
        worldObj.spawnParticle("smoke", d, d1, d2, d3, d4, d5);
      }

      if (i2 > 0) {
        // Block.blocksList[i2].dropBlockAsItemWithChance(worldObj, k,
        // i1, k1,
        // worldObj.getBlockMetadata(k, i1, k1), 0.3F, 0);
        // worldObj.setBlockWithNotify(k, i1, k1, 0);
        // Block.blocksList[i2].onBlockDestroyedByExplosion(worldObj, k,
        // i1, k1);
      }
    }
    for (int j = arraylist.size() - 1; j >= 0; j--) {
      ChunkPosition chunkposition1 = (ChunkPosition) arraylist.get(j);
      int l = chunkposition1.x;
      int j1 = chunkposition1.y;
      int l1 = chunkposition1.z;
      int j2 = worldObj.getBlockId(l, j1, l1);
      int k2 = worldObj.getBlockId(l, j1 - 1, l1);
View Full Code Here

Examples of net.minecraft.world.ChunkPosition

     * Strongly favors positive y positions.
     */
    @Override
    public ChunkPosition findBiomePosition (int par1, int par2, int par3, List par4List, Random par5Random)
    {
        return par4List.contains(this.biomeGenerator) ? new ChunkPosition(par1 - par3 + par5Random.nextInt(par3 * 2 + 1), 0, par2 - par3 + par5Random.nextInt(par3 * 2 + 1)) : null;
    }
View Full Code Here

Examples of net.minecraft.world.ChunkPosition

                double var8 = (1.25D * (double) var6 + random.nextDouble()) * this.distance * (double) var6;
                int var10 = (int) Math.round(Math.cos(randomNumBetween0and2PI) * var8);
                int var11 = (int) Math.round(Math.sin(randomNumBetween0and2PI) * var8);
                ArrayList var12 = new ArrayList();
                Collections.addAll(var12, this.allowedBiomeGenBases);
                ChunkPosition var13 = this.worldObj.getWorldChunkManager().findBiomePosition((var10 << 4) + 8, (var11 << 4) + 8, 112, var12, random);

                if (var13 != null)
                {
                    var10 = var13.chunkPosX >> 4;
                    var11 = var13.chunkPosZ >> 4;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.