Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Better loottable hooks #139

Draft
wants to merge 2 commits into
base: 1.14.x
Choose a base branch
from
Draft

Conversation

kitlith
Copy link
Contributor

@kitlith kitlith commented Jul 22, 2020

Opening this as a draft pull request so we can discuss.

I believe there's still an error present, but it's just a matter of how we handle an exception.

The whole idea is to cut out the static ThreadLocal<Deque<...>> in LootHooks in favor of messing with json. However, this PR also includes a technique we could use to avoid overwriting the lambda that could be pulled in on its own. (see second commit)

Only issue is: once again, the lambda is static, and that *doesn't work
for this* because we need the lootManager to fire the event.

I do have a couple ideas revolving around doing something hacky with
JsonElement, and doing something hacky with ImmutableMap.Builder, but
this is my current status.
@TheGlitch76
Copy link
Member

Kit's taking a break from modding, if someone wants to take up this PR they can make PRs to this branch.

@kitlith
Copy link
Contributor Author

kitlith commented Jul 30, 2020

I'm still around to answer questions and stuff though ^-^

EDIT: Right, it may worth looking at using Fabric's loot table event again -- we can't handle setting the names of loot pools with it, but that doesn't mean we can't still use it to obtain the final result

@TheGlitch76 TheGlitch76 changed the base branch from master to 1.14.x December 24, 2020 02:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants