Jump to content

[SOLVED] [1.8] (Schematic reader, id too high for byte)


Recommended Posts

Posted

So I made a schematic reader that reads schematics..

It works, everything generates, but the only things

that doesn't generate are the walls..

 

I think the IDs are to high for the bytes or something..

Does someone have a solution for this?

 

Schematic

 

  Reveal hidden contents

 

 

ForestGen

 

  Reveal hidden contents

 

 

Registry stuff:

public static final Schematic FOREST_DUNGEON = new Schematic("ForestDungeon.schematic");

GameRegistry.registerWorldGenerator(new ForestGen(Main.FOREST_DUNGEON), 0);

 

Thanks for your support!

Posted
  On 9/12/2015 at 2:50 PM, DaryBob said:

everything generates, but the only things

that doesn't generate are the walls..

 

It works, but it doesn't.

 

1. While I am looking deeper - Ids can't be saved in byte[]. Ids expand much further.

  Quote

1.7.10 is no longer supported by forge, you are on your own.

Posted

Oh yeah, forget to mention the block object class I made.

 

BlockObject

 

  Reveal hidden contents

 

Posted

solved it..

 

int counter = 0;

for(int i = 0; i < height; i++) {

for(int j = 0; j < length; j++) {

for(int k = 0; k < width; k++) {

    int blockId = UnsignedBytes.toInt(blockIDs[counter]);

BlockPos pos = new BlockPos(k, i, j);

IBlockState state = Block.getBlockById(blockId).getStateFromMeta(metadata[counter]);

blockObjects[counter] = new BlockObject(pos, state);

counter++;

}

}

}

 

made an int blockId that returns blockIDs[counter].

Now it can generate blocks with higher ids.

 

Thanks to Resinresin for sharing he's code (just

took the part with the blockId and updated it

so it can run on forge 1.8).

http://www.minecraftforge.net/forum/index.php?topic=30800.0

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.

Announcements



×
×
  • Create New...

Important Information

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