用户:MashKJo/1.12.2模组开发笔记/实现新维度:修订间差异

第163行: 第163行:
=== 维度区块生成的一般步骤 ===
=== 维度区块生成的一般步骤 ===
==== 声明与初始化变量 ====
==== 声明与初始化变量 ====
private Random rand;
private NoiseGeneratorOctaves noiseGenerator1;
...
private NoiseGeneratorPerlin noiseGeneratorN;
...
private World world;
private WorldType worldType;
private MapGenBase structureGenerator1 = new ...;
...
private Biome[] biomesForGeneration;
{
    structureGenerator1 = TerrainGen.getModdedMapGen(..., ...);
    ...
}
public MyDimChunkGenerator(World world)
{
    this.world = world;
    this.worldType = world.getWorldInfo().getTerrainType();
    this.rand = this.world.getSeed();
   
    this.noiseGenerator1 = new NoiseGeneratorOctaves(this.rand, ...);
    ...
    this.noiseGeneratorN = new NoiseGeneratorPerlin(this.rand, ...);
    ...
}
读者估计已经看得晕头转向了。
的确,如果没有清晰的教程指引的话,任何人在初学这块的时候很容易在第一步就卡住——那为什么会卡住呢?还不是因为不知所谓的变量太多了!让我们先来理一理。


==== 实现generateChunk方法 ====
==== 实现generateChunk方法 ====
行政员、​优秀编辑者、​界面管理员、​监督员、​管理员、​小部件编辑者
3,417

个编辑