Jump to content

NamelessDev

Members
  • Posts

    5
  • Joined

  • Last visited

NamelessDev's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. This was an excellent answer. Thank you. I actually have a BiomeSource and ChunkGenerator. My mod is supposed to clone the overworld to another dimension. With vanilla, by listening for all available biomes at the start, I just get them, use BiomeBuilder to replace some of their settings, and register them as mine. During run time for world gen, I relay chunk generation to my cloned version of the vanilla ChunkGenerator which leads to an exact replica of the overworld, with a little bit of spooky environment added in. The problem here of course is datapack biomes aren't registered the same way. Ideally, my mod would always clone your (the users) overworld. For my personal purposes, copy-pasting terralith is fine but... it leaves something to be desired from the mod itself. Is there anyway I can get the datapack biomes on world creation and perform my cloning operation on them and then save them in the world as you mentioned? Additionally, here is my working code: @Override public Holder<Biome> getNoiseBiome(int x, int y, int z, Climate.Sampler sampler) { var overworld = TUDChunkGenerator.GET_OVERWORLD_CHUNK_GEN().getBiomeSource().getNoiseBiome(x, y, z, sampler); var tud = Registration.TUD_BIOME_KEYS.get(overworld.value().getRegistryName().getPath()); if(tud != null) return getBiomeRegistry().getHolderOrThrow(tud); else return overworld; } While this works, as you can see, if it found a cloned biome, it uses the clone. If it did not (either because another mod loaded after it, or a datapack adds in data), it simply relays the overworld ChunkGenerator. This is not ideal and does not clone as well as it does when I have the biomes registered before hand. I am open to alternative solutions, if needed.
  2. Using ForgeRegistries.Biomes, after adding a TOML dependency to load AFTER Terralith, I realized it is (according to the author) "a datapack wrapped as a mod." I am guessing datapacks are only enabled at the start of a world as Terraliths biomes are not registered in the main menu at all. My mod needs to clone and modify all biomes in a level. How can this be done?
  3. Solved. Using an access modifer to change what is clearly the original function: DimensionType private static float[] fillBrightnessRamp(float pLight) { float[] afloat = new float[16]; for(int i = 0; i <= 15; ++i) { float f = (float)i / 15.0F; float f1 = f / (4.0F - 3.0F * f); afloat = Mth.lerp(pLight, f1, 1.0F); } return afloat; }
  4. Hey Warjort, thanks for the answer but this field is simply a boolean. For clarity, below was the code from the past that actually let me give the lightness of the dimension a value. @Override protected void generateLightBrightnessTable() { float f = 0F; for (int i = 0; i <= 15; i++) { float f1 = 1F - i / 15F; float temp = (((1F - f1) / (f1 * 3F + 1F) * (1F - f) + f) / 5f) + 0.01f; lightBrightnessTable[i] = temp; } }
  5. Previously, in 1.12.2, we use to have WorldProvider.generateLightBrightnessTable(), but things have changed with WorldGen a lot since then! How do I go about controlling the lightness in a world or biome in 1.18.2? Edit 1: Changing has_skylight to false in the DimensionType Json gave okay results. Perhaps a custom Dimension Type class will solve this? EDIT 2 SOLUTION: See my answer below; TLDR DimensionType.fillBrightnessRamp() & DimensionType.brightnessRamp access modifier.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.