4096 and beyond!

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord
Status
Not open for further replies.

Sadistical_satan

New Member
Jul 29, 2019
43
0
0
Hello, sorry if this post seems a little bit unorganized....

I had originally posted this on the minecraft forum's, but I figured I would double my odd's at getting some good intell from people whom are more into the modding scene than what I am currently capable of...

After doing some research on the ever growing popularity of mod's, I've run into a not so
uncommon problem.. It appears that Minecraft can only support 4096 block Id's.
So my question is, is there a way to go beyond that number?

After reading up on a multitude of forum's, I was met with some rather hostile
moderator's telling me that sort of thing was 'impossible' and that I should stop looking
into it...

But I think I may have found a way, two way's to be exact :)

My first experiment involved modifying the Anvil file format.
This was done by modding the 'Minecraft Anvil converter' source, changing the number of
available bit's in the data layer from 4 to 8, (the minecraft anvil converter is much
easier to use as it will automatically inject and recompile the format code). However,I
may have overlooked some code as the game refused to launch. After I had decompiled my
newly created format file I did find that the bit's were in fact increased to 8 like I
had intended, so my plan didn't actually fail after all, it just need's to be refined a
little bit.
Even if I were to get my new custom format to work, I'll more than likely have to create
a new launcher to utilise the extra bit's, that is unless I create a mod that reformat's
the current format to the new 'custom one', then I can use forge as a spearhead...


The second way is just a theory, it revolves around the way minecraft creates file's and
store's data in them. In the event that I (we) cannot modify the Anvil format to suit our
modding need's, then why not create a mod that create's a second or 'dummy' Anvil file to
store the excess block id's in? Of course this yet non-existent mod would also have to
both load the id's and save them in their respective spots...

I just want to see what you idea's are on this and not start a massive flame war.

thank you :)
 
  • Like
Reactions: Eyamaz

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
Minecraft is limited to 256 block ids. Forge worked in some code to increase this to 4096.
And you want to increase this to, what, a million block ids I believe?

The issue isn't the number of blocks, it's memory. Even though mojang allows modding of its software, the code simply isn't written correctly for this to even be plausible. minecraft currently loads EVERYTHING into memory when you load the game. FTB ultimate takes just under 3gigs of ram fully loaded on a NEW world.

Bottom line, being able to have more blocks would be cool, but more detrimental than anything because of code.
 

Sadistical_satan

New Member
Jul 29, 2019
43
0
0
minecraft currently loads EVERYTHING into memory when you load the game.

Yes, I did put that into consideration, but if this theoretical mod were to exist, it would be a user reliant mod that they could install considering they knew how well their computer could handle it.

And yes, I am fully aware that a vast majority of people feed the beast with their potato's
and this mod would not be for them..
 

ApSciLiara

New Member
Jul 29, 2019
1,216
0
0
Yes, I did put that into consideration, but if this theoretical mod were to exist, it would be a user reliant mod that they could install considering they knew how well their computer could handle it.

And yes, I am fully aware that a vast majority of people feed the beast with their potato's
and this mod would not be for them..
Excuse me? My potato and I are perfectly capable of playing Minecraft at a relatively playable FPS.
I just wait for the day that I can fry my potato and eat it because I have a better one.

Sent from my phone using black magic
 
  • Like
Reactions: Bahnmor

Siro

New Member
Jul 29, 2019
638
0
0
Yes, I did put that into consideration, but if this theoretical mod were to exist, it would be a user reliant mod that they could install considering they knew how well their computer could handle it.

And yes, I am fully aware that a vast majority of people feed the beast with their potato's
and this mod would not be for them..

Regardless of there being a need for this now, there will eventually be a need for this in the future as available memory increase, single process computing power increase and interest in the game continues.
 
  • Like
Reactions: TheLegendaryFoxFire

Sadistical_satan

New Member
Jul 29, 2019
43
0
0
The block id limit in vanilla Minecraft was increased to 4096 with the Anvil file format in MC 1.2.

Correct indeed.

So how did modder's install vast mod's before MC 1.2?
Well, looking back on some of Robinton's work with the 4096id's mod back in 1.2.5
http://www.minecraftforum.net/topic/1248996-125-4096ids/

It would seem that Minecraft at that time HAD the ability to achieve 4096, but for some reason it's hard limit was set to 256. It wasn't until Robinton's 4096 mod that extended this limit to the actual 4096.

But this is what I'm stuck with.. Now that Vanilla has 4096id's available. It intrigue's me to see that this is the hard limit and that you can't exceed this number. It seem's that the only way we can increase the total available block id's is to either have a mod that can modify the original Anvil format, or one that can create a duplicate blank Anvil file in which to store the extra id's within.
 

CrafterOfMines57

