garbagemule / MobArena

MobArena plugin for Minecraft
GNU General Public License v3.0
196 stars 150 forks source link

Waterlogged Blocks Persist After Arena Completion #798

Open Psychopompwastaken opened 2 weeks ago

Psychopompwastaken commented 2 weeks ago

Bug report

Short description

Players flood the arena to manage the overwhelming number of mobs, but when they do so on stairs or walls, the water becomes 'waterlogged.' Waterlogged blocks are blocks where water remains trapped, creating persistent water that doesn't flow away naturally

Reproduction steps

  1. Join an arena with /ma join
  2. Use water bucket on a stairs or wall and water should stay in place.
  3. Exit arena
  4. Rejoin arena and water still persists

Details

Additional info

Psychopompwastaken commented 2 weeks ago

image

Example of a waterlogged block in minecraft

garbagemule commented 2 weeks ago

Thanks for the bug report!

I'll have to take a look at what events are involved in this "transformation", but first it might be good to know if waterlogged blocks are expected behavior in an arena. That is, if it's possible to prevent the blocks from becoming waterlogged, is that the proper way to solve the problem, or is it perfectly acceptable that blocks become waterlogged, but that they should restore like other blocks that change and shift during a session?

Without knowing all that much about waterlogged blocks, I personally think MobArena's own protection code should try to prevent this change to the blocks, similar to how it tries to prevent block destruction in various ways. But maybe the restoration code that's in place for soft-restore could allow waterlogged blocks to form, and then "just" restore it on arena end, similar to how it tries to restore other kinds of block changes. But if one or the other isn't possible, it would be good to consider other options of what's doable in the current code base.

Psychopompwastaken commented 2 weeks ago

Hey garbagemule! thanks for noticing

"but first it might be good to know if waterlogged blocks are expected behavior in an arena."

"That is, if it's possible to prevent the blocks from becoming waterlogged, is that the proper way to solve the problem, or is it perfectly acceptable that blocks become waterlogged, but that they should restore like other blocks that change and shift during a session?"

"Without knowing all that much about waterlogged blocks, I personally think MobArena's own protection code should try to prevent this change to the blocks, similar to how it tries to prevent block destruction in various ways. But maybe the restoration code that's in place for soft-restore could allow waterlogged blocks to form, and then "just" restore it on arena end, similar to how it tries to restore other kinds of block changes. But if one or the other isn't possible, it would be good to consider other options of what's doable in the current code base."

Psychopompwastaken commented 2 weeks ago

I just tested the soft restore feature to see if it could return the blocks to their original state, but unfortunately, the blocks weren't restored as intended.

garbagemule commented 1 week ago

How can blocks become waterlogged? Is it only if a player dumps a bucket of water directly on a block? Or can a block also become waterlogged if water just flows into it?

From a quick googling, I can't seem to find a surefire way to prevent blocks from getting waterlogged. Currently, my only idea is to just block interact events that are right-clicks with a bucket of water on blocks that can be waterlogged, which seems to be doable. It would be nice if there was a dedicated event we could cancel, but I'm not really finding anything. Do you know of any plugins that successfully prevent blocks from getting waterlogged that we could maybe turn to and check out for inspiration or a solution?

prototype464 commented 1 week ago

How can blocks become waterlogged? Is it only if a player dumps a bucket of water directly on a block? Or can a block also become waterlogged if water just flows into it?

From a quick googling, I can't seem to find a surefire way to prevent blocks from getting waterlogged. Currently, my only idea is to just block interact events that are right-clicks with a bucket of water on blocks that can be waterlogged, which seems to be doable. It would be nice if there was a dedicated event we could cancel, but I'm not really finding anything. Do you know of any plugins that successfully prevent blocks from getting waterlogged that we could maybe turn to and check out for inspiration or a solution?

If I recall correctly, having a couple source blocks on either side can waterlog waterloggable blocks, basically, treat it as if it were an air block that the water is traveling to. I believe CoreProtect does stuff with waterloggable blocks but I don't recall if it's open source.

Psychopompwastaken commented 1 week ago

for now I just posted a warning that do not waterlog blocks but I was thinking of replacing the water loggable blocks with something else.

I haven't explored CoreProtect for this but wont the MobArena plugin override it?