forked from Limework/skript-db
Compare commits
8 Commits
v0.2.1
...
0.3.0-Govi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2a53078a6 | ||
|
|
83f71e147b | ||
|
|
e610fc1357 | ||
|
|
aa1a1d14c7 | ||
|
|
3a1ec76a0b | ||
|
|
2eb691cd69 | ||
|
|
6dbd2effb3 | ||
|
|
88b76f1b5b |
12
build.gradle
12
build.gradle
@@ -31,7 +31,7 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
shadow 'org.spigotmc:spigot-api:1.11-R0.1-SNAPSHOT'
|
shadow 'org.spigotmc:spigot-api:1.11-R0.1-SNAPSHOT'
|
||||||
shadow 'ch.njol:skript:2.2-SNAPSHOT'
|
shadow 'ch.njol:skript:2.2-SNAPSHOT'
|
||||||
compile 'com.zaxxer:HikariCP:2.6.2'
|
compile 'com.zaxxer:HikariCP:3.4.3'
|
||||||
}
|
}
|
||||||
|
|
||||||
task buildReadme(type: Javadoc) {
|
task buildReadme(type: Javadoc) {
|
||||||
@@ -43,3 +43,13 @@ task buildReadme(type: Javadoc) {
|
|||||||
options.addStringOption('file', 'README.md')
|
options.addStringOption('file', 'README.md')
|
||||||
options.addStringOption('markdown', '-quiet')
|
options.addStringOption('markdown', '-quiet')
|
||||||
}
|
}
|
||||||
|
task fatJar(type: Jar) {
|
||||||
|
manifest {
|
||||||
|
attributes 'Implementation-Title': 'Gradle Jar File Example',
|
||||||
|
'Implementation-Version': version,
|
||||||
|
'Main-Class': 'com.mkyong.DateUtils'
|
||||||
|
}
|
||||||
|
baseName = project.name + '-all'
|
||||||
|
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
|
||||||
|
with jar
|
||||||
|
}
|
||||||
|
|||||||
3
src/main/java/META-INF/MANIFEST.MF
Normal file
3
src/main/java/META-INF/MANIFEST.MF
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
Main-Class: com.btk5h.skriptdb.SkriptDB
|
||||||
|
|
||||||
@@ -53,9 +53,7 @@ import ch.njol.util.Kleenean;
|
|||||||
*/
|
*/
|
||||||
public class EffExecuteStatement extends Delay {
|
public class EffExecuteStatement extends Delay {
|
||||||
static {
|
static {
|
||||||
Skript.registerEffect(EffExecuteStatement.class,
|
Skript.registerEffect(EffExecuteStatement.class, "[(1¦synchronously)] execute %string% (in|on) %datasource% [and store [[the] (output|result)[s]] (to|in) [the] [var[iable]] %-objects%]");
|
||||||
"[(1¦synchronously)] execute %string% (in|on) %datasource% " +
|
|
||||||
"[and store [[the] (output|result)[s]] (to|in) [the] [var[iable]] %-objects%]");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static String lastError;
|
static String lastError;
|
||||||
@@ -82,13 +80,10 @@ public class EffExecuteStatement extends Delay {
|
|||||||
protected void execute(Event e) {
|
protected void execute(Event e) {
|
||||||
boolean isMainThread = Bukkit.isPrimaryThread();
|
boolean isMainThread = Bukkit.isPrimaryThread();
|
||||||
|
|
||||||
if (isSync && !isMainThread) {
|
if (isSync) {
|
||||||
String result = executeStatement(e);
|
String result = executeStatement(e);
|
||||||
continueScriptExecution(e, result);
|
continueScriptExecution(e, result);
|
||||||
} else {
|
} else {
|
||||||
if (isSync) {
|
|
||||||
Skript.warning("A SQL query was attempted on the main thread!");
|
|
||||||
}
|
|
||||||
|
|
||||||
CompletableFuture<String> sql =
|
CompletableFuture<String> sql =
|
||||||
CompletableFuture.supplyAsync(() -> executeStatement(e), threadPool);
|
CompletableFuture.supplyAsync(() -> executeStatement(e), threadPool);
|
||||||
@@ -106,7 +101,9 @@ public class EffExecuteStatement extends Delay {
|
|||||||
@Override
|
@Override
|
||||||
protected TriggerItem walk(Event e) {
|
protected TriggerItem walk(Event e) {
|
||||||
debug(e, true);
|
debug(e, true);
|
||||||
|
if (!isSync) {
|
||||||
SkriptUtil.delay(e);
|
SkriptUtil.delay(e);
|
||||||
|
}
|
||||||
execute(e);
|
execute(e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name: skript-db
|
name: skript-db
|
||||||
version: 0.2.1
|
version: 0.3.0-Govindas
|
||||||
main: com.btk5h.skriptdb.SkriptDB
|
main: com.btk5h.skriptdb.SkriptDB
|
||||||
depend: [Skript]
|
depend: [Skript]
|
||||||
|
|||||||
Reference in New Issue
Block a user