-
Notifications
You must be signed in to change notification settings - Fork 48
Add LootTableLoadEvent, methods on LootPool/LootTable #113
Conversation
https://github.com/rikka0w0/AdditionalLootTables/tree/master-1.15.2 Rename the following to .jar: |
Turns out it uses FMLServerStoppedEvent which isn't implemented yet. >_> I'll try and implement it later today (assuming nobody else swoops in), right now I just want to take a short break. |
Okay, well, the game runs if FMLServerStoppedEvent is implemented, but the mod performs reflection on ForgeHooks, which, well, #115 |
FMLServerStoppedEvent can be moved to another PR entirely, just including it here for now since it's why I implemented it in the first place. |
rebase'd |
note: i should remember to rebase/add a couple things to patchwork-god-classes once #127 is merged. |
Rebased, added ForgeHooks and such. |
patchwork-loot/src/main/java/net/patchworkmc/mixin/loot/MixinLootManager.java
Outdated
Show resolved
Hide resolved
rebased |
patchwork-loot/src/main/java/net/patchworkmc/mixin/loot/MixinLootPool.java
Show resolved
Hide resolved
patchwork-loot/src/main/java/net/patchworkmc/mixin/loot/MixinLootPoolBuilder.java
Outdated
Show resolved
Hide resolved
patchwork-loot/src/main/java/net/patchworkmc/mixin/loot/MixinLootPoolBuilder.java
Show resolved
Hide resolved
patchwork-loot/src/main/java/net/patchworkmc/mixin/loot/MixinLootTable.java
Show resolved
Hide resolved
...ents-lifecycle/src/main/java/net/patchworkmc/mixin/event/lifecycle/MixinMinecraftServer.java
Outdated
Show resolved
Hide resolved
patchwork-loot/src/main/java/net/patchworkmc/mixin/loot/MixinLootPoolSerializer.java
Show resolved
Hide resolved
The mixin to LootManager is messy, and I'm open to alternative ways to doing it, even if it involves scrapping the 'forge way' of doing it and doing it a different way. For now, I'm going to get this up so that bikeshedding can happen. I'm using the "net.patchworkmc.api.*.Forge<classname>" pattern for interfaces that describe public methods added by Forge for use by mods in this commit. This is up for bikeshedding. This is untested other than starting up Minecraft and opening a world.
The idea is to add an inject in the same place as the method we would be redirecting (but are instead cancelling) so that we can capture locals, and grab the builder that we would otherwise be missing. The downside is that we are effectively overwriting the lambda that vanilla uses in favor of our own.
Mainly adding Override annotations to methods for interfaces, but a few other things as well.
rebased to fix merge conflicts |
The mixin to LootManager is messy, and I'm open to alternative ways to doing it, even if it involves doing it in a completely different way from how forge does it. For now, I'm going to get this up so that bikeshedding can happen.
I'm using the "net.patchworkmc.api.*.Forge" pattern for interfaces that describe public methods added by Forge for use by mods in this commit. This is up for bikeshedding.
This is untested other than starting up Minecraft and opening a world. I was originally going to at least use the mod mentioned in #110, but it doesn't appear to have a version for 1.14.4, and I didn't feel like trying to run a 1.15.2 mod through patcher and hoping it worked.
The reason why this PR doesn't simply add/dispatch the LootTableLoadEvent is because many consumers of the event (according to github search) call methods on LootPool and/or LootTable.