Browse Source

Converted to maven

RadBuilder 6 years ago
parent
commit
f17d519e51

+ 88 - 0
Plugin/pom.xml

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>de.Linus122.customoregen</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.2.32</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>CustomOreGen Plugin</name>
+    <packaging>jar</packaging>
+    <artifactId>Plugin</artifactId>
+
+    <build>
+        <directory>../target</directory>
+        <finalName>CustomOreGen</finalName>
+        <resources>
+            <resource>
+                <targetPath>.</targetPath>
+                <filtering>true</filtering>
+                <directory>src/main/resources</directory>
+                <includes>
+                    <include>plugin.yml</include>
+                    <include>config.yml</include>
+                </includes>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>2.4.3</version>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <artifactSet>
+                                <includes>
+                                    <include>de.Linus122.TimeIsMoney:*</include>
+                                </includes>
+                            </artifactSet>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <addMavenDescriptor>false</addMavenDescriptor>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.spigotmc</groupId>
+            <artifactId>spigot-api</artifactId>
+            <version>1.12.2-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.wasteofplastic</groupId>
+            <artifactId>askyblock</artifactId>
+            <version>LATEST</version>
+        </dependency>
+        <dependency>
+            <groupId>com.wasteofplastic</groupId>
+            <artifactId>acidisland</artifactId>
+            <version>LATEST</version>
+        </dependency>
+        <dependency>
+            <groupId>com.github.rlf</groupId>
+            <artifactId>uSkyBlock-API</artifactId>
+            <version>LATEST</version>
+        </dependency>
+    </dependencies>
+</project>

+ 4 - 3
src/de/Linus122/customoregen/Cmd.java → Plugin/src/main/java/de/Linus122/customoregen/Cmd.java

@@ -1,17 +1,18 @@
 package de.Linus122.customoregen;
 
-import java.io.IOException;
 import org.bukkit.command.Command;
 import org.bukkit.command.CommandExecutor;
 import org.bukkit.command.CommandSender;
 
