mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-13 19:11:22 +01:00
Allow exemption for prevention of breaking special blocks (e.g. liquid).
This commit is contained in:
parent
7889868905
commit
f37fd4b166
@ -40,6 +40,8 @@ public enum CheckType {
|
||||
ALL(Permissions.CHECKS),
|
||||
|
||||
BLOCKBREAK(BlockBreakConfig.factory, BlockBreakData.factory, Permissions.BLOCKBREAK),
|
||||
/** This will allow breaking all special blocks, currently only liquid. Later there might be more sub-types. */
|
||||
BLOCKBREAK_BREAK(BLOCKBREAK, Permissions.BLOCKBREAK_BREAK),
|
||||
BLOCKBREAK_DIRECTION(BLOCKBREAK, Permissions.BLOCKBREAK_DIRECTION),
|
||||
BLOCKBREAK_FASTBREAK(BLOCKBREAK, Permissions.BLOCKBREAK_FASTBREAK),
|
||||
BLOCKBREAK_FREQUENCY(BLOCKBREAK, Permissions.BLOCKBREAK_FREQUENCY),
|
||||
|
@ -174,6 +174,8 @@ public class BlockBreakConfig extends ACheckConfig {
|
||||
return reachCheck;
|
||||
case BLOCKBREAK_WRONGBLOCK:
|
||||
return wrongBlockCheck;
|
||||
case BLOCKBREAK_BREAK:
|
||||
return true;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckListener;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.inventory.Items;
|
||||
import fr.neatmonster.nocheatplus.hooks.NCPExemptionManager;
|
||||
import fr.neatmonster.nocheatplus.permissions.Permissions;
|
||||
import fr.neatmonster.nocheatplus.utilities.BlockProperties;
|
||||
import fr.neatmonster.nocheatplus.utilities.TickTask;
|
||||
@ -136,7 +137,7 @@ public class BlockBreakListener extends CheckListener {
|
||||
cancelled = true;
|
||||
|
||||
// Destroying liquid blocks.
|
||||
if (!cancelled && BlockProperties.isLiquid(block.getTypeId()) && !player.hasPermission(Permissions.BLOCKBREAK_BREAK_LIQUID)){
|
||||
if (!cancelled && BlockProperties.isLiquid(block.getTypeId()) && !player.hasPermission(Permissions.BLOCKBREAK_BREAK_LIQUID) && !NCPExemptionManager.isExempted(player, CheckType.BLOCKBREAK_BREAK)){
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user