mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-06 20:18:00 +02:00
Removed player interact infinite durability check, as the exploit is
now fixed by bukkit itself.
This commit is contained in:
parent
a8342b0681
commit
e93f501271
@ -57,11 +57,6 @@ permissions:
|
|||||||
description: Allow a player to place blocks at maximum range (about 6-7 blocks)
|
description: Allow a player to place blocks at maximum range (about 6-7 blocks)
|
||||||
nocheat.checks.blockplace.onliquid:
|
nocheat.checks.blockplace.onliquid:
|
||||||
description: Allow a player to place non-liquid blocks on liquids
|
description: Allow a player to place non-liquid blocks on liquids
|
||||||
nocheat.checks.interact:
|
|
||||||
description: Allow the player to bypass all interact checks
|
|
||||||
children:
|
|
||||||
nocheat.checks.interact.durability:
|
|
||||||
description: Allow a player to use an infinite durability item hack
|
|
||||||
nocheat.checks.chat:
|
nocheat.checks.chat:
|
||||||
description: Allow the player to bypass all chat checks
|
description: Allow the player to bypass all chat checks
|
||||||
children:
|
children:
|
||||||
|
@ -22,7 +22,6 @@ import cc.co.evenprime.bukkit.nocheat.events.BlockPlaceEventManager;
|
|||||||
import cc.co.evenprime.bukkit.nocheat.events.BlockBreakEventManager;
|
import cc.co.evenprime.bukkit.nocheat.events.BlockBreakEventManager;
|
||||||
import cc.co.evenprime.bukkit.nocheat.events.EventManager;
|
import cc.co.evenprime.bukkit.nocheat.events.EventManager;
|
||||||
import cc.co.evenprime.bukkit.nocheat.events.PlayerChatEventManager;
|
import cc.co.evenprime.bukkit.nocheat.events.PlayerChatEventManager;
|
||||||
import cc.co.evenprime.bukkit.nocheat.events.PlayerInteractEventManager;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.events.PlayerMoveEventManager;
|
import cc.co.evenprime.bukkit.nocheat.events.PlayerMoveEventManager;
|
||||||
import cc.co.evenprime.bukkit.nocheat.events.PlayerTeleportEventManager;
|
import cc.co.evenprime.bukkit.nocheat.events.PlayerTeleportEventManager;
|
||||||
import cc.co.evenprime.bukkit.nocheat.log.LogLevel;
|
import cc.co.evenprime.bukkit.nocheat.log.LogLevel;
|
||||||
@ -85,7 +84,6 @@ public class NoCheat extends JavaPlugin {
|
|||||||
|
|
||||||
eventManagers.add(new PlayerMoveEventManager(this));
|
eventManagers.add(new PlayerMoveEventManager(this));
|
||||||
eventManagers.add(new PlayerTeleportEventManager(this));
|
eventManagers.add(new PlayerTeleportEventManager(this));
|
||||||
eventManagers.add(new PlayerInteractEventManager(this));
|
|
||||||
eventManagers.add(new PlayerChatEventManager(this));
|
eventManagers.add(new PlayerChatEventManager(this));
|
||||||
eventManagers.add(new BlockBreakEventManager(this));
|
eventManagers.add(new BlockBreakEventManager(this));
|
||||||
eventManagers.add(new BlockPlaceEventManager(this));
|
eventManagers.add(new BlockPlaceEventManager(this));
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.checks.interact;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionExecutor;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.Permissions;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.InteractData;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.LogData;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Evenprime
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class InteractCheck {
|
|
||||||
|
|
||||||
private final NoCheat plugin;
|
|
||||||
private final ActionExecutor action;
|
|
||||||
|
|
||||||
public InteractCheck(NoCheat plugin) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
action = new ActionExecutor(plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean check(Player player, InteractData data, ConfigurationCache cc) {
|
|
||||||
|
|
||||||
boolean cancel = false;
|
|
||||||
|
|
||||||
final boolean durability = cc.interact.durabilityCheck && !player.hasPermission(Permissions.INTERACT_DURABILITY);
|
|
||||||
|
|
||||||
if(durability) {
|
|
||||||
// It's so simple, I'll just do the check in place
|
|
||||||
if(player.getInventory().getHeldItemSlot() == 9) {
|
|
||||||
|
|
||||||
data.violationLevel += 1;
|
|
||||||
|
|
||||||
LogData ldata = plugin.getDataManager().getLogData(player);
|
|
||||||
ldata.check = "interact.durability";
|
|
||||||
|
|
||||||
cancel = action.executeActions(player, cc.interact.durabilityActions, (int) data.violationLevel, ldata, cc);
|
|
||||||
}
|
|
||||||
|
|
||||||
data.violationLevel *= 0.95D; // Reduce level over time
|
|
||||||
}
|
|
||||||
|
|
||||||
return cancel;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -82,13 +82,6 @@ public abstract class Configuration {
|
|||||||
public final static OptionNode BLOCKPLACE_ONLIQUID_CHECK = new OptionNode("check", BLOCKPLACE_ONLIQUID, DataType.BOOLEAN);
|
public final static OptionNode BLOCKPLACE_ONLIQUID_CHECK = new OptionNode("check", BLOCKPLACE_ONLIQUID, DataType.BOOLEAN);
|
||||||
public final static OptionNode BLOCKPLACE_ONLIQUID_ACTIONS = new OptionNode("actions", BLOCKPLACE_ONLIQUID, DataType.ACTIONLIST);
|
public final static OptionNode BLOCKPLACE_ONLIQUID_ACTIONS = new OptionNode("actions", BLOCKPLACE_ONLIQUID, DataType.ACTIONLIST);
|
||||||
|
|
||||||
public final static OptionNode INTERACT = new OptionNode("interact", ROOT, DataType.PARENT);
|
|
||||||
public final static OptionNode INTERACT_CHECK = new OptionNode("check", INTERACT, DataType.BOOLEAN);
|
|
||||||
|
|
||||||
public final static OptionNode INTERACT_DURABILITY = new OptionNode("durability", INTERACT, DataType.PARENT);
|
|
||||||
public final static OptionNode INTERACT_DURABILITY_CHECK = new OptionNode("check", INTERACT_DURABILITY, DataType.BOOLEAN);
|
|
||||||
public final static OptionNode INTERACT_DURABILITY_ACTIONS = new OptionNode("actions", INTERACT_DURABILITY, DataType.ACTIONLIST);
|
|
||||||
|
|
||||||
public final static OptionNode CHAT = new OptionNode("chat", ROOT, DataType.PARENT);
|
public final static OptionNode CHAT = new OptionNode("chat", ROOT, DataType.PARENT);
|
||||||
public final static OptionNode CHAT_CHECK = new OptionNode("check", CHAT, DataType.BOOLEAN);
|
public final static OptionNode CHAT_CHECK = new OptionNode("check", CHAT, DataType.BOOLEAN);
|
||||||
|
|
||||||
|
@ -124,17 +124,6 @@ public class DefaultConfiguration extends Configuration {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** INTERACT ***/
|
|
||||||
{
|
|
||||||
setValue(INTERACT_CHECK, true);
|
|
||||||
setValue(INTERACT_DURABILITY_CHECK, true);
|
|
||||||
|
|
||||||
ActionList infiniteDurabilityActionList = new ActionList();
|
|
||||||
infiniteDurabilityActionList.setActions(0, action.getActions("durabilityLog interactCancel".split(" ")));
|
|
||||||
setValue(INTERACT_DURABILITY_ACTIONS, infiniteDurabilityActionList);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*** CHAT ***/
|
/*** CHAT ***/
|
||||||
{
|
{
|
||||||
setValue(CHAT_CHECK, true);
|
setValue(CHAT_CHECK, true);
|
||||||
@ -224,7 +213,6 @@ public class DefaultConfiguration extends Configuration {
|
|||||||
w(w, "# Some other log messages that are limited a bit by default, to avoid too extreme spam");
|
w(w, "# Some other log messages that are limited a bit by default, to avoid too extreme spam");
|
||||||
w(w, "log reachLog 0 1 med NC: [player] failed [check]: tried to interact with a block over distance [reachdistance].");
|
w(w, "log reachLog 0 1 med NC: [player] failed [check]: tried to interact with a block over distance [reachdistance].");
|
||||||
w(w, "log directionLog 2 1 med NC: [player] failed [check]: tried to destroy a block out of line of sight.");
|
w(w, "log directionLog 2 1 med NC: [player] failed [check]: tried to destroy a block out of line of sight.");
|
||||||
w(w, "log durabilityLog 0 1 med NC: [player] failed [check]: tried to use infinity durability hack.");
|
|
||||||
w(w, "log onliquidLog 2 1 med NC: [player] failed [check]: tried to place a [blocktype] block at [placelocation] against block at [placeagainst].");
|
w(w, "log onliquidLog 2 1 med NC: [player] failed [check]: tried to place a [blocktype] block at [placelocation] against block at [placeagainst].");
|
||||||
w(w, "log spamLog 0 4 med NC: [player] failed [check]: Last sent message \"[text]\".");
|
w(w, "log spamLog 0 4 med NC: [player] failed [check]: Last sent message \"[text]\".");
|
||||||
w(w, "log nofallLog 0 1 med NC: [player] failed [check]: tried to avoid fall damage for ~[falldistance] blocks.");
|
w(w, "log nofallLog 0 1 med NC: [player] failed [check]: tried to avoid fall damage for ~[falldistance] blocks.");
|
||||||
@ -240,7 +228,6 @@ public class DefaultConfiguration extends Configuration {
|
|||||||
w(w, "special moveCancel 0 0");
|
w(w, "special moveCancel 0 0");
|
||||||
w(w, "special blockbreakCancel 0 0");
|
w(w, "special blockbreakCancel 0 0");
|
||||||
w(w, "special blockplaceCancel 0 0");
|
w(w, "special blockplaceCancel 0 0");
|
||||||
w(w, "special interactCancel 0 0");
|
|
||||||
w(w, "special spamCancel 0 0");
|
w(w, "special spamCancel 0 0");
|
||||||
w(w, "special nofallDamage 0 0");
|
w(w, "special nofallDamage 0 0");
|
||||||
w(w, "");
|
w(w, "");
|
||||||
|
@ -3,7 +3,6 @@ package cc.co.evenprime.bukkit.nocheat.config;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Textual explainations of options, will be displayed in the gui tool and the
|
* Textual explainations of options, will be displayed in the gui tool and the
|
||||||
* descriptions.txt file.
|
* descriptions.txt file.
|
||||||
@ -48,7 +47,6 @@ public class Explainations {
|
|||||||
set(Configuration.MOVING_RUNFLY_FLYINGSPEEDLIMITHORIZONTAL, "Set the speed limit for moving horizontal while flying.\nUnit is 1/100 of a block, default is 60.");
|
set(Configuration.MOVING_RUNFLY_FLYINGSPEEDLIMITHORIZONTAL, "Set the speed limit for moving horizontal while flying.\nUnit is 1/100 of a block, default is 60.");
|
||||||
set(Configuration.MOVING_RUNFLY_FLYINGACTIONS, "What should be done if a player flies faster than the speed limit(s). \nUnits are in 1/100 of a block above the speedlimit.");
|
set(Configuration.MOVING_RUNFLY_FLYINGACTIONS, "What should be done if a player flies faster than the speed limit(s). \nUnits are in 1/100 of a block above the speedlimit.");
|
||||||
|
|
||||||
|
|
||||||
set(Configuration.MOVING_MOREPACKETS_CHECK, "If true, check if a player is sending too many 'move-packets' per second. In a normal game, the player won't send more than 22 packets per second.");
|
set(Configuration.MOVING_MOREPACKETS_CHECK, "If true, check if a player is sending too many 'move-packets' per second. In a normal game, the player won't send more than 22 packets per second.");
|
||||||
set(Configuration.MOVING_MOREPACKETS_ACTIONS, "What should be done if a player sends more 'move-packets' than normal.\nUnits are packets per second above the limit.");
|
set(Configuration.MOVING_MOREPACKETS_ACTIONS, "What should be done if a player sends more 'move-packets' than normal.\nUnits are packets per second above the limit.");
|
||||||
|
|
||||||
@ -71,11 +69,6 @@ public class Explainations {
|
|||||||
set(Configuration.BLOCKPLACE_ONLIQUID_CHECK, "If true, check if a player is trying to place non-liquid blocks against liquid blocks\nIn a normal Minecraft game, it is impossible to place a block without it touching something that is considered solid (neither air nor a liquid).\nBut if people use a modified client, to can do that. This check tries to identify that trick.");
|
set(Configuration.BLOCKPLACE_ONLIQUID_CHECK, "If true, check if a player is trying to place non-liquid blocks against liquid blocks\nIn a normal Minecraft game, it is impossible to place a block without it touching something that is considered solid (neither air nor a liquid).\nBut if people use a modified client, to can do that. This check tries to identify that trick.");
|
||||||
set(Configuration.BLOCKPLACE_ONLIQUID_ACTIONS, "What should be done if a player is is trying to place non-liquid blocks against liquid blocks.\nUnit is number of place(attempt)s.");
|
set(Configuration.BLOCKPLACE_ONLIQUID_ACTIONS, "What should be done if a player is is trying to place non-liquid blocks against liquid blocks.\nUnit is number of place(attempt)s.");
|
||||||
|
|
||||||
set(Configuration.INTERACT_CHECK, "If true, do various checks on PlayerInteract events.");
|
|
||||||
|
|
||||||
set(Configuration.INTERACT_DURABILITY_CHECK, "If true, check if a player is using a hack that provides infinite durability items.");
|
|
||||||
set(Configuration.INTERACT_DURABILITY_ACTIONS, "What should be done if a player is trying to use the hack.\nUnit is number of uses or attempts to use the hack.");
|
|
||||||
|
|
||||||
set(Configuration.CHAT_CHECK, "If true, do various checks on PlayerChat events.");
|
set(Configuration.CHAT_CHECK, "If true, do various checks on PlayerChat events.");
|
||||||
|
|
||||||
set(Configuration.CHAT_SPAM_CHECK, "If true, check if a player is spamming the chat.");
|
set(Configuration.CHAT_SPAM_CHECK, "If true, check if a player is spamming the chat.");
|
||||||
|
@ -24,9 +24,6 @@ public class Permissions {
|
|||||||
public final static String BLOCKBREAK_REACH = BLOCKBREAK + ".reach";
|
public final static String BLOCKBREAK_REACH = BLOCKBREAK + ".reach";
|
||||||
public final static String BLOCKBREAK_DIRECTION = BLOCKBREAK + ".direction";
|
public final static String BLOCKBREAK_DIRECTION = BLOCKBREAK + ".direction";
|
||||||
|
|
||||||
public final static String INTERACT = CHECKS + ".interact";
|
|
||||||
public final static String INTERACT_DURABILITY = INTERACT + ".durability";
|
|
||||||
|
|
||||||
public final static String BLOCKPLACE = CHECKS + ".blockplace";
|
public final static String BLOCKPLACE = CHECKS + ".blockplace";
|
||||||
public final static String BLOCKPLACE_ONLIQUID = BLOCKPLACE + ".onliquid";
|
public final static String BLOCKPLACE_ONLIQUID = BLOCKPLACE + ".onliquid";
|
||||||
public final static String BLOCKPLACE_REACH = BLOCKPLACE + ".reach";
|
public final static String BLOCKPLACE_REACH = BLOCKPLACE + ".reach";
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.config.cache;
|
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.actions.ActionList;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.Configuration;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.DefaultConfiguration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Evenprime
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class CCInteract {
|
|
||||||
|
|
||||||
public final boolean check;
|
|
||||||
|
|
||||||
public final boolean durabilityCheck;
|
|
||||||
public final ActionList durabilityActions;
|
|
||||||
|
|
||||||
public CCInteract(Configuration data) {
|
|
||||||
|
|
||||||
check = data.getBoolean(DefaultConfiguration.INTERACT_CHECK);
|
|
||||||
durabilityCheck = data.getBoolean(DefaultConfiguration.INTERACT_DURABILITY_CHECK);
|
|
||||||
durabilityActions = data.getActionList(DefaultConfiguration.INTERACT_DURABILITY_ACTIONS);
|
|
||||||
}
|
|
||||||
}
|
|
@ -16,7 +16,6 @@ public class ConfigurationCache {
|
|||||||
public final CCMoving moving;
|
public final CCMoving moving;
|
||||||
public final CCLogging logging;
|
public final CCLogging logging;
|
||||||
public final CCBlockBreak blockbreak;
|
public final CCBlockBreak blockbreak;
|
||||||
public final CCInteract interact;
|
|
||||||
public final CCBlockPlace blockplace;
|
public final CCBlockPlace blockplace;
|
||||||
public final CCChat chat;
|
public final CCChat chat;
|
||||||
public final CCDebug debug;
|
public final CCDebug debug;
|
||||||
@ -32,7 +31,6 @@ public class ConfigurationCache {
|
|||||||
moving = new CCMoving(data);
|
moving = new CCMoving(data);
|
||||||
blockbreak = new CCBlockBreak(data);
|
blockbreak = new CCBlockBreak(data);
|
||||||
blockplace = new CCBlockPlace(data);
|
blockplace = new CCBlockPlace(data);
|
||||||
interact = new CCInteract(data);
|
|
||||||
chat = new CCChat(data);
|
chat = new CCChat(data);
|
||||||
logging = new CCLogging(data, worldSpecificFileLogger);
|
logging = new CCLogging(data, worldSpecificFileLogger);
|
||||||
debug = new CCDebug(data);
|
debug = new CCDebug(data);
|
||||||
|
@ -17,7 +17,6 @@ public class DataManager {
|
|||||||
// Store data between Events
|
// Store data between Events
|
||||||
private final Map<Player, MovingData> movingData = new HashMap<Player, MovingData>();
|
private final Map<Player, MovingData> movingData = new HashMap<Player, MovingData>();
|
||||||
private final Map<Player, BlockBreakData> blockbreakData = new HashMap<Player, BlockBreakData>();
|
private final Map<Player, BlockBreakData> blockbreakData = new HashMap<Player, BlockBreakData>();
|
||||||
private final Map<Player, InteractData> interactData = new HashMap<Player, InteractData>();
|
|
||||||
private final Map<Player, BlockPlaceData> blockPlaceData = new HashMap<Player, BlockPlaceData>();
|
private final Map<Player, BlockPlaceData> blockPlaceData = new HashMap<Player, BlockPlaceData>();
|
||||||
private final Map<Player, ChatData> chatData = new HashMap<Player, ChatData>();
|
private final Map<Player, ChatData> chatData = new HashMap<Player, ChatData>();
|
||||||
private final Map<Player, LogData> logData = new HashMap<Player, LogData>();
|
private final Map<Player, LogData> logData = new HashMap<Player, LogData>();
|
||||||
@ -58,21 +57,6 @@ public class DataManager {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InteractData getInteractData(Player player) {
|
|
||||||
InteractData data;
|
|
||||||
|
|
||||||
// intentionally not thread-safe, because bukkit events are handled
|
|
||||||
// in sequence anyway, so zero chance of two events of the same
|
|
||||||
// player being handled at the same time
|
|
||||||
data = interactData.get(player);
|
|
||||||
if(data == null) {
|
|
||||||
data = new InteractData();
|
|
||||||
interactData.put(player, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockPlaceData getBlockPlaceData(Player player) {
|
public BlockPlaceData getBlockPlaceData(Player player) {
|
||||||
BlockPlaceData data;
|
BlockPlaceData data;
|
||||||
|
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.data;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Evenprime
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class InteractData {
|
|
||||||
|
|
||||||
public double violationLevel = 0.0D;
|
|
||||||
}
|
|
@ -1,85 +0,0 @@
|
|||||||
package cc.co.evenprime.bukkit.nocheat.events;
|
|
||||||
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.Event;
|
|
||||||
import org.bukkit.event.Event.Priority;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
|
||||||
import org.bukkit.event.player.PlayerListener;
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
|
||||||
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.NoCheat;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.checks.interact.InteractCheck;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.Permissions;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.config.cache.ConfigurationCache;
|
|
||||||
import cc.co.evenprime.bukkit.nocheat.data.InteractData;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Evenprime
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class PlayerInteractEventManager extends PlayerListener implements EventManager {
|
|
||||||
|
|
||||||
private final NoCheat plugin;
|
|
||||||
private final InteractCheck interactCheck;
|
|
||||||
|
|
||||||
public PlayerInteractEventManager(NoCheat plugin) {
|
|
||||||
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.interactCheck = new InteractCheck(plugin);
|
|
||||||
|
|
||||||
PluginManager pm = Bukkit.getServer().getPluginManager();
|
|
||||||
|
|
||||||
pm.registerEvent(Event.Type.PLAYER_INTERACT, this, Priority.Lowest, plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
|
||||||
|
|
||||||
if(event.isCancelled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Player player = event.getPlayer();
|
|
||||||
final ConfigurationCache cc = plugin.getConfigurationManager().getConfigurationCacheForWorld(player.getWorld().getName());
|
|
||||||
|
|
||||||
// Find out if checks need to be done for that player
|
|
||||||
if(cc.interact.check && !player.hasPermission(Permissions.INTERACT)) {
|
|
||||||
|
|
||||||
boolean cancel = false;
|
|
||||||
|
|
||||||
// Get the player-specific stored data that applies here
|
|
||||||
final InteractData data = plugin.getDataManager().getInteractData(player);
|
|
||||||
|
|
||||||
cancel = interactCheck.check(player, data, cc);
|
|
||||||
|
|
||||||
if(cancel) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getActiveChecks(ConfigurationCache cc) {
|
|
||||||
LinkedList<String> s = new LinkedList<String>();
|
|
||||||
|
|
||||||
if(cc.interact.check && cc.interact.durabilityCheck)
|
|
||||||
s.add("interact.durability");
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getInactiveChecks(ConfigurationCache cc) {
|
|
||||||
LinkedList<String> s = new LinkedList<String>();
|
|
||||||
|
|
||||||
if(!(cc.interact.check && cc.interact.durabilityCheck))
|
|
||||||
s.add("interact.durability");
|
|
||||||
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user