+import java.io.IOException;
+
 public class Cmd implements CommandExecutor {
 	Main main;
-
+	
 	public Cmd(Main main) {
 		this.main = main;
 	}
-
+	
 	public boolean onCommand(CommandSender cs, Command arg1, String arg2, String[] arg3) {
 		if (!cs.hasPermission("customoregen.admin")) {
 			cs.sendMessage("You dont have permissions.");

+ 9 - 8
src/de/Linus122/customoregen/Events.java → Plugin/src/main/java/de/Linus122/customoregen/Events.java

@@ -1,6 +1,5 @@
 package de.Linus122.customoregen;
 
-import java.util.Random;
 import org.bukkit.Material;
 import org.bukkit.block.Block;
 import org.bukkit.entity.Player;
@@ -8,6 +7,8 @@ import org.bukkit.event.EventHandler;
 import org.bukkit.event.Listener;
 import org.bukkit.event.block.BlockFormEvent;
 
+import java.util.Random;
+
 public class Events implements Listener {
 	@SuppressWarnings("deprecation")
 	@EventHandler
@@ -15,7 +16,7 @@ public class Events implements Listener {
 		if (Main.disabledWorlds.contains(event.getBlock().getLocation().getWorld().getName())) {
 			return;
 		}
-
+		
 		Material newBlock = event.getNewState().getType();
 		Block b = event.getBlock();
 		
@@ -24,13 +25,13 @@ public class Events implements Listener {
 		
 		if (newBlock.equals(Material.COBBLESTONE) || newBlock.equals(Material.STONE)) {
 			GeneratorConfig gc = null;
-
+			
 			Player p = Main.getOwner(b.getLocation());
 			if (p == null) {
 				gc = Main.generatorConfigs.get(0);
 			} else {
 				int islandLevel = Main.getLevel(p);
-
+				
 				if (Main.activeInWorld.getName().equals(b.getWorld().getName())) {
 					for (GeneratorConfig gc2 : Main.generatorConfigs) {
 						if (gc2 == null) {
@@ -40,7 +41,7 @@ public class Events implements Listener {
 							// Weiter
 							gc = gc2;
 						}
-
+						
 					}
 				}
 			}
@@ -51,7 +52,7 @@ public class Events implements Listener {
 			GeneratorItem winning = getObject(gc);
 			if (Material.getMaterial(winning.name) == null)
 				return;
-
+			
 			if (Material.getMaterial(winning.name).equals(Material.COBBLESTONE) && winning.damage == 0) {
 				return;
 			}
@@ -60,9 +61,9 @@ public class Events implements Listener {
 		}
 	}
 	
-
+	
 	public GeneratorItem getObject(GeneratorConfig gc) {
-
+		
 		Random random = new Random();
 		double d = random.nextDouble() * 100;
 		for (GeneratorItem key : gc.itemList) {

+ 0 - 1
src/de/Linus122/customoregen/GeneratorConfig.java → Plugin/src/main/java/de/Linus122/customoregen/GeneratorConfig.java

@@ -3,7 +3,6 @@ package de.Linus122.customoregen;
 import java.util.ArrayList;
 import java.util.List;
 
-
 public class GeneratorConfig {
 	public List<GeneratorItem> itemList = new ArrayList<GeneratorItem>();
 	public String permission = ";";

+ 2 - 2
src/de/Linus122/customoregen/GeneratorItem.java → Plugin/src/main/java/de/Linus122/customoregen/GeneratorItem.java

@@ -1,11 +1,11 @@
 package de.Linus122.customoregen;
 
 public class GeneratorItem {
-
 	String name;
 	Byte damage = 0;
 	double chance = 0d;
-	GeneratorItem(String name, byte damage, double chance){
+	
+	GeneratorItem(String name, byte damage, double chance) {
 		this.name = name;
 		this.damage = damage;
 		this.chance = chance;

+ 51 - 52
src/de/Linus122/customoregen/Main.java → Plugin/src/main/java/de/Linus122/customoregen/Main.java

@@ -1,5 +1,13 @@
 package de.Linus122.customoregen;
 
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.World;
+import org.bukkit.command.ConsoleCommandSender;
+import org.bukkit.entity.Player;
+import org.bukkit.plugin.PluginManager;
+import org.bukkit.plugin.java.JavaPlugin;
+
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -10,148 +18,139 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.UUID;
-import org.bukkit.Bukkit;
-import org.bukkit.Location;
-import org.bukkit.World;
-import org.bukkit.command.ConsoleCommandSender;
-import org.bukkit.entity.Player;
-import org.bukkit.plugin.PluginManager;
-import org.bukkit.plugin.java.JavaPlugin;
-
 
 public class Main extends JavaPlugin {
 	public static List<GeneratorConfig> generatorConfigs = new ArrayList<GeneratorConfig>();
 	public static List<String> disabledWorlds = new ArrayList<String>();
-
+	
 	public static World activeInWorld;
-
+	
 	public static ConsoleCommandSender clogger;
-
+	
 	public void onEnable() {
 		clogger = getServer().getConsoleSender();
 		PluginManager pm = Bukkit.getPluginManager();
 		pm.registerEvents(new Events(), this);
 		Bukkit.getPluginCommand("customoregen").setExecutor(new Cmd(this));
-		try{
+		try {
 			loadConfig();
-		}catch(IOException e) {
+		} catch (IOException e) {
 			e.printStackTrace();
 		}
 		disabledWorlds = getConfig().getStringList("disabled-worlds");
-		if(Bukkit.getServer().getPluginManager().isPluginEnabled("ASkyBlock")) {
+		if (Bukkit.getServer().getPluginManager().isPluginEnabled("ASkyBlock")) {
 			activeInWorld = com.wasteofplastic.askyblock.ASkyBlock.getIslandWorld();
 			clogger.sendMessage("§6[CustomOreGen] §aUsing ASkyBlock as SkyBlock-Plugin");
-		}else if(Bukkit.getServer().getPluginManager().isPluginEnabled("AcidIsland")) {
+		} else if (Bukkit.getServer().getPluginManager().isPluginEnabled("AcidIsland")) {
 			activeInWorld = com.wasteofplastic.acidisland.ASkyBlock.getIslandWorld();
 			clogger.sendMessage("§6[CustomOreGen] §aUsing AcidIsland as SkyBlock-Plugin");
-		}else if(Bukkit.getServer().getPluginManager().isPluginEnabled("uSkyBlock")) {
+		} else if (Bukkit.getServer().getPluginManager().isPluginEnabled("uSkyBlock")) {
 			us.talabrek.ultimateskyblock.api.uSkyBlockAPI api = (us.talabrek.ultimateskyblock.api.uSkyBlockAPI) Bukkit.getPluginManager().getPlugin("uSkyBlock");
 			api.getConfig().getString("options.general.worldName");
 			activeInWorld = Bukkit.getWorld(api.getConfig().getString("options.general.worldName"));
-
+			
 			clogger.sendMessage("§6[CustomOreGen] §aUsing uSkyBlock as SkyBlock-Plugin");
 		}
 		new Metrics(this);
 	}
-
+	
 	public void onDisable() {
 		
 	}
-
+	
 	public static int getLevel(Player p) {
-		if(Bukkit.getServer().getPluginManager().isPluginEnabled("ASkyBlock")) {
+		if (Bukkit.getServer().getPluginManager().isPluginEnabled("ASkyBlock")) {
 			return com.wasteofplastic.askyblock.ASkyBlockAPI.getInstance().getIslandLevel(p.getUniqueId());
 		}
-		if(Bukkit.getServer().getPluginManager().isPluginEnabled("AcidIsland")) {
+		if (Bukkit.getServer().getPluginManager().isPluginEnabled("AcidIsland")) {
 			return com.wasteofplastic.acidisland.ASkyBlockAPI.getInstance().getIslandLevel(p.getUniqueId());
 		}
-		if(Bukkit.getServer().getPluginManager().isPluginEnabled("uSkyBlock")) {
+		if (Bukkit.getServer().getPluginManager().isPluginEnabled("uSkyBlock")) {
 			return (int) Math.floor(us.talabrek.ultimateskyblock.uSkyBlock.getAPI().getIslandLevel(p));
 		}
 		return 0;
 	}
 	
 	static HashMap<UUID, Player> map = new HashMap<UUID, Player>();
-
+	
 	public static Player getOwner(Location loc) {
 		Set<Location> set = new HashSet<Location>();
 		set.add(loc);
-
+		
 		UUID uuid = null;
-		if(Bukkit.getServer().getPluginManager().isPluginEnabled("ASkyBlock")) {
+		if (Bukkit.getServer().getPluginManager().isPluginEnabled("ASkyBlock")) {
 			uuid = com.wasteofplastic.askyblock.ASkyBlockAPI.getInstance()
 					.getOwner(com.wasteofplastic.askyblock.ASkyBlockAPI.getInstance().locationIsOnIsland(set, loc));
-		}else if(Bukkit.getServer().getPluginManager().isPluginEnabled("AcidIsland")) {
+		} else if (Bukkit.getServer().getPluginManager().isPluginEnabled("AcidIsland")) {
 			uuid = com.wasteofplastic.acidisland.ASkyBlockAPI.getInstance()
 					.getOwner(com.wasteofplastic.acidisland.ASkyBlockAPI.getInstance().locationIsOnIsland(set, loc));
-		}else if(Bukkit.getServer().getPluginManager().isPluginEnabled("uSkyBlock")) {
+		} else if (Bukkit.getServer().getPluginManager().isPluginEnabled("uSkyBlock")) {
 			String player = us.talabrek.ultimateskyblock.uSkyBlock.getInstance().getIslandInfo(loc).getLeader();
-			if((Bukkit.getPlayer(player) != null) && (Bukkit.getPlayer(player).getUniqueId() != null)) {
+			if ((Bukkit.getPlayer(player) != null) && (Bukkit.getPlayer(player).getUniqueId() != null)) {
 				uuid = Bukkit.getPlayer(player).getUniqueId();
 			}
 		}
-
+		
 		Player p = Bukkit.getPlayer(uuid);
-
-		if(p != null) {
+		
+		if (p != null) {
 			map.put(uuid, p);
-			if(p.isOnline()) {
+			if (p.isOnline()) {
 				activeInWorld = p.getWorld();
 			}
-		}else if(map.containsKey(uuid)) {
+		} else if (map.containsKey(uuid)) {
 			p = (Player) map.get(uuid);
 		}
-
+		
 		return p;
 	}
-
+	
 	public void reload() throws IOException {
 		reloadConfig();
 		loadConfig();
 	}
-
+	
 	public void loadConfig() throws IOException {
 		File cfg = new File("plugins/CustomOreGen/config.yml");
 		File dir = new File("plugins/CustomOreGen/");
-		if(!dir.exists()) dir.mkdirs();
-		if(!cfg.exists()){
+		if (!dir.exists()) dir.mkdirs();
+		if (!cfg.exists()) {
 			FileOutputStream writer = new FileOutputStream(new File(getDataFolder() + "/config.yml"));
 			InputStream out = this.getClassLoader().getResourceAsStream("config.yml");
 			byte[] linebuffer = new byte[4096];
 			int lineLength = 0;
-			while((lineLength = out.read(linebuffer)) > 0)
-			{
-			   writer.write(linebuffer, 0, lineLength);
+			while ((lineLength = out.read(linebuffer)) > 0) {
+				writer.write(linebuffer, 0, lineLength);
 			}
-			writer.close();	
+			writer.close();
 		}
-		 
-
+		
+		
 		generatorConfigs = new ArrayList<GeneratorConfig>();
 		int i = 0;
-		while(true){
+		while (true) {
 			i++;
-			if(this.getConfig().contains("generators.generator" + i)){
+			if (this.getConfig().contains("generators.generator" + i)) {
 				GeneratorConfig gc = new GeneratorConfig();
 				gc.permission = this.getConfig().getString("generators.generator" + i + ".permission");
 				gc.unlock_islandLevel = this.getConfig().getInt("generators.generator" + i + ".unlock_islandLevel");
-				for(String raw : this.getConfig().getStringList("generators.generator" + i + ".blocks")){
-					try{
-						if(!raw.contains("!")){
+				for (String raw : this.getConfig().getStringList("generators.generator" + i + ".blocks")) {
+					try {
+						if (!raw.contains("!")) {
 							String material = raw.split(":")[0];
 							double percent = Double.parseDouble(raw.split(":")[1]);
 							gc.itemList.add(new GeneratorItem(material, (byte) 0, percent));
-						}else{
+						} else {
 							String material = raw.split("!")[0];
 							double percent = Double.parseDouble(raw.split(":")[1]);
 							int damage = Integer.parseInt(raw.split("!")[1].split(":")[0]);
 							gc.itemList.add(new GeneratorItem(material, (byte) damage, percent));
 						}
-					}catch(Exception e){
+					} catch (Exception e) {
 					}
 				}
 				generatorConfigs.add(gc);
-			}else{
+			} else {
 				break;
 			}
 			

+ 56 - 52
src/de/Linus122/customoregen/Metrics.java → Plugin/src/main/java/de/Linus122/customoregen/Metrics.java

@@ -1,5 +1,9 @@
 package de.Linus122.customoregen;
 
+import com.google.gson.Gson;
+import org.bukkit.plugin.Plugin;
+
+import javax.net.ssl.HttpsURLConnection;
 import java.io.BufferedReader;
 import java.io.DataOutputStream;
 import java.io.File;
@@ -11,12 +15,6 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 
-import javax.net.ssl.HttpsURLConnection;
-
-import org.bukkit.plugin.Plugin;
-
-import com.google.gson.Gson;
-
 /*
  * SpaceIOMetrics main class by Linus122
  * version: 0.02
@@ -28,36 +26,38 @@ public class Metrics {
 	
 	private String URL = "https://spaceio.de/update/%s";
 	
-	public Metrics(Plugin pl){
+	public Metrics(Plugin pl) {
 		this.pl = pl;
 		
 		// check if Metrics are disabled (checks if file "disablemetrics" is added to the plugins's folder
 		try {
 			Files.list(pl.getDataFolder().getParentFile().toPath()).filter(Files::isRegularFile).forEach(v -> {
-				if(v.getFileName().toString().equalsIgnoreCase("disablemetrics")){
+				if (v.getFileName().toString().equalsIgnoreCase("disablemetrics")) {
 					return;
 				}
 			});
 		} catch (IOException e1) {
 			e1.printStackTrace();
 		}
-
+		
 		URL = String.format(URL, pl.getName());
 		pl.getServer().getScheduler().runTaskTimerAsynchronously(pl, () -> {
 			String dataJson = collectData();
-			try{
+			try {
 				sendData(dataJson);
-			}catch(Exception e){
+			} catch (Exception e) {
 				// skip
 				//e.printStackTrace();
 			}
 		}, 20L * 5, 20L * 60 * 10);
 	}
+	
 	private String collectData() {
 		Data data = new Data();
-
+		
 		// collect plugin list
-		for(Plugin plug : pl.getServer().getPluginManager().getPlugins()) data.plugs.put(plug.getName(), plug.getDescription().getVersion());
+		for (Plugin plug : pl.getServer().getPluginManager().getPlugins())
+			data.plugs.put(plug.getName(), plug.getDescription().getVersion());
 		
 		// fetch online players
 		data.onlinePlayers = pl.getServer().getOnlinePlayers().size();
@@ -79,7 +79,7 @@ public class Metrics {
 		
 		// online mode
 		data.onlineMode = pl.getServer().getOnlineMode();
-
+		
 		// software information
 		data.osName = System.getProperty("os.name");
 		data.osArch = System.getProperty("os.arch");
@@ -87,19 +87,20 @@ public class Metrics {
 		
 		data.diskSize = new File("/").getTotalSpace();
 		
-		if(data.osName.equals("Linux")){
+		if (data.osName.equals("Linux")) {
 			data.linuxDistro = getDistro();
 		}
 		
 		return gson.toJson(data);
 	}
-	private void sendData(String dataJson) throws Exception{
+	
+	private void sendData(String dataJson) throws Exception {
 		java.net.URL obj = new java.net.URL(URL);
 		HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
-
+		
 		con.setRequestMethod("POST");
 		con.setRequestProperty("User-Agent", "Java/Bukkit");
-
+		
 		con.setDoOutput(true);
 		DataOutputStream wr = new DataOutputStream(con.getOutputStream());
 		wr.writeBytes(dataJson);
@@ -107,44 +108,47 @@ public class Metrics {
 		wr.close();
 		con.getResponseCode();
 	}
-	private String getVersion(){
-        String packageName = pl.getServer().getClass().getPackage().getName();
-        return  packageName.substring(packageName.lastIndexOf('.') + 1);
+	
+	private String getVersion() {
+		String packageName = pl.getServer().getClass().getPackage().getName();
+		return packageName.substring(packageName.lastIndexOf('.') + 1);
 	}
+	
 	// method source: http://www.jcgonzalez.com/linux-get-distro-from-java-examples
-	private String getDistro(){
-		 //lists all the files ending with -release in the etc folder
-        File dir = new File("/etc/");
-        File fileList[] = new File[0];
-        if(dir.exists()){
-            fileList =  dir.listFiles(new FilenameFilter() {
-                public boolean accept(File dir, String filename) {
-                    return filename.endsWith("-release");
-                }
-            });
-        }
-        //looks for the version file (not all linux distros)
-        File fileVersion = new File("/proc/version");
-        if(fileVersion.exists()){
-            fileList = Arrays.copyOf(fileList,fileList.length+1);
-            fileList[fileList.length-1] = fileVersion;
-        }       
-        //prints first version-related file
-        for (File f : fileList) {
-            try {
-                BufferedReader myReader = new BufferedReader(new FileReader(f));
-                String strLine = null;
-                while ((strLine = myReader.readLine()) != null) {
-                    return strLine;
-                }
-                myReader.close();
-            } catch (Exception e) {
-                
-            }
-        }
-		return "unknown";    
+	private String getDistro() {
+		//lists all the files ending with -release in the etc folder
+		File dir = new File("/etc/");
+		File fileList[] = new File[0];
+		if (dir.exists()) {
+			fileList = dir.listFiles(new FilenameFilter() {
+				public boolean accept(File dir, String filename) {
+					return filename.endsWith("-release");
+				}
+			});
+		}
+		//looks for the version file (not all linux distros)
+		File fileVersion = new File("/proc/version");
+		if (fileVersion.exists()) {
+			fileList = Arrays.copyOf(fileList, fileList.length + 1);
+			fileList[fileList.length - 1] = fileVersion;
+		}
+		//prints first version-related file
+		for (File f : fileList) {
+			try {
+				BufferedReader myReader = new BufferedReader(new FileReader(f));
+				String strLine = null;
+				while ((strLine = myReader.readLine()) != null) {
+					return strLine;
+				}
+				myReader.close();
+			} catch (Exception e) {
+			
+			}
+		}
+		return "unknown";
 	}
 }
+
 class Data {
 	HashMap<String, String> plugs = new HashMap<String, String>();
 	int onlinePlayers;

+ 33 - 33
src/config.yml → Plugin/src/main/resources/config.yml

@@ -1,33 +1,33 @@
-# You can create generators as much as you want.
-# Important: All generators should be named "generator1", "generator2", etc. 
-# You can define the spawnrates of any block in the blocks-section.
-# The spawnrates are in percent, for example 57.3 are 57,3%.
-# All values together should be 100%. If all values together are higher or lower as 100, the plugin would'nt work correctly.
-# The permissions are custom, so you can make a generator for VIPS, and give them the permission "oregen.vip".
-# Are you finish with configuring? Just type /customoregen to reload the plugin!
-
-# Note: If the Island's owner is offline, the cobblestone generator would be choose the first Generator-Config.
-
-generators:
-  generator1:
-    # default generator
-    blocks:
-    # Please use Bukkit-Blocknames. List: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
-    - STONE:50.0
-    - SANDSTONE:40.0
-    - IRON_ORE:10.0
-    permission: ''
-    # You can also define from what level the generator should be activated. Example: Leave all permissions empty and
-    # only work with the island Level. The plugin would only consider the islandLevel then.
-    unlock_islandLevel: 0
-  generator2:
-    # vip generator, VIPS need generators.vip permission
-    blocks:
-    - IRON_ORE:90.0
-    - STONE:5.0
-    - SANDSTONE:5.0
-    permission: 'oregen.vip'
-    unlock_islandLevel: 0
-# Here you can define worlds where the generator should not work
-disabled-worlds:
-- "world_nether"
+# You can create generators as much as you want.
+# Important: All generators should be named "generator1", "generator2", etc. 
+# You can define the spawnrates of any block in the blocks-section.
+# The spawnrates are in percent, for example 57.3 are 57,3%.
+# All values together should be 100%. If all values together are higher or lower as 100, the plugin would'nt work correctly.
+# The permissions are custom, so you can make a generator for VIPS, and give them the permission "oregen.vip".
+# Are you finish with configuring? Just type /customoregen to reload the plugin!
+
+# Note: If the Island's owner is offline, the cobblestone generator would be choose the first Generator-Config.
+
+generators:
+  generator1:
+    # default generator
+    blocks:
+    # Please use Bukkit-Blocknames. List: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
+    - STONE:50.0
+    - SANDSTONE:40.0
+    - IRON_ORE:10.0
+    permission: ''
+    # You can also define from what level the generator should be activated. Example: Leave all permissions empty and
+    # only work with the island Level. The plugin would only consider the islandLevel then.
+    unlock_islandLevel: 0
+  generator2:
+    # vip generator, VIPS need generators.vip permission
+    blocks:
+    - IRON_ORE:90.0
+    - STONE:5.0
+    - SANDSTONE:5.0
+    permission: 'oregen.vip'
+    unlock_islandLevel: 0
+# Here you can define worlds where the generator should not work
+disabled-worlds:
+- "world_nether"

+ 9 - 9
src/plugin.yml → Plugin/src/main/resources/plugin.yml

@@ -1,10 +1,10 @@
-name: CustomOreGen
-version: 1.2.32
-description: Controls the Ore-Generator
-author: Linus122
-soft-depends: [ASkyBlock, AcidIsland, uSkyBlock]
-main: de.Linus122.customoregen.Main
-commands:
-   customoregen:
-     description: reloads the plugin
+name: CustomOreGen
+version: 1.2.32
+description: Controls the Ore-Generator
+author: Linus122
+soft-depends: [ASkyBlock, AcidIsland, uSkyBlock]
+main: de.Linus122.customoregen.Main
+commands:
+   customoregen:
+     description: reloads the plugin
      usage: /CustomOreGen

+ 76 - 0
pom.xml

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>de.Linus122.customoregen</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.2.32</version>
+    <name>CustomOreGen Parent</name>
+    <url>https://www.spigotmc.org/resources/time-is-money.12409/</url>
+    <packaging>pom</packaging>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <modules>
+        <module>Plugin</module>
+    </modules>
+
+    <repositories>
+        <repository>
+            <id>spigot-repo</id>
+            <url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
+        </repository>
+        <repository>
+            <id>vault-repo</id>
+            <url>http://nexus.hc.to/content/repositories/pub_releases</url>
+        </repository>
+        <repository>
+            <id>ess-repo</id>
+            <url>http://repo.ess3.net/content/groups/essentials</url>
+        </repository>
+        <repository>
+            <id>bintray-tastybento-maven-repo</id>
+            <name>bintray</name>
+            <url>http://dl.bintray.com/tastybento/maven-repo</url>
+        </repository>
+        <repository>
+            <id>uSkyBlock-mvn-repo</id>
+            <url>https://raw.github.com/rlf/uSkyBlock/mvn-repo/</url>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>always</updatePolicy>
+            </snapshots>
+        </repository>
+    </repositories>
+
+    <build>
+        <defaultGoal>clean package install</defaultGoal>
+        <finalName>${project.name}</finalName>
+        <sourceDirectory>src/main/java</sourceDirectory>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.4</version>
+                <configuration>
+                    <archive>
+                        <addMavenDescriptor>false</addMavenDescriptor>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>