From 5ff045ecacd87a1443c71b4ce9edca9e04635f13 Mon Sep 17 00:00:00 2001 From: Blaster Date: Wed, 11 Dec 2019 20:07:32 +0100 Subject: [PATCH 1/8] Upload files to 'src/main/java/com/sosnitzka/taiga/world' --- .../com/sosnitzka/taiga/world/WorldGen.java | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sosnitzka/taiga/world/WorldGen.java b/src/main/java/com/sosnitzka/taiga/world/WorldGen.java index 51e5bef..e417c28 100644 --- a/src/main/java/com/sosnitzka/taiga/world/WorldGen.java +++ b/src/main/java/com/sosnitzka/taiga/world/WorldGen.java @@ -108,7 +108,7 @@ public class WorldGen implements IWorldGenerator { world, IRON_VAL, 0, 32, 2, 8); } } - + private void end(Random random, int x, int z, World world) { Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, world, URU_VAL, 2, 0, 96, 3); @@ -122,6 +122,28 @@ public class WorldGen implements IWorldGenerator { Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z, world, ABYSSUM_VAL, 4, 64); } + //Spawns nether/end ores in the Overworld if the server has allow-nether set to 0 WIP: needs alternate textures + private void worldextra(Random random, int x, int z, World world) { + Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, + world, URU_VAL, 2, 0, 96, 3); + //if (endGen) //What does this do? Might interfere with this generator hack + //Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null, + //random, x, z, world, 1, 100, 3, 64, 3, 8, null); + Generator.generateOre(auroriumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world, + AURORIUM_VAL, 8, 48, 2, 4); + Generator.generateOre(palladiumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, + world, PALLADIUM_VAL, 12, 64, 2, 4); + Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), abyssumOre.getDefaultState(), random, x, z, + world, ABYSSUM_VAL, 4, 6); + Generator.generateOre(tiberiumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, TIBERIUM_VAL, 16, 128, 10, 35); + Generator.generateOre(prometheumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, PROMETHEUM_VAL, 0, 32, 2, 4); + Generator.generateOre(valyriumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, VALYRIUM_VAL, 0, 128, 2, 4); + Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), + osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15); //Why is this switched around? + } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, @@ -134,6 +156,9 @@ public class WorldGen implements IWorldGenerator { break; case 0: world(random, x, z, world); + if(net.minecraft.server.MinecraftServer.getAllowNether() == FALSE) + worldextra(random, x, z, world); //worldextra generates nether/end ores in overworld + } break; case 1: end(random, x, z, world); From fd80efa35499b172fa03e869534d99259e37599d Mon Sep 17 00:00:00 2001 From: Blaster Date: Fri, 20 Dec 2019 04:03:43 +0100 Subject: [PATCH 2/8] Upload files to 'src/main/java/com/sosnitzka/taiga/world' Edited source as requested --- .../java/com/sosnitzka/taiga/world/WorldGen.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/sosnitzka/taiga/world/WorldGen.java b/src/main/java/com/sosnitzka/taiga/world/WorldGen.java index e417c28..bb8596c 100644 --- a/src/main/java/com/sosnitzka/taiga/world/WorldGen.java +++ b/src/main/java/com/sosnitzka/taiga/world/WorldGen.java @@ -108,7 +108,7 @@ public class WorldGen implements IWorldGenerator { world, IRON_VAL, 0, 32, 2, 8); } } - + private void end(Random random, int x, int z, World world) { Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, world, URU_VAL, 2, 0, 96, 3); @@ -122,13 +122,10 @@ public class WorldGen implements IWorldGenerator { Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z, world, ABYSSUM_VAL, 4, 64); } - //Spawns nether/end ores in the Overworld if the server has allow-nether set to 0 WIP: needs alternate textures + /** Spawns nether/end ores in the Overworld if the server has allow-nether set to 0 WIP: needs alternate textures */ private void worldextra(Random random, int x, int z, World world) { Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, world, URU_VAL, 2, 0, 96, 3); - //if (endGen) //What does this do? Might interfere with this generator hack - //Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null, - //random, x, z, world, 1, 100, 3, 64, 3, 8, null); Generator.generateOre(auroriumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world, AURORIUM_VAL, 8, 48, 2, 4); Generator.generateOre(palladiumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, @@ -142,7 +139,7 @@ public class WorldGen implements IWorldGenerator { Generator.generateOre(valyriumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, world, VALYRIUM_VAL, 0, 128, 2, 4); Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), - osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15); //Why is this switched around? + osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15); } @Override @@ -156,8 +153,8 @@ public class WorldGen implements IWorldGenerator { break; case 0: world(random, x, z, world); - if(net.minecraft.server.MinecraftServer.getAllowNether() == FALSE) - worldextra(random, x, z, world); //worldextra generates nether/end ores in overworld + if(!net.minecraft.server.MinecraftServer.getAllowNether()) + worldextra(random, x, z, world); /** worldextra generates nether/end ores in overworld */ } break; case 1: From c509b4cdd9692e96a6d6f1a3cfeec33b1fd22691 Mon Sep 17 00:00:00 2001 From: Blaster Date: Sat, 1 Feb 2020 23:58:59 +0100 Subject: [PATCH 3/8] Upload files to 'src/main/java/com/sosnitzka/taiga/world' Reupload From 4f852b0d322493aee0b7075718314a0aa1fa5b5f Mon Sep 17 00:00:00 2001 From: Blaster Date: Thu, 13 Feb 2020 17:09:13 +0100 Subject: [PATCH 4/8] src/main/java/com/sosnitzka/taiga/world/ --- WorldGen.java | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 WorldGen.java diff --git a/WorldGen.java b/WorldGen.java new file mode 100644 index 0000000..e417c28 --- /dev/null +++ b/WorldGen.java @@ -0,0 +1,172 @@ +package com.sosnitzka.taiga.world; + + +import com.sosnitzka.taiga.TAIGA; +import com.sosnitzka.taiga.util.Generator; +import net.minecraft.block.BlockStone; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.IChunkGenerator; +import net.minecraftforge.fml.common.IWorldGenerator; + +import java.util.*; + +import static com.google.common.collect.Lists.newArrayList; +import static com.sosnitzka.taiga.Blocks.*; +import static com.sosnitzka.taiga.TAIGAConfiguration.*; + +@SuppressWarnings("unchecked") +public class WorldGen implements IWorldGenerator { + private static WorldGen INSTANCE; + private final List blackList = new ArrayList(); + private final Map meteorGenStats = new HashMap(); + private final Map meteorChunkStats = new HashMap(); + + public static WorldGen getInstance() { + if (INSTANCE == null) + INSTANCE = new WorldGen(); + + return INSTANCE; + } + + private void nether(Random random, int x, int z, World world) { + Generator.generateOre(tiberiumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, + world, TIBERIUM_VAL, 32, 128, 10, 35); + Generator.generateOre(prometheumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, + world, PROMETHEUM_VAL, 0, 32, 2, 4); + Generator.generateOre(valyriumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, + world, VALYRIUM_VAL, 0, 128, 2, 4); + Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), + osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15); + } + + private void other(Random random, int x, int z, World world) { + int dim = world.provider.getDimension(); + if (!meteorGenStats.containsKey(dim)) + meteorGenStats.put(dim, 0); + + if (!meteorChunkStats.containsKey(dim)) + meteorChunkStats.put(dim, 0); + + meteorChunkStats.put(dim, meteorChunkStats.get(dim) + 1); + meteorGenStats.put(meteorGenStats.get(dim), meteorGenStats.get(dim) + Generator.generateMeteor(duraniteOre + .getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, world, DURANITE_VAL, 6, 16, 112)); + Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA + .getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64); + Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(), + random, x, z, world, EEZO_VAL, 0, 10); + Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z, + world, KARMESINE_VAL); + Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, + world, OVIUM_VAL); + Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, JAUXUM_VAL); + Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, + VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes + .EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT)); + Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, + DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes + .MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH)); + Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1, + 15, 0, 128, 1, 5, null); + if (ironGen) { + Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, + world, IRON_VAL, 0, 32, 2, 8); + } + + if (meteorChunkStats.get(dim) > 100 && meteorGenStats.get(dim) == 0) { + blackList.add(dim); + TAIGA.logger.info(String.format("Detected void dimension, adding to blacklist: %d", dim)); + } + } + + private void world(Random random, int x, int z, World world) { + Generator.generateMeteor(duraniteOre.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, + world, DURANITE_VAL, 6, 16, 112); + Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA + .getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64); + Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(), + random, x, z, world, EEZO_VAL, 0, 10); + Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z, + world, KARMESINE_VAL); + Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, + world, OVIUM_VAL); + Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, JAUXUM_VAL); + Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, + VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes + .EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT)); + Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, + DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes + .MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH)); + Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1, + 15, 0, 128, 1, 5, null); + if (ironGen) { + Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, + world, IRON_VAL, 0, 32, 2, 8); + } + } + + private void end(Random random, int x, int z, World world) { + Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, + world, URU_VAL, 2, 0, 96, 3); + if (endGen) + Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null, + random, x, z, world, 1, 100, 3, 64, 3, 8, null); + Generator.generateOre(auroriumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, world, + AURORIUM_VAL, 32, 48, 2, 4); + Generator.generateOre(palladiumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, + world, PALLADIUM_VAL, 48, 64, 2, 4); + Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z, + world, ABYSSUM_VAL, 4, 64); + } + //Spawns nether/end ores in the Overworld if the server has allow-nether set to 0 WIP: needs alternate textures + private void worldextra(Random random, int x, int z, World world) { + Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, + world, URU_VAL, 2, 0, 96, 3); + //if (endGen) //What does this do? Might interfere with this generator hack + //Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null, + //random, x, z, world, 1, 100, 3, 64, 3, 8, null); + Generator.generateOre(auroriumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world, + AURORIUM_VAL, 8, 48, 2, 4); + Generator.generateOre(palladiumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, + world, PALLADIUM_VAL, 12, 64, 2, 4); + Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), abyssumOre.getDefaultState(), random, x, z, + world, ABYSSUM_VAL, 4, 6); + Generator.generateOre(tiberiumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, TIBERIUM_VAL, 16, 128, 10, 35); + Generator.generateOre(prometheumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, PROMETHEUM_VAL, 0, 32, 2, 4); + Generator.generateOre(valyriumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, VALYRIUM_VAL, 0, 128, 2, 4); + Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), + osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15); //Why is this switched around? + } + + @Override + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, + IChunkProvider chunkProvider) { + int x = chunkX * 16; + int z = chunkZ * 16; + switch (world.provider.getDimension()) { + case -1: + nether(random, x, z, world); + break; + case 0: + world(random, x, z, world); + if(net.minecraft.server.MinecraftServer.getAllowNether() == FALSE) + worldextra(random, x, z, world); //worldextra generates nether/end ores in overworld + } + break; + case 1: + end(random, x, z, world); + break; + default: + if (!blackList.contains(world.provider.getDimension())) + other(random, x, z, world); + break; + } + } +} From 9828cc1a66db63977abccabb6cb5d4056c23b260 Mon Sep 17 00:00:00 2001 From: Blaster Date: Thu, 13 Feb 2020 17:12:46 +0100 Subject: [PATCH 5/8] Delete 'WorldGen.java' --- WorldGen.java | 172 -------------------------------------------------- 1 file changed, 172 deletions(-) delete mode 100644 WorldGen.java diff --git a/WorldGen.java b/WorldGen.java deleted file mode 100644 index e417c28..0000000 --- a/WorldGen.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.sosnitzka.taiga.world; - - -import com.sosnitzka.taiga.TAIGA; -import com.sosnitzka.taiga.util.Generator; -import net.minecraft.block.BlockStone; -import net.minecraft.init.Biomes; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import net.minecraft.world.gen.IChunkGenerator; -import net.minecraftforge.fml.common.IWorldGenerator; - -import java.util.*; - -import static com.google.common.collect.Lists.newArrayList; -import static com.sosnitzka.taiga.Blocks.*; -import static com.sosnitzka.taiga.TAIGAConfiguration.*; - -@SuppressWarnings("unchecked") -public class WorldGen implements IWorldGenerator { - private static WorldGen INSTANCE; - private final List blackList = new ArrayList(); - private final Map meteorGenStats = new HashMap(); - private final Map meteorChunkStats = new HashMap(); - - public static WorldGen getInstance() { - if (INSTANCE == null) - INSTANCE = new WorldGen(); - - return INSTANCE; - } - - private void nether(Random random, int x, int z, World world) { - Generator.generateOre(tiberiumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, - world, TIBERIUM_VAL, 32, 128, 10, 35); - Generator.generateOre(prometheumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, - world, PROMETHEUM_VAL, 0, 32, 2, 4); - Generator.generateOre(valyriumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, - world, VALYRIUM_VAL, 0, 128, 2, 4); - Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), - osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15); - } - - private void other(Random random, int x, int z, World world) { - int dim = world.provider.getDimension(); - if (!meteorGenStats.containsKey(dim)) - meteorGenStats.put(dim, 0); - - if (!meteorChunkStats.containsKey(dim)) - meteorChunkStats.put(dim, 0); - - meteorChunkStats.put(dim, meteorChunkStats.get(dim) + 1); - meteorGenStats.put(meteorGenStats.get(dim), meteorGenStats.get(dim) + Generator.generateMeteor(duraniteOre - .getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, world, DURANITE_VAL, 6, 16, 112)); - Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA - .getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64); - Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(), - random, x, z, world, EEZO_VAL, 0, 10); - Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z, - world, KARMESINE_VAL); - Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, - world, OVIUM_VAL); - Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, - world, JAUXUM_VAL); - Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, - VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes - .EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT)); - Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, - DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes - .MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH)); - Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1, - 15, 0, 128, 1, 5, null); - if (ironGen) { - Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, - world, IRON_VAL, 0, 32, 2, 8); - } - - if (meteorChunkStats.get(dim) > 100 && meteorGenStats.get(dim) == 0) { - blackList.add(dim); - TAIGA.logger.info(String.format("Detected void dimension, adding to blacklist: %d", dim)); - } - } - - private void world(Random random, int x, int z, World world) { - Generator.generateMeteor(duraniteOre.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, - world, DURANITE_VAL, 6, 16, 112); - Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA - .getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64); - Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(), - random, x, z, world, EEZO_VAL, 0, 10); - Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z, - world, KARMESINE_VAL); - Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, - world, OVIUM_VAL); - Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, - world, JAUXUM_VAL); - Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, - VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes - .EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT)); - Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, - DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes - .MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH)); - Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1, - 15, 0, 128, 1, 5, null); - if (ironGen) { - Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, - world, IRON_VAL, 0, 32, 2, 8); - } - } - - private void end(Random random, int x, int z, World world) { - Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, - world, URU_VAL, 2, 0, 96, 3); - if (endGen) - Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null, - random, x, z, world, 1, 100, 3, 64, 3, 8, null); - Generator.generateOre(auroriumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, world, - AURORIUM_VAL, 32, 48, 2, 4); - Generator.generateOre(palladiumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, - world, PALLADIUM_VAL, 48, 64, 2, 4); - Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z, - world, ABYSSUM_VAL, 4, 64); - } - //Spawns nether/end ores in the Overworld if the server has allow-nether set to 0 WIP: needs alternate textures - private void worldextra(Random random, int x, int z, World world) { - Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, - world, URU_VAL, 2, 0, 96, 3); - //if (endGen) //What does this do? Might interfere with this generator hack - //Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null, - //random, x, z, world, 1, 100, 3, 64, 3, 8, null); - Generator.generateOre(auroriumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world, - AURORIUM_VAL, 8, 48, 2, 4); - Generator.generateOre(palladiumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, - world, PALLADIUM_VAL, 12, 64, 2, 4); - Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), abyssumOre.getDefaultState(), random, x, z, - world, ABYSSUM_VAL, 4, 6); - Generator.generateOre(tiberiumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, - world, TIBERIUM_VAL, 16, 128, 10, 35); - Generator.generateOre(prometheumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, - world, PROMETHEUM_VAL, 0, 32, 2, 4); - Generator.generateOre(valyriumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, - world, VALYRIUM_VAL, 0, 128, 2, 4); - Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), - osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15); //Why is this switched around? - } - - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, - IChunkProvider chunkProvider) { - int x = chunkX * 16; - int z = chunkZ * 16; - switch (world.provider.getDimension()) { - case -1: - nether(random, x, z, world); - break; - case 0: - world(random, x, z, world); - if(net.minecraft.server.MinecraftServer.getAllowNether() == FALSE) - worldextra(random, x, z, world); //worldextra generates nether/end ores in overworld - } - break; - case 1: - end(random, x, z, world); - break; - default: - if (!blackList.contains(world.provider.getDimension())) - other(random, x, z, world); - break; - } - } -} From ada8e9e004e64fbd35ba22ba57d16978979ee2bc Mon Sep 17 00:00:00 2001 From: Blaster Date: Thu, 13 Feb 2020 17:14:05 +0100 Subject: [PATCH 6/8] Upload files to 'src/main/java/com/sosnitzka/taiga/world' Formatting fixes --- src/main/java/com/sosnitzka/taiga/world/WorldGen.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/sosnitzka/taiga/world/WorldGen.java b/src/main/java/com/sosnitzka/taiga/world/WorldGen.java index bb8596c..145673d 100644 --- a/src/main/java/com/sosnitzka/taiga/world/WorldGen.java +++ b/src/main/java/com/sosnitzka/taiga/world/WorldGen.java @@ -122,8 +122,9 @@ public class WorldGen implements IWorldGenerator { Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z, world, ABYSSUM_VAL, 4, 64); } + /** Spawns nether/end ores in the Overworld if the server has allow-nether set to 0 WIP: needs alternate textures */ - private void worldextra(Random random, int x, int z, World world) { + private void worldNetherless(Random random, int x, int z, World world) { Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, world, URU_VAL, 2, 0, 96, 3); Generator.generateOre(auroriumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world, @@ -153,8 +154,9 @@ public class WorldGen implements IWorldGenerator { break; case 0: world(random, x, z, world); - if(!net.minecraft.server.MinecraftServer.getAllowNether()) - worldextra(random, x, z, world); /** worldextra generates nether/end ores in overworld */ + if(!net.minecraft.server.MinecraftServer.getAllowNether()) { + /** worldNetherless generates nether/end ores in overworld */ + worldNetherless(random, x, z, world); } break; case 1: From cda20df50144da309fd1c7a2e9ac362f669e168a Mon Sep 17 00:00:00 2001 From: Blaster Date: Thu, 13 Feb 2020 17:16:52 +0100 Subject: [PATCH 7/8] Formatting fix --- src/main/java/com/sosnitzka/taiga/world/WorldGen.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/sosnitzka/taiga/world/WorldGen.java b/src/main/java/com/sosnitzka/taiga/world/WorldGen.java index 145673d..f70c070 100644 --- a/src/main/java/com/sosnitzka/taiga/world/WorldGen.java +++ b/src/main/java/com/sosnitzka/taiga/world/WorldGen.java @@ -155,6 +155,7 @@ public class WorldGen implements IWorldGenerator { case 0: world(random, x, z, world); if(!net.minecraft.server.MinecraftServer.getAllowNether()) { + /** worldNetherless generates nether/end ores in overworld */ worldNetherless(random, x, z, world); } From 18543ec172c3b5215fb9649b45194881679373f7 Mon Sep 17 00:00:00 2001 From: Blaster Date: Thu, 13 Feb 2020 17:21:11 +0100 Subject: [PATCH 8/8] Formatting fix --- .../java/sosnitzka/taiga/world/WorldGen.java | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 src/main/java/sosnitzka/taiga/world/WorldGen.java diff --git a/src/main/java/sosnitzka/taiga/world/WorldGen.java b/src/main/java/sosnitzka/taiga/world/WorldGen.java new file mode 100644 index 0000000..2f107e8 --- /dev/null +++ b/src/main/java/sosnitzka/taiga/world/WorldGen.java @@ -0,0 +1,171 @@ +package com.sosnitzka.taiga.world; + + +import com.sosnitzka.taiga.TAIGA; +import com.sosnitzka.taiga.util.Generator; +import net.minecraft.block.BlockStone; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.IChunkGenerator; +import net.minecraftforge.fml.common.IWorldGenerator; + +import java.util.*; + +import static com.google.common.collect.Lists.newArrayList; +import static com.sosnitzka.taiga.Blocks.*; +import static com.sosnitzka.taiga.TAIGAConfiguration.*; + +@SuppressWarnings("unchecked") +public class WorldGen implements IWorldGenerator { + private static WorldGen INSTANCE; + private final List blackList = new ArrayList(); + private final Map meteorGenStats = new HashMap(); + private final Map meteorChunkStats = new HashMap(); + + public static WorldGen getInstance() { + if (INSTANCE == null) + INSTANCE = new WorldGen(); + + return INSTANCE; + } + + private void nether(Random random, int x, int z, World world) { + Generator.generateOre(tiberiumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, + world, TIBERIUM_VAL, 32, 128, 10, 35); + Generator.generateOre(prometheumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, + world, PROMETHEUM_VAL, 0, 32, 2, 4); + Generator.generateOre(valyriumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, + world, VALYRIUM_VAL, 0, 128, 2, 4); + Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), + osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15); + } + + private void other(Random random, int x, int z, World world) { + int dim = world.provider.getDimension(); + if (!meteorGenStats.containsKey(dim)) + meteorGenStats.put(dim, 0); + + if (!meteorChunkStats.containsKey(dim)) + meteorChunkStats.put(dim, 0); + + meteorChunkStats.put(dim, meteorChunkStats.get(dim) + 1); + meteorGenStats.put(meteorGenStats.get(dim), meteorGenStats.get(dim) + Generator.generateMeteor(duraniteOre + .getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, world, DURANITE_VAL, 6, 16, 112)); + Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA + .getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64); + Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(), + random, x, z, world, EEZO_VAL, 0, 10); + Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z, + world, KARMESINE_VAL); + Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, + world, OVIUM_VAL); + Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, JAUXUM_VAL); + Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, + VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes + .EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT)); + Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, + DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes + .MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH)); + Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1, + 15, 0, 128, 1, 5, null); + if (ironGen) { + Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, + world, IRON_VAL, 0, 32, 2, 8); + } + + if (meteorChunkStats.get(dim) > 100 && meteorGenStats.get(dim) == 0) { + blackList.add(dim); + TAIGA.logger.info(String.format("Detected void dimension, adding to blacklist: %d", dim)); + } + } + + private void world(Random random, int x, int z, World world) { + Generator.generateMeteor(duraniteOre.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, + world, DURANITE_VAL, 6, 16, 112); + Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA + .getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64); + Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(), + random, x, z, world, EEZO_VAL, 0, 10); + Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z, + world, KARMESINE_VAL); + Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, + world, OVIUM_VAL); + Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, JAUXUM_VAL); + Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, + VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes + .EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT)); + Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, + DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes + .MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH)); + Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1, + 15, 0, 128, 1, 5, null); + if (ironGen) { + Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, + world, IRON_VAL, 0, 32, 2, 8); + } + } + + private void end(Random random, int x, int z, World world) { + Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, + world, URU_VAL, 2, 0, 96, 3); + if (endGen) + Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null, + random, x, z, world, 1, 100, 3, 64, 3, 8, null); + Generator.generateOre(auroriumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, world, + AURORIUM_VAL, 32, 48, 2, 4); + Generator.generateOre(palladiumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, + world, PALLADIUM_VAL, 48, 64, 2, 4); + Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z, + world, ABYSSUM_VAL, 4, 64); + } + + /** Spawns nether/end ores in the Overworld if the server has allow-nether set to 0 WIP: needs alternate textures */ + private void worldNetherless(Random random, int x, int z, World world) { + Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, + world, URU_VAL, 2, 0, 96, 3); + Generator.generateOre(auroriumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world, + AURORIUM_VAL, 8, 48, 2, 4); + Generator.generateOre(palladiumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, + world, PALLADIUM_VAL, 12, 64, 2, 4); + Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), abyssumOre.getDefaultState(), random, x, z, + world, ABYSSUM_VAL, 4, 6); + Generator.generateOre(tiberiumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, TIBERIUM_VAL, 16, 128, 10, 35); + Generator.generateOre(prometheumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, PROMETHEUM_VAL, 0, 32, 2, 4); + Generator.generateOre(valyriumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, + world, VALYRIUM_VAL, 0, 128, 2, 4); + Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), + osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15); + } + + @Override + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, + IChunkProvider chunkProvider) { + int x = chunkX * 16; + int z = chunkZ * 16; + switch (world.provider.getDimension()) { + case -1: + nether(random, x, z, world); + break; + case 0: + world(random, x, z, world); + if (!net.minecraft.server.MinecraftServer.getAllowNether()) { + /** worldNetherless generates nether/end ores in overworld */ + worldNetherless(random, x, z, world); + } + break; + case 1: + end(random, x, z, world); + break; + default: + if (!blackList.contains(world.provider.getDimension())) + other(random, x, z, world); + break; + } + } +}