This commit is contained in:
Izzel_Aliz
2018-04-01 15:18:57 +08:00
parent f5d1edc9e0
commit 946adbb3eb
14 changed files with 252 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
package com.ilummc.tlib;
import com.ilummc.tlib.annotations.Config;
import com.ilummc.tlib.annotations.ConfigNode;
import com.ilummc.tlib.bean.BooleanProperty;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
@Config(name = "cfg.yml", charset = "GBK")
public class ExampleMain extends JavaPlugin {
@ConfigNode("enableUpdate")
private BooleanProperty update = new BooleanProperty(true);
@Override
public void onEnable() {
update.addListener(((oldVal, newVal) -> {
Bukkit.getLogger().info("配置项 enableUpdate 的值由 " + oldVal + " 变为了 " + newVal);
if (newVal)
Updater.start();
else
Updater.stop();
}));
}
private static class Updater {
public static void start() {
}
public static void stop() {
}
}
}