mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-27 14:13:11 +02:00
Add skipping conditions for redstone current change.
This commit is contained in:
parent
ef9492b0bc
commit
06c2cadf7f
@ -114,11 +114,9 @@ public class BlockChangeListener implements Listener {
|
||||
}
|
||||
final List<Block> blocks;
|
||||
if (retractHasBlocks) {
|
||||
// TODO: Legacy: Set flag in constructor (getRetractLocation).
|
||||
blocks = event.getBlocks();
|
||||
}
|
||||
else {
|
||||
// TODO: Use getRetractLocation.
|
||||
@SuppressWarnings("deprecation")
|
||||
final Location retLoc = event.getRetractLocation();
|
||||
if (retLoc == null) {
|
||||
@ -163,6 +161,11 @@ public class BlockChangeListener implements Listener {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
final int oldCurrent = event.getOldCurrent();
|
||||
final int newCurrent = event.getNewCurrent();
|
||||
if (oldCurrent == newCurrent || oldCurrent > 0 && newCurrent > 0) {
|
||||
return;
|
||||
}
|
||||
// TODO: Fine grained enabling state (pistons, doors, other).
|
||||
final Block block = event.getBlock();
|
||||
// TODO: Abstract method for a block and a set of materials (redstone, interact, ...).
|
||||
|
Loading…
Reference in New Issue
Block a user