OpenBlocks

OpenBlocks

56M Downloads

[v1.4.4]Crane Backpack does not handle the cancelling of the place block event properly

MuresanSergiu opened this issue ยท 8 comments

commented

I need this for my mod to provide protection through it. Please implement or at least consider doing so.

commented

There we go. For some reason this does not work. I am on latest version from CurseForge

commented

Ah, I see what the problem is. It's using a fake player to place the block. Can't it be fired using the player that's wearing the crane?

commented

Not much. Magnet can be used by non-players (like CC turtles) and EntityBlock is used for other purposes (like golden egg effects), so there are few cases where player is not available.

Is there something wrong with fake players?

commented

Yes. It is impossible (or very cpu intensive) to link the action of a fake player to an actual player in the world. So, using players instead of fake players whenever possible is optimal for us. If the event is fired with a fake player from, let's say a CC turtle, we can handle that.

commented

Hmm, I see your point (player with permissions can pick block, but cannot place). But I don't think there is reliable way to link block to player (what if player unlogs while using magnet?).

Also, cancelling event causes block to drop as item, so it's not that terrible.

What if I made separate players for different actions, like "OpenModsFakePlayer-magnet-001", "OpenModsFakePlayer-machine-001" (for placer and breaker), etc?

commented

No, it won't make much of a difference.

I see what the issue is.
Oh well, I will leave it at that. Thanks for your time. I will see if I can do anything on my side.