ProtectionStones icon indicating copy to clipboard operation
ProtectionStones copied to clipboard

Split actions from checks for block events to MONITOR

Open plebexer opened this issue 5 years ago • 10 comments

HI!, i think this is an easy fix and its necessary i currently use the plugin Insights to limit the placing of tile entities per chunk, and the incompatibility comes when using insights to limit player-heads per chunk and you use player heads as protection blocks

what happens is that if you reach the maximum limit of player heads in a chunk and you place a protection in that same chunk the protection will get placed, insights will detect that you reached the maximum in a chunk and it will give you the protection back but at the same time ProtectionStones will create a region anyways so if you then do /p unhide, the head will appear, if you break that head then you will have 2 protections, the one insights gave you and the one ProtectionStones gave you.

it would be useful to fix this because it is an important dupe and i think it is quite easy to fix, and there are more plugins out there to limit tile-entities per chunk so this problem will probably happen with other plugins, not only Insights.

plebexer avatar Sep 02 '20 20:09 plebexer

Definitely wouldn't say this is an easy fix, I will have to rewrite much of the block handling code to split between event checks (before the event is called) and actual behaviour (after the event). Looking at Insight's code, their event declared highest priority, so their checks are after ProtectionStones's. Since I want to keep the current priority, I will have to split the code.

It will likely make its way into v2.8.0

espidev avatar Sep 02 '20 20:09 espidev

oh, i really tought it was an easy fix, i will also try to contact the developer of insights, maybe he can fix it by his side and it will be easier for you i will tell you what he says

plebexer avatar Sep 02 '20 21:09 plebexer

No there is no need, the issue is mainly on my side because of the original way this plugin was designed.

espidev avatar Sep 02 '20 21:09 espidev

I have a quick fix that should work for your case here: https://ci.espi.dev/job/ProtectionStones/284/ I will have to do some internal work for a release though.

espidev avatar Sep 02 '20 21:09 espidev

thanks so much!, i really needed a quick fix because players could start to dupe protection blocks, i will test that version

plebexer avatar Sep 02 '20 21:09 plebexer

that version seems to work fine right now, thanks

plebexer avatar Sep 02 '20 21:09 plebexer

Please try this build, and let me know if it works: https://ci.espi.dev/job/ProtectionStones/285/ There were some serious issues with the previous one I gave you (the block would be placed regardless of PS errors).

espidev avatar Sep 02 '20 22:09 espidev

okay, i will test that version in a moment, thanks n.n

plebexer avatar Sep 03 '20 04:09 plebexer

that lastest version is also working perfect for me, thanks!

plebexer avatar Sep 03 '20 06:09 plebexer

Moving this to low priority because the current fix should work for almost all cases.

espidev avatar Sep 21 '20 20:09 espidev