JimiIT92 / UniverseGuard2

An easy to use world protection plugin for Sponge
https://ore.spongepowered.org/Francesco_Jimi/Universe-Guard
GNU General Public License v3.0
19 stars 3 forks source link

Bug with pistons. Part 2 #130

Closed IXaar1 closed 3 years ago

IXaar1 commented 3 years ago

Now pistons works in regions, but when we disable destroy flag they are not working properly. Common pistons only work with lever activation(with buttons they are bugging), and sticky pistons aren't working at all.

video: https://www.youtube.com/watch?v=Q8ybKpln-uU rg file: https://mega.nz/file/VIZhwSIS#G1RfzLNUzsgD88xI1-hBhkeyTaCpLgBn7RYKjrqAj48

JimiIT92 commented 3 years ago

Mmm, this is strange. I was pretty sure that the two flags wasn't conflicting anymore :/ Will do some more tests to see what's the issue, 99% is the destroy flag preventing the piston heads to be "destroyed"

JimiIT92 commented 3 years ago

Hi. This issue should now be fixed, but since is the second issue in a short time related to pistons, I would ask you if you can test this with this 2.29 preview, to avoid multiple releases in small time. I've done some tests and it should work, but maybe you can find something else more specific :) Once the bug is confirmed to be fixed I'll release this version on Sponge UniverseGuard-2.29.jar.zip

IXaar1 commented 3 years ago

Okay, we will test it soon. Thank you :)

IXaar1 commented 3 years ago

So, we've tested it. Results: common pistons are working now perfectly. But sticky pistons still don't...

Video( sorry for voice, i was talking with friend, who recorded this in discord :D ): https://youtu.be/m6NMremdAiI region file: https://drive.google.com/file/d/1eihylB9cIoJFFGNkPYLR4gz7KPrbGorN/view

JimiIT92 commented 3 years ago

So I dag deep into this issue and turns out is more a Sponge Issue. Let me explain: when a block is retracted by a Sticky Piston it seems there's nothing in the event for "breaking" the block that tells that the block is being "broken" or changed by a piston. The only difference I found from other events, like player break or explosions, is the SpawnType. By checking the Spawn Type the piston retracts as well as the block, while still preventing players from breaking blocks. Let me know if is now fixed :) UniverseGuard-2.29.jar.zip

IXaar1 commented 3 years ago

Okay, so pistons work now, but here become another problem: flag that should disable pistons is not working now :D

JimiIT92 commented 3 years ago

Is just when the flag is turned on? Because I tested right now with the flag set to false and the destroy flag set to true or false and I wasn't able to use pistons if I was not OP or in the Region

IXaar1 commented 3 years ago

EDIT: Thats ok, only owner can do this :) But we don't know if players could push and pull blocks from the region before

IXaar1 commented 3 years ago

Like this https://youtu.be/cV9Ft9dbDc0?t=88

JimiIT92 commented 3 years ago

Will test different cases for that ;)

JimiIT92 commented 3 years ago

I've just published the 2.29 version. For the moment what happens is that you won't be able to push/retract blocks into/from a Region with the pistons flag set to false. However there is a drawback: if you power a piston and it touches a block inside the Region, the piston will remain powered. I think the most important part is that pistons don't damage the area. A proper fix for this will be implemented in v3, as to fix it you need to understand the direction the piston is trying to pull/push, and since v3 is almost done (I'm implementing the different handlers for the flags right now, so it should be really really really close) I prefer doing that in v3 directly so I can finally release it 😅 You can find the latest version here https://ore.spongepowered.org/Francesco_Jimi/Universe-Guard/versions/2.29