9761fde77d
WARNING: no patch merged, we will start merge later there are to many update between 1.21.11 and 26.1.2, so we need more time to build a base version which can stable to use
42 lines
1.3 KiB
Java
42 lines
1.3 KiB
Java
package fun.bm.lophine.config.modules.function;
|
|
|
|
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
|
|
import fun.bm.lophine.command.counter.CounterCommand;
|
|
import me.earthme.luminol.config.IConfigModule;
|
|
import me.earthme.luminol.config.flags.ConfigClassInfo;
|
|
import me.earthme.luminol.config.flags.ConfigInfo;
|
|
import me.earthme.luminol.config.flags.DoNotLoad;
|
|
import me.earthme.luminol.enums.EnumConfigCategory;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
import java.util.Set;
|
|
|
|
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "wool-hopper-counter")
|
|
public class WoolHopperCounterConfig implements IConfigModule {
|
|
@ConfigInfo(name = "enabled")
|
|
public static boolean enabled = false;
|
|
|
|
@ConfigInfo(name = "unlimited-speed")
|
|
public static boolean unlimitedSpeed = false;
|
|
|
|
@DoNotLoad
|
|
private static CounterCommand counterCommand = null;
|
|
|
|
@Override
|
|
public void onLoaded(CommentedFileConfig configInstance, @Nullable Set<Exception> exs) {
|
|
if (enabled) {
|
|
if (counterCommand == null) {
|
|
counterCommand = new CounterCommand();
|
|
}
|
|
counterCommand.register();
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onUnloaded(CommentedFileConfig configInstance) {
|
|
if (counterCommand != null) {
|
|
counterCommand.unregister();
|
|
}
|
|
}
|
|
}
|