30 août 2014, 20:47

J’ai essayé de generer mon propre arbre dans mon World Type mais sans succès ! J’ai rajouté ceci a mon code :

public WorldGenAbstractTree func_150567_a(Random p_150567_1_)
{
return (WorldGenAbstractTree)(p_150567_1_.nextInt(10) == 0 ? new WorldGenAncientAcacia(false) : (!this.field_150614_aC && p_150567_1_.nextInt(3) == 0 ? new WorldGenTrees(false) : new WorldGenTrees(false)));
}

public void genTerrainBlocks(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_)
{
this.generateBiomeTerrain(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_);
}

public final void generateBiomeTerrain(World world, Random rand, Block[] BLOCK, byte[] BYTE, int x, int z, double p_150560_7_)
{
boolean flag = true;
Block block = this.topBlock;
byte b0 = (byte)(this.field_150604_aj & 255);
Block block1 = this.fillerBlock;
int k = -1;
int l = (int)(p_150560_7_ / 3.0D + 3.0D + rand.nextDouble() * 0.25D);
int i1 = x & 15;
int j1 = z & 15;
int k1 = BLOCK.length / 256;

for (int l1 = 255; l1 >= 0; –l1)
{
int i2 = (j1 * 16 + i1) * k1 + l1;

if (l1 <= 0 + rand.nextInt(5))
{
BLOCK[i2] = Blocks.bedrock;
}
else
{
Block block2 = BLOCK[i2];

if (block2 != null && block2.getMaterial() != Material.air)
{
if (block2 == Blocks.stone)
{
if (k == -1)
{
if (l <= 0)
{
block = null;
b0 = 0;
block1 = Blocks.stone;
}
else if (l1 >= 59 && l1 <= 64)
{
block = this.topBlock;
b0 = (byte)(this.field_150604_aj & 255);
block1 = this.fillerBlock;
}

if (l1 < 63 && (block == null || block.getMaterial() == Material.air))
{
if (this.getFloatTemperature(x, l1, z) < 0.15F)
{

}
else
{

}
}

k = l;

if (l1 >= 62)
{
BLOCK[i2] = block;
BYTE[i2] = b0;
}
else if (l1 < 56 - l)
{
block = null;
block1 = Blocks.stone;
BLOCK[i2] = Blocks.stone;
}
else
{
BLOCK[i2] = block1;
}
}
else if (k > 0)
{
–k;
BLOCK[i2] = block1;

if (k == 0 && block1 == Blocks.stone)
{
k = rand.nextInt(4) + Math.max(0, l1 - 63);
block1 = Blocks.stone;
}
}
}
}
else
{
k = -1;
}
}
}
}

Ah cette ligne :


return (WorldGenAbstractTree)(p_150567_1_.nextInt(10) == 0 ? new WorldGenAncientAcacia(false) : (!this.field_150614_aC && p_150567_1_.nextInt(3) == 0 ? new WorldGenTrees(false) : new WorldGenTrees(false)));

field_150614_aC est surligner en rouge . . .

Mais je ne comprend pas le code donc je n’arrive pas a résoudre le soucis /: