3 mai 2014, 12:23

Je parle pas de ça ^^
Moi je suis plus perdu dans ce code :


public void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int chancesToSpawn, int minY, int maxY) {

assert maxY > minY : "La position Y maximum doit être supérieure à la position Y minimum.";
assert maxX > 0 && maxX <= 16 : "X doit se trouver entre 0 et 16.";
assert minY > 0 : "La position Y minimum doit être supérieure à 0.";
assert maxY < 256 && maxY > 0 : "La position Y maximum doit se trouver entre 0 et 256.";
assert maxZ > 0 && maxZ <= 16 : "Z doit se trouver entre 0 et 16.";

int diffBtwnMinMaxY = maxY - minY;
for (int x = 0; x < chancesToSpawn; x++) {

int posX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(diffBtwnMinMaxY);
int posZ = blockZPos + random.nextInt(maxZ);
(new WorldGenMinable(block, maxVeinSize)).generate(world, random, posX, posY, posZ);

}

}