Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Make custom dimension that is based on the nether a surface world
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
ThanosGecko

Make custom dimension that is based on the nether a surface world

By ThanosGecko, April 3, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

ThanosGecko    0

ThanosGecko

ThanosGecko    0

  • Tree Puncher
  • ThanosGecko
  • Members
  • 0
  • 5 posts
Posted April 3, 2020

I basically copy pasted all the code necessary for a dimension based on the Nether, but I'm now trying to figure out how to make it have an open top/roof. I tried overriding isSurfaceWorld, but that doesn't seem to work. Any ideas?

  • Quote

Share this post


Link to post
Share on other sites

imacatlolol    60

imacatlolol

imacatlolol    60

  • Diamond Finder
  • imacatlolol
  • Forge Modder
  • 60
  • 274 posts
Posted April 3, 2020

You would need to override createChunkGenerator and return your own chunk generator that generates terrain in the way that you want.

It's not a simple process, but if you study how vanilla does it then you should get an idea of what to do.

  • Quote

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

Share this post


Link to post
Share on other sites

ThanosGecko    0

ThanosGecko

ThanosGecko    0

  • Tree Puncher
  • ThanosGecko
  • Members
  • 0
  • 5 posts
Posted April 3, 2020
43 minutes ago, imacatlolol said:

You would need to override createChunkGenerator and return your own chunk generator that generates terrain in the way that you want.

It's not a simple process, but if you study how vanilla does it then you should get an idea of what to do.

I've already made my own chunk generator and all that, but the vanilla code is super confusing and like 90% of the variables are obfuscated even with updated mappings. Also it's a crap ton of math functions that I don't think I could realistically comprehend.

  • Quote

Share this post


Link to post
Share on other sites

imacatlolol    60

imacatlolol

imacatlolol    60

  • Diamond Finder
  • imacatlolol
  • Forge Modder
  • 60
  • 274 posts
Posted April 3, 2020
16 minutes ago, ThanosGecko said:

I've already made my own chunk generator and all that, but the vanilla code is super confusing and like 90% of the variables are obfuscated even with updated mappings. Also it's a crap ton of math functions that I don't think I could realistically comprehend.

Well, here's a couple ideas to try:

  • To get rid of the roof bedrock you can override getBedrockRoofHeight to 0 in NetherGenSettings.
  • After that, try making your own CaveWorldCarver that works the same as NetherCaveWorldCarver, but with a higher maximum height so that it breaks through the top.

No idea if it'll work like you want, but it's worth trying. Experimentation is generally a good way to go.

  • Quote

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

Share this post


Link to post
Share on other sites

ThanosGecko    0

ThanosGecko

ThanosGecko    0

  • Tree Puncher
  • ThanosGecko
  • Members
  • 0
  • 5 posts
Posted April 3, 2020
12 hours ago, imacatlolol said:

Well, here's a couple ideas to try:

  • To get rid of the roof bedrock you can override getBedrockRoofHeight to 0 in NetherGenSettings.
  • After that, try making your own CaveWorldCarver that works the same as NetherCaveWorldCarver, but with a higher maximum height so that it breaks through the top.

No idea if it'll work like you want, but it's worth trying. Experimentation is generally a good way to go.

I've already done the bedrock thing, that works fine. The CaveWorldCarver is a biome specific thing, and I know it's not the thing that controls if there's a roof or not as I replaced my biome with an OceanBiome and it still had a roof. I'm fairly sure it's in either the chunk generator or the noise chunk generator, but both have like 4 methods that are incomprehensible.

  • Quote

Share this post


Link to post
Share on other sites

ThanosGecko    0

ThanosGecko

ThanosGecko    0

  • Tree Puncher
  • ThanosGecko
  • Members
  • 0
  • 5 posts
Posted April 3, 2020

It seems like it might be something in either this method:
 

public int func_222529_a(int p_222529_1_, int p_222529_2_, Heightmap.Type heightmapType) {
		int i = Math.floorDiv(p_222529_1_, this.horizontalNoiseGranularity);
		int j = Math.floorDiv(p_222529_2_, this.horizontalNoiseGranularity);
		int k = Math.floorMod(p_222529_1_, this.horizontalNoiseGranularity);
		int l = Math.floorMod(p_222529_2_, this.horizontalNoiseGranularity);
		double d0 = (double)k / (double)this.horizontalNoiseGranularity;
		double d1 = (double)l / (double)this.horizontalNoiseGranularity;
		double[][] adouble = new double[][]{this.func_222547_b(i, j), this.func_222547_b(i, j + 1), this.func_222547_b(i + 1, j), this.func_222547_b(i + 1, j + 1)};
		int i1 = this.getSeaLevel();

		for(int j1 = this.noiseSizeY - 1; j1 >= 0; --j1) {
			double d2 = adouble[0][j1];
			double d3 = adouble[1][j1];
			double d4 = adouble[2][j1];
			double d5 = adouble[3][j1];
			double d6 = adouble[0][j1 + 1];
			double d7 = adouble[1][j1 + 1];
			double d8 = adouble[2][j1 + 1];
			double d9 = adouble[3][j1 + 1];

			for(int k1 = this.verticalNoiseGranularity - 1; k1 >= 0; --k1) {
				double d10 = (double)k1 / (double)this.verticalNoiseGranularity;
				double d11 = MathHelper.lerp3(d10, d0, d1, d2, d6, d4, d8, d3, d7, d5, d9);
				int l1 = j1 * this.verticalNoiseGranularity + k1;
				if (d11 > 0.0D || l1 < i1) {
					BlockState blockstate;
					if (d11 > 0.0D) {
						blockstate = this.defaultBlock;
					} else {
						blockstate = this.defaultFluid;
					}

					if (heightmapType.getHeightLimitPredicate().test(blockstate)) {
						return l1 + 1;
					}
				}
			}
		}

		return 0;
	}

 

 

