# [1.10.2] Underground structure generation problem

## Recommended Posts

So i'm trying to spawn a structure underground but the problem is that is too common, despite i give it a really low chance of spawn. This is the code i'm using in the WorldGenerator class

```if (world.getBiomeGenForCoords(new BlockPos(x, 30, z)).equals(Biomes.ICE_MOUNTAINS)
|| world.getBiomeGenForCoords(new BlockPos(x, 30, z)).equals(Biomes.ICE_PLAINS)
|| world.getBiomeGenForCoords(new BlockPos(x, 30, z)).equals(Biomes.MUTATED_ICE_FLATS)
|| world.getBiomeGenForCoords(new BlockPos(x, 30, z)).equals(MWWorld.arctic)
|| world.getBiomeGenForCoords(new BlockPos(x, 30, z)).equals(MWWorld.iceHills)
&& random.nextInt(1000) == 1) {
int randPosX = x + random.nextInt(35);
int randPosZ = z + random.nextInt(35);
int randPosY = 30 + random.nextInt(10);
BlockPos position = new BlockPos(randPosX, randPosY, randPosZ);
if (!(world.getBlockState(position).getBlock().equals(Blocks.WATER)))
new WorldGenIceDungeon(position, world);
}
```

And this is the amount of structures that are generated

As you can see there are too much of this. So how can i spawn the structure with the properly rarity?

Don't blame me if i always ask for your help. I just want to learn to be better

##### Share on other sites

By having them unwrapped it does this:

`if (world.getBiomeGenForCoords(new BlockPos(x, 30, z)).equals(Biomes.ICE_MOUNTAINS)...`

"Hmm, is it ice mountains?  Yes, yes it is.  This whole statement evaluates to true."

A || B && C ≡ A || (B && C)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

DO NOT PM ME WITH PROBLEMS. No help will be given.

##### Share on other sites

*facepalm* totally forgot the wrap! And that's why i should never program when i'm sick, that was a really dumb "error" Thanks for pointed it out, now it works

Don't blame me if i always ask for your help. I just want to learn to be better

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• ### Posts

• One of the mods has an invalid animation json - but this mod is not mentioned Start with GeckoLib and AzureLib and the mods requiring it If this works, add the rest of your mods one by one or in groups until you find the one, causing this issue
• Your new LanguageManager() is not the language manager that is being used when you call Minecraft.getInstant().getLocale(). Minecraft.getLanguageManager().setSelected(code);  should work.  Can you show that code?
• My game keeps crashing due to rendering overlay and blames either geckolib 4 or azurelib, does anyone know a fix? This is the error: https://paste.ee/p/X3tZ8
• Hello, I got some code that won't register in Forge (MC=1.20.4), (FML=49.0.30) (It basically iterates through an array all supported Minecraft languages and picks at random one and reloads ResourceManager with it:     List<String> languageCountryCodes = new ArrayList<>(); Collections.addAll(languageCountryCodes, "af_za", "ara_sa", "ast_es", "aze_az", "bak_ru", "bar_de", "bel_by", "bul_bg", "bre_fr", "qbr_nl", "bos_ba", "cat_es", "ces_cz", "cym_gb", "dan_dk", "bar_at", "gsw_ch", "deu_de", "ell_gr", "eng_au", "eng_ca", "eng_gb", "eng_nz", "qpe", "eng_qabs_gb", "en_ud", "epo", "spa_ar", "spa_cl", "spa_ec", "spa_es", "spa_mx", "spa_uy", "spa_ve", "spa_es_an", "est_ee", "eus_es", "fas_ir", "fin_fi", "fil_ph", "fao_fo", "fra_ca", "fra_fr", "fra_de", "fur_it", "fry_nl", "gle_ie", "gla_gb", "glg_es", "haw_us", "heb_il", "hin_in", "hrv_hr", "hun_hu", "hye_am", "id_id", "ibo_ng", "is_is", "qis", "ita_it", "jpn_jp", "jbo", "kat_ge", "kaz_kz", "kan_in", "kor_kr", "ksh_de", "kw_gb", "lat_va", "ltz_lu", "lim_nl", "lmo_it", "lao_la", "qll", "lit_lt", "lav_lv", "lzh", "mkd_mk", "mon_mn", "zlm_my", "mlt_mt", "nhe_mx", "vmf_de", "msa_my", "mlg_mg", "mar_in", "nld_be", "nld_nl", "nno_no", "nob_no", "quc_latn_gt", "pol_pl", "por_br", "por_pt", "qya", "ro_ro", "qpr", "rus_ru", "srp_latn_rs", "srp_cyrl_rs", "swe_se", "slk_sk", "slv_si", "som_so", "sqi_al", "ckb_ir", "sr_sp", "swa_ke", "swh_tz", "tam_in", "tha_th", "tgk_tj", "uig_cn", "ukr_ua", "urd_pk", "uzb_uz", "ven_za", "cymr", "xho_za", "yor_ng", "yue_hk", "zho_hans_cn", "zho_hant_hk", "zho_hant_tw"); // Shuffle the list Collections.shuffle(languageCountryCodes); // Print one code at a time for (String code : languageCountryCodes) { LanguageManager languageManager = new LanguageManager(code); languageManager.onResourceManagerReload(TroubleshootingMod.getResourceManager()); System.out.println(Minecraft.getInstance().getLocale()); System.out.println(code); break; // Exit the loop after printing one code } Minecraft.getInstance().getLanguageManager().setSelected("bar_de"); also does not appear to be functional..   Kind regards, Ensamisten

• ### Who's Online (See full list)

×

• #### Activity

×
• Create New...