diff --git a/src/main/java/com/hbm/itempool/ItemPoolsPile.java b/src/main/java/com/hbm/itempool/ItemPoolsPile.java index 8c303556c..a0e414951 100644 --- a/src/main/java/com/hbm/itempool/ItemPoolsPile.java +++ b/src/main/java/com/hbm/itempool/ItemPoolsPile.java @@ -30,6 +30,7 @@ public class ItemPoolsPile { public static final String POOL_PILE_OF_GARBAGE = "POOL_PILE_OF_GARBAGE"; public static final String POOL_PILE_MECHANICAL = "POOL_PILE_MECHANICAL"; public static final String POOL_PILE_GEAR = "POOL_PILE_GEAR"; + public static final String POOL_PILE_SUPPLIES = "POOL_PILE_SUPPLIES"; public static void init() { @@ -173,5 +174,17 @@ public class ItemPoolsPile { weighted(ModItems.taurun_boots, 0, 1, 1, 20) }; }}; + + new ItemPool(POOL_PILE_SUPPLIES) {{ + this.pool = new WeightedRandomChestContent[] { + weighted(ItemGrenadeUniversal.make(EnumGrenadeShell.FRAG, EnumGrenadeFilling.HE, EnumGrenadeFuze.S3, EnumGrenadeExtra.FRAG_SLEEVE), 3, 5, 10), + weighted(ItemGrenadeUniversal.make(EnumGrenadeShell.FRAG, EnumGrenadeFilling.HE, EnumGrenadeFuze.S3, EnumGrenadeExtra.FRAG_SLEEVE), 3, 5, 10), + weighted(ItemGrenadeUniversal.make(EnumGrenadeShell.FRAG, EnumGrenadeFilling.HE, EnumGrenadeFuze.S3, EnumGrenadeExtra.FRAG_SLEEVE), 3, 5, 10), + weighted(ModItems.syringe_metal_stimpak, 0, 3, 5, 30), + weighted(ModItems.syringe_metal_psycho, 0, 3, 5, 30), + weighted(ModItems.syringe_antidote, 0, 1, 2, 30), + weighted(ModItems.ammo_container, 0, 2, 3, 40) + }; + }}; } } diff --git a/src/main/java/com/hbm/util/LootGenerator.java b/src/main/java/com/hbm/util/LootGenerator.java index 77bc6d2a0..9ad983f1c 100644 --- a/src/main/java/com/hbm/util/LootGenerator.java +++ b/src/main/java/com/hbm/util/LootGenerator.java @@ -32,6 +32,7 @@ public class LootGenerator { public static final String LOOT_SHIT = "LOOT_SHIT"; public static final String LOOT_MECHANICAL = "LOOT_MECHANICAL"; public static final String LOOT_GEAR = "LOOT_GEAR"; + public static final String LOOT_SUPPLIES = "LOOT_SUPPLIES"; public static void applyLoot(World world, int x, int y, int z, String name) { switch(name) { @@ -47,7 +48,8 @@ public class LootGenerator { case LOOT_FLAREGUN: lootFlareGun(world, x, y, z); case LOOT_SHIT: lootShit(world, x, y, z); case LOOT_MECHANICAL: lootMechanical(world, x, y, z); - case LOOT_GEAR: lootMechanical(world, x, y, z); + case LOOT_GEAR: lootGear(world, x, y, z); + case LOOT_SUPPLIES: lootSupplies(world, x, y, z); default: lootBones(world, x, y, z); break; } } @@ -65,8 +67,10 @@ public class LootGenerator { LOOT_METEOR, LOOT_FLAREGUN, LOOT_MECHANICAL, - LOOT_GEAR, LOOT_SHIT, + LOOT_GEAR, + LOOT_SUPPLIES + }; } @@ -280,4 +284,17 @@ public class LootGenerator { } } } + + public static void lootSupplies(World world, int x, int y, int z) { + + TileEntityLoot loot = (TileEntityLoot) world.getTileEntity(x, y, z); + + if(loot != null && loot.items.isEmpty()) { + + int limit = world.rand.nextInt(3) + 4; + for(int i = 0; i < limit; i++) { + addItemWithDeviation(loot, world.rand, ItemPool.getStack(ItemPool.getPool(ItemPoolsPile.POOL_PILE_SUPPLIES), world.rand), world.rand.nextDouble() - 0.5, i * 0.03125, world.rand.nextDouble() - 0.5); + } + } + } } diff --git a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java index 051b11d1e..2c2e79b87 100644 --- a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -34,12 +34,12 @@ import net.minecraftforge.event.world.WorldEvent; public class NTMWorldGenerator implements IWorldGenerator { boolean regTest = false; - + /** Includes all biomes tagged as ocean or river */ public static boolean isWaterBiome(BiomeGenBase biome) { return BiomeDictionary.isBiomeOfType(biome, Type.WATER); } - + /** Includes biomes with little height variation and sparse vegetation, excludes water biomes */ public static boolean isFlatBiome(BiomeGenBase biome) { return biome.heightVariation <= 0.2F && !isWaterBiome(biome) && BiomeDictionary.isBiomeOfType(biome, Type.SPARSE); @@ -144,17 +144,17 @@ public class NTMWorldGenerator implements IWorldGenerator { }}); NBTStructure.registerStructure(0, new SpawnCondition("factory") {{ - canSpawn = biome -> isFlatBiome(biome); + canSpawn = biome -> biome.heightVariation <= 0.2F && !isWaterBiome(biome); structure = new JigsawPiece("factory", StructureManager.factory, -10); spawnWeight = StructureConfig.factorySpawnWeight; }}); NBTStructure.registerStructure(0, new SpawnCondition("crane") {{ - canSpawn = biome -> isFlatBiome(biome); - structure = new JigsawPiece("crane", StructureManager.crane, -9); + canSpawn = biome -> biome.heightVariation <= 0.2F && !isWaterBiome(biome); + structure = new JigsawPiece("crane", StructureManager.crane, -13); spawnWeight = StructureConfig.craneSpawnWeight; }}); - + NBTStructure.registerStructure(0, new SpawnCondition("broadcaster_tower") {{ canSpawn = biome -> isFlatBiome(biome); structure = new JigsawPiece("broadcaster_tower", StructureManager.broadcasting_tower, -9); diff --git a/src/main/resources/assets/hbm/structures/crane_mod.nbt b/src/main/resources/assets/hbm/structures/crane_mod.nbt index fe86cd9b0..bd2743c58 100644 Binary files a/src/main/resources/assets/hbm/structures/crane_mod.nbt and b/src/main/resources/assets/hbm/structures/crane_mod.nbt differ