From 66971b3310cbca7ca98d20baa7475338338f376d Mon Sep 17 00:00:00 2001 From: Lazzzycatwastaken Date: Wed, 27 Aug 2025 17:36:40 +0200 Subject: [PATCH] SIX @SEVEN --- src/main/java/com/hbm/util/LootGenerator.java | 14 +++++ .../com/hbm/world/gen/NTMWorldGenerator.java | 51 +++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/src/main/java/com/hbm/util/LootGenerator.java b/src/main/java/com/hbm/util/LootGenerator.java index cee32e713..a91ec0e3a 100644 --- a/src/main/java/com/hbm/util/LootGenerator.java +++ b/src/main/java/com/hbm/util/LootGenerator.java @@ -29,6 +29,7 @@ public class LootGenerator { public static final String LOOT_GLYPHID_HIVE = "LOOT_GLYPHID_HIVE"; public static final String LOOT_METEOR = "LOOT_METEOR"; public static final String LOOT_FLAREGUN = "LOOT_FLAREGUN"; + public static final String LOOT_SHIT = "LOOT_SHIT"; public static void applyLoot(World world, int x, int y, int z, String name) { switch(name) { @@ -42,6 +43,7 @@ public class LootGenerator { case LOOT_GLYPHID_HIVE: lootGlyphidHive(world, x, y, z); case LOOT_METEOR: lootBookMeteor(world, x, y, z); case LOOT_FLAREGUN: lootFlareGun(world, x, y, z); + case LOOT_SHIT: lootShit(world, x, y, z); default: lootBones(world, x, y, z); break; } } @@ -233,4 +235,16 @@ public class LootGenerator { 0.25, k * 0.03125, 0.125); } } + public static void lootShit(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) + 3; + for(int i = 0; i < limit; i++) { + addItemWithDeviation(loot, world.rand, ItemPool.getStack(ItemPool.getPool(ItemPoolsPile.POOL_PILE_OF_GARBAGE), 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 049428707..3fcb7e903 100644 --- a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -113,6 +113,57 @@ public class NTMWorldGenerator implements IWorldGenerator { spawnWeight = 1; }}); + NBTStructure.registerStructure(0, new SpawnCondition("ruin1") {{ + canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); + structure = new JigsawPiece("NTMRuinsA", StructureManager.ntmruinsA, -1) {{conformToTerrain = true;}}; + spawnWeight = 20; + }}); + NBTStructure.registerStructure(0, new SpawnCondition("ruin2") {{ + canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); + structure = new JigsawPiece("NTMRuinsB", StructureManager.ntmruinsB, -1) {{conformToTerrain = true;}}; + spawnWeight = 25; + }}); + NBTStructure.registerStructure(0, new SpawnCondition("ruin3") {{ + canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); + structure = new JigsawPiece("NTMRuinsC", StructureManager.ntmruinsC, -1) {{conformToTerrain = true;}}; + spawnWeight = 25; + }}); + NBTStructure.registerStructure(0, new SpawnCondition("ruin4") {{ + canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); + structure = new JigsawPiece("NTMRuinsD", StructureManager.ntmruinsD, -1) {{conformToTerrain = true;}}; + spawnWeight = 30; + }}); + NBTStructure.registerStructure(0, new SpawnCondition("ruin5") {{ + canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); + structure = new JigsawPiece("NTMRuinsE", StructureManager.ntmruinsE, -1) {{conformToTerrain = true;}}; + spawnWeight = 30; + }}); + NBTStructure.registerStructure(0, new SpawnCondition("ruin6") {{ + canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); + structure = new JigsawPiece("NTMRuinsF", StructureManager.ntmruinsF, -1) {{conformToTerrain = true;}}; + spawnWeight = 50; + }}); + NBTStructure.registerStructure(0, new SpawnCondition("ruin7") {{ + canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); + structure = new JigsawPiece("NTMRuinsG", StructureManager.ntmruinsG, -1) {{conformToTerrain = true;}}; + spawnWeight = 50; + }}); + NBTStructure.registerStructure(0, new SpawnCondition("ruin8") {{ + canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); + structure = new JigsawPiece("NTMRuinsH", StructureManager.ntmruinsH, -1) {{conformToTerrain = true;}}; + spawnWeight = 50; + }}); + NBTStructure.registerStructure(0, new SpawnCondition("ruin9") {{ + canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); + structure = new JigsawPiece("NTMRuinsI", StructureManager.ntmruinsI, -1) {{conformToTerrain = true;}}; + spawnWeight = 50; + }}); + NBTStructure.registerStructure(0, new SpawnCondition("ruin10") {{ + canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); + structure = new JigsawPiece("NTMRuinsJ", StructureManager.ntmruinsJ, -1) {{conformToTerrain = true;}}; + spawnWeight = 35; + }}); + NBTStructure.registerNullWeight(0, 2, biome -> biome == BiomeGenBase.plains); NBTStructure.registerNullWeight(0, 2, oceanBiomes::contains);