diff --git a/pom.xml b/pom.xml index b77b1e5..4af0f89 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,11 @@ LinkedBeaconTeleporters 1.0 + + + Ruakij + 11 11 @@ -29,4 +33,13 @@ + + + + src/main/resources + true + + + + \ No newline at end of file diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java new file mode 100644 index 0000000..54ced32 --- /dev/null +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java @@ -0,0 +1,54 @@ +package eu.ruekov.ruakij.LinkedBeaconTeleporters; + +import org.bukkit.Bukkit; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginManager; +import org.bukkit.plugin.java.JavaPlugin; + +import java.io.File; + +public class Main extends JavaPlugin { + + public static Plugin plugin; + + public static FileConfiguration config; + public static FileConfiguration data; + + public void onEnable() { + + plugin = this; + + PluginManager pluginManager = Bukkit.getPluginManager(); + + + loadConfigs(); + + getLogger().info("Plugin activated"); + } + + public void onDisable() { + + getLogger().info("Plugin deactivated"); + } + + public void loadConfigs() { + // config.yml + this.saveDefaultConfig(); + config = this.getConfig(); + + // data.yml + try{ + File dataFile = new File("plugins/"+ plugin.getName() +"/data.yml"); + dataFile.createNewFile(); + data = YamlConfiguration.loadConfiguration( + dataFile + ); + }catch (Exception ex){ + getLogger().severe("Could not load/create data.yml!"); + ex.printStackTrace(); + Bukkit.getPluginManager().disablePlugin(this); + } + } +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..58eac98 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,4 @@ +name: ${artifactId} +version: ${version} +author: ${author} +main: ${groupId}.${artifactId}.Main \ No newline at end of file