Adding Generator For Single Prefab Structures
#11
I created a child of the prefab class that accepts a new parameter in the constructor which is the loot table.

If the draw into chunk method is called it checks any block placed if it‘s a chest and fills it with the loot specified

I don’t like the way it checks for chests (simple going through every block) maybe if we include a vector of all chests position exported from the structure this could be skipped

Although this could be done within another PR

Oh yeah - I already noticed this and that you sometimes you can‘t achieve vanilla behaviour because it changed during the supported versions

And you spend some time looking for the code that actually does the stuff you look for
Reply
Thanks given by:
#12
Nooo, that's the wrong approach again. What is the loot table bound to? Why a child class when that behavior is intended for all prefabs?

The proper way would be to have a list of loot tables in the prefab, each bound to relative coords inside that prefab. So that when there are three chests and a furnace in the prefab, they can each be filled with specific loot.

And as I said, better split this into two tasks, first implement the generator without caring for the loot, then add loot table support to entire Cuberite. There's chests in villages, in the mineshafts and in the nether fortresses that need loot tables, too.
Reply
Thanks given by:
#13
Ok, now I got what you‘re talking about. Sorry my brain is sometimes slow.

Then I think my code already works - just need to test the Code with prefabs. The loot stuff needs to be reverted

Adding the loot in the cuberite binary should be quite easy since the GalExport plugin is doing the heavy lifting
Reply
Thanks given by:
#14
So it does generate - maybe overdone the setting but this was just a test

[Image: 90990060-9411a800-e59e-11ea-988f-3cda885d42ca.png]
Reply
Thanks given by:
#15
That looks good. I hope the grid size setting comes from the cubeset file Smile
Reply
Thanks given by:
#16
Yes - the settings are from the cubeset file. Just wanted to see it work.

All the code is more or less taken from other places (mostly the PieceGenerator)

How do I assign the metadata for the group in the export plugin? is there any documentation on the options avaiable in the metadata?
Reply
Thanks given by:
#17
For group metadata, I use the webadmin editor that GalExport provides. Go to GalExport -> Groups -> (group) Details and there should be the metadata for the group, just above the prefab list.
It should be possible to edit the group metadata in-game using commands, but I don't remember anymore, and don't care enough to re-learn Smile

The metadata can really have any name / value, there's no documented list of known values, I know that's a bad thing. There's some info to be scraped from GalExport's metadata checking functions ( https://github.com/madmaxoft/GalExport/b...tadata.lua ). The code that uses this metadata is actually sprinkled all over the codebase, wherever the value is actually used, it is extracted from the metadata map.
Reply
Thanks given by:
#18
i tried all comannds documented but didn't find any - well webinterface works for me

the code is a good start thank you

ok - time to use grep on the stringmap and check when it's actually used
Gonna post the results here
Reply
Thanks given by:
#19
Ok I had some time to look into it but there doesn't seem to be a "Group" menu to be displayed

I used the default config and the lastest version of the plugin and the Galery server backup. Didn't find any other error in the log related to the galery export plugin.
Reply
Thanks given by:
#20
I've got it like this:
[Image: GalExport_Groups.png]
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)