mizarc / bell-claims

A comprehensive yet intuitive land claiming system for PaperMC servers, allowing players to protect their builds.
https://modrinth.com/plugin/bell-claims
MIT License
9 stars 4 forks source link

Place the block - claim collision checking timing #38

Open VsevkaD opened 1 week ago

VsevkaD commented 1 week ago

All items that spawn additional blocks can be put in someone else's claim, such as beds, eggs and other plugins that with one item put several (the main block disappears) If you put the bed next to the claim, the second part of the bed is placed on the territory image The second picture is an object from plugin, it consists of several parts and when foreign player puts the main block (bottom one), it disappears but all the others appear, in WorldGuard there is no such thing. image It looks like it removes the block after it has been placed, rather than preventing placement I don't know much about modding, but I think in WorldGuard the territory check goes at the moment the block is placed, and in your mod it goes afterwards, or something like that I suppose there are other blocks/items besides the eggs


Trespassing (It doesn't move the blocks(good)) image If you put a bucket of water near the area it will flood the area and the crops image I can put a painting INSIDE the border image


Also, I noticed that when a unknown player tries to open your chest (claimed area), the chest plays an opening sound, other vaults don't make any sound, not even the chest in the minecart. I compared with WorldGuard there is no sound there either. I think it also has something to do with the timing of the check execution.

mizarc commented 1 week ago

Alright let me go over these one at a time to see how I can handle each case.

All items that spawn additional blocks can be put in someone else's claim, such as beds, eggs and other plugins that with one item put several (the main block disappears) If you put the bed next to the claim, the second part of the bed is placed on the territory

Nice catch, I'll have to add an additional check for multiblocks to ensure that all blocks that stem from the original placement are checked for.

It looks like it removes the block after it has been placed, rather than preventing placement

That's not exactly how it works. Events are cancelled from the moment they're fired to ensure that the initial action is never visible to any other player. When you see the block showing up for a millisecond it's supposed to just be client-side, with the server acknowledging that the action never takes place. I'll need to see how WorldGuard implements their own solution to see if I can catch it even earlier.

Trespassing (It doesn't move the blocks(good))

I'm actually working on this right now on the piston flag branch.

If you put a bucket of water near the area it will flood the area and the crops

Fixed and ready for next feature release.

I can put a painting INSIDE the border

My bad, forgot about paintings. Should be an easy enough patch fix.

Also, I noticed that when a unknown player tries to open your chest (claimed area), the chest plays an opening sound, other vaults don't make any sound, not even the chest in the minecart. I compared with WorldGuard there is no sound there either. I think it also has something to do with the timing of the check execution.

Yeah I've definitely noticed that sounds still emit despite the action being cancelled. Once again I'll have to check how WorldGuard does their own implementation for this.

Thanks for all the thorough research with provided images, gives me a lot to work with to solve these issues quicker.

mizarc commented 1 week ago

Here's the fluid protection at work. Kinda fun to look at.

image

mizarc commented 1 week ago

Is it possible for you to provide the plugin that generates multi-block structures inside of the claim for me to test? I'd like to see what's going on there.

VsevkaD commented 1 week ago

Is it possible for you to provide the plugin that generates multi-block structures inside of the claim for me to test? I'd like to see what's going on there.

Here you go https://modrinth.com/plugin/waystonesplus