Alpha-s-Stuff / TinkersConstruct

Tinker a little, build a little, tinker a little more...
MIT License
84 stars 33 forks source link

Hephaestus tools don't fire Fabric API PlayerBlockBreakEvents #82

Open unilock opened 1 year ago

unilock commented 1 year ago

Minecraft Version

1.20.1

Fabric Version

0.14.23

Fabric API Version

0.90.4+1.20.1

Hephaestus Version

1.20.1-3.6.3.236

Describe your issue

Tools created with Hephaestus do not fire Fabric API's PlayerBlockBreakEvents, breaking compatibility with many mods, including (for example) FallingTree and VeinDigging.

To diagnose this issue, I created a mod that sends a chat message to the player whenever any of Fabric API's PlayerBlockBreakEvents.BEFORE / AFTER events, Porting Lib's BlockEvents.BreakEvent.BLOCK_BREAK event, or Architectury API's BlockEvent.BREAK event is fired. (code: https://github.com/unilock/BreakEventTest)

Below are snippets of screenshots of the results of using a pickaxe from Hephaestus to break stone, and a shovel from vanilla Minecraft to break dirt, with said mod.

Hephaestus pickaxe:

image

Vanilla shovel:

image

(Yes, Porting Lib's event did fire twice with the pickaxe; not sure what's going on there 🤷‍♀️)

I'm aware of the existence of Tamago, a mod that fixed this issue with Architectury API's event (specifically) on 1.18.2.
Now, with Tamago being All Rights Reserved and closed source, it would be unethical for me to attempt to port it to 1.20.1. But I'm not one to let things like "the law" get in my way.
So I decompiled and re-created a version of it that adds support for Fabric API's events as well. It does work, but obviously it's not an ideal solution.

Crash Report

N/A

Other mods

Tried reproducing with just Tinkers?

Yes

Performance Enchancers

None of the above

Searched for known issues?

Checked pinned issues, Searched open issues, Searched closed issues

AlphaMode commented 1 year ago

I can look into fixing this soon, I plan on releasing a update to tamago very soon for 1.20.1, anyway here is the source for tamago I was just too lazy to upload it https://github.com/AlphaMode/Tamago/ its MIT not ARR

unilock commented 1 year ago

That is definitely not the same Tamago I was looking at :P
https://modrinth.com/mod/tamago/version/1.0

This is my much less comprehensive rendition:
https://github.com/unilock/NotTamago

AlphaMode commented 1 year ago

Yeah, I did some updates and cursed stuff