summaryrefslogtreecommitdiffstats
path: root/EssentialsAntiCheat/src/com/earth2me/essentials/anticheat/checks/blockplace/BlockPlaceConfig.java
blob: 26c8d0f6de3ef9f559e6087cbad67a2d5ecb92f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.earth2me.essentials.anticheat.checks.blockplace;

import com.earth2me.essentials.anticheat.ConfigItem;
import com.earth2me.essentials.anticheat.actions.types.ActionList;
import com.earth2me.essentials.anticheat.config.ConfPaths;
import com.earth2me.essentials.anticheat.config.NoCheatConfiguration;
import com.earth2me.essentials.anticheat.config.Permissions;


/**
 * Configurations specific for the "BlockPlace" checks Every world gets one of these assigned to it, or if a world
 * doesn't get it's own, it will use the "global" version
 *
 */
public class BlockPlaceConfig implements ConfigItem
{
	public final boolean reachCheck;
	public final double reachDistance;
	public final ActionList reachActions;
	public final boolean directionCheck;
	public final ActionList directionActions;
	public final long directionPenaltyTime;
	public final double directionPrecision;

	public BlockPlaceConfig(NoCheatConfiguration data)
	{

		reachCheck = data.getBoolean(ConfPaths.BLOCKPLACE_REACH_CHECK);
		reachDistance = 535D / 100D;
		reachActions = data.getActionList(ConfPaths.BLOCKPLACE_REACH_ACTIONS, Permissions.BLOCKPLACE_REACH);

		directionCheck = data.getBoolean(ConfPaths.BLOCKPLACE_DIRECTION_CHECK);
		directionPenaltyTime = data.getInt(ConfPaths.BLOCKPLACE_DIRECTION_PENALTYTIME);
		directionPrecision = ((double)data.getInt(ConfPaths.BLOCKPLACE_DIRECTION_PRECISION)) / 100D;
		directionActions = data.getActionList(ConfPaths.BLOCKPLACE_DIRECTION_ACTIONS, Permissions.BLOCKPLACE_DIRECTION);
	}
}