PatchworkMC / patchwork-api

An attempt to reimplement the Minecraft Forge API on Fabric
GNU Lesser General Public License v2.1
282 stars 48 forks source link

Fixed #114 (works in vanilla, not tested with mods) (v2) #160

Closed obj-obj closed 4 years ago

obj-obj commented 4 years ago

This is my first contribution :)

obj-obj commented 4 years ago

Ok I broke entity attacks (entites cannot attack at all) Gotta fix that

kitlith commented 4 years ago

Please note that the original ForgeHooks returns the inverse of what the method on EntityEvents returns, which is almost certainly why this is breaking as you didn't account for it.

obj-obj commented 4 years ago

for SOME REASON when a specific line of code is MinecraftForge.EVENT_BUS.post(new LivingAttackEvent(entity, src, damage)), players can't attack But when it's !(!MinecraftForge.EVENT_BUS.post(new LivingAttackEvent(entity, src, damage))), players can attack

My brain hurts

obj-obj commented 4 years ago

I need to actually learn how forge works before I try to fix bugs lmao

kitlith commented 4 years ago

For the record, @obj-obj, afaict all you needed was as extra inversion there.

Patchwork's version of that hook doesn't seem to follow the same convention as Forge's version (specifically, one returns the inverse of the other). That might be worth fixing too (at it's callsites) but as I don't think I was the one to put those hooks in place, I can't speak for why they don't follow forge.