Global Loot Funcs on 1.15.x#6401
Global Loot Funcs on 1.15.x#6401LexManos merged 11 commits intoMinecraftForge:1.15.xfrom Draco18s:Global-Loot-Funcs-1.15
Conversation
|
change e-mail |
|
Hey @LexManos just saw the LTS post on the forums, your request for me to target 1.15 in order to get this merged makes a lot more sense now. 👍 Just let me know if anything needs to be changed and I'll get it done asap. @metelares huh? Your comment makes no sense. |
LexManos
left a comment
There was a problem hiding this comment.
This isn't bad, my main concerns are the lack of documentation on the root internfaces.
I also don't see where the serialization comes into play.
And lastly, one of the main reasons I've been procrastinating doing this. Do we just not care about reentrancy at all?
src/main/java/net/minecraftforge/common/loot/IGlobalLootModifierSerializer.java
Outdated
Show resolved
Hide resolved
src/main/java/net/minecraftforge/common/loot/IGlobalLootModifierSerializer.java
Outdated
Show resolved
Hide resolved
src/main/java/net/minecraftforge/common/loot/LootModifierManager.java
Outdated
Show resolved
Hide resolved
src/main/java/net/minecraftforge/common/loot/LootModifierManager.java
Outdated
Show resolved
Hide resolved
src/test/java/net/minecraftforge/debug/gameplay/loot/GlobalLootModifiersTest.java
Outdated
Show resolved
Hide resolved
src/test/java/net/minecraftforge/debug/gameplay/loot/GlobalLootModifiersTest.java
Outdated
Show resolved
Hide resolved
src/test/java/net/minecraftforge/debug/gameplay/loot/GlobalLootModifiersTest.java
Outdated
Show resolved
Hide resolved
src/test/java/net/minecraftforge/debug/gameplay/loot/GlobalLootModifiersTest.java
Outdated
Show resolved
Hide resolved
|
Other comments re @LexManos
It probably doesn't. Any code that still exists as a vestige of my hacking about semi-blindly. I'm not even sure what parts that might be, the interface only contains a
I don't know, do we? This is one of the reasons I tried to request feedback from you two months ago when I started working on this. The only comment in this regard was about what happens if two mods want to modify the same drop differently, what order takes precedence, which is why the list is sorted by registry name. If we do care, we also have to address I wrote this PR because no one else was, I don't know what I'm doing, I'm just trying to get something done so that I (and many others) can move forwards. |
Removed @author Added a LootContext.Builder constructor that can clone a context object Added javadoc Made LootModifierManager not a singleton
Reads all.json to determine what loot modifiers to load. Functions like tags.
|
We had a long discussion and brainstorming session on discord, he knows what he needs to do to move forward. Marked this as WIP until he's done. |
Updated EntityLiving's call Updated LootTable to mark previous entityliving entry as deprecated Renamed all.json to global_loot_modifiers.json Relocated test mod data resources to generated_test Fixed setRegistryName implementation Tabs to spaces Refactored json loading system making it simpler and less round about.
Cleaned up javadoc wording in several places Made setRegistryName final
Adjusted javadoc, added @nonnull annotations
# Conflicts: # patches/minecraft/net/minecraft/entity/LivingEntity.java.patch # patches/minecraft/net/minecraft/server/MinecraftServer.java.patch # src/test/resources/META-INF/mods.toml
|
All requested changes have been made. I have requested a re-review. What is holding this up? |
gigaherz
left a comment
There was a problem hiding this comment.
I had completely disregarded this PR thinking it was just some other "let's add new loot events!" proposal, and I'm pleasantly surprised of what I see.
I do have one concern, but don't think of it as a change request, rather only as a discussion topic.
GlobalLootModifierSerializer is now an abstract class and the abstract implementation in LootModifier was no longer needed.
LexManos
left a comment
There was a problem hiding this comment.
Few code style issues, and still lacking documentation in places. But it'll work.
|
I'll backport this to 1.14 this weekend. I'll see if I can do something about docs and style, but I feel like I've been over them a bunch and am not sure what to add. |
|
@Draco18s , I'm looking for a HarvestDropsEvent replacement so I can keep track of loot mined. Does this feature support that? |
|
You'd still have to register it as a modifier, but you don't have to actually modify anything (and you'd still get the list of harvested loot and full context). |
See #6267 for complete details.
Data driven system for arbitrary loot modification as a replacement for HarvestDropsEvent, addressing #5871.