Forgot to alter VL.

This commit is contained in:
asofold 2014-02-16 22:31:09 +01:00
parent 4ddfcc9063
commit 598896a7cc

View File

@ -23,7 +23,7 @@ public class Against extends Check {
public boolean check(final Player player, final Block block, final Material mat, final Block blockAgainst, final BlockPlaceData data, final BlockPlaceConfig cc) {
boolean violation = false;
// TODO: Maybe make it an extra check after all.
// TODO: Make more precise (workarounds like WATER_LILY, general points).
final int againstId = blockAgainst.getTypeId();
if (BlockProperties.isLiquid(againstId)) {
if ((mat != Material.WATER_LILY || !BlockProperties.isLiquid(block.getRelative(BlockFace.DOWN).getTypeId()))) {
@ -35,10 +35,12 @@ public class Against extends Check {
}
// Handle violation and return.
if (violation) {
data.againstVL += 1.0;
final ViolationData vd = new ViolationData(this, player, data.againstVL, 1, cc.againstActions);
vd.setParameter(ParameterName.BLOCK_ID, Integer.toString(mat.getId()));
return executeActions(vd);
} else {
data.againstVL *= 100; // Assume one false positive every 100 blocks.
return false;
}
}