mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-10-22 12:20:26 +02:00
re-add sync.
This commit is contained in:
parent
c6f2d5530d
commit
6e49b7b6d1
@ -88,10 +88,15 @@ public class SongodaCore {
|
||||
if(clazz.getSimpleName().equals("SongodaCore")) {
|
||||
try {
|
||||
// test to see if we're up to date
|
||||
int otherVersion = (int) clazz.getMethod("getCoreVersion").invoke(null);
|
||||
int otherVersion;
|
||||
try {
|
||||
otherVersion = (int) clazz.getMethod("getCoreVersion").invoke(null);
|
||||
} catch (Exception ignore) {
|
||||
otherVersion = -1;
|
||||
}
|
||||
if(otherVersion >= getCoreVersion()) {
|
||||
// use the active service
|
||||
// assuming that the other is greater than R6 ;)
|
||||
// assuming that the other is greater than R6 if we get here ;)
|
||||
clazz.getMethod("registerPlugin", JavaPlugin.class, int.class, String.class, String.class).invoke(null, plugin, pluginID, icon, coreVersion);
|
||||
|
||||
if(hasShading()) {
|
||||
|
@ -40,10 +40,9 @@ public class ConfigEditorGui extends SimplePagedGui {
|
||||
|
||||
public ConfigEditorGui(JavaPlugin plugin, Gui parent, String file, MemoryConfiguration config) {
|
||||
this(plugin, parent, file, config, config);
|
||||
setOnClose((gui) -> save());
|
||||
}
|
||||
|
||||
public ConfigEditorGui(JavaPlugin plugin, Gui parent, String file, MemoryConfiguration config, ConfigurationSection node) {
|
||||
protected ConfigEditorGui(JavaPlugin plugin, Gui parent, String file, MemoryConfiguration config, ConfigurationSection node) {
|
||||
super(parent);
|
||||
this.plugin = plugin;
|
||||
this.file = file;
|
||||
@ -150,6 +149,7 @@ public class ConfigEditorGui extends SimplePagedGui {
|
||||
++index;
|
||||
}
|
||||
|
||||
setOnClose((gui) -> save());
|
||||
}
|
||||
|
||||
public ConfigurationSection getCurrentNode() {
|
||||
|
@ -52,4 +52,13 @@ public class DataManagerAbstract {
|
||||
public void async(Runnable runnable) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, runnable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Queue a task to be run synchronously.
|
||||
*
|
||||
* @param runnable task to run on the next server tick
|
||||
*/
|
||||
public void sync(Runnable runnable) {
|
||||
Bukkit.getScheduler().runTask(this.plugin, runnable);
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,3 @@
|
||||
/**
|
||||
* Hooks for adding a custom WorldGuard flag
|
||||
*
|
||||
* Note: Hooks must be added before WG loads!
|
||||
*/
|
||||
package com.songoda.core.hooks.worldguard;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
@ -29,6 +24,11 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
|
||||
/**
|
||||
* Hooks for adding a custom WorldGuard flag
|
||||
*
|
||||
* Note: Hooks must be added before WG loads!
|
||||
*/
|
||||
public class WorldGuardFlagHandler {
|
||||
|
||||
static Boolean wgPlugin = null;
|
||||
|
Loading…
Reference in New Issue
Block a user