Explorar o código

mavenized project

linus %!s(int64=5) %!d(string=hai) anos
pai
achega
6baf29b234

+ 33 - 33
src/config.yml → bin/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"

BIN=BIN
bin/de/Linus122/SpaceIOMetrics/Data.class


BIN=BIN
bin/de/Linus122/SpaceIOMetrics/Metrics$1.class


BIN=BIN
bin/de/Linus122/SpaceIOMetrics/Metrics.class


+ 1 - 1
src/plugin.yml → bin/plugin.yml

@@ -3,7 +3,7 @@ version: 1.2.42
 description: Controls the Ore-Generator
 author: Linus122
 softdepend: [ASkyBlock, AcidIsland, uSkyBlock]
-main: de.Linus122.customoregen.Main
+main: xyz.spaceio.customoregen.CustomOreGen
 commands:
    customoregen:
      description: reloads the plugin

BIN=BIN
bin/xyz/spaceio/customoregen/Cmd.class


BIN=BIN
bin/xyz/spaceio/customoregen/CustomOreGen$1.class


BIN=BIN
bin/xyz/spaceio/customoregen/CustomOreGen.class


BIN=BIN
bin/xyz/spaceio/customoregen/Events.class


BIN=BIN
bin/xyz/spaceio/customoregen/GeneratorConfig.class


BIN=BIN
bin/xyz/spaceio/customoregen/GeneratorItem.class


BIN=BIN
bin/xyz/spaceio/customoregen/JSONConfig.class


+ 98 - 0
pom.xml