or this method:

 

public void generateSurface(IChunk chunkIn) {
		ChunkPos chunkpos = chunkIn.getPos();
		int i = chunkpos.x;
		int j = chunkpos.z;
		SharedSeedRandom sharedseedrandom = new SharedSeedRandom();
		sharedseedrandom.setBaseChunkSeed(i, j);
		ChunkPos chunkpos1 = chunkIn.getPos();
		int k = chunkpos1.getXStart();
		int l = chunkpos1.getZStart();
		double d0 = 0.0625D;
		Biome[] abiome = chunkIn.getBiomes();

		for(int i1 = 0; i1 < 16; ++i1) {
			for(int j1 = 0; j1 < 16; ++j1) {
				int k1 = k + i1;
				int l1 = l + j1;
				int i2 = chunkIn.getTopBlockY(Heightmap.Type.WORLD_SURFACE_WG, i1, j1) + 1;
				double d1 = this.surfaceDepthNoise.noiseAt((double)k1 * 0.0625D, (double)l1 * 0.0625D, 0.0625D, (double)i1 * 0.0625D);
				abiome[j1 * 16 + i1].buildSurface(sharedseedrandom, chunkIn, k1, l1, i2, d1, this.getSettings().getDefaultBlock(), this.getSettings().getDefaultFluid(), this.getSeaLevel(), this.world.getSeed());
			}
		}

		this.makeBedrock(chunkIn, sharedseedrandom);
	}

 

 

But I'm not sure what to change

  • Quote

Share this post


Link to post
Share on other sites

ThanosGecko    0

ThanosGecko

ThanosGecko    0

  • Tree Puncher
  • ThanosGecko
  • Members
  • 0
  • 5 posts
Posted April 3, 2020

Alright I ended up commenting out random lines of code and one of them worked lmao. For anybody else that might need this in the future, I just commented out this line in the ChunkGenerator:

private double[] func_222572_j() {
		double[] adouble = new double[this.noiseSizeY()];

		for(int i = 0; i < this.noiseSizeY(); ++i) {
			adouble[i] = Math.cos((double)i * Math.PI * 6.0D / (double)this.noiseSizeY()) * 2.0D;
			double d0 = (double)i;
			if (i > this.noiseSizeY() / 2) {
				d0 = (double)(this.noiseSizeY() - 1 - i);
			}

			if (d0 < 4.0D) {
				d0 = 4.0D - d0;
				//adouble[i] -= d0 * d0 * d0 * 10.0D;
			}
		}

		return adouble;
	}

 

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • ThisIsNotOriginal
      Error at load_registries event phase

      By ThisIsNotOriginal · Posted 44 minutes ago

      The pastebin for the log and Registry Event is posted below this text.   https://pastebin.com/KEzJvRgG https://pastebin.com/VUrXR94k
    • PlasmaPig13
      The game crashed whilst rendering overlay Error: java.lang.NullPointerException: Rendering overlay Exit Code: -1

      By PlasmaPig13 · Posted 49 minutes ago

      Here's the crash report and the loglatest.log crash-2021-03-02_19.33.58-client.txt
    • PlasmaPig13
      The game crashed whilst rendering overlay Error: java.lang.NullPointerException: Rendering overlay Exit Code: -1

      By PlasmaPig13 · Posted 54 minutes ago

      I'm using 1.14.4 forge version 28.2.23 and the game crashes with the title's error message. Also, I'm new here; how do I paste the log? 
    • LexManos
      The vanilla tag system isnt suitable for ore dictionary

      By LexManos · Posted 54 minutes ago

      You can also use conditionals, However empty tags are probably the best way to go. Data gens make any argument of being hard to use moot. So there is nothing we need to do in this reguard.
    • Ilikecheese
      forge 1.16.5 wont show up

      By Ilikecheese · Posted 1 hour ago

      I downloaded forge 1.16.5 but it doesn't show up in my installations, the modded box is checked of and its not there if I try to create it idk what to do
  • Topics

    • ThisIsNotOriginal
      0
      Error at load_registries event phase

      By ThisIsNotOriginal
      Started 39 minutes ago

    • PlasmaPig13
      1
      The game crashed whilst rendering overlay Error: java.lang.NullPointerException: Rendering overlay Exit Code: -1

      By PlasmaPig13
      Started 49 minutes ago

    • EnderiumSmith
      3
      The vanilla tag system isnt suitable for ore dictionary

      By EnderiumSmith
      Started 14 hours ago

    • Ilikecheese
      0
      forge 1.16.5 wont show up

      By Ilikecheese
      Started 1 hour ago

    • GhostGamesFSM
      0
      1.16 Ore generation.

      By GhostGamesFSM
      Started 1 hour ago

  • Who's Online (See full list)

    • Radical
    • ThisIsNotOriginal
    • A1ixir
    • WaromiV
    • Tavi007
    • fluiX
    • Paperbagwastaken
    • fallOut015
    • duracell00122@gmail.com
    • Ilikecheese
    • louvenoir
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Make custom dimension that is based on the nether a surface world
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community