final version

This commit is contained in:
坏黑 2019-07-06 00:39:56 +08:00
parent dfae3001ef
commit 78a5f6ce4f
6 changed files with 6 additions and 47 deletions

View File

@ -5,7 +5,7 @@ plugins {
id 'com.github.johnrengelman.shadow' version '4.0.4'
}
group = 'me.skymc'
version = '4.86'
version = '4.9'
sourceCompatibility = 1.8
targetCompatibility = 1.8

View File

@ -1,10 +0,0 @@
§r
§r
§b________ §b______ §f______§8___________
§b___ __/§3_____ §b___ /§3_____________§f___ /§8___(_)__ /_
§b__ / §3_ __ `/§b_ __ \§3 __ \ __ \§f_ / §8__ /__ __ \
§b_ / §3/ /_/ /§b_ /_/ /§3 /_/ / /_/ /§f /___§8 / _ /_/ /
§b/_/ §3\__,_/ §b/_.___/§3\____/\____/§f/_____/§8_/ /_.___/
§r
§8version §f{0}
§r

View File

@ -3,13 +3,10 @@ package me.skymc.taboolib;
import com.ilummc.tlib.TLib;
import com.ilummc.tlib.filter.TLoggerFilter;
import com.ilummc.tlib.resources.TLocale;
import com.ilummc.tlib.util.IO;
import com.ilummc.tlib.util.Strings;
import me.skymc.taboolib.database.GlobalDataManager;
import me.skymc.taboolib.database.PlayerDataManager;
import me.skymc.taboolib.economy.EcoUtils;
import me.skymc.taboolib.fileutils.ConfigUtils;
import me.skymc.taboolib.fileutils.FileUtils;
import me.skymc.taboolib.listener.TListenerHandler;
import me.skymc.taboolib.mysql.hikari.HikariHandler;
import me.skymc.taboolib.mysql.protect.MySQLConnection;
@ -24,10 +21,6 @@ import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Random;
/**
@ -114,17 +107,6 @@ public class Main extends JavaPlugin {
@Override
public void run() {
// 面子工程
if (!TabooLib.isSilent()) {
InputStream inputStream = FileUtils.getResource("motd.txt");
try {
String text = new String(IO.readFully(inputStream), Charset.forName("utf-8"));
if (text != null) {
Arrays.stream(text.split("\n")).forEach(line -> Bukkit.getConsoleSender().sendMessage(Strings.replaceWithOrder(line, getDescription().getVersion())));
}
} catch (IOException ignored) {
}
}
// 本地通讯网络终端
if (getConfig().getBoolean("SERVER")) {
TabooLibServer.main(new String[0]);

View File

@ -11,7 +11,7 @@ import me.skymc.taboolib.string.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.command.*;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import java.lang.reflect.Field;
@ -206,10 +206,10 @@ public abstract class BaseMainCommand implements CommandExecutor, TabExecutor {
}
private void disguisedPlugin() {
linkClasses.forEach(clazz -> disguisedPlugin(clazz, (JavaPlugin) registerCommand.getPlugin()));
linkClasses.forEach(clazz -> disguisedPlugin(clazz, registerCommand.getPlugin()));
}
private void disguisedPlugin(Class<?> targetClass, JavaPlugin plugin) {
private void disguisedPlugin(Class<?> targetClass, Plugin plugin) {
try {
Field pluginField = targetClass.getClassLoader().getClass().getDeclaredField("plugin");
pluginField.setAccessible(true);

View File

@ -180,15 +180,8 @@ public class PlayerDataManager implements Listener {
@Override
public void run() {
long time = System.currentTimeMillis();
// 保存
for (String name : PLAYER_DATA.keySet()) {
savePlayerData(name, false);
}
// 提示
if (!Main.getInst().getConfig().getBoolean("HIDE-NOTIFY")) {
TLocale.Logger.info("PLAYER-DATAMANAGER.SUCCESS-SAVE-DATA", String.valueOf(PLAYER_DATA.size()), String.valueOf(System.currentTimeMillis() - time));
}
PLAYER_DATA.keySet().forEach(name -> savePlayerData(name, false));
}
};
// 如果异步

View File

@ -46,13 +46,7 @@ public class DataUtils implements Listener {
}
public static void saveAllCaches(boolean remove) {
long time = System.currentTimeMillis();
for (String plugin : CACHE_DATA_PLUGIN.keySet()) {
saveAllCaches(getFixedPlugin(plugin), remove);
}
if (!Main.getInst().getConfig().getBoolean("HIDE-NOTIFY")) {
TLocale.Logger.info("DATA-UTILS.SUCCESS-SAVE-DATA", String.valueOf(DataUtils.CACHE_DATA_PLUGIN.size()), String.valueOf(System.currentTimeMillis() - time));
}
CACHE_DATA_PLUGIN.keySet().forEach(plugin -> saveAllCaches(getFixedPlugin(plugin), remove));
}
public static void saveConfiguration(FileConfiguration conf, File file) {