in 1.7.10 the method was genBiomeTerrain(World, Random, Block[], byte[], int, int, double) and in 1.10.2 it is generateBiomeTerrain(World, Random, ChunkPrimer, int, int, double) i need to know how to convert the old one into the new one
In 1.7.10, each index of the Block and byte arrays is used to store the Block and metadata at a specific position.
In 1.8+, these arrays have been replaced by a ChunkPrimer, which stores the IBlockState at each position instead. Use ChunkPrimer#setBlockState to set the IBlockState at a position.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
In 1.7.10, each index of the Block and byte arrays is used to store the Block and metadata at a specific position.
In 1.8+, these arrays have been replaced by a ChunkPrimer, which stores the IBlockState at each position instead. Use ChunkPrimer#setBlockState to set the IBlockState at a position.
So when vanilla's method called chunk primer it's still going to = "block array byte[]" ? Since It's an overridden method. I am confused as to what you are trying to say and how to convert it?
So when vanilla's method called chunk primer it's still going to = "block array byte[]" ? Since It's an overridden method. I am confused as to what you are trying to say and how to convert it?
To set the Block and metadata at a specific position in 1.7.10, you'd calculate an array index based on the coordinates (the i2 local variable in the BiomeGenBase#genBiomeTerrain method) and then set that index of the Block and byte arrays to the desired Block and metadata.
To set the IBlockState (which is essentially a wrapper around a Block and metadata) at a specific position in 1.8+, you'd simply call ChunkPrimer#setBlockState with the coordinates and the IBlockState. You don't need to calculate any indexes or deal with any arrays, the ChunkPrimer handles all of that for you.
Compare 1.10.2's Biome#generateBiomeTerrain method to 1.7.10's BiomeGenBase#genBiomeTerrain method to see the difference between using the arrays and using the ChunkPrimer. The method also has a nice doc comment in 1.8.9+ explaining what it does.
Forge's documentation has an introduction to block states here, which you may find helpful.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
in 1.7.10 the method was genBiomeTerrain(World, Random, Block[], byte[], int, int, double) and in 1.10.2 it is generateBiomeTerrain(World, Random, ChunkPrimer, int, int, double) i need to know how to convert the old one into the new one
In 1.7.10, each index of the Block and byte arrays is used to store the Block and metadata at a specific position.
In 1.8+, these arrays have been replaced by a ChunkPrimer, which stores the IBlockState at each position instead. Use ChunkPrimer#setBlockState to set the IBlockState at a position.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
So when vanilla's method called chunk primer it's still going to = "block array byte[]" ? Since It's an overridden method. I am confused as to what you are trying to say and how to convert it?
To set the Block and metadata at a specific position in 1.7.10, you'd calculate an array index based on the coordinates (the i2 local variable in the BiomeGenBase#genBiomeTerrain method) and then set that index of the Block and byte arrays to the desired Block and metadata.
To set the IBlockState (which is essentially a wrapper around a Block and metadata) at a specific position in 1.8+, you'd simply call ChunkPrimer#setBlockState with the coordinates and the IBlockState. You don't need to calculate any indexes or deal with any arrays, the ChunkPrimer handles all of that for you.
Compare 1.10.2's Biome#generateBiomeTerrain method to 1.7.10's BiomeGenBase#genBiomeTerrain method to see the difference between using the arrays and using the ChunkPrimer. The method also has a nice doc comment in 1.8.9+ explaining what it does.
Forge's documentation has an introduction to block states here, which you may find helpful.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.