mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-27 14:13:11 +02:00
FastConsume: disable the instanteat check on reloading the
configuration.
This commit is contained in:
parent
371afd91d0
commit
ea9c5a1b19
@ -28,6 +28,7 @@ import fr.neatmonster.nocheatplus.checks.Check;
|
|||||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||||
import fr.neatmonster.nocheatplus.checks.ViolationData;
|
import fr.neatmonster.nocheatplus.checks.ViolationData;
|
||||||
import fr.neatmonster.nocheatplus.compat.BridgeHealth;
|
import fr.neatmonster.nocheatplus.compat.BridgeHealth;
|
||||||
|
import fr.neatmonster.nocheatplus.components.registry.feature.INotifyReload;
|
||||||
import fr.neatmonster.nocheatplus.config.ConfPaths;
|
import fr.neatmonster.nocheatplus.config.ConfPaths;
|
||||||
import fr.neatmonster.nocheatplus.config.ConfigManager;
|
import fr.neatmonster.nocheatplus.config.ConfigManager;
|
||||||
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||||
@ -42,7 +43,7 @@ import fr.neatmonster.nocheatplus.utilities.TickTask;
|
|||||||
* @author mc_dev
|
* @author mc_dev
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class FastConsume extends Check implements Listener{
|
public class FastConsume extends Check implements Listener, INotifyReload {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -58,6 +59,11 @@ public class FastConsume extends Check implements Listener{
|
|||||||
public FastConsume() {
|
public FastConsume() {
|
||||||
super(CheckType.INVENTORY_FASTCONSUME);
|
super(CheckType.INVENTORY_FASTCONSUME);
|
||||||
// Overrides the instant-eat check.
|
// Overrides the instant-eat check.
|
||||||
|
disableInstantEat();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void disableInstantEat() {
|
||||||
|
// TODO: Do this kind of thing via registries later on.
|
||||||
ConfigManager.setForAllConfigs(ConfPaths.INVENTORY_INSTANTEAT_CHECK, false);
|
ConfigManager.setForAllConfigs(ConfPaths.INVENTORY_INSTANTEAT_CHECK, false);
|
||||||
StaticLog.logInfo("Inventory checks: FastConsume is available, disabled InstantEat.");
|
StaticLog.logInfo("Inventory checks: FastConsume is available, disabled InstantEat.");
|
||||||
}
|
}
|
||||||
@ -147,4 +153,9 @@ public class FastConsume extends Check implements Listener{
|
|||||||
return cancel;
|
return cancel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReload() {
|
||||||
|
disableInstantEat();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user