Advertisement
MrScautHD

Untitled

Apr 20th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.65 KB | None | 0 0
  1. @Override
  2. public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) {
  3. int ci = (pos.getX() >> 4) << 4;
  4. int ck = (pos.getZ() >> 4) << 4;
  5. RegistryKey<World> dimensionType = world.getWorld().getDimensionKey();
  6. boolean dimensionCriteria = false;
  7. if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("boss_tools:moon")))
  8. dimensionCriteria = true;
  9. if (!dimensionCriteria)
  10. return false;
  11. if ((random.nextInt(1000000) + 1) <= 10000) { //800
  12. int count = random.nextInt(1) + 1;
  13. int i = ci + random.nextInt(16);
  14. int k = ck + random.nextInt(16);
  15. int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
  16. j -= 1;
  17. // ChunkEvent.Load;
  18. for (int a = 0; a < count; a++) {
  19. Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
  20. Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
  21. BlockPos spawnTo = new BlockPos(i + 0, j - 20, k + 0);
  22. int x = spawnTo.getX();
  23. int y = spawnTo.getY();
  24. int z = spawnTo.getZ();
  25. if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
  26. continue;
  27. Template template = world.getWorld().getStructureTemplateManager()
  28. .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village1"));
  29. if (template == null)
  30. return false;
  31. template.func_237144_a_(world, spawnTo,
  32. new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
  33. .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
  34. random);
  35. }
  36. for (int a = 0; a < count; a++) {
  37. Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
  38. Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
  39. //int i = ci + random.nextInt(16);
  40. //int k = ck + random.nextInt(16);
  41. //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
  42. BlockPos spawnTo = new BlockPos(i - 7, j - 20, k + 0);
  43. int x = spawnTo.getX();
  44. int y = spawnTo.getY();
  45. int z = spawnTo.getZ();
  46. if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
  47. continue;
  48. Template template = world.getWorld().getStructureTemplateManager()
  49. .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village2"));
  50. if (template == null)
  51. return false;
  52. template.func_237144_a_(world, spawnTo,
  53. new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
  54. .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
  55. random);
  56. }
  57. for (int a = 0; a < count; a++) {
  58. Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
  59. Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
  60. //int i = ci + random.nextInt(16);
  61. //int k = ck + random.nextInt(16);
  62. //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
  63. BlockPos spawnTo = new BlockPos(i - 14, j - 20, k + 0);
  64. int x = spawnTo.getX();
  65. int y = spawnTo.getY();
  66. int z = spawnTo.getZ();
  67. if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
  68. continue;
  69. Template template = world.getWorld().getStructureTemplateManager()
  70. .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village2"));
  71. if (template == null)
  72. return false;
  73. template.func_237144_a_(world, spawnTo,
  74. new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
  75. .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
  76. random);
  77. }
  78. for (int a = 0; a < count; a++) {
  79. Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
  80. Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
  81. //int i = ci + random.nextInt(16);
  82. //int k = ck + random.nextInt(16);
  83. //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
  84. BlockPos spawnTo = new BlockPos(i - 21, j - 20, k + 0);
  85. int x = spawnTo.getX();
  86. int y = spawnTo.getY();
  87. int z = spawnTo.getZ();
  88. if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
  89. continue;
  90. Template template = world.getWorld().getStructureTemplateManager()
  91. .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village3"));
  92. if (template == null)
  93. return false;
  94. template.func_237144_a_(world, spawnTo,
  95. new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
  96. .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
  97. random);
  98. }
  99. for (int a = 0; a < count; a++) {
  100. Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
  101. Mirror mirror = Mirror.values()[2]; //Mirror.values()[random.nextInt(2)];
  102. //int i = ci + random.nextInt(16);
  103. //int k = ck + random.nextInt(16);
  104. //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
  105. BlockPos spawnTo = new BlockPos(i - 15, j - 20, k + 0);
  106. int x = spawnTo.getX();
  107. int y = spawnTo.getY();
  108. int z = spawnTo.getZ();
  109. if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
  110. continue;
  111. Template template = world.getWorld().getStructureTemplateManager()
  112. .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village4"));
  113. if (template == null)
  114. return false;
  115. template.func_237144_a_(world, spawnTo,
  116. new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
  117. .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
  118. random);
  119. }
  120. for (int a = 0; a < count; a++) {
  121. Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
  122. Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
  123. //int i = ci + random.nextInt(16);
  124. //int k = ck + random.nextInt(16);
  125. //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
  126. BlockPos spawnTo = new BlockPos(i - 28, j - 20, k - 6);
  127. int x = spawnTo.getX();
  128. int y = spawnTo.getY();
  129. int z = spawnTo.getZ();
  130. if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
  131. continue;
  132. Template template = world.getWorld().getStructureTemplateManager()
  133. .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village2"));
  134. if (template == null)
  135. return false;
  136. template.func_237144_a_(world, spawnTo,
  137. new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
  138. .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
  139. random);
  140. }
  141. for (int a = 0; a < count; a++) {
  142. Rotation rotation = Rotation.values()[0]; //Rotation.values()[random.nextInt(3)];
  143. Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
  144. //int i = ci + random.nextInt(16);
  145. //int k = ck + random.nextInt(16);
  146. //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
  147. BlockPos spawnTo = new BlockPos(i - 15, j - 20, k - 0);
  148. int x = spawnTo.getX();
  149. int y = spawnTo.getY();
  150. int z = spawnTo.getZ();
  151. if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
  152. continue;
  153. Template template = world.getWorld().getStructureTemplateManager()
  154. .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village9"));
  155. if (template == null)
  156. return false;
  157. template.func_237144_a_(world, spawnTo,
  158. new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
  159. .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
  160. random);
  161. }
  162. for (int a = 0; a < count; a++) {
  163. Rotation rotation = Rotation.values()[1]; //Rotation.values()[random.nextInt(3)];
  164. Mirror mirror = Mirror.values()[1]; //Mirror.values()[random.nextInt(2)];
  165. //int i = ci + random.nextInt(16);
  166. //int k = ck + random.nextInt(16);
  167. //int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
  168. BlockPos spawnTo = new BlockPos(i - 35, j - 20, k - 6);
  169. int x = spawnTo.getX();
  170. int y = spawnTo.getY();
  171. int z = spawnTo.getZ();
  172. if (!AlienVillageAdditionalGenerationConditionProcedure.executeProcedure(ImmutableMap.of()))
  173. continue;
  174. Template template = world.getWorld().getStructureTemplateManager()
  175. .getTemplateDefaulted(new ResourceLocation("boss_tools", "alien_village5"));
  176. if (template == null)
  177. return false;
  178. template.func_237144_a_(world, spawnTo,
  179. new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror)
  180. .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false),
  181. random);
  182. }
  183. }
  184. return true;
  185. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement