Jump to content

Allow custom world types to generate up to a height of 255


Two

Recommended Posts

As the title says: I'd love to be able to allow custom world types to be able to generate worlds with a height of 256. The changes necessary are actually very simple and I tried them already by modifying vanilla code. The following (hand written) patch would modify the code so that both vanilla generation and 256 generation would be possible.

 

Chunk.java:131

- int var9 = par2ArrayOfByte[var6 << 11 | var7 << 7 | var8] & 0xFF;

+ int var9 = var5 == 256? par2ArrayOfByte[var6 << 12 | var7 << 8 | var8] & 0xFF : par2ArrayOfByte[var6 << 11 | var7 << 7 | var8] & 0xFF;

 

MapGenCaves.java:20

+ final int chunkDataHeight = par5ArrayOfByte.length / 256;

 

:137

- var45 = (var42 * 16 + var43) * 128 + var44;

+ var45 = (var42 * 16 + var43) * chunkDataHeight + var44;

 

:139

- if (var44 >= 0 && var44 < 128)

+ if (var44 >= 0 && var44 < chunkDataHeight)

 

:165

- int var48 = (var42 * 16 + var45) * 128 + var38;

+ int var48 = (var42 * 16 + var45) * chunkDataHeight + var38;

 

MapGenRavine.java:11

+ final int chunkDataHeight = par5ArrayOfByte.length / 256;

 

:124

- var44 = (var41 * 16 + var42) * 128 + var43;

+ var44 = (var41 * 16 + var42) * chunkDataHeight + var43;

 

:126

- if (var43 >= 0 && var43 < 128)

+ if (var43 >= 0 && var43 < chunkDataHeight)

 

:152

- int var47 = (var41 * 16 + var44) * 128 + var37;

+ int var47 = (var41 * 16 + var44) * chunkDataHeight + var37;

 

 

My Mods

 

New Dawn - A completely new terrain engine for Minecraft

TwoTility - Blocks and Items for a better Minecraft

TwoGraves - Keeps your items safe on death

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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

×   Pasted as rich text.   Restore formatting

  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.



×
×
  • Create New...

Important Information

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