Posts: 953
Threads: 16
Joined: May 2013
Thanks: 67
Given 106 thank(s) in 90 post(s)
01-25-2019, 09:44 PM
(This post was last modified: 01-25-2019, 09:51 PM by tigerw.)
I suppose there wouldn't be overlap if Mojang say, kept on adding new states to grass thereby shifting all the mappings along each time. Otherwise they'd just be adding more entries to the end.
For the internal storage format presumably full backwards compatibility can be maintained if the format is as before (blocktype, nibbletype) but with larger storage types.
However, any sort of internal representation that isn't strings ("minecraft:potato_chips" crispness:1 colour:1000) would be impossible as now we would have to write and maintain a (internal <-> vanilla state) map in order to use the generated protocol mapping. Right?
If so, it seems like we are forced to use a slow option.
Posts: 953
Threads: 16
Joined: May 2013
Thanks: 67
Given 106 thank(s) in 90 post(s)
But still, killing backwards compatibility altogether might be a bad idea, unless we have the time or can convince authors to update plugins. So, perhaps writing that BLOCKTYPE/NIBBLETYPE-to-String/State map might be worth it in the short term. In fact, I could add something to that PR I mentioned for that; it would be a start.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
I like the new string-based format, it is highly extensible, plugins could finally be made to extend the blocks and items easily. And I don't think it's too much slower than current, in the end most of the operations are just number-based (and we're going from two numbers per block to a single number per block); the operations on strings only take place when manipulating something in a way that doesn't require too much performance, such as placing and removing blocks.
If we find that the string manipulation is slow, we could adapt it with additional performance boosters, such as hashing the entire BlockState to improve comparison, etc.
And, on the plus side, having a per-cProtocol map of block types means that we can finally support older protocols properly - the blocks not available in them can get replaced with a placeholder, rather than sent through and crashing the client.
Posts: 953
Threads: 16
Joined: May 2013
Thanks: 67
Given 106 thank(s) in 90 post(s)
Ok. In that case can we update our Lua version? :)
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
Yea, we can do anything. Although I'd prefer not to do it all at once. Let's get the block type registy in first, then the item type registry, then BlockArea, and then all the rest.
Posts: 14
Threads: 1
Joined: Sep 2015
Thanks: 7
Given 0 thank(s) in 0 post(s)
Have the plans changed any? 1.14.2 has come, and the 1.13 support in Cuberite seems stalled (if going by the 1.13 branch)?
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
Yeah, well, real life has caught up, so the development is kinda dead now.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
Astonishingly I got some free time despite the family matters, so I dived into this a bit more. I've started adding real blocks to the block type registry, and I have to say I'm surprised by the amount of blocks that got added to Minecraft since we last updated.