-
-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loonium with data-driven structure loot #4639
Loonium with data-driven structure loot #4639
Conversation
Supersedes #4313, but is only loosely based on that PR. |
8813fdc
to
272d340
Compare
0819447
to
2fed3ca
Compare
7344086
to
a088bac
Compare
ca9e6a4
to
1c516fd
Compare
Writing this comment as i'm going through the review:
Why not Actually, what if we made the loot table specifiable in the config? Then, if you're just referencing something, you can point to it directly without creating a new loot table file, and if you want to make something custom, you can reference any custom loot table. Then the config becomes the only "magic" resource location, instead of having two. Thoughts?
What's different? Will/should our implementation change to match more closely with vanilla in 1.21? Or will we be able to reuse vanilla code?
Realizing on a second read that this means any individual piece of a structure, right? Vs the cuboid bounding box that encompasses the whole structure. But the way i first interpreted this made me think: Is it possible to detect which structure piece you're in? I guess it would depend on the structure type, i don't know too much about structures, but there's at least jigsaw placement with pieces. Are there other, non-jigsaw ways to make a structure? Anyway, different configs for individual structure pieces would be cool to have, though maybe that could be an additional change later. |
Xplat/src/main/java/vazkii/botania/data/LooniumStructureLootProvider.java
Outdated
Show resolved
Hide resolved
Xplat/src/main/java/vazkii/botania/data/LooniumStructureLootProvider.java
Outdated
Show resolved
Hide resolved
Xplat/src/main/java/vazkii/botania/data/LooniumStructureLootProvider.java
Show resolved
Hide resolved
Xplat/src/main/java/vazkii/botania/data/LooniumStructureLootProvider.java
Outdated
Show resolved
Hide resolved
Xplat/src/main/java/vazkii/botania/common/block/flower/functional/LooniumBlockEntity.java
Outdated
Show resolved
Hide resolved
Xplat/src/main/java/vazkii/botania/common/block/flower/functional/LooniumBlockEntity.java
Outdated
Show resolved
Hide resolved
Xplat/src/main/java/vazkii/botania/api/configdata/LooniumStructureConfiguration.java
Outdated
Show resolved
Hide resolved
Xplat/src/main/java/vazkii/botania/api/configdata/LooniumStructureConfiguration.java
Outdated
Show resolved
Hide resolved
Xplat/src/main/java/vazkii/botania/api/configdata/LooniumStructureConfiguration.java
Outdated
Show resolved
Hide resolved
Xplat/src/main/java/vazkii/botania/common/config/ConfigDataManager.java
Outdated
Show resolved
Hide resolved
Xplat/src/main/java/vazkii/botania/common/block/flower/functional/LooniumBlockEntity.java
Show resolved
Hide resolved
Xplat/src/main/java/vazkii/botania/common/block/flower/functional/LooniumBlockEntity.java
Show resolved
Hide resolved
Loonium figures out which structures(s) it was placed in and uses a corresponding list of loot tables with the id `botania:loonium/<structure_namespace>/<structure_path>`. If the flower is placed in overlapping pieces of multiple structures with configured loot tables, it randomly chooses one of the tables whenever it spawns a mob. The Loonium drop capability is now attached to all mob entities, in preparation of customizable mob pools. Default equipment slot drops are turned off. TODO: Define loot tables for relevant vanilla structures. TODO: Define structure configuration data (JSON, likely separate registry) for the spawnable mob pool and whether the flower must be placed within a structure piece or anywhere within the structure's overall bounding box, maybe even the amount of mana per spawned mob. TODO: Move default configuration to a default structure configuration entry.
(can't be detected reliably)
- tweak ancient table selection city weights - fix reference to elder guardian drops loot table - remove type specification on Loonium loot tables, as it caused validation warnings
(includes a generic reloadable config data manager, which currently only covers Loonium configurations)
(covers e.g. the skeleton from a spider jockey or the bonus chicken for some baby zombies)
(such as skeletons from a spider jockey or chickens from a zombie jockey, provided they are in the spawned mobs list)
- move inner config classes to own files - add builders where appropriate - simplify optional field definitions in codecs where possible, and remove constructors with Optional arguments
Equipment tables are not vanilla yet, so they currently use the "selector" loot table type and are applied manually by the Loonium. Nested loot table definitions also currently need to be loot table references, since embedded tables as pool entries are not supported by vanilla yet either.
- mobs are spawned on a unique team, which means even Loonium-spawned zoglins don't attack other Loonium-spawned mobs - new challenge advancement "King" requires killing each of the currently 22 different mobs the Loonium spawns in different structures
- var -> explicit type, unless it's obvious from a constructor call - extracted API interface for ConfigDataManager - replace "drop nothing" flag in LooniumComponent with "override drop"; mobs will drop whatever is defined as "to drop" when that flag is set - don't bother creating specialized map types for detected structures - adjust variable names in renderHUD code - replaced some manually validated attribute CODECs with corresponding predefined ExtraCodecs variants - allow configured mana cost for a structure to be zero - add default translation for botania:loonium_offhand_equipment tag
39cc716
to
92cba74
Compare
I think we're good to go... |
Again, thanks a bunch for this, i think this turned out really cool |
Implementation for structure detection and structure-specific loot tables and mob spawning pools, customizable via data packs.
minecraft:pillager_outpost
the custom Loonium loot table is located atdata/botania/loot_tables/loonium/minecraft/pillager_outpost.json
), with a default loot table corresponding to dungeon loot (located atdata/botania/loot_tables/loonium/default.json
)minecraft:pillager_outpost
the custom configuration is located atdata/minecraft/config/loonium/pillager_outpost.json
) with a default configuration (located atdata/botania/config/loonium/default.json
) acting as fallback