SpongePowered / SpongeVanilla

The SpongeAPI implementation for Vanilla Minecraft.
http://www.spongepowered.org/
MIT License
253 stars 78 forks source link

Canceled water placement can still destroy rails and causes an error when the rail is replaced. #395

Closed ghost closed 5 years ago

ghost commented 5 years ago

SpongeVanilla 7.1.5 (RC139 with MySQL PR merged).

@Listener
public void onChangeBlockPlace(final ChangeBlockEvent.Place event, @First Player player) {
    event.setCancelled(true);
}

Use a water bucket on a rail and it will get destroyed which can be used to bypass regional protections. Replacing the rail returns this: https://paste.md-5.net/pupetobelu.tex

It will also destroy buttons and other blocks where water may be placed at the same coordinate.

Edit: https://cdn.discordapp.com/attachments/142425412096491520/520031262358896640/2018-12-05_19-18-03.mp4

In this clip, all block placement is canceled, but rails bypass with a large error (as seen in the link above). Water destroys the rails despite being canceled as well.

ItsDoot commented 5 years ago

Is the bug reproduce-able in SpongeForge, or is this vanilla only?

ghost commented 5 years ago

I only use SpongeVanilla; I would have to merge my MySQL PR into a SpongeForge workspace to test it.

DrZoddiak commented 5 years ago

Tested with 1.12.2-2768-7.1.5-RC3507 Rails appear to still get blocked placing with no errors, so the rail issue appears to be SV specific. Water blocks appear to actually still place entirely with no issue.

I however tested using Griefprevention to block placement of blocks. https://griefprevention.github.io/debug/?ITy2xjXXJg

With this report you can see that in the beginning I did have permissions to place blocks (Trust) https://gyazo.com/14d008165d9613647743c094c74d4d1c and after executing cfd I was treated normally and blocks were denied placement. https://gyazo.com/8335ffff8730bc3dbd883ac0fc5dd89f Here you can see that my placement for placing blocks was denied https://gyazo.com/b25d21ada6d41903e6a7eff18a244ddd

but as shown here it places them anyway (I place blocks, turn on debug, attempt to place a few more and am denied, and then am allowed to place rails) https://gyazo.com/ffff85d45d7352112b67469ac365489a

And here you may notice that Block-Place does not actually appear to be checked on Water at all (this may be GP specific which is likely the discrepancy in the water being allowed placement compared to OP) https://gyazo.com/d17ce1669669a0c065df8a982cc7a053

So to summarize. Rails allowing to be placed despite block-placement appears to be an SV specific issue. The matter of water breaking blocks it is placed on is still up in the air, as GP doesn't appear to effect water blocks as OP's test did. My IDE isn't in functioning order, or I'd test the same way.

Edit: Latest.log from SV test https://gist.github.com/DrZoddiak/111657ad23bdd64f3674d18bad5d37a3

DrZoddiak commented 5 years ago

Alright upon being given a plugin from @brjcarbone Using similar code he posted I get this error on SV and SF.

https://gist.github.com/DrZoddiak/e43e18e447bef447ed70019b45b488c9

This issue should probably be moved to SC because of this.

ryantheleach commented 5 years ago

~move to sc

limbo-app commented 5 years ago

Hey @brjcarbone! I've moved your issue to SpongePowered/SpongeCommon#2158.