Open sshipway opened 10 years ago
It would be nice to do this generically, i.e. specify a chest material:
chest_material = lucky_block
write_chest_tags = False
That way this could be of use to other mods. Secret chests would have to be dealt with as an exception. Maps and lore book placement might need some thought.
In the meantime - it's not quite as cool - but you could add lucky blocks to the standard loot tables.
That's a good idea (chest_material) -- this would allow using a Gold/Diamond block, or an enderchest, for example.
I would assume that, if you're specifying a material, then write_chest_tags would always be false - you'd only need to write them if the material was Materials.Chest anyway.
In treasure hunts, the first clue_chest always has to exist (as it contains the clue book, and maybe the key) as do any intermediate treasure chests. However the final chest and definitely any intermediate chests could be replaced.
In dungeons, you might want to handle the surface and treasure room chests differently... Also, if you replace the chests with this custom material, it would break the map-placement pass that hides the various maps and documents.
I've already done the simple bits in an example config to add them to the loot tables...
I would assume that, if you're specifying a material, then write_chest_tags would always be false - you'd only need to write them if the material was Materials.Chest anyway.
Some mods add new kinds of chests that use the normal tags. So I could see it being useful to separate them. IronChests does this, I believe.
Perhaps in a dungeon, only the treasure room chest should be replaced. That would solve the map/lore placement issue.
Maybe it would be acceptable to just state that, if you replace the chest material with a non-taggable block, then the map/lore items simply won't be placed? Alternatively, leave the Ruins chest as normal and let all the maps/lore go in there.
Do you really want to replace every single chest in the entire dungeon with another block? This would break a lot of features, and is a lot to think about.
I think the easiest solution is to just replace all your loot tables with a single 100% chance to add a single lucky block item, and add the item to items.txt, or use a themed config with a custom items.txt. Then every chest will contain exactly one lucky block. This can be all be accomplished with the theme config feature JiFish put in. No need to change any code.
Maybe make this a little more generic... add the ability to place a configured block using the same placement algorithms as spawner and chest. Default to nothing, but then you could place gold blocks, or lucky blocks, or whatever you want with the density algorithm. If you don't want chests, and only this special block, set chests to zero.
This would work for things like diamond-blocks, but the lucky-block is activated by mining - so if you put it in a chest, the player can position it where they want before activation, rather than having to activate it where it is. Replacement chest mods would not work this way either.
I was thinking of doing this in the dungeon.placechests() function, so as not to break features or rooms that explicitly call addchest() for a special reason.
Having a more generic placement function sounds even better -- something like a cfg file section holding a list of Block Type and Chance, so the existing behaviour would be minecraft:chest with probability cfg.chests, or with Block Type and Weight with a separate parameter like cfg.chests to apply to the whole set. This would presumably replace placechests()?
Lucky Blocks are now available for Minecraft 1.8. I've not yet tried to have them in the loot tables though.
My kids love the Lucky Blocks mod ( http://www.planetminecraft.com/mod/lucky-block/ ) and would like some of these in their dungeon instead of treasure chests.
Adding the object is easy using the existing materials.cfg, items.txt and items/*.nbt as the block is just ID 850, or lucky:lucky_block ; this should probably not be done in the main config, but in a separate sample config (in the same way as sample_themed)
However it would be nice to have an option in the config (lucky_blocks=True) that, if Materials.LuckyBlock exists, will place a luckyblock rather than a treasure chest when it comes to random chest generation time.
Since this is explicitly supporting a mod rather than vanilla Minecraft, plus MCF and Lucky Blocks are not yet available for 1.8, then I wouldn't give it a high priority, even if doing this is not already contrary to the MCdungeon design philosophy...