Create icon indicating copy to clipboard operation
Create copied to clipboard

Fix dupe bug with using a wrench in claimed chunks

Open Attack8 opened this issue 1 year ago • 8 comments

Fixes FTBTeam/FTB-Mods-Issues#1162 Fixes #6465

Attack8 avatar May 08 '24 23:05 Attack8

world.destroyBlock(pos, false) does not cause any block break events to be fired, so I don't believe this approach will work to account for claim protection mods (more precisely, it'll probably fix the original problem, but introduce a new one, where players can use a wrench to steal blocks from other players' claims). The false return from the method is purely based on vanilla checks.

desht avatar May 09 '24 07:05 desht

You can give it a try yourself but it worked for me in testing. I will do further testing to confirm

Attack8 avatar May 09 '24 10:05 Attack8

Did you try it with a mod like FTB Chunks installed, in a claim you can't normally break blocks in?

Arguably that's not necessarily a bug, since block-breaking is a feature of sneak+right-clicking the wrench, which is an item interaction rather than a block break. But from a gameplay point of view, it's equivalent to breaking a block, so if a player chooses to allow item interaction in their claims, they may be surprised when someone else comes in and steals their blocks...

desht avatar May 09 '24 10:05 desht

Did you try it with a mod like FTB Chunks installed, in a claim you can't normally break blocks in?

Yes, I did

Arguably that's not necessarily a bug, since block-breaking is a feature of sneak+right-clicking the wrench, which is an item interaction rather than a block break. But from a gameplay point of view, it's equivalent to breaking a block, so if a player chooses to allow item interaction in their claims, they may be surprised when someone else comes in and steals their blocks...

Yes, I agree that it's a bug; it doesn't make sense gameplay-wise

Attack8 avatar May 09 '24 10:05 Attack8

Needs more 1.20.1 specific testing

Attack8 avatar May 09 '24 10:05 Attack8

Should be pretty easy to get around; fire a Forge BlockEvent.BreakEvent before attempting to break the block, and if the event comes back canceled, don't proceed.

desht avatar May 09 '24 11:05 desht

Yea, I’ll take a look at it this evening after school with specifically 1.20.1 since I can’t reproduce the bug in 1.18.2

Attack8 avatar May 09 '24 11:05 Attack8

Ok, fixed

Attack8 avatar May 09 '24 20:05 Attack8

Thanks!

simibubi avatar Jul 16 '24 17:07 simibubi