Merge pull request #2402 from Lazzzycatwastaken/Radio-house

Radio rework (shocker)
This commit is contained in:
HbmMods 2025-08-31 12:57:42 +02:00 committed by GitHub
commit 1be5127582
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 22 additions and 15 deletions

View File

@ -81,7 +81,7 @@ public class WorldConfig {
public static boolean enableSulfurCave = true;
public static boolean enableAsbestosCave = true;
public static int radioStructure = 500;
// public static int radioStructure = 500;
public static int antennaStructure = 250;
public static int atomStructure = 500;
public static int dungeonStructure = 64;
@ -204,7 +204,7 @@ public class WorldConfig {
enableAsbestosCave = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.C01_enableAsbestosCave", "Toggles asbestos caves", true);
final String CATEGORY_DUNGEON = CommonConfig.CATEGORY_DUNGEONS;
radioStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.00_radioSpawn", "Spawn radio station on every nTH chunk", 500);
// radioStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.00_radioSpawn", "Spawn radio station on every nTH chunk", 500);
antennaStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.01_antennaSpawn", "Spawn antenna on every nTH chunk", 250);
atomStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.02_atomSpawn", "Spawn power plant on every nTH chunk", 500);
dungeonStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.04_dungeonSpawn", "Spawn library dungeon on every nTH chunk", 64);
@ -245,7 +245,7 @@ public class WorldConfig {
craterBiomeOuterRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_BIOMES, "17.R02_craterBiomeOuterRad", "RAD/s for the outer crater biome", 0.5D);
craterBiomeWaterMult = (float) CommonConfig.createConfigDouble(config, CATEGORY_BIOMES, "17.R03_craterBiomeWaterMult", "Multiplier for RAD/s in crater biomes when in water", 5D);
radioStructure = CommonConfig.setDefZero(radioStructure, 1000);
// radioStructure = CommonConfig.setDefZero(radioStructure, 1000);
antennaStructure = CommonConfig.setDefZero(antennaStructure, 1000);
atomStructure = CommonConfig.setDefZero(atomStructure, 1000);
dungeonStructure = CommonConfig.setDefZero(dungeonStructure, 1000);

View File

@ -223,17 +223,17 @@ public class HbmWorldGen implements IWorldGenerator {
}
}
if(biome == BiomeGenBase.plains || biome == BiomeGenBase.desert) {
if(WorldConfig.radioStructure > 0 && rand.nextInt(WorldConfig.radioStructure) == 0) {
for(int a = 0; a < 1; a++) {
int x = i + rand.nextInt(16);
int z = j + rand.nextInt(16);
int y = world.getHeightValue(x, z);
new Radio01().generate(world, rand, x, y, z);
}
}
}
// if(biome == BiomeGenBase.plains || biome == BiomeGenBase.desert) {
// if(WorldConfig.radioStructure > 0 && rand.nextInt(WorldConfig.radioStructure) == 0) {
// for(int a = 0; a < 1; a++) {
// int x = i + rand.nextInt(16);
// int z = j + rand.nextInt(16);
// int y = world.getHeightValue(x, z);
//
// new Radio01().generate(world, rand, x, y, z);
// }
// }
// }
if(biome.temperature >= 0.4F && biome.rainfall <= 0.6F) {
if(WorldConfig.antennaStructure > 0 && rand.nextInt(WorldConfig.antennaStructure) == 0) {

View File

@ -53,7 +53,6 @@ public class StructureManager {
public static final NBTStructure vertibird = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/vertibird.nbt"));
public static final NBTStructure crashed_vertibird = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/crashed-vertibird.nbt"));
public static final NBTStructure aircraft_carrier = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/aircraft_carrier.nbt"));
@ -61,6 +60,7 @@ public class StructureManager {
public static final NBTStructure beached_patrol = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/beached_patrol.nbt"));
public static final NBTStructure lighthouse = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/lighthouse.nbt"));
public static final NBTStructure dish = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/dish.nbt"));
public static final NBTStructure radio_house = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/radio_house.nbt"));
public static final NBTStructure spire = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/spire.nbt"));

View File

@ -40,6 +40,7 @@ public class NTMWorldGenerator implements IWorldGenerator {
final List<BiomeGenBase> oceanBiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.ocean, BiomeGenBase.deepOcean });
final List<BiomeGenBase> beachBiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.beach, BiomeGenBase.stoneBeach, BiomeGenBase.coldBeach });
final List<BiomeGenBase> lighthouseBiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.ocean, BiomeGenBase.deepOcean, BiomeGenBase.beach, BiomeGenBase.stoneBeach, BiomeGenBase.coldBeach });
final List<BiomeGenBase> flatbiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.plains, BiomeGenBase.icePlains, BiomeGenBase.desert });
/// SPIRE ///
NBTStructure.registerStructure(0, new SpawnCondition("spire") {{
@ -113,6 +114,12 @@ public class NTMWorldGenerator implements IWorldGenerator {
spawnWeight = 1;
}});
NBTStructure.registerStructure(0, new SpawnCondition("radio") {{
canSpawn = flatbiomes::contains;
structure = new JigsawPiece("radio_house", StructureManager.radio_house, -6);
spawnWeight = 30;
}});
NBTStructure.registerNullWeight(0, 2, biome -> biome == BiomeGenBase.plains);
NBTStructure.registerNullWeight(0, 2, oceanBiomes::contains);