Posted March 24, 201510 yr I'd like to replace vanilla stone with different custom stones based on height. Does anyone know of anywhere I could look for a reference on doing this please? Thanks!
March 24, 201510 yr Author Figured it out. In case anyone else wants to know.... @SubscribeEvent public void populateChunk(PopulateChunkEvent.Pre event) { Chunk chunk = event.world.getChunkFromChunkCoords(event.chunkX, event.chunkZ); for (ExtendedBlockStorage storage : chunk.getBlockStorageArray()) { if (storage != null) { for (int x = 0; x < 16; ++x) { for (int y = 0; y < 16; ++y) { for (int z = 0; z < 16; ++z) { if (storage.getBlockByExtId(x, y, z) == Blocks.stone) { storage.set(x, y, z, CustomBlocks.customBlock.getDefaultState()); } } } } } } }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.