Skip to content
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

Fixed NBT being checked when it shouldn't #57

Closed
wants to merge 2 commits into from

Conversation

TBiscuit1
Copy link

Not the most code efficient (still a noob to Forge codding), but it gets the job done

Feel free to upgrade it!

Not the most code efficient (still a noob to Forge codding), but it gets the job done
@TBiscuit1 TBiscuit1 mentioned this pull request Sep 6, 2022
@noeppi-noeppi
Copy link
Owner

I still don't understand why this is necessary. If the ItemStack from the task has no NBT, Util.matchesNBT won't even check the actual nbt. And if the required ItemStack has a tag that does not contain the key Damage, it is not checked in the actual NBT as well.
At least that's how it is supposed to work...

@TBiscuit1
Copy link
Author

TBiscuit1 commented Sep 7, 2022

And if the required ItemStack has a tag that does not contain the key Damage

The game automaticly gives the Damage key to any ItemStack with durability, which is the problem, so the compare ItemStack gets Damage:0 causing the nbt match to fail

Oh and it's without forgetting that EventListener has "tagMatches" which want the EXACT same nbt so your matchesNBT is meaningless at the end

Better optimisation and also found the TRUE issue, tho it has one problem

Also fully fixes noeppi-noeppi#47
@TBiscuit1
Copy link
Author

Ok so now it has a better code optimisation and also fixes both the durability issue AND the nbt issue in general

But now there is a new problem, it's now impossible to have tools without durability lost thanks to that stupid "Damage:0" that the game insert inside the ItemStack for no reason

@TBiscuit1 TBiscuit1 changed the title Fixed durability being checked Fixed NBT being checked when it shouldn't Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants