IDEA Auto Inspect
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
package me.skymc.tlm;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
import lombok.Getter;
|
||||
import me.skymc.taboolib.Main;
|
||||
import me.skymc.taboolib.fileutils.ConfigUtils;
|
||||
@@ -13,6 +10,7 @@ import me.skymc.tlm.module.sub.ModuleCommandChanger;
|
||||
import me.skymc.tlm.module.sub.ModuleInventorySave;
|
||||
import me.skymc.tlm.module.sub.ModuleKits;
|
||||
import me.skymc.tlm.module.sub.ModuleTimeCycle;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
/**
|
||||
* @author sky
|
||||
@@ -82,8 +80,7 @@ public class TLM {
|
||||
language = new Language2(config.getString("Language"), Main.getInst());
|
||||
} catch (Exception e) {
|
||||
MsgUtils.warn("语言文件不存在: &4" + config.getString("Language"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package me.skymc.tlm.annotation;
|
||||
|
||||
import static java.lang.annotation.ElementType.TYPE;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.TYPE;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target(TYPE)
|
||||
/**
|
||||
* @author sky
|
||||
* @since 2018年2月22日 下午3:59:30
|
||||
*/
|
||||
public @interface DisableConfig {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
package me.skymc.tlm.command.sub;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.skymc.taboolib.commands.SubCommand;
|
||||
import me.skymc.tlm.TLM;
|
||||
import me.skymc.tlm.module.TabooLibraryModule;
|
||||
import me.skymc.tlm.module.sub.ModuleKits;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author sky
|
||||
@@ -36,15 +35,13 @@ public class TLMKitCommand extends SubCommand {
|
||||
// 判断命令
|
||||
if (args.length == 1) {
|
||||
TLM.getInst().getLanguage().get("KIT-EMPTY").send(sender);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
else if (args[1].equalsIgnoreCase("list")) {
|
||||
// 判断权限
|
||||
if (!sender.hasPermission("taboolib.kit.list")) {
|
||||
TLM.getInst().getLanguage().get("NOPERMISSION-KIT-LIST").send(sender);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
TLM.getInst().getLanguage().get("KIT-LIST")
|
||||
.addPlaceholder("$kits", moduleKits.getConfig().getConfigurationSection("Kits").getKeys(false).toString())
|
||||
@@ -158,8 +155,7 @@ public class TLMKitCommand extends SubCommand {
|
||||
// 玩家不存在
|
||||
if (player == null) {
|
||||
TLM.getInst().getLanguage().get("KIT-OFFLINE").addPlaceholder("$name", args[3]).send(sender);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
moduleKits.setPlayerReward(player, args[2], false);
|
||||
TLM.getInst().getLanguage().get("KIT-RESET-PLAYER").addPlaceholder("$kit", args[2]).addPlaceholder("$player", player.getName()).send(sender);
|
||||
|
||||
@@ -6,15 +6,16 @@ import org.bukkit.configuration.file.FileConfiguration;
|
||||
* @author sky
|
||||
* @since 2018年2月17日 下午11:22:42
|
||||
*/
|
||||
public abstract interface ITabooLibraryModule {
|
||||
public interface ITabooLibraryModule {
|
||||
|
||||
default void onEnable() {}
|
||||
|
||||
default void onDisable() {}
|
||||
|
||||
default void onReload() {};
|
||||
|
||||
abstract String getName();
|
||||
|
||||
default void onReload() {
|
||||
}
|
||||
|
||||
String getName();
|
||||
|
||||
default FileConfiguration getConfig() {
|
||||
return TabooLibraryModule.getInst().getConfig(this);
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package me.skymc.tlm.module;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
|
||||
import me.skymc.taboolib.Main;
|
||||
import me.skymc.tlm.annotation.DisableConfig;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import me.skymc.taboolib.Main;
|
||||
import me.skymc.tlm.annotation.DisableConfig;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author sky
|
||||
@@ -53,7 +52,7 @@ public class TabooLibraryModule {
|
||||
}
|
||||
|
||||
public void unloadModules() {
|
||||
TLM_MODULE.keySet().forEach(x -> x.onDisable());
|
||||
TLM_MODULE.keySet().forEach(ITabooLibraryModule::onDisable);
|
||||
}
|
||||
|
||||
public void reloadConfig() {
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
package me.skymc.tlm.module.sub;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import lombok.Getter;
|
||||
import me.skymc.taboolib.database.PlayerDataManager;
|
||||
import me.skymc.taboolib.inventory.ItemUtils;
|
||||
import me.skymc.taboolib.message.MsgUtils;
|
||||
import me.skymc.taboolib.other.DateUtils;
|
||||
import me.skymc.taboolib.other.NumberUtils;
|
||||
import me.skymc.taboolib.playerdata.DataUtils;
|
||||
import me.skymc.tlm.module.ITabooLibraryModule;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author sky
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
package me.skymc.tlm.module.sub;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import me.skymc.taboolib.Main;
|
||||
import me.skymc.taboolib.message.MsgUtils;
|
||||
import me.skymc.taboolib.other.DateUtils;
|
||||
@@ -17,6 +9,11 @@ import me.skymc.taboolib.timecycle.TimeCycleEvent;
|
||||
import me.skymc.taboolib.timecycle.TimeCycleInitializeEvent;
|
||||
import me.skymc.taboolib.timecycle.TimeCycleManager;
|
||||
import me.skymc.tlm.module.ITabooLibraryModule;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
/**
|
||||
* @author sky
|
||||
|
||||
Reference in New Issue
Block a user