Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean hasMineshaftStartingPoint(long mapSeed, int chunkX, int chunkZ){
- Random rand = new Random();
- // *** MapGenBase->generate() / MapGenStructure->getNeareastInstance()
- rand.setSeed(mapSeed);
- long seedMod1 = rand.nextLong();
- long seedMod2 = rand.nextLong();
- long seedMod3 = (long)chunkX * seedMod1;
- long seedMod4 = (long)chunkZ * seedMod2;
- rand.setSeed(seedMod3 ^ seedMod4 ^ mapSeed);
- rand.nextInt();
- // *** MapGenMineshaft->canSpawnStructureAtCoords
- if(rand.nextDouble() < 0.01D && rand.nextInt(80) < Math.max(Math.abs(chunkX), Math.abs(chunkZ))){
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement