Skip to content

Commit

Permalink
FastConsume: disable the instanteat check on reloading the
Browse files Browse the repository at this point in the history
configuration.
  • Loading branch information
asofold committed Nov 26, 2016
1 parent 371afd9 commit ea9c5a1
Showing 1 changed file with 12 additions and 1 deletion.
Expand Up @@ -28,6 +28,7 @@
import fr.neatmonster.nocheatplus.checks.CheckType;
import fr.neatmonster.nocheatplus.checks.ViolationData;
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.ConfigManager;
import fr.neatmonster.nocheatplus.logging.StaticLog;
Expand All @@ -42,7 +43,7 @@
* @author mc_dev
*
*/
public class FastConsume extends Check implements Listener{
public class FastConsume extends Check implements Listener, INotifyReload {



Expand All @@ -58,6 +59,11 @@ public static void testAvailability(){
public FastConsume() {
super(CheckType.INVENTORY_FASTCONSUME);
// 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);
StaticLog.logInfo("Inventory checks: FastConsume is available, disabled InstantEat.");
}
Expand Down Expand Up @@ -147,4 +153,9 @@ else if (cc.fastConsumeItems.contains(mat)){
return cancel;
}

@Override
public void onReload() {
disableInstantEat();
}

}

0 comments on commit ea9c5a1

Please sign in to comment.