nbt in lua
#1
Is there any way to access/write nbt in lua? If not i suggest adding that. Not only would it allow easier customization of many things but also allow another (automatically syncronized) way of saving information about world. E.g. had an idea for meteors. It would be easiest to make ghast fireballs rain from sky, but tracking which ones are spawned by plugin which are natural is somewhat troublesome.
Reply
Thanks given by:
#2
That's not only about reading and writing NBT, it's also about attaching foreign information to practically any object in the server. That would be a huge undertaking. (Also, consider that it's theoretically possible, although not used at this moment, to have a different world storage schema that's not using NBT).

Is it so important to track which fireballs are natural? Is there any special processing you'd be doing for the plugin's ones? I'd just go with not bothering, at least for the first version of the plugin.
Reply
Thanks given by:
#3
About world storage: if we want to have comparability with vanilla minecraft we would have to have some system of having custom data attached to objects (specifically all entities) even if using different world storage.
Also it does not need to be as flexible as NBT. E.g. storing any string in any entity seems excessive.

Lastly it's not necessary to differentiate the two fireballs, however it would seem very strange that ghast shot a fireball that destroyed HUGE amount of terrain and left ores in the crater... (also somewhat related: there is no scale for entities?)
Reply
Thanks given by:
#4
Eventually, yes, we'll need something like that, but it won't make it the Lua Challenge deadlineTongue

I'd recommend keeping track of the spawned meteors in the plugin, and only process those ghast fireballs that are found in that table as meteors. So if there is indeed a world save / load event in the middle of this, the fireballs get converted to regular ones.
It shouldn't be much of a problem since natural fireballs only occur in the Nether and the Nether has a roof where meteors are quite unlikely anyway Smile
Reply
Thanks given by:
#5
I just hope not to leak something (e.g. meteors that get unloaded?)
Reply
Thanks given by:
#6
You could timestamp the entries and remove them after a timeout.
Reply
Thanks given by:
#7
(06-14-2015, 07:15 PM)xoft Wrote: You could timestamp the entries and remove them after a timeout.

Simple and effective. I like it. Smile
Reply
Thanks given by:




Users browsing this thread: 3 Guest(s)