@@ -0,0 +1,98 @@
+<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>CustomOreGen</groupId>
+	<artifactId>CustomOreGen</artifactId>
+	<version>1.2.5-SNAPSHOT</version>
+	<repositories>
+		<repository>
+			<id>spigot-repo</id>
+			<url>https://hub.spigotmc.org/nexus/content/groups/public/</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>
+	<dependencies>
+		<!--Spigot API -->
+		<dependency>
+			<groupId>org.spigotmc</groupId>
+			<artifactId>spigot-api</artifactId>
+			<version>1.13.1-R0.1-SNAPSHOT</version>
+			<scope>provided</scope>
+		</dependency>
+		<!-- Bukkit API -->
+		<dependency>
+			<groupId>org.bukkit</groupId>
+			<artifactId>craftbukkit</artifactId>
+			<version>1.13.1-R0.1-SNAPSHOT</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.wasteofplastic</groupId>
+			<artifactId>askyblock</artifactId>
+			<version>3.0.9</version>
+		</dependency>
+		<dependency>
+			<groupId>com.wasteofplastic</groupId>
+			<artifactId>acidisland</artifactId>
+			<version>3.0.9</version>
+		</dependency>
+		<dependency>
+			<groupId>com.github.rlf</groupId>
+			<artifactId>uSkyBlock-API</artifactId>
+			<version>2.6.4</version>
+		</dependency>
+	</dependencies>
+	<build>
+		<!-- Uses the properties in this file for plugin.yml and config.yml -->
+		<resources>
+			<resource>
+				<directory>${basedir}/src/main/resources</directory>
+				<filtering>true</filtering>
+				<includes>
+					<include>plugin.yml</include>
+					<include>config.yml</include>
+					<include>translations/*</include>
+				</includes>
+			</resource>
+		</resources>
+		<plugins>
+			<!-- Sets the Java version to 8 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-shade-plugin</artifactId>
+				<version>3.1.0</version>
+				<executions>
+					<execution>
+						<phase>package</phase>
+						<goals>
+							<goal>shade</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<!-- Sets the custom JARfile name (Project name without spaces is good) -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<version>2.4</version>
+				<configuration>
+					<outputDirectory>${dir}</outputDirectory>
+					<finalName>${project.name}</finalName>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>

+ 33 - 0
src/main/resources/config.yml

@@ -0,0 +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"

+ 10 - 0
src/main/resources/plugin.yml

@@ -0,0 +1,10 @@
+name: CustomOreGen
+version: 1.2.42
+description: Controls the Ore-Generator
+author: Linus122
+softdepend: [ASkyBlock, AcidIsland, uSkyBlock]
+main: xyz.spaceio.customoregen.CustomOreGen
+commands:
+   customoregen:
+     description: reloads the plugin
+     usage: /CustomOreGen

+ 5 - 5
src/de/Linus122/customoregen/Cmd.java → src/xyz/spaceio/customoregen/Cmd.java

@@ -1,4 +1,4 @@
-package de.Linus122.customoregen;
+package xyz.spaceio.customoregen;
 
 import java.io.IOException;
 import org.bukkit.command.Command;
@@ -6,10 +6,10 @@ import org.bukkit.command.CommandExecutor;
 import org.bukkit.command.CommandSender;
 
 public class Cmd implements CommandExecutor {
-	Main main;
+	CustomOreGen plugin;
 
-	public Cmd(Main main) {
-		this.main = main;
+	public Cmd(CustomOreGen main) {
+		this.plugin = main;
 	}
 
 	public boolean onCommand(CommandSender cs, Command arg1, String arg2, String[] arg3) {
@@ -17,7 +17,7 @@ public class Cmd implements CommandExecutor {
 			cs.sendMessage("You dont have permissions.");
 		} else {
 			try {
-				this.main.reload();
+				this.plugin.reload();
 			} catch (IOException e) {
 				// TODO Auto-generated catch block
 				e.printStackTrace();

+ 6 - 6
src/de/Linus122/customoregen/Main.java → src/xyz/spaceio/customoregen/CustomOreGen.java

@@ -1,4 +1,4 @@
-package de.Linus122.customoregen;
+package xyz.spaceio.customoregen;
 
 import java.io.File;
 import java.io.FileOutputStream;
@@ -25,7 +25,7 @@ import com.google.gson.reflect.TypeToken;
 import de.Linus122.SpaceIOMetrics.Metrics;
 
 
-public class Main extends JavaPlugin {
+public class CustomOreGen extends JavaPlugin {
 	public static List<GeneratorConfig> generatorConfigs = new ArrayList<GeneratorConfig>();
 	public static List<String> disabledWorlds = new ArrayList<String>();
 
@@ -196,17 +196,17 @@ public class Main extends JavaPlugin {
 		GeneratorConfig gc = null;
 		int id = 0;
 		if (p == null) {
-			gc = Main.generatorConfigs.get(0);
+			gc = CustomOreGen.generatorConfigs.get(0);
 			cacheOreGen(p.getUniqueId(), id);
 		} else {
 			
-			int islandLevel = Main.getLevel(p.getUniqueId());
+			int islandLevel = CustomOreGen.getLevel(p.getUniqueId());
 
 			if(p.isOnline()){
 				Player realP = p.getPlayer();
 				if (activeInWorldName.equals(
 						realP.getWorld().getName())) {
-					for (GeneratorConfig gc2 : Main.generatorConfigs) {
+					for (GeneratorConfig gc2 : CustomOreGen.generatorConfigs) {
 						if (gc2 == null) {
 							continue;
 						}
@@ -229,7 +229,7 @@ public class Main extends JavaPlugin {
 	}
 	public static GeneratorConfig getCachedGeneratorConfig(UUID uuid){
 		if(cachedOregenConfigs.containsKey(uuid)){
-			return Main.generatorConfigs.get(cachedOregenConfigs.get(uuid));
+			return CustomOreGen.generatorConfigs.get(cachedOregenConfigs.get(uuid));
 		}
 		return null;
 	}

+ 5 - 5
src/de/Linus122/customoregen/Events.java → src/xyz/spaceio/customoregen/Events.java

@@ -1,4 +1,4 @@
-package de.Linus122.customoregen;
+package xyz.spaceio.customoregen;
 
 import java.util.Random;
 
@@ -16,7 +16,7 @@ public class Events implements Listener {
 	@SuppressWarnings("deprecation")
 	@EventHandler
 	public void onFromTo(BlockFromToEvent event) {
-		if (Main.disabledWorlds.contains(event.getBlock().getLocation().getWorld().getName())) {
+		if (CustomOreGen.disabledWorlds.contains(event.getBlock().getLocation().getWorld().getName())) {
 			return;
 		}
 
@@ -34,10 +34,10 @@ public class Events implements Listener {
 			}
 
 			if ((toid == 0 || toid == 9 || toid == 8) && (generatesCobble(id, b))) {
-				OfflinePlayer p = Main.getOwner(b.getLocation());
+				OfflinePlayer p = CustomOreGen.getOwner(b.getLocation());
 				if (p == null)
 					return;
-				GeneratorConfig gc = Main.getGeneratorConfigForPlayer(p);
+				GeneratorConfig gc = CustomOreGen.getGeneratorConfigForPlayer(p);
 				if (gc == null)
 					return;
 				if (getObject(gc) == null)
@@ -77,7 +77,7 @@ public class Events implements Listener {
 
 	@EventHandler
 	public void onJoin(PlayerJoinEvent e) {
-		Main.getGeneratorConfigForPlayer(e.getPlayer());
+		CustomOreGen.getGeneratorConfigForPlayer(e.getPlayer());
 	}
 
 	public GeneratorItem getObject(GeneratorConfig gc) {

+ 1 - 1
src/de/Linus122/customoregen/GeneratorConfig.java → src/xyz/spaceio/customoregen/GeneratorConfig.java

@@ -1,4 +1,4 @@
-package de.Linus122.customoregen;
+package xyz.spaceio.customoregen;
 
 import java.util.ArrayList;
 import java.util.List;

+ 1 - 1
src/de/Linus122/customoregen/GeneratorItem.java → src/xyz/spaceio/customoregen/GeneratorItem.java

@@ -1,4 +1,4 @@
-package de.Linus122.customoregen;
+package xyz.spaceio.customoregen;
 
 public class GeneratorItem {
 

+ 63 - 63
src/de/Linus122/customoregen/JSONConfig.java → src/xyz/spaceio/customoregen/JSONConfig.java

@@ -1,63 +1,63 @@
-package de.Linus122.customoregen;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.lang.reflect.Type;
-
-import org.bukkit.plugin.Plugin;
-
-import com.google.gson.Gson;
-
-
-public class JSONConfig {
-	File data;
-	Type type;
-	Object obj;
-	
-	public JSONConfig(Object obj, Type type, Plugin pl){
-		this.data = new File(pl.getDataFolder().getPath() + "/" + "data.json");
-		this.type = type;
-	}
-	public String getJson(Object obj){
-		Gson gson = new Gson();
-		return gson.toJson(obj, type);
-	}
-	public long saveToDisk(Object obj){
-		Gson gson = new Gson();
-		try {
-			FileOutputStream fout= new FileOutputStream (data);
-			ObjectOutputStream oos = new ObjectOutputStream(fout);
-			
-			oos.writeObject(gson.toJson(obj, type));
-			fout.close();
-			oos.close();
-		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return data.length();
-	}
-	public Object get(){
-		Object  c = null;
-		if(data.exists()){
-			try {
-				FileInputStream fin = new FileInputStream(data);
-				ObjectInputStream ois = new ObjectInputStream(fin);
-				Gson gson = new Gson();
-				c = gson.fromJson((String) ois.readObject(), type);
-				ois.close();
-				fin.close();
-			} catch (Exception e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
-			return c;
-		}else{
-			return null;
-		}
-	}
-}
+package xyz.spaceio.customoregen;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.lang.reflect.Type;
+
+import org.bukkit.plugin.Plugin;
+
+import com.google.gson.Gson;
+
+
+public class JSONConfig {
+	File data;
+	Type type;
+	Object obj;
+	
+	public JSONConfig(Object obj, Type type, Plugin pl){
+		this.data = new File(pl.getDataFolder().getPath() + "/" + "data.json");
+		this.type = type;
+	}
+	public String getJson(Object obj){
+		Gson gson = new Gson();
+		return gson.toJson(obj, type);
+	}
+	public long saveToDisk(Object obj){
+		Gson gson = new Gson();
+		try {
+			FileOutputStream fout= new FileOutputStream (data);
+			ObjectOutputStream oos = new ObjectOutputStream(fout);
+			
+			oos.writeObject(gson.toJson(obj, type));
+			fout.close();
+			oos.close();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return data.length();
+	}
+	public Object get(){
+		Object  c = null;
+		if(data.exists()){
+			try {
+				FileInputStream fin = new FileInputStream(data);
+				ObjectInputStream ois = new ObjectInputStream(fin);
+				Gson gson = new Gson();
+				c = gson.fromJson((String) ois.readObject(), type);
+				ois.close();
+				fin.close();
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+			return c;
+		}else{
+			return null;
+		}
+	}
+}