mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 06:57:39 +01:00
Fix AntiBuild performing place checks for block state changes (#3914)
Bukkit sometimes decides that state changes are also a block placement. Work around this by comparing the previous block state with the new block type. Fixes #3150.
This commit is contained in:
parent
4e7f1377bf
commit
401fc4d2eb
@ -100,6 +100,11 @@ public class EssentialsAntiBuildListener implements Listener {
|
||||
final Block block = event.getBlockPlaced();
|
||||
final Material type = block.getType();
|
||||
|
||||
// Happens with blocks like eyes of ender, we shouldn't treat state changes as a block place.
|
||||
if (type.equals(event.getBlockReplacedState().getType())) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (prot.getSettingBool(AntiBuildConfig.disable_build) && !user.canBuild() && !metaPermCheck(user, "place", block)) {
|
||||
if (ess.getSettings().warnOnBuildDisallow()) {
|
||||
user.sendMessage(tl("antiBuildPlace", EssentialsAntiBuild.getNameForType(type)));
|
||||
|
Loading…
Reference in New Issue
Block a user