Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected ChunkPos getStart(ChunkGenerator<?> chunkGenerator, Random random, int chunkX, int chunkZ, int spacingMultiplier, int separationMultiplier) {
- // from AbstractTempleFeature#shouldStartAt method, k = 0, l = 0
- int spacing = this.getSpacing(chunkGenerator); // spacing = 32
- int separation = this.getSeparation(chunkGenerator); // separation = 8
- int o = chunkX + spacing * spacingMultiplier; // o == chunkX
- int p = chunkZ + spacing * separationMultiplier; // p == chunkZ
- int q = o < 0 ? o - spacing + 1 : o; // on the left side of the map; q == chunkX - 31, otherwise, just chunkX
- int r = p < 0 ? p - spacing + 1 : p; // on the top side of the map; r = chunkZ - 31, otherwise, just chunkZ
- int finalChunkX = q / spacing; // idk why do you have to divide by spacing
- int finalChunkZ = r / spacing;
- ((ChunkRandom)random).setStructureSeed(chunkGenerator.getSeed(), finalChunkX, finalChunkZ, this.getSeedModifier());
- finalChunkX *= spacing; // finalChunkX == q; ignoring floating point
- finalChunkZ *= spacing; // finalChunkZ == r; ignoring floating point
- finalChunkX += random.nextInt(spacing - separation);
- finalChunkZ += random.nextInt(spacing - separation);
- return new ChunkPos(finalChunkX, finalChunkZ);
- }
Advertisement
Add Comment
Please, Sign In to add comment