mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-26 10:28:05 +01:00
Allow exemption for blockplace/against checks.
Adds a CheckType for this purpose.
This commit is contained in:
parent
47862a651f
commit
b72b51e317
@ -54,6 +54,7 @@ public enum CheckType {
|
||||
BLOCKINTERACT_VISIBLE(BLOCKINTERACT, Permissions.BLOCKINTERACT_VISIBLE),
|
||||
|
||||
BLOCKPLACE(BlockPlaceConfig.factory, BlockPlaceData.factory, Permissions.BLOCKPLACE),
|
||||
BLOCKPLACE_AGAINST(BLOCKPLACE, Permissions.BLOCKPLACE_AGAINST),
|
||||
BLOCKPLACE_DIRECTION(BLOCKPLACE, Permissions.BLOCKPLACE_DIRECTION),
|
||||
BLOCKPLACE_FASTPLACE(BLOCKPLACE, Permissions.BLOCKPLACE_FASTPLACE),
|
||||
BLOCKPLACE_NOSWING(BLOCKPLACE, Permissions.BLOCKPLACE_NOSWING),
|
||||
|
@ -134,6 +134,8 @@ public class BlockPlaceConfig extends ACheckConfig {
|
||||
return reachCheck;
|
||||
case BLOCKPLACE_SPEED:
|
||||
return speedCheck;
|
||||
case BLOCKPLACE_AGAINST:
|
||||
return true;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import fr.neatmonster.nocheatplus.checks.CheckListener;
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.checks.combined.Combined;
|
||||
import fr.neatmonster.nocheatplus.checks.combined.Improbable;
|
||||
import fr.neatmonster.nocheatplus.hooks.NCPExemptionManager;
|
||||
import fr.neatmonster.nocheatplus.permissions.Permissions;
|
||||
import fr.neatmonster.nocheatplus.utilities.BlockProperties;
|
||||
|
||||
@ -97,10 +98,10 @@ public class BlockPlaceListener extends CheckListener {
|
||||
final int againstId = blockAgainst.getTypeId();
|
||||
if (BlockProperties.isLiquid(againstId)){
|
||||
if ((mat != Material.WATER_LILY || !BlockProperties.isLiquid(block.getRelative(BlockFace.DOWN).getTypeId()))
|
||||
&& !player.hasPermission(Permissions.BLOCKPLACE_AGAINST_LIQUIDS)) cancelled = true;
|
||||
&& !player.hasPermission(Permissions.BLOCKPLACE_AGAINST_LIQUIDS) && !NCPExemptionManager.isExempted(player, CheckType.BLOCKPLACE_AGAINST)) cancelled = true;
|
||||
}
|
||||
else if (againstId == Material.AIR.getId()){
|
||||
if (!player.hasPermission(Permissions.BLOCKPLACE_AGAINST_AIR)) cancelled = true;
|
||||
if (!player.hasPermission(Permissions.BLOCKPLACE_AGAINST_AIR) && !NCPExemptionManager.isExempted(player, CheckType.BLOCKPLACE_AGAINST)) cancelled = true;
|
||||
}
|
||||
|
||||
// First, the fast place check.
|
||||
|
Loading…
Reference in New Issue
Block a user