2019-03-27 15:32:35 +01:00
|
|
|
package de.warking.schematicsystem;
|
|
|
|
|
2019-03-27 22:15:24 +01:00
|
|
|
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
2019-04-23 12:47:37 +02:00
|
|
|
import de.warking.schematicsystem.check.CheckUtils;
|
|
|
|
import de.warking.schematicsystem.commands.CheckCommand;
|
2019-03-27 22:15:24 +01:00
|
|
|
import de.warking.schematicsystem.commands.SchematicCommand;
|
2019-03-29 23:27:47 +01:00
|
|
|
import de.warking.schematicsystem.listener.PlayerJoinListener;
|
2019-04-22 13:14:32 +02:00
|
|
|
import de.warking.schematicsystem.listener.PlayerQuitListener;
|
2019-03-27 22:15:24 +01:00
|
|
|
import de.warking.schematicsystem.utils.CommandRemover;
|
2019-04-20 18:09:46 +02:00
|
|
|
import de.warking.schematicsystem.utils.Config;
|
2019-03-27 22:15:24 +01:00
|
|
|
import org.bukkit.Bukkit;
|
2019-03-29 23:27:47 +01:00
|
|
|
import org.bukkit.plugin.PluginManager;
|
2019-03-27 22:15:24 +01:00
|
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
|
|
|
|
|
|
public class SchematicSystem extends JavaPlugin {
|
|
|
|
|
|
|
|
public static String SCHEM_DIR = "/home/netuser/schematics/";
|
|
|
|
public static String PREFIX = "§8[§3Schematic§8] §7";
|
|
|
|
|
|
|
|
private static SchematicSystem instance;
|
|
|
|
|
|
|
|
public void onEnable() {
|
|
|
|
instance = this;
|
|
|
|
|
2019-04-20 18:09:46 +02:00
|
|
|
Config.load();
|
|
|
|
|
2019-03-27 22:15:24 +01:00
|
|
|
try {
|
|
|
|
CommandRemover.removeAll("/schematic", "/schem", "//schematic", "//schem");
|
|
|
|
} catch (Exception ex) {
|
|
|
|
ex.printStackTrace();
|
|
|
|
}
|
|
|
|
|
|
|
|
getCommand("schematic").setExecutor(new SchematicCommand());
|
|
|
|
getCommand("/schematic").setExecutor(new SchematicCommand());
|
|
|
|
getCommand("schem").setExecutor(new SchematicCommand());
|
|
|
|
getCommand("/schem").setExecutor(new SchematicCommand());
|
2019-04-23 12:47:37 +02:00
|
|
|
getCommand("check").setExecutor(new CheckCommand());
|
2019-03-29 23:27:47 +01:00
|
|
|
|
|
|
|
init();
|
2019-04-22 13:14:32 +02:00
|
|
|
|
|
|
|
Bukkit.getScheduler().scheduleAsyncRepeatingTask(instance, new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
2019-04-23 12:47:37 +02:00
|
|
|
if(CheckUtils.getCSchematicsSize() > 0)
|
|
|
|
CheckUtils.sendTeamMembersCSchematics(CheckUtils.sendTeamMembersCSchematicsInfo());
|
2019-04-22 13:14:32 +02:00
|
|
|
}
|
|
|
|
}, 0, 20*60*10);
|
2019-03-27 22:15:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void onDisable() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-03-29 23:27:47 +01:00
|
|
|
public void init() {
|
|
|
|
PluginManager pm = Bukkit.getPluginManager();
|
|
|
|
pm.registerEvents(new PlayerJoinListener(), instance);
|
2019-04-22 13:14:32 +02:00
|
|
|
pm.registerEvents(new PlayerQuitListener(), instance);
|
2019-03-29 23:27:47 +01:00
|
|
|
}
|
|
|
|
|
2019-03-27 22:15:24 +01:00
|
|
|
|
|
|
|
public static SchematicSystem getInstance() {
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static WorldEditPlugin getWorldEditPlugin() {
|
|
|
|
return (WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit");
|
|
|
|
}
|
2019-03-27 15:32:35 +01:00
|
|
|
}
|