Ручная настройка частоты генерации

Версия Minecraft
1.7.10
5,150
49
901
Скопипастил я значит генератор цветов, создал некий блок, который от гриба, и решил их совместить. Вот код.
Код:
import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;

public class MushroomGenerator extends WorldGenerator
{

 private Block field_150552_a;
    private int field_150551_b;


    public MushroomGenerator(Block block)
    {
        this.field_150552_a = block;
    }

    public void func_150550_a(Block block, int a)
    {
        this.field_150552_a = block;
        this.field_150551_b = a;
    }

    public boolean generate(World world, Random random, int x, int y, int z)
    {
        for (int l = 0; l < 64; ++l)
        {
            int i1 = x + random.nextInt(8) - random.nextInt(8);
            int j1 = y + random.nextInt(4) - random.nextInt(4);
            int k1 = z + random.nextInt(8) - random.nextInt(8);

         
            if (world.isAirBlock(i1, j1, k1) && (!world.provider.hasNoSky || j1 < 255) && this.field_150552_a.canBlockStay(world, i1, j1, k1))
            {

 if(world.getBlock(x + i1, y + j1, z + k1) == Blocks.lava)
             world.setBlock(i1, j1, k1, this.field_150552_a, this.field_150551_b, 2);
            }
        }

        return true;
    }
}
Это код ворлдгена цветка( как ни странно, в папках с ворлдгеном я не нашел генератора грибов :( )

А вот мой тоже слизанный с ванили код гриба. 
Код:
public class MushroomBirchMushroom extends BlockBush implements IGrowable
{

    public MushroomBirchMushroom()
    {
        float f = 0.2F;
        this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
        this.setTickRandomly(true);
        this.setCreativeTab(MushroomMain.tabMushroom);
        this.setBlockTextureName("mushroom:MushroomBirchMushroom");
        this.setBlockName("BirchMushroom");
    }

    /**
     * Помечает блок, если это было запланировано
     */
    public void updateTick(World world, int x, int y, int z, Random random)
    {
        if (random.nextInt(25) == 0)
        {
            byte b0 = 4;
            int l = 5;
            int i1;
            int j1;
            int k1;

            for (i1 = x - b0; i1 <= x + b0; ++i1)
            {
                for (j1 = z - b0; j1 <= z + b0; ++j1)
                {
                    for (k1 = y - 1; k1 <= y + 1; ++k1)
                    {
                        if (world.getBlock(i1, k1, j1) == this)
                        {
                            --l;

                            if (l <= 0)
                            {
                                return;
                            }
                        }
                    }
                }
            }

            i1 = x + random.nextInt(3) - 1;
            j1 = y + random.nextInt(2) - random.nextInt(2);
            k1 = z + random.nextInt(3) - 1;

            for (int l1 = 0; l1 < 4; ++l1)
            {
                if (world.isAirBlock(i1, j1, k1) && this.canBlockStay(world, i1, j1, k1))
                {
                    x = i1;
                    y = j1;
                    z = k1;
                }

                i1 = x + random.nextInt(3) - 1;
                j1 = y + random.nextInt(2) - random.nextInt(2);
                k1 = z + random.nextInt(3) - 1;
            }

            if (world.isAirBlock(i1, j1, k1) && this.canBlockStay(world, i1, j1, k1))
            {
             world.setBlock(i1, j1, k1, this, 0, 2);
            }
        }
    }

    /**
     * Проверяет, является ли его действительным поставить этот блок по указанным координатам. Args: world, x, y, z
     */
    public boolean canPlaceBlockAt(World world, int x, int y, int z)
    {
        return super.canPlaceBlockAt(world, x, y, z) && this.canBlockStay(world, x, y, z);
    }

    /**
     * это блок-трава, грязь или мицелий
     */
    protected boolean canPlaceBlockOn(Block block)
    {
        return block.func_149730_j();
    }

    /**
     * Может ли этот блок оставаться в этом положении. Подобно canPlaceBlockAt кроме получает часто проверяться с растениями.
     */
    public boolean canBlockStay(World world, int x, int y, int z)
    {
        if (y >= 0 && y < 256)
        {
            Block block = world.getBlock(x, y - 1, z);
            return block == MyBlocks.BlockCompost || block == Blocks.grass || block == Blocks.dirt  && world.getBlockMetadata(x, y - 1, z) == 2 || world.getFullBlockLightValue(x, y, z) < 13 && block.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, this);
        }
        else
        {
            return false;
        }
    }

    
    
    
    
    
    public boolean func_149884_c(World world, int x, int y, int z, Random random)
    {
        int l = world.getBlockMetadata(x, y, z);
        world.setBlockToAir(x, y, z);
        WorldGenBigMushroom worldgenbigmushroom = null;

        if (this == Blocks.brown_mushroom)
        {
            worldgenbigmushroom = new WorldGenBigMushroom(0);
        }
        else if (this == Blocks.red_mushroom)
        {
            worldgenbigmushroom = new WorldGenBigMushroom(1);
        }

        if (worldgenbigmushroom != null && worldgenbigmushroom.generate(world, random, x, y, z))
        {
            return true;
        }
        else
        {
         world.setBlock(x, y, z, this, l, 3);
            return false;
        }
    }

    
    
    
    
    
    
    public boolean func_149851_a(World world, int x, int y, int z, boolean bool)
    {
        return true;
    }

    public boolean func_149852_a(World world, Random random, int x, int y, int z)
    {
        return (double)random.nextFloat() < 0.4D;
    }

    public void func_149853_b(World world, Random random, int x, int y, int z)
    {
        this.func_149884_c(world, x, y, z, random);
    }
}
и у меня 2 вопроса -
1) (подозрение) нигде не видел вообще никакой связи между этими двумя классами в ванильном майне
2) как настроить 100% генерацию? Ну тоесть, чтобы 100% рядом с каждым блоком лавы был мой грибоцвет?

И да, я не уверен, что этот ворлдген вообще работает, поэтому и хочу 100 % генерацию.


Ну что? Совсем никто не знает?
 
Liahim написал(а):
На форуме куча тем, связанных с генерацией...

Ты не поверишь. Я просмотрел все 3 страницы с темами которые вылазят по запросу "генерация". Нигде не было такой же (даже похожей) проблемы...

Погодь! Кажется что то нашел...
 
Назад
Сверху