HaniiPuppy

Nae dice :(

Aug 23rd, 2016
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. public class RoadWorldGenerator implements IWorldGenerator
  2. {
  3.     @Override
  4.     public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
  5.     {
  6.         int blockX = chunkX * 16;
  7.         int blockZ = chunkZ * 16;
  8.        
  9.         BlockPos topBlock = world.getTopSolidOrLiquidBlock(new BlockPos(blockX, 90, blockZ));
  10.         System.out.println("Top block: " + topBlock.getX() + ", " + topBlock.getY() + ", " + topBlock.getZ());
  11.         Chunk chunk = chunkGenerator.provideChunk(chunkX, chunkZ); // Tried using both chunkX/Z and blockX/Z
  12.         chunk.setBlockState(topBlock, Blocks.NETHER_BRICK.getDefaultState());
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment