Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) {
- int ci = (pos.getX() >> 4) << 4;
- int ck = (pos.getZ() >> 4) << 4;
- RegistryKey<World> dimensionType = world.getWorld().getDimensionKey();
- boolean dimensionCriteria = false;
- if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("boss_tools:moon")))
- dimensionCriteria = true;
- if (!dimensionCriteria)
- return false;
- if ((random.nextInt(1000000) + 1) <= 10000) { //800
- int count = random.nextInt(1) + 1;
- int i = ci + random.nextInt(16);
- int k = ck + random.nextInt(16);
- int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
- j -= 1;
- // ChunkEvent.Load;
- for (int a = 0; a < count; a++) {
- Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
- Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
- BlockPos spawnTo = new BlockPos(i + 0, j - 20, k + 0);
- int x = spawnTo.getX();
- int y = spawnTo.getY();
- int z = spawnTo.getZ();
- if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
- continue;
- Template template = world.getWorld().getStructureTemplateManager()
- .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village1"));
- if (template == null)
- return false;
- template.func_237144_a_(world, spawnTo,
- new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
- .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
- random);
- }
- for (int a = 0; a < count; a++) {
- Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
- Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
- //int i = ci + random.nextInt(16);
- //int k = ck + random.nextInt(16);
- //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
- BlockPos spawnTo = new BlockPos(i - 7, j - 20, k + 0);
- int x = spawnTo.getX();
- int y = spawnTo.getY();
- int z = spawnTo.getZ();
- if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
- continue;
- Template template = world.getWorld().getStructureTemplateManager()
- .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village2"));
- if (template == null)
- return false;
- template.func_237144_a_(world, spawnTo,
- new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
- .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
- random);
- }
- for (int a = 0; a < count; a++) {
- Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
- Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
- //int i = ci + random.nextInt(16);
- //int k = ck + random.nextInt(16);
- //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
- BlockPos spawnTo = new BlockPos(i - 14, j - 20, k + 0);
- int x = spawnTo.getX();
- int y = spawnTo.getY();
- int z = spawnTo.getZ();
- if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
- continue;
- Template template = world.getWorld().getStructureTemplateManager()
- .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village2"));
- if (template == null)
- return false;
- template.func_237144_a_(world, spawnTo,
- new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
- .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
- random);
- }
- for (int a = 0; a < count; a++) {
- Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
- Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
- //int i = ci + random.nextInt(16);
- //int k = ck + random.nextInt(16);
- //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
- BlockPos spawnTo = new BlockPos(i - 21, j - 20, k + 0);
- int x = spawnTo.getX();
- int y = spawnTo.getY();
- int z = spawnTo.getZ();
- if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
- continue;
- Template template = world.getWorld().getStructureTemplateManager()
- .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village3"));
- if (template == null)
- return false;
- template.func_237144_a_(world, spawnTo,
- new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
- .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
- random);
- }
- for (int a = 0; a < count; a++) {
- Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
- Mirror mirror = Mirror.values()[2]; //Mirror.values()[random.nextInt(2)];
- //int i = ci + random.nextInt(16);
- //int k = ck + random.nextInt(16);
- //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
- BlockPos spawnTo = new BlockPos(i - 15, j - 20, k + 0);
- int x = spawnTo.getX();
- int y = spawnTo.getY();
- int z = spawnTo.getZ();
- if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
- continue;
- Template template = world.getWorld().getStructureTemplateManager()
- .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village4"));
- if (template == null)
- return false;
- template.func_237144_a_(world, spawnTo,
- new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
- .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
- random);
- }
- for (int a = 0; a < count; a++) {
- Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
- Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
- //int i = ci + random.nextInt(16);
- //int k = ck + random.nextInt(16);
- //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
- BlockPos spawnTo = new BlockPos(i - 28, j - 20, k - 6);
- int x = spawnTo.getX();
- int y = spawnTo.getY();
- int z = spawnTo.getZ();
- if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
- continue;
- Template template = world.getWorld().getStructureTemplateManager()
- .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village2"));
- if (template == null)
- return false;
- template.func_237144_a_(world, spawnTo,
- new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
- .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
- random);
- }
- for (int a = 0; a < count; a++) {
- Rotation rotation = Rotation.values()[0]; //Rotation.values()[random.nextInt(3)];
- Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
- //int i = ci + random.nextInt(16);
- //int k = ck + random.nextInt(16);
- //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
- BlockPos spawnTo = new BlockPos(i - 15, j - 20, k - 0);
- int x = spawnTo.getX();
- int y = spawnTo.getY();
- int z = spawnTo.getZ();
- if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
- continue;
- Template template = world.getWorld().getStructureTemplateManager()
- .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village9"));
- if (template == null)
- return false;
- template.func_237144_a_(world, spawnTo,
- new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
- .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
- random);
- }
- for (int a = 0; a < count; a++) {
- Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
- Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
- //int i = ci + random.nextInt(16);
- //int k = ck + random.nextInt(16);
- //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
- BlockPos spawnTo = new BlockPos(i - 35, j - 20, k - 6);
- int x = spawnTo.getX();
- int y = spawnTo.getY();
- int z = spawnTo.getZ();
- if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
- continue;
- Template template = world.getWorld().getStructureTemplateManager()
- .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village5"));
- if (template == null)
- return false;
- template.func_237144_a_(world, spawnTo,
- new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
- .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
- random);
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement