fix forge

This commit is contained in:
坏黑 2019-08-02 10:36:01 +08:00
parent 5fe59ca797
commit fa432ff741
4 changed files with 14 additions and 6 deletions

View File

@ -5,7 +5,7 @@ plugins {
id 'com.github.johnrengelman.shadow' version '4.0.4' id 'com.github.johnrengelman.shadow' version '4.0.4'
} }
group = 'me.skymc' group = 'me.skymc'
version = '5.0' version = '5.01'
sourceCompatibility = 1.8 sourceCompatibility = 1.8
targetCompatibility = 1.8 targetCompatibility = 1.8
@ -63,10 +63,7 @@ processResources {
from(sourceSets.main.resources.srcDirs) { from(sourceSets.main.resources.srcDirs) {
include '__resources__/version' include '__resources__/version'
include 'plugin.yml'
expand 'version': project.version expand 'version': project.version
} }
from(sourceSets.main.resources.srcDirs) {
exclude '__resources__/version'
}
} }

View File

@ -0,0 +1,5 @@
name: TabooLib5
main: io.izzel.taboolib.common.plugin.InternalJavaPlugin
version: ${version}
author: 坏黑

View File

@ -74,6 +74,10 @@ public class SQLTable {
return executeUpdate("insert into " + tableName + " values(" + queryValues + ")"); return executeUpdate("insert into " + tableName + " values(" + queryValues + ")");
} }
public RunnableUpdate executeUpdateIfDuplicate(String queryValues, String queryUpdate) {
return executeUpdate("insert into " + tableName + " values(" + queryValues + ") on duplicate key update " + queryUpdate);
}
public RunnableUpdate executeUpdate(String query) { public RunnableUpdate executeUpdate(String query) {
return new RunnableUpdate(query); return new RunnableUpdate(query);
} }

View File

@ -3,6 +3,7 @@ package io.izzel.taboolib.util;
import io.izzel.taboolib.TabooLib; import io.izzel.taboolib.TabooLib;
import io.izzel.taboolib.common.plugin.InternalPlugin; import io.izzel.taboolib.common.plugin.InternalPlugin;
import io.izzel.taboolib.module.inject.TSchedule; import io.izzel.taboolib.module.inject.TSchedule;
import io.izzel.taboolib.util.plugin.PluginUtils;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
@ -73,7 +74,8 @@ public class Files {
public static InputStream getCanonicalResource(Plugin plugin, String filename) { public static InputStream getCanonicalResource(Plugin plugin, String filename) {
File file = file(new File("plugins/TabooLib/temp/" + UUID.randomUUID())); File file = file(new File("plugins/TabooLib/temp/" + UUID.randomUUID()));
try { try {
ZipFile zipFile = new ZipFile(toFile(plugin.getClass().getProtectionDomain().getCodeSource().getLocation().openStream(), file)); copy(plugin instanceof InternalPlugin ? new File("libs/TabooLib.jar") : PluginUtils.getPluginFile(plugin), file);
ZipFile zipFile = new ZipFile(file);
ZipEntry entry = zipFile.getEntry(filename); ZipEntry entry = zipFile.getEntry(filename);
if (entry != null) { if (entry != null) {
return zipFile.getInputStream(entry); return zipFile.getInputStream(entry);