- 10
- 0
Здравствуйте люди добрые.
Сделал что бы моя руда генерировалась, но ее нет
Помогите найти ошибку ^^
Заранее спасибо.
Сделал что бы моя руда генерировалась, но ее нет
Код:
package ru.bs.vancraft.world;
import java.util.Random;
import akka.japi.Predicate;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.state.pattern.BlockMatcher;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraftforge.fml.common.IWorldGenerator;
import ru.bs.vancraft.init.InitBlocks;
public class ModWorldGen implements IWorldGenerator
{
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.getDimension())
{
case 0:
runGenerator(InitBlocks.UNKNOWN_ORE.getDefaultState(), 1 + random.nextInt(4), 8, 16, 64, BlockMatcher.forBlock(Blocks.STONE), world, random, chunkX, chunkZ);
break;
}
}
private void runGenerator(IBlockState blockToGen, int blockAmount, int chancesToSpawn, int minHeight, int maxHeight, BlockMatcher blockMatcher, World world, Random rand, int chunk_X, int chunk_Z)
{
if (minHeight <0 || maxHeight > 256 || minHeight > maxHeight)
throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator");
WorldGenMinable generator = new WorldGenMinable(blockToGen, blockAmount, blockMatcher);
int heightdiff = maxHeight - minHeight +1;
for (int i=0; i<chancesToSpawn; i++)
{
int x = chunk_X * 16 +rand.nextInt(16);
int y = minHeight + rand.nextInt(heightdiff);
int z = chunk_Z * 16 + rand.nextInt(16);
generator.generate(world, rand, new BlockPos(x, y, z));
}
}
}
Код:
package ru.bs.vancraft.init;
import World.ModWorldGen;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class InitGen
{
public static void register()
{
GameRegistry.registerWorldGenerator(new ModWorldGen(), 0);
}
}
Код:
package ru.bs.vancraft.proxy;
import net.minecraft.item.Item;
import ru.bs.vancraft.init.InitGen;
public class CommonProxy
{
private void init()
{
InitGen.register();
}
public void registerItemRenderer(Item item, int meta, String id) {}
}
Помогите найти ошибку ^^
Заранее спасибо.
Последнее редактирование: