Applied Energistics 2

Applied Energistics 2

137M Downloads

Compatibility request: fire a PlayerInteractEvent.LeftClickBlock from PartLeftClickPacket

desht opened this issue ยท 7 comments

commented

Describe the feature

Please see FTBTeam/FTB-Mods-Issues#634 for some background.

In summary, because AE2 uses a custom packet to send player left click events on the Conversion Monitor to the server, protection mods such as FTB Chunks don't get a chance to see the click on the server, and thus can't protect the clicked block from interaction.

A viable fix would be to fire a PlayerInteractEvent.LeftClickBlock from the server side packet handler and only proceed if that event doesn't get cancelled.

Reasons why it should be considered

This would help integration with chunk protection mods, where SMP players want to keep their stored inventory safe. I'm aware that AE2 has its own security system, but it would be desirable to allow other protection mods to work here too.

Additional details

No response

commented

Seems reasonable to me. ๐Ÿ‘

commented

Shouldn't we just check maymodify or whatever the vanilla thing is?

commented

If you're referring to Level#mayInteract(), all that does is check for spawn protection and world border.

commented

Hm. Don't protection mods hook into that? It should be what we previously checked for part placement et al.

commented

Pretty sure you still use that, but it's not sufficient on its own for a mod like FTB Chunks, where players have specific chunk claims...

commented

I noticed the above commit - thanks for that. But is that Fabric-only? Not sure how your multi-platform stuff works, but I don't see an equivalent Forge event being fired.

commented

We use separate branches. It will be converted to the Forge event when we get to porting it for 1.19.4, no worries.

(We can't support anything other than 1.19.4 due to limited dev resources)