Fix blacklisted blocks being pulled by pistons (#3610)

Closes #3609.
This commit is contained in:
MD 2020-08-21 16:31:34 +01:00 committed by GitHub
commit 2c462106bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -992,7 +992,7 @@ protect:
# Which blocks should people be prevented from breaking?
break:
# Which blocks should not be pushed by pistons?
# Which blocks should not be moved by pistons?
piston:
# Which blocks should not be dispensed by dispensers

View file

@ -277,9 +277,11 @@ public class EssentialsAntiBuildListener implements Listener {
if (!event.isSticky()) {
return;
}
final Block block = event.getBlock();
if (prot.checkProtectionItems(AntiBuildConfig.blacklist_piston, block.getType())) {
event.setCancelled(true);
for (Block block : event.getBlocks()) {
if (prot.checkProtectionItems(AntiBuildConfig.blacklist_piston, block.getType())) {
event.setCancelled(true);
return;
}
}
}