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

    • monkeysHK
      [1.16] Transparent Picture Render in GUI

      By monkeysHK · Posted 3 minutes ago

      Hi. I tried translucent_transparency. I copied code from it to setup and clear the renderstate. Still doesn't work, texture is not transparent. Am I missing something?   minecraft.getTextureManager().bindTexture(TEXTURE_LOC); matrixStack.push(); { RenderSystem.enableBlend(); RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); RenderSystem.blendColor(1f, 1f, 1f, 0.5f); matrixStack.translate(instru_pos[currentNbo.ordinal()][0], instru_pos[currentNbo.ordinal()][1], 0); matrixStack.scale((255/20f)*scale, (255/20f)*scale, (255/20f)*scale); this.blit(matrixStack, 0, 0, 0, 146, 20, 20); RenderSystem.disableBlend(); RenderSystem.defaultBlendFunc(); } matrixStack.pop();  
    • CookieLukas
      Tessellator ignores lighting?

      By CookieLukas · Posted 5 minutes ago

      Im trying to render a simple plane with the following code:   GL11.glPushMatrix(); GL11.glTranslated(-doubleX, -doubleY, -doubleZ); ResourceLocation texture = new ResourceLocation(ExampleMod.MODID, "debug.png"); mc.renderEngine.bindTexture(texture); Tessellator tessellator = Tessellator.getInstance(); VertexBuffer bufferbuilder = tessellator.getBuffer(); GL11.glEnable(GL11.GL_TEXTURE_2D); bufferbuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); bufferbuilder.pos(x, y + 1.1, z + 1.0D).tex(0, 1).endVertex(); bufferbuilder.pos(x + 1.0D, y + 1.1, z + 1.0D).tex(1, 1).endVertex(); bufferbuilder.pos(x + 1.0D, y + 1.1, z).tex(1, 0).endVertex(); bufferbuilder.pos(x, y + 1.1, z).tex(0, 0).endVertex(); GL11.glEnd(); tessellator.draw(); GlStateManager.popMatrix(); It renders the plane perfectly, but it just completly ignores lighting. I tried stuff like GlStateManager.enableLighting(); but I cant get it work. Also, some textures like staind glass or water wont render in from of it. How can I fix those issues? Thanks in advance -Lukas  
    • ChampionAsh5357
      The import net cannot be resolved

      By ChampionAsh5357 · Posted 26 minutes ago

      Please link a paste to the gradle log from the erroring build process.
    • buffalobob
      Forge opening in Internet Explorer instead of Java

      By buffalobob · Posted 46 minutes ago

      I will literally make out with you I was struggling with this for two hours and you fixed it papi chulo I love you
    • diesieben07
      [1.15.2] Render as 2D icon in GUI, 3D model in hand

      By diesieben07 · Posted 1 hour ago

      The loader is an inner class: https://github.com/MinecraftForge/MinecraftForge/blob/1.16.x/src/main/java/net/minecraftforge/client/model/SeparatePerspectiveModel.java#L164   You need to register the loader (see where Forge does it). Then the loader will be called to load the JSON model into memory.
  • Topics

    • monkeysHK
      4
      [1.16] Transparent Picture Render in GUI

      By monkeysHK
      Started Yesterday at 12:19 AM

    • CookieLukas
      0
      Tessellator ignores lighting?

      By CookieLukas
      Started 5 minutes ago

    • me1
      25
      The import net cannot be resolved

      By me1
      Started March 29, 2020

    • Stinkerpot
      5
      Forge opening in Internet Explorer instead of Java

      By Stinkerpot
      Started March 8, 2016

    • Woodside
      10
      [1.15.2] Render as 2D icon in GUI, 3D model in hand

      By Woodside
      Started 21 hours ago

  • Who's Online (See full list)

    • kmann383
    • stegii
    • CookieLukas
    • EveryDayThief
    • JoieNL
    • diesieben07
    • jbredwards
    • T1ps
    • DavidQF555
    • vemerion
    • Martinjanning@web.de
    • bananapizzuh
    • ChampionAsh5357
    • Heinzchen
  • 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