New Member
Jul 29, 2019
275
0
0
I believe it is very likely possible to extend it through the use of Reflection (I might even have some code lying around very similar to doing that), why you would want to do this however I don't know.

EDIT: Aren't things past 4096 considered Items, the only thing I can see this doing is screwing with things, any particular reason you need over 3840 Block IDs?

EDIT2: It was a pain in the ass, but I used reflection to alter all (I think) fields of the block class to go up to ID 6000. It crashed my game upon placing the block, but it's a start, and I think it might be theoretically possible.
 

Sadistical_satan

New Member
Jul 29, 2019
43
0
0
The whole reason why I wish to see this happen, I that Mojang is and will be adding more and more blocks to the game.
Eventually, large modpacks such as "the beast" will have no room left to expand, both block-wise and item-wise.

On a similar note, I've always wondered that when Mojang add's new block's and item's, does it reduce the number of available id's in the file structure? or are the addition's hard coded within it's base class file's?
 

ApSciLiara

New Member
Jul 29, 2019
1,216
0
0
The whole reason why I wish to see this happen, I that Mojang is and will be adding more and more blocks to the game.
Eventually, large modpacks such as "the beast" will have no room left to expand, both block-wise and item-wise.
Sounds about right.
On a similar note, I've always wondered that when Mojang add's new block's and item's, does it reduce the number of available id's in the file structure? or are the addition's hard coded within it's base class file's?
Yes, it reduces the amount of available IDs.
 

CrafterOfMines57

New Member
Jul 29, 2019
275
0
0
On a similar note, I've always wondered that when Mojang add's new block's and item's, does it reduce the number of available id's in the file structure? or are the addition's hard coded within it's base class file's?
The way it works is that the Block class has a crapload of arrays of 4096 length, the Block class also has the instantiation of every vanilla block ever, and when a Block is instantiated, it gets stored in the various arrays, thereby reducing the amount of space available for mod items by 1. Although I simply don't see this ever becoming a problem, and if it does, I'm pretty certain Forge could just up the available space to 6000 or something.
 

Iskandar

Popular Member
Feb 17, 2013
1,285
685
128
Yikes, man. When would this ever be useful? Outside of a few exceptions (DivineRPG coming to mind) it is rare for any given mod to use more than 10 to 25 block IDs, especially since a lot of mods condense several blocks into 1 ID (much like vanilla Minecraft does with colored wool). Even under the worst case circumstances, you could load just about 200 mods, and probably closer 500 or more, before you hit the ID cap. To give you any indication, the Ultimate pack, with 83 different mods, uses just about 250 to 300 different block IDs, and that pack is near the limits of how many mods you can load into Minecraft without causing crashes and problems for other reasons.

You are trying to solve a problem that simply doesn't exist, and likely won't ever exist no matter how crazy vanilla Minecraft goes with new blocks.

I mean, if you want to do it just as a coding exercise, go for it, but don't ever expect it to ever be a practical or necessary thing.
 

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
I would rather see all the blocks separate. When you stack blocks that way, you are creating tileEntities. And having a lot of tileEntities means a lot of extra code that has to be run anytime the block is loaded, creating extra lag.
 

Iskandar

Popular Member
Feb 17, 2013
1,285
685
128
I would rather see all the blocks separate. When you stack blocks that way, you are creating tileEntities. And having a lot of tileEntities means a lot of extra code that has to be run anytime the block is loaded, creating extra lag.
Actually, no. Stacking block IDs is usually done the same way as vanilla Minecraft handles wool, leaves, wood, and saplings, you assign the block a damage value for each different variation. This does not cause it to be a tileEntity, as every block has the extra 4 bits of metadata.
 

Eyamaz

New Member
Jul 29, 2019
2,373
0
0
Hrm, I misconstrued that then. Ive been wanting to start a mod and going over source. Mostly buildcrafts and of course forge. I did not know this, but makes what I want to do more feasible.

Learn something new every day. That's why I like this type of thread.
 

Sadistical_satan

New Member
Jul 29, 2019
43
0
0
Ugh... by the look's of thing's (those thing's being the code) it appear's I'll have to either completely re-build the current Anvil file or, Create an entirely new format.

The difficult thing will be making it compatible with how mod's work with forge..oh well...
...for SCIENCE!!
 

CrafterOfMines57

New Member
Jul 29, 2019
275
0
0
Ugh... by the look's of thing's (those thing's being the code) it appear's I'll have to either completely re-build the current Anvil file or, Create an entirely new format.

The difficult thing will be making it compatible with how mod's work with forge..oh well...
...for SCIENCE!!
But why would you ever do that? As stated earlier, you are trying to solve a non-issue. Unless you have some reason for needing 3840 IDs, I see absolutely no reason why this would ever be necessary.
 
Status
Not open for further replies.