Browse Source

Converted project to maven

RadBuilder 6 years ago
parent
commit
b8bba0cdd2
29 changed files with 1754 additions and 1187 deletions
  1. 129 0
      Plugin/pom.xml
  2. 349 348
      Plugin/src/main/java/de/Linus122/TimeIsMoney/ATM.java
  3. 25 25
      Plugin/src/main/java/de/Linus122/TimeIsMoney/Cmd.java
  4. 494 493
      Plugin/src/main/java/de/Linus122/TimeIsMoney/Main.java
  5. 0 0
      Plugin/src/main/java/de/Linus122/TimeIsMoney/Metrics.java
  6. 12 12
      Plugin/src/main/java/de/Linus122/TimeIsMoney/Payout.java
  7. 84 84
      Plugin/src/main/resources/config.yml
  8. 54 54
      Plugin/src/main/resources/plugin.yml
  9. 0 19
      TimeIsMoney2/src/de/Linus122/TimeIsMoney/Utils.java
  10. 36 0
      Tools/pom.xml
  11. 1 1
      Tools/src/main/java/de/Linus122/TimeIsMoney/tools/ActionBarUtils.java
  12. 19 0
      Tools/src/main/java/de/Linus122/TimeIsMoney/tools/Utils.java
  13. 72 0
      pom.xml
  14. 41 0
      v1_10_R1/pom.xml
  15. 19 19
      v1_10_R1/src/main/java/de/Linus122/TimeIsMoney/version/v1_10_R1/NBTUtils.java
  16. 41 0
      v1_11_R1/pom.xml
  17. 19 19
      v1_11_R1/src/main/java/de/Linus122/TimeIsMoney/version/v1_11_R1/NBTUtils.java
  18. 41 0
      v1_12_R1/pom.xml
  19. 19 19
      v1_12_R1/src/main/java/de/Linus122/TimeIsMoney/version/v1_12_R1/NBTUtils.java
  20. 41 0
      v1_8_R1/pom.xml
  21. 20 20
      v1_8_R1/src/main/java/de/Linus122/TimeIsMoney/version/v1_8_R1/NBTUtils.java
  22. 41 0
      v1_8_R2/pom.xml
  23. 19 19
      v1_8_R2/src/main/java/de/Linus122/TimeIsMoney/version/v1_8_R2/NBTUtils.java
  24. 41 0
      v1_8_R3/pom.xml
  25. 18 18
      v1_8_R3/src/main/java/de/Linus122/TimeIsMoney/version/v1_8_R3/NBTUtils.java
  26. 41 0
      v1_9_R1/pom.xml
  27. 18 18
      v1_9_R1/src/main/java/de/Linus122/TimeIsMoney/version/v1_9_R1/NBTUtils.java
  28. 41 0
      v1_9_R2/pom.xml
  29. 19 19
      v1_9_R2/src/main/java/de/Linus122/TimeIsMoney/version/v1_9_R2/NBTUtils.java

+ 129 - 0
Plugin/pom.xml

@@ -0,0 +1,129 @@
+<?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.TimeIsMoney</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.9.6.1</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>TimeIsMoney Plugin</name>
+    <packaging>jar</packaging>
+    <artifactId>Plugin</artifactId>
+
+    <build>
+        <directory>../target</directory>
+        <finalName>TimeIsMoney</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>net.milkbowl.vault</groupId>
+            <artifactId>VaultAPI</artifactId>
+            <version>1.6</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>net.ess3</groupId>
+            <artifactId>Essentials</artifactId>
+            <version>2.13-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>Tools</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>v1_8_R1</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>v1_8_R2</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>v1_8_R3</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>v1_9_R1</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>v1_9_R2</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>v1_10_R1</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>v1_11_R1</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>v1_12_R1</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+    </dependencies>
+</project>

+ 349 - 348
TimeIsMoney2/src/de/Linus122/TimeIsMoney/ATM.java → Plugin/src/main/java/de/Linus122/TimeIsMoney/ATM.java

@@ -1,348 +1,349 @@
-package de.Linus122.TimeIsMoney;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-import org.bukkit.Bukkit;
-import org.bukkit.Material;
-import org.bukkit.OfflinePlayer;
-import org.bukkit.block.Block;
-import org.bukkit.block.Sign;
-import org.bukkit.command.Command;
-import org.bukkit.command.CommandExecutor;
-import org.bukkit.command.CommandSender;
-import org.bukkit.configuration.file.YamlConfiguration;
-import org.bukkit.entity.Player;
-import org.bukkit.event.Event.Result;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.block.SignChangeEvent;
-import org.bukkit.event.inventory.InventoryClickEvent;
-import org.bukkit.event.inventory.InventoryDragEvent;
-import org.bukkit.event.inventory.InventoryMoveItemEvent;
-import org.bukkit.event.player.PlayerInteractEvent;
-import org.bukkit.inventory.Inventory;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.inventory.meta.ItemMeta;
-import org.bukkit.plugin.Plugin;
-
-import com.google.common.primitives.Doubles;
-
-import static de.Linus122.TimeIsMoney.Utils.CC;
-
-public class ATM implements Listener, CommandExecutor {
-	private final Plugin pl;
-	
-	private static YamlConfiguration cfg;
-	private static final File fileBankAccounts = new File("plugins/TimeIsMoney/data.dat");
-	
-	private double[] worths = new double[4];
-	
-	public ATM(Main pl){
-		this.pl = pl;
-		pl.getServer().getPluginManager().registerEvents(this, pl);
-		pl.getCommand("atm").setExecutor(this);
-		if(!fileBankAccounts.exists()){
-			try {
-				fileBankAccounts.createNewFile();
-			} catch (IOException e) {
-				e.printStackTrace();
-			}	
-		}
-		cfg = YamlConfiguration.loadConfiguration(fileBankAccounts);
-		
-		worths = Doubles.toArray(Main.finalconfig.getDoubleList("atm_worth_gradation"));
-	}
-	private static void withdrawBank(Player p, double amount){
-		String bankString = getBankString(p);
-		if(!cfg.contains(bankString)) cfg.set(bankString, 0.0);
-		cfg.set(bankString, getBankBalance(p) - amount);
-		saveBanks();
-	}
-	public static void depositBank(Player p, double amount){
-		String bankString = getBankString(p);
-		if(!cfg.contains(bankString)) cfg.set(bankString, 0.0);
-		cfg.set(bankString, getBankBalance(p) + amount);
-		saveBanks();
-	}
-	private static boolean bankHas(Player p, double amount){
-		String bankString = getBankString(p);
-		if(!cfg.contains(bankString)) cfg.set(bankString, 0.0);
-		return getBankBalance(p) >= amount;
-		
-	}
-	//Doesn't support groups 
-	private static double getBankBalance(OfflinePlayer p){
-		String bankString =  p.getName() + "_TimBANK";
-		if(!cfg.contains(bankString)) cfg.set(bankString, 0.0);
-		return cfg.getDouble(bankString);
-	}
-	private static double getBankBalance(Player p){
-		String bankString = getBankString(p);
-		if(!cfg.contains(bankString)) cfg.set(bankString, 0.0);
-		return cfg.getDouble(bankString);
-	}
-	private static void saveBanks(){
-		try {
-			cfg.save(fileBankAccounts);
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-	//Converts old tim bank
-	private static void convertOldBank(Player p){
-		String bankString = getBankString(p);
-		if(Main.economy.hasAccount(bankString)){
-			if(Main.economy.getBalance(bankString) > 0){
-				p.sendMessage(CC("&aSuccessfully converted your old TIM-Bank to new version!"));
-				depositBank(p, Main.economy.getBalance(bankString));
-				Main.economy.withdrawPlayer(bankString, Main.economy.getBalance(bankString));	
-			}
-		}
-	}
-	private static String getBankString(Player p){
-		if(!Main.finalconfig.getBoolean("group-atms")){
-			return p.getName() + "_TimBANK";
-		}else{
-			for(String key : Main.finalconfig.getConfigurationSection("atm_groups").getKeys(false)){
-				List<String> list = Main.finalconfig.getStringList("atm_groups." + key);
-				if(list.contains(p.getWorld().getName())){
-					return p.getName() + "_TimBANK_" + key;
-				}
-			}
-		}
-		return p.getName() + "_TimBANK";
-		/*if(!Main.finalconfig.getBoolean("group-atms")){
-			return p.getName() + "_TimBANK";
-		}else{
-			for(String key : Main.finalconfig.getConfigurationSection("atm_groups").getKeys(false)){
-				List<String> list = Main.finalconfig.getStringList("atm_groups." + key);
-				if(list.contains(p.getWorld().getName())){
-					return p.getName() + "_TimBANK_" + key;
-				}
-			}
-		}
-		return p.getName() + "_TimBANK";*/
-	}
-	@EventHandler(priority = EventPriority.HIGHEST)
-	public void onInteract(PlayerInteractEvent e){
-		if(e.getClickedBlock() != null){
-			if(e.getClickedBlock().getType() == Material.WALL_SIGN || e.getClickedBlock().getType() == Material.SIGN || e.getClickedBlock().getType() == Material.SIGN_POST){
-				Sign sign = (Sign) e.getClickedBlock().getState();	
-				if(sign.getLine(0).equalsIgnoreCase(CC("&cATM"))){
-					if(!e.getPlayer().hasPermission("tim.atm.use")){
-						e.getPlayer().sendMessage(CC(Main.finalconfig.getString("message_atm_noperms")));
-					}else{
-						this.openGUI(e.getPlayer());
-					}
-				}
-			}
-		}
-	}
-	@EventHandler
-	public void onMove(InventoryMoveItemEvent e){
-		if(e.getSource() == null) return;
-		if(e.getSource().getTitle() == null) return;
-		if(e.getSource().getTitle().equals(CC(Main.finalconfig.getString("atm_title")))) {
-			e.setCancelled(true);
-		}
-	}
-	@SuppressWarnings("deprecation")
-	@EventHandler
-	public void onClick(InventoryClickEvent e){
-		try{
-			if(e == null) return;
-			if(e.getInventory() == null) return;
-			if(e.getInventory().getTitle() == null) return;
-			if(e.getInventory().getTitle().equals(CC(Main.finalconfig.getString("atm_title")))){
-				e.setResult(Result.DENY);
-				Player p = (Player) e.getWhoClicked();
-				//e.setCancelled(true);
-				if(e.getCurrentItem() != null){
-					// left side
-					if(e.getSlot() < 4){
-	
-						double amount = worths[3 - e.getSlot()];
-						
-						if(ATM.bankHas(p, amount)){
-							ATM.withdrawBank(p, amount);
-							Main.economy.depositPlayer(p, amount);
-							e.getWhoClicked().sendMessage(CC(Main.finalconfig.getString("atm_withdraw")) + " " + Main.economy.format(amount));
-						}else{
-							e.getWhoClicked().sendMessage(CC(Main.finalconfig.getString("message_atm_nomoneyinbank")));
-						}
-					}else
-					// right side
-					if(e.getSlot() > 4){
-						
-						double amount = worths[3 - (3 - (e.getSlot() - 5))];
-						
-						if(Main.economy.has((Player) e.getWhoClicked(), amount)){
-							ATM.depositBank(p, amount);
-							Main.economy.withdrawPlayer((Player) e.getWhoClicked(), amount);
-							e.getWhoClicked().sendMessage(CC(Main.finalconfig.getString("atm_deposit")) + " " + Main.economy.format(amount));
-						}else{
-							e.getWhoClicked().sendMessage(CC(Main.finalconfig.getString("message_atm_nomoney")));
-						}
-					}
-					ItemStack is = new ItemStack(Material.GOLD_NUGGET, 1);
-					ItemMeta im = is.getItemMeta();
-					im.setDisplayName(CC(Main.finalconfig.getString("atm_balance")) + " " + Main.economy.format(ATM.getBankBalance(p)));
-					is.setItemMeta(im);
-					e.getInventory().setItem(4, is);
-				}
-			}
-		}catch(Exception ignored){
-			
-		}
-	}
-	private void openGUI(Player player) {
-		convertOldBank(player);
-		Inventory atm_gui = Bukkit.createInventory(null, 9, CC(Main.finalconfig.getString("atm_title")));
-		
-		//
-		ItemStack is = new ItemStack(Material.GOLD_NUGGET, 1);
-		ItemMeta im = is.getItemMeta();
-		im.setDisplayName(CC(Main.finalconfig.getString("atm_balance")) + " " + Main.economy.format(ATM.getBankBalance(player)));
-		is.setItemMeta(im);
-		atm_gui.setItem(4, is);
-		
-
-		//
-		is = new ItemStack(Material.CLAY_BRICK, 1);
-		im = is.getItemMeta();
-		im.setDisplayName(CC(Main.finalconfig.getString("atm_withdraw") + " &a") + Main.economy.format(worths[0]));
-		is.setItemMeta(im);
-		atm_gui.setItem(3, is);
-		
-		//
-		is = new ItemStack(Material.IRON_INGOT, 1);
-		im = is.getItemMeta();
-		im.setDisplayName(CC(Main.finalconfig.getString("atm_withdraw") +  " &a") + Main.economy.format(worths[1]));
-		is.setItemMeta(im);
-		atm_gui.setItem(2, is);
-		
-		//
-		is = new ItemStack(Material.GOLD_INGOT, 1);
-		im = is.getItemMeta();
-		im.setDisplayName(CC(Main.finalconfig.getString("atm_withdraw") + " &a") + Main.economy.format(worths[2]));
-		is.setItemMeta(im);
-		atm_gui.setItem(1, is);
-		
-		//
-		is = new ItemStack(Material.DIAMOND, 1);
-		im = is.getItemMeta();
-		im.setDisplayName(CC(Main.finalconfig.getString("atm_withdraw") + " &a") + Main.economy.format(worths[3]));
-		is.setItemMeta(im);
-		atm_gui.setItem(0, is);
-		
-		//DEPOSITE
-		//
-		is = new ItemStack(Material.CLAY_BRICK, 1);
-		im = is.getItemMeta();
-		im.setDisplayName(CC(Main.finalconfig.getString("atm_deposit") + " &4") + Main.economy.format(worths[0]));
-		is.setItemMeta(im);
-		atm_gui.setItem(5, is);
-		
-		//
-		is = new ItemStack(Material.IRON_INGOT, 1);
-		im = is.getItemMeta();
-		im.setDisplayName(CC(Main.finalconfig.getString("atm_deposit") + " &4") + Main.economy.format(worths[1]));
-		is.setItemMeta(im);
-		atm_gui.setItem(6, is);
-		
-		//
-		is = new ItemStack(Material.GOLD_INGOT, 1);
-		im = is.getItemMeta();
-		im.setDisplayName(CC(Main.finalconfig.getString("atm_deposit") + " &4" )+ Main.economy.format(worths[2]));
-		is.setItemMeta(im);
-		atm_gui.setItem(7, is);
-		
-		//
-		is = new ItemStack(Material.DIAMOND, 1);
-		im = is.getItemMeta();
-		im.setDisplayName(CC(Main.finalconfig.getString("atm_deposit") + " &4") + Main.economy.format(worths[3]));
-		is.setItemMeta(im);
-		atm_gui.setItem(8, is);
-		
-		player.openInventory(atm_gui);
-		
-	}
-	public static void changeMoney(Player p, double amount){
-		
-	}
-	@EventHandler
-	public void onItem2(InventoryDragEvent e){
-		if(e == null) return;
-		if(e.getInventory() == null) return;
-		if(e.getInventory().getTitle() == null) return;
-		if(e.getInventory().getTitle().equals(CC(Main.finalconfig.getString("atm_title")))){
-			e.setResult(Result.DENY);
-		}
-	}
-	@EventHandler
-	public void onSign(final SignChangeEvent e){
-		final Block b = e.getBlock();
-		if(b.getType() == Material.WALL_SIGN || b.getType() == Material.SIGN || b.getType() == Material.SIGN_POST){
-			pl.getServer().getScheduler().scheduleSyncDelayedTask(pl, () -> {
-                if(b.getType() == Material.WALL_SIGN || b.getType() == Material.SIGN || b.getType() == Material.SIGN_POST){
-                    Sign sign = (Sign) e.getBlock().getState();
-                    if(sign.getLine(0).equalsIgnoreCase("[atm]")){
-                        if(!e.getPlayer().hasPermission("tim.atm.place")){
-                            e.getPlayer().sendMessage(CC("&cYou dont have permissions to build ATM's!"));
-                            sign.setLine(0, "");
-                        }else{
-                            sign.setLine(0, CC("&cATM"));
-                            sign.update();
-                            e.getPlayer().sendMessage(CC("&2ATM created! (You can also write something in the Lines 2-4)"));
-                        }
-                    }
-                }
-            }, 10L);
-		}
-	}
-
-	@Override
-	public boolean onCommand(CommandSender cs, Command arg1, String arg2, String[] args) {
-		if(args.length == 0){
-			if(cs.hasPermission("tim.use")){
-				openGUI((Player) cs);
-				return true;
-			}
-		}
-		if(cs.hasPermission("tim.admin")){
-			if(args.length > 0){
-				switch(args[0]){
-					case "balance":
-						if(args.length > 1){		
-							cs.sendMessage(CC("&2ATM-Balance of&c " + args[1] + "&2: &c") + getBankBalance(Bukkit.getOfflinePlayer(args[1])));
-						}else{
-							cs.sendMessage("/atm balance <player>");
-						}
-						break;
-					default:
-						@SuppressWarnings("deprecation")
-						OfflinePlayer op = Bukkit.getOfflinePlayer(args[0]);
-						if(op == null){
-							cs.sendMessage("Player is offline");
-							return true;
-						}
-						if(op.isOnline()){
-							openGUI(op.getPlayer());
-							cs.sendMessage("opened!");
-						}
-						break;
-						
-				}
-			
-			}else{
-				cs.sendMessage(CC("&c/atm <player> &a- opens atm for player"));
-				cs.sendMessage(CC("&c/atm balance <player> &a- gets balance of player"));
-				return true;
-			}
-		}
-		return true;
-	}
-}
+package de.Linus122.TimeIsMoney;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import org.bukkit.Bukkit;
+import org.bukkit.Material;
+import org.bukkit.OfflinePlayer;
+import org.bukkit.block.Block;
+import org.bukkit.block.Sign;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.configuration.file.YamlConfiguration;
+import org.bukkit.entity.Player;
+import org.bukkit.event.Event.Result;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.block.SignChangeEvent;
+import org.bukkit.event.inventory.InventoryClickEvent;
+import org.bukkit.event.inventory.InventoryDragEvent;
+import org.bukkit.event.inventory.InventoryMoveItemEvent;
+import org.bukkit.event.player.PlayerInteractEvent;
+import org.bukkit.inventory.Inventory;
+import org.bukkit.inventory.ItemStack;
+import org.bukkit.inventory.meta.ItemMeta;
+import org.bukkit.plugin.Plugin;
+
+import com.google.common.primitives.Doubles;
+
+import static de.Linus122.TimeIsMoney.tools.Utils.CC;
+
+
+public class ATM implements Listener, CommandExecutor {
+	private final Plugin pl;
+	
+	private static YamlConfiguration cfg;
+	private static final File fileBankAccounts = new File("plugins/TimeIsMoney/data.dat");
+	
+	private double[] worths = new double[4];
+	
+	public ATM(Main pl){
+		this.pl = pl;
+		pl.getServer().getPluginManager().registerEvents(this, pl);
+		pl.getCommand("atm").setExecutor(this);
+		if(!fileBankAccounts.exists()){
+			try {
+				fileBankAccounts.createNewFile();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}	
+		}
+		cfg = YamlConfiguration.loadConfiguration(fileBankAccounts);
+		
+		worths = Doubles.toArray(Main.finalconfig.getDoubleList("atm_worth_gradation"));
+	}
+	private static void withdrawBank(Player p, double amount){
+		String bankString = getBankString(p);
+		if(!cfg.contains(bankString)) cfg.set(bankString, 0.0);
+		cfg.set(bankString, getBankBalance(p) - amount);
+		saveBanks();
+	}
+	public static void depositBank(Player p, double amount){
+		String bankString = getBankString(p);
+		if(!cfg.contains(bankString)) cfg.set(bankString, 0.0);
+		cfg.set(bankString, getBankBalance(p) + amount);
+		saveBanks();
+	}
+	private static boolean bankHas(Player p, double amount){
+		String bankString = getBankString(p);
+		if(!cfg.contains(bankString)) cfg.set(bankString, 0.0);
+		return getBankBalance(p) >= amount;
+		
+	}
+	//Doesn't support groups 
+	private static double getBankBalance(OfflinePlayer p){
+		String bankString =  p.getName() + "_TimBANK";
+		if(!cfg.contains(bankString)) cfg.set(bankString, 0.0);
+		return cfg.getDouble(bankString);
+	}
+	private static double getBankBalance(Player p){
+		String bankString = getBankString(p);
+		if(!cfg.contains(bankString)) cfg.set(bankString, 0.0);
+		return cfg.getDouble(bankString);
+	}
+	private static void saveBanks(){
+		try {
+			cfg.save(fileBankAccounts);
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+	//Converts old tim bank
+	private static void convertOldBank(Player p){
+		String bankString = getBankString(p);
+		if(Main.economy.hasAccount(bankString)){
+			if(Main.economy.getBalance(bankString) > 0){
+				p.sendMessage(CC("&aSuccessfully converted your old TIM-Bank to new version!"));
+				depositBank(p, Main.economy.getBalance(bankString));
+				Main.economy.withdrawPlayer(bankString, Main.economy.getBalance(bankString));	
+			}
+		}
+	}
+	private static String getBankString(Player p){
+		if(!Main.finalconfig.getBoolean("group-atms")){
+			return p.getName() + "_TimBANK";
+		}else{
+			for(String key : Main.finalconfig.getConfigurationSection("atm_groups").getKeys(false)){
+				List<String> list = Main.finalconfig.getStringList("atm_groups." + key);
+				if(list.contains(p.getWorld().getName())){
+					return p.getName() + "_TimBANK_" + key;
+				}
+			}
+		}
+		return p.getName() + "_TimBANK";
+		/*if(!Main.finalconfig.getBoolean("group-atms")){
+			return p.getName() + "_TimBANK";
+		}else{
+			for(String key : Main.finalconfig.getConfigurationSection("atm_groups").getKeys(false)){
+				List<String> list = Main.finalconfig.getStringList("atm_groups." + key);
+				if(list.contains(p.getWorld().getName())){
+					return p.getName() + "_TimBANK_" + key;
+				}
+			}
+		}
+		return p.getName() + "_TimBANK";*/
+	}
+	@EventHandler(priority = EventPriority.HIGHEST)
+	public void onInteract(PlayerInteractEvent e){
+		if(e.getClickedBlock() != null){
+			if(e.getClickedBlock().getType() == Material.WALL_SIGN || e.getClickedBlock().getType() == Material.SIGN || e.getClickedBlock().getType() == Material.SIGN_POST){
+				Sign sign = (Sign) e.getClickedBlock().getState();	
+				if(sign.getLine(0).equalsIgnoreCase(CC("&cATM"))){
+					if(!e.getPlayer().hasPermission("tim.atm.use")){
+						e.getPlayer().sendMessage(CC(Main.finalconfig.getString("message_atm_noperms")));
+					}else{
+						this.openGUI(e.getPlayer());
+					}
+				}
+			}
+		}
+	}
+	@EventHandler
+	public void onMove(InventoryMoveItemEvent e){
+		if(e.getSource() == null) return;
+		if(e.getSource().getTitle() == null) return;
+		if(e.getSource().getTitle().equals(CC(Main.finalconfig.getString("atm_title")))) {
+			e.setCancelled(true);
+		}
+	}
+	@SuppressWarnings("deprecation")
+	@EventHandler
+	public void onClick(InventoryClickEvent e){
+		try{
+			if(e == null) return;
+			if(e.getInventory() == null) return;
+			if(e.getInventory().getTitle() == null) return;
+			if(e.getInventory().getTitle().equals(CC(Main.finalconfig.getString("atm_title")))){
+				e.setResult(Result.DENY);
+				Player p = (Player) e.getWhoClicked();
+				//e.setCancelled(true);
+				if(e.getCurrentItem() != null){
+					// left side
+					if(e.getSlot() < 4){
+	
+						double amount = worths[3 - e.getSlot()];
+						
+						if(ATM.bankHas(p, amount)){
+							ATM.withdrawBank(p, amount);
+							Main.economy.depositPlayer(p, amount);
+							e.getWhoClicked().sendMessage(CC(Main.finalconfig.getString("atm_withdraw")) + " " + Main.economy.format(amount));
+						}else{
+							e.getWhoClicked().sendMessage(CC(Main.finalconfig.getString("message_atm_nomoneyinbank")));
+						}
+					}else
+					// right side
+					if(e.getSlot() > 4){
+						
+						double amount = worths[3 - (3 - (e.getSlot() - 5))];
+						
+						if(Main.economy.has((Player) e.getWhoClicked(), amount)){
+							ATM.depositBank(p, amount);
+							Main.economy.withdrawPlayer((Player) e.getWhoClicked(), amount);
+							e.getWhoClicked().sendMessage(CC(Main.finalconfig.getString("atm_deposit")) + " " + Main.economy.format(amount));
+						}else{
+							e.getWhoClicked().sendMessage(CC(Main.finalconfig.getString("message_atm_nomoney")));
+						}
+					}
+					ItemStack is = new ItemStack(Material.GOLD_NUGGET, 1);
+					ItemMeta im = is.getItemMeta();
+					im.setDisplayName(CC(Main.finalconfig.getString("atm_balance")) + " " + Main.economy.format(ATM.getBankBalance(p)));
+					is.setItemMeta(im);
+					e.getInventory().setItem(4, is);
+				}
+			}
+		}catch(Exception ignored){
+			
+		}
+	}
+	private void openGUI(Player player) {
+		convertOldBank(player);
+		Inventory atm_gui = Bukkit.createInventory(null, 9, CC(Main.finalconfig.getString("atm_title")));
+		
+		//
+		ItemStack is = new ItemStack(Material.GOLD_NUGGET, 1);
+		ItemMeta im = is.getItemMeta();
+		im.setDisplayName(CC(Main.finalconfig.getString("atm_balance")) + " " + Main.economy.format(ATM.getBankBalance(player)));
+		is.setItemMeta(im);
+		atm_gui.setItem(4, is);
+		
+
+		//
+		is = new ItemStack(Material.CLAY_BRICK, 1);
+		im = is.getItemMeta();
+		im.setDisplayName(CC(Main.finalconfig.getString("atm_withdraw") + " &a") + Main.economy.format(worths[0]));
+		is.setItemMeta(im);
+		atm_gui.setItem(3, is);
+		
+		//
+		is = new ItemStack(Material.IRON_INGOT, 1);
+		im = is.getItemMeta();
+		im.setDisplayName(CC(Main.finalconfig.getString("atm_withdraw") +  " &a") + Main.economy.format(worths[1]));
+		is.setItemMeta(im);
+		atm_gui.setItem(2, is);
+		
+		//
+		is = new ItemStack(Material.GOLD_INGOT, 1);
+		im = is.getItemMeta();
+		im.setDisplayName(CC(Main.finalconfig.getString("atm_withdraw") + " &a") + Main.economy.format(worths[2]));
+		is.setItemMeta(im);
+		atm_gui.setItem(1, is);
+		
+		//
+		is = new ItemStack(Material.DIAMOND, 1);
+		im = is.getItemMeta();
+		im.setDisplayName(CC(Main.finalconfig.getString("atm_withdraw") + " &a") + Main.economy.format(worths[3]));
+		is.setItemMeta(im);
+		atm_gui.setItem(0, is);
+		
+		//DEPOSITE
+		//
+		is = new ItemStack(Material.CLAY_BRICK, 1);
+		im = is.getItemMeta();
+		im.setDisplayName(CC(Main.finalconfig.getString("atm_deposit") + " &4") + Main.economy.format(worths[0]));
+		is.setItemMeta(im);
+		atm_gui.setItem(5, is);
+		
+		//
+		is = new ItemStack(Material.IRON_INGOT, 1);
+		im = is.getItemMeta();
+		im.setDisplayName(CC(Main.finalconfig.getString("atm_deposit") + " &4") + Main.economy.format(worths[1]));
+		is.setItemMeta(im);
+		atm_gui.setItem(6, is);
+		
+		//
+		is = new ItemStack(Material.GOLD_INGOT, 1);
+		im = is.getItemMeta();
+		im.setDisplayName(CC(Main.finalconfig.getString("atm_deposit") + " &4" )+ Main.economy.format(worths[2]));
+		is.setItemMeta(im);
+		atm_gui.setItem(7, is);
+		
+		//
+		is = new ItemStack(Material.DIAMOND, 1);
+		im = is.getItemMeta();
+		im.setDisplayName(CC(Main.finalconfig.getString("atm_deposit") + " &4") + Main.economy.format(worths[3]));
+		is.setItemMeta(im);
+		atm_gui.setItem(8, is);
+		
+		player.openInventory(atm_gui);
+		
+	}
+	public static void changeMoney(Player p, double amount){
+		
+	}
+	@EventHandler
+	public void onItem2(InventoryDragEvent e){
+		if(e == null) return;
+		if(e.getInventory() == null) return;
+		if(e.getInventory().getTitle() == null) return;
+		if(e.getInventory().getTitle().equals(CC(Main.finalconfig.getString("atm_title")))){
+			e.setResult(Result.DENY);
+		}
+	}
+	@EventHandler
+	public void onSign(final SignChangeEvent e){
+		final Block b = e.getBlock();
+		if(b.getType() == Material.WALL_SIGN || b.getType() == Material.SIGN || b.getType() == Material.SIGN_POST){
+			pl.getServer().getScheduler().scheduleSyncDelayedTask(pl, () -> {
+                if(b.getType() == Material.WALL_SIGN || b.getType() == Material.SIGN || b.getType() == Material.SIGN_POST){
+                    Sign sign = (Sign) e.getBlock().getState();
+                    if(sign.getLine(0).equalsIgnoreCase("[atm]")){
+                        if(!e.getPlayer().hasPermission("tim.atm.place")){
+                            e.getPlayer().sendMessage(CC("&cYou dont have permissions to build ATM's!"));
+                            sign.setLine(0, "");
+                        }else{
+                            sign.setLine(0, CC("&cATM"));
+                            sign.update();
+                            e.getPlayer().sendMessage(CC("&2ATM created! (You can also write something in the Lines 2-4)"));
+                        }
+                    }
+                }
+            }, 10L);
+		}
+	}
+
+	@Override
+	public boolean onCommand(CommandSender cs, Command arg1, String arg2, String[] args) {
+		if(args.length == 0){
+			if(cs.hasPermission("tim.use")){
+				openGUI((Player) cs);
+				return true;
+			}
+		}
+		if(cs.hasPermission("tim.admin")){
+			if(args.length > 0){
+				switch(args[0]){
+					case "balance":
+						if(args.length > 1){		
+							cs.sendMessage(CC("&2ATM-Balance of&c " + args[1] + "&2: &c") + getBankBalance(Bukkit.getOfflinePlayer(args[1])));
+						}else{
+							cs.sendMessage("/atm balance <player>");
+						}
+						break;
+					default:
+						@SuppressWarnings("deprecation")
+						OfflinePlayer op = Bukkit.getOfflinePlayer(args[0]);
+						if(op == null){
+							cs.sendMessage("Player is offline");
+							return true;
+						}
+						if(op.isOnline()){
+							openGUI(op.getPlayer());
+							cs.sendMessage("opened!");
+						}
+						break;
+						
+				}
+			
+			}else{
+				cs.sendMessage(CC("&c/atm <player> &a- opens atm for player"));
+				cs.sendMessage(CC("&c/atm balance <player> &a- gets balance of player"));
+				return true;
+			}
+		}
+		return true;
+	}
+}

+ 25 - 25
TimeIsMoney2/src/de/Linus122/TimeIsMoney/Cmd.java → Plugin/src/main/java/de/Linus122/TimeIsMoney/Cmd.java

@@ -1,25 +1,25 @@
-package de.Linus122.TimeIsMoney;
-
-import org.bukkit.command.Command;
-import org.bukkit.command.CommandExecutor;
-import org.bukkit.command.CommandSender;
-
-import static de.Linus122.TimeIsMoney.Utils.CC;
-
-class Cmd implements CommandExecutor {
-	private final Main main;
-	Cmd(Main main) {
-		this.main = main;
-	}
-
-	@Override
-	public boolean onCommand(CommandSender cs, Command arg1, String arg2, String[] arg3) {
-		if(cs.hasPermission("tim.reload")){
-			main.reload();
-			cs.sendMessage(CC("&aTime is Money &cv" + Main.PL_VERSION + " &areloaded!"));
-			
-		}
-		return true;
-	}
-
-}
+package de.Linus122.TimeIsMoney;
+
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+
+import static de.Linus122.TimeIsMoney.tools.Utils.CC;
+
+class Cmd implements CommandExecutor {
+	private final Main main;
+	Cmd(Main main) {
+		this.main = main;
+	}
+
+	@Override
+	public boolean onCommand(CommandSender cs, Command arg1, String arg2, String[] arg3) {
+		if(cs.hasPermission("tim.reload")){
+			main.reload();
+			cs.sendMessage(CC("&aTime is Money &cv" + Main.PL_VERSION + " &areloaded!"));
+			
+		}
+		return true;
+	}
+
+}

+ 494 - 493
TimeIsMoney2/src/de/Linus122/TimeIsMoney/Main.java → Plugin/src/main/java/de/Linus122/TimeIsMoney/Main.java

@@ -1,493 +1,494 @@
-package de.Linus122.TimeIsMoney;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.PrintWriter;
-import java.lang.reflect.Field;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.UUID;
-
-import com.earth2me.essentials.Essentials;
-import org.bukkit.Bukkit;
-import org.bukkit.Location;
-import org.bukkit.Server;
-import org.bukkit.command.Command;
-import org.bukkit.command.ConsoleCommandSender;
-import org.bukkit.command.PluginCommand;
-import org.bukkit.command.SimpleCommandMap;
-import org.bukkit.configuration.file.YamlConfiguration;
-import org.bukkit.entity.Player;
-import org.bukkit.plugin.Plugin;
-import org.bukkit.plugin.PluginManager;
-import org.bukkit.plugin.RegisteredServiceProvider;
-import org.bukkit.plugin.SimplePluginManager;
-import org.bukkit.plugin.java.JavaPlugin;
-
-import static de.Linus122.TimeIsMoney.Utils.CC;
-
-public class Main extends JavaPlugin {
-
-    public static net.milkbowl.vault.economy.Economy economy = null;
-    private static ActionBarUtils actionBarUtils = null;
-    private static final int CFG_VERSION = 12;
-    public static String PL_VERSION;
-    public static YamlConfiguration finalconfig;
-    private static List<String> disabledWorlds;
-    private static final HashMap<String, UUID> boundIPs = new HashMap<>();
-    private final List<Payout> payouts = new ArrayList<>();
-    private HashMap<String, Double> payedMoney = new HashMap<>();
-    private final HashMap<UUID, Integer> onlineSeconds = new HashMap<>();
-    private final HashMap<UUID, Location> lastLocation = new HashMap<>();
-    private String message;
-    private String messageActionbar;
-    private final ConsoleCommandSender clogger = this.getServer().getConsoleSender();
-    private int currentDay = 0;
-    private boolean use18Features = true;
-
-    @SuppressWarnings({"deprecation", "unchecked"})
-    @Override
-    public void onEnable() {
-        this.getCommand("timeismoney").setExecutor(new Cmd(this));
-        PL_VERSION = this.getDescription().getVersion();
-        currentDay = (new Date()).getDay();
-
-        File config = new File("plugins/TimeIsMoney/config.yml");
-        if (config.exists()) {
-            YamlConfiguration cfg = YamlConfiguration.loadConfiguration(config);
-            String old_config = "config_old " + cfg.getInt("configuration-version") + ".yml";
-            if (cfg.contains("configuration-version")) {
-                if (cfg.getInt("configuration-version") < CFG_VERSION) {
-                    clogger.sendMessage(CC("[TimeIsMoney] &cYOU ARE USING AN OLD CONFIG-VERSION. The plugin CANT work with this."));
-                    clogger.sendMessage(CC("[TimeIsMoney] &cI have created an new config for you. The old one is saved as config_old.yml."));
-                    config.renameTo(new File("plugins/TimeIsMoney/" + old_config));
-                }
-            }
-            this.saveDefaultConfig();
-            for (String key : cfg.getConfigurationSection("").getKeys(true)) {
-                if (!this.getConfig().contains(key)) {
-                    this.getConfig().set(key, cfg.get(key));
-                }
-            }
-        } else {
-            this.saveDefaultConfig();
-        }
-
-
-        finalconfig = YamlConfiguration.loadConfiguration(config);
-        disabledWorlds = getConfig().getStringList("disabled_in_worlds");
-
-        if (getConfig().getBoolean("enable_atm")) new ATM(this);
-
-        final int seconds = getConfig().getInt("give_money_every_second");
-        Bukkit.getScheduler().runTaskTimerAsynchronously(this, () -> {
-            try {
-                for (Player p : Bukkit.getOnlinePlayers()) {
-                    if (disabledWorlds.contains(p.getWorld().getName())) continue;
-                    if (!boundIPs.containsKey(p.getAddress().getHostName())) {
-                        boundIPs.put(p.getAddress().getHostName(), p.getUniqueId());
-                    }
-                    if (onlineSeconds.containsKey(p.getUniqueId())) {
-
-                        onlineSeconds.put(p.getUniqueId(), onlineSeconds.get(p.getUniqueId()) + 1);
-                    } else {
-                        onlineSeconds.put(p.getUniqueId(), 1);
-                    }
-                    if (onlineSeconds.get(p.getUniqueId()) > seconds) {
-                        pay(p);
-                        onlineSeconds.remove(p.getUniqueId());
-                    }
-                }
-            } catch (NullPointerException e) {
-                //
-            }
-        }, 20L, 20L);
-        Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> {
-            if (currentDay != new Date().getDay()) { //Next day, clear payouts!
-                log("Cleared all payouts");
-                payedMoney.clear();
-                currentDay = new Date().getDay();
-            }
-        }, 20L * 60, 20L * 60 * 15);
-        setupEconomy();
-
-        message = finalconfig.getString("message");
-        message = CC(message);
-        messageActionbar = finalconfig.getString("message_actionbar");
-        messageActionbar = CC(messageActionbar);
-
-        try {
-            FileInputStream fis = new FileInputStream(new File("plugins/TimeIsMoney/payed_today.data"));
-            ObjectInputStream ois = new ObjectInputStream(fis);
-            payedMoney = (HashMap<String, Double>) ((HashMap<String, Double>) ois.readObject()).clone();
-
-            ois.close();
-        } catch (Exception ignored) {
-
-        }
-
-        loadPayouts();
-
-
-        String packageName = this.getServer().getClass().getPackage().getName();
-        // Get full package string of CraftServer.
-        // org.bukkit.craftbukkit.version
-        String Bukkitversion = packageName.substring(packageName.lastIndexOf('.') + 1);
-        // Get the last element of the package
-        try {
-            final Class<?> clazz = Class.forName(Bukkitversion + ".NBTUtils");
-            // Check if we have a NMSHandler class at that location.
-            if (ActionBarUtils.class.isAssignableFrom(clazz)) { // Make sure it actually implements NMS
-                actionBarUtils = (ActionBarUtils) clazz.getConstructor().newInstance(); // Set our handler
-            }
-
-        } catch (final Exception e) {
-            this.getLogger().severe("Actionbars are not supported on your spigot version, sorry.");
-            use18Features = false;
-            return;
-        }
-
-        if (Bukkit.getPluginManager().isPluginEnabled("Essentials")) {
-            clogger.sendMessage("Time is Money: Essentials found. Hook in it -> Will use Essentials's AFK feature if afk is enabled.");
-        }
-        new Metrics(this);
-        
-        clogger.sendMessage(CC("&aTime is Money &2v" + PL_VERSION + " &astarted."));
-    }
-
-    @Override
-    public void onDisable() {
-        FileOutputStream fos;
-        try {
-            fos = new FileOutputStream(new File("plugins/TimeIsMoney/payed_today.data"));
-            ObjectOutputStream oos = new ObjectOutputStream(fos);
-            oos.writeObject(payedMoney);
-            oos.close();
-        } catch (Exception ignored) {
-
-        }
-    }
-
-    public void reload() {
-        //File config = new File("plugins/TimeIsMoney/config.yml");
-        //finalconfig = YamlConfiguration.loadConfiguration(config);
-        Bukkit.getPluginManager().disablePlugin(this);
-        Bukkit.getPluginManager().enablePlugin(this);
-        //this.onDisable();
-        //this.onEnable();
-        //loadPayouts();
-    }
-
-    private void loadPayouts() {
-        try {
-            payouts.clear();
-            for (String key : finalconfig.getConfigurationSection("payouts").getKeys(false)) {
-                Payout payout = new Payout();
-                payout.max_payout_per_day = finalconfig.getDouble("payouts." + key + ".max_payout_per_day");
-                payout.payout_amount = finalconfig.getDouble("payouts." + key + ".payout_amount");
-                if (finalconfig.getString("payouts." + key + ".permission") != null) {
-                    payout.permission = finalconfig.getString("payouts." + key + ".permission");
-                }
-                if (finalconfig.getString("payouts." + key + ".commands") != null) {
-                    payout.commands = finalconfig.getStringList("payouts." + key + ".commands");
-                }
-
-                if (finalconfig.getString("payouts." + key + ".chance") != null) {
-                    payout.chance = finalconfig.getInt("payouts." + key + ".chance");
-                }
-                payouts.add(payout);
-            }
-            clogger.sendMessage(CC("[TimeIsMoney] &aLoaded " + finalconfig.getConfigurationSection("payouts").getKeys(false).size() + " Payouts!"));
-        } catch (Exception e) {
-            clogger.sendMessage(CC("[TimeIsMoney] &aFailed to load Payouts! (May made a mistake in config.yml?)"));
-        }
-    }
-
-    private boolean setupEconomy() {
-        RegisteredServiceProvider<net.milkbowl.vault.economy.Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
-        if (economyProvider != null) {
-            economy = economyProvider.getProvider();
-        }
-
-        return (economy != null);
-    }
-
-    private Payout getPayOutForPlayer(Player p) {
-        Payout finalpayout = null;
-        if (!this.getConfig().getBoolean("choose-payout-by-chance")) {
-            //by Permission
-            for (Payout payout : payouts) {
-                if (payout.permission.equalsIgnoreCase("")) finalpayout = payout;
-                if (p.hasPermission(payout.permission)) {
-                    finalpayout = payout;
-                }
-            }
-        } else {
-            //by Chance
-            Random rnd = new Random();
-            List<Payout> list = new ArrayList<>();
-            for (Payout payout : payouts) {
-                for (int i = 0; i < payout.chance; i++) list.add(payout);
-            }
-            finalpayout = list.get(rnd.nextInt(list.size() - 1));
-        }
-        return finalpayout;
-    }
-
-    @SuppressWarnings("deprecation")
-    private void pay(Player p) {
-        if (p == null) return;
-
-        //REACHED MAX PAYOUT CHECK
-        double payed = 0;
-        if (payedMoney.containsKey(p.getName())) {
-            payed = payedMoney.get(p.getName());
-        }
-        Payout payout = getPayOutForPlayer(p);
-        if (payout == null) return;
-        if (payout.max_payout_per_day != -1) {
-            if (payed >= payout.max_payout_per_day) { //Reached max payout
-                if (finalconfig.getBoolean("display-messages-in-chat")) {
-                    sendMessage(p, finalconfig.getString("message_payoutlimit_reached"));
-                }
-                if (finalconfig.getBoolean("display-messages-in-actionbar") && use18Features) {
-                    sendActionbar(p, finalconfig.getString("message_payoutlimit_reached_actionbar"));
-                }
-                return;
-            }
-        }
-
-        if (!finalconfig.getBoolean("allow-multiple-accounts")) {
-            if (boundIPs.containsKey(p.getAddress().getHostName())) {
-                if (!boundIPs.get(p.getAddress().getHostName()).equals(p.getUniqueId())) {
-                    sendMessage(p, finalconfig.getString("message_multiple_ips"));
-                    return;
-                }
-            }
-        }
-
-        //AFK CHECK
-        if (!finalconfig.getBoolean("afk_payout") && !p.hasPermission("tim.afkbypass")) {
-            //ESENTIALS_AFK_FEATURE
-            if (Bukkit.getServer().getPluginManager().isPluginEnabled("Essentials")) {
-                Essentials essentials = (com.earth2me.essentials.Essentials) Bukkit.getServer().getPluginManager().getPlugin("Essentials");
-                if (essentials.getUser(p).isAfk()) {
-                    //AFK
-                    if (finalconfig.getBoolean("display-messages-in-chat")) {
-                        sendMessage(p, finalconfig.getString("message_afk"));
-                    }
-                    if (finalconfig.getBoolean("display-messages-in-actionbar") && use18Features) {
-                        sendActionbar(p, finalconfig.getString("message_afk_actionbar"));
-                    }
-                    return;
-                }
-            } else
-                //PLUGIN_AFK_FEATURE
-                if (lastLocation.containsKey(p.getUniqueId())) { //AntiAFK
-                    if (lastLocation.get(p.getUniqueId()).getX() == p.getLocation().getX() && lastLocation.get(p.getUniqueId()).getY() == p.getLocation().getY() && lastLocation.get(p.getUniqueId()).getZ() == p.getLocation().getZ() || lastLocation.get(p.getUniqueId()).getYaw() == p.getLocation().getYaw()) {
-                        //AFK
-                        if (finalconfig.getBoolean("display-messages-in-chat")) {
-                            sendMessage(p, finalconfig.getString("message_afk"));
-                        }
-                        if (finalconfig.getBoolean("display-messages-in-actionbar") && use18Features) {
-                            sendActionbar(p, finalconfig.getString("message_afk_actionbar"));
-                        }
-                        return;
-                    }
-                }
-        }
-
-        //DEPOSIT
-        if (finalconfig.getBoolean("store-money-in-bank")) {
-            ATM.depositBank(p, payout.payout_amount);
-        } else {
-            double before = 0;
-            if (economy.hasAccount(p)) {
-                before = economy.getBalance(p);
-            }
-
-            economy.depositPlayer(p, payout.payout_amount);
-            log(p.getName() + ": Deposited: " + payout.payout_amount + " Balance-before: " + before + " Balance-now: " + economy.getBalance(p));
-
-        }
-        if (finalconfig.getBoolean("display-messages-in-chat")) {
-            sendMessage(p, message.replace("%money%", economy.format(payout.payout_amount)));
-        }
-        if (finalconfig.getBoolean("display-messages-in-actionbar") && use18Features) {
-            sendActionbar(p, messageActionbar.replace("%money%", economy.format(payout.payout_amount)));
-        }
-        for (String cmd : payout.commands) {
-            dispatchCommandSync(cmd.replace("/", "").replaceAll("%player%", p.getName()));
-        }
-
-        //ADD PAYED MONEY
-        if (payedMoney.containsKey(p.getName())) {
-            payedMoney.put(p.getName(), payedMoney.get(p.getName()) + payout.payout_amount);
-        } else {
-            payedMoney.put(p.getName(), payout.payout_amount);
-        }
-
-        lastLocation.put(p.getUniqueId(), p.getLocation());
-
-    }
-
-    private void dispatchCommandSync(final String cmd) {
-        final Server server = this.getServer();
-
-        this.getServer().getScheduler().runTask(this, () -> server.dispatchCommand(server.getConsoleSender(), cmd));
-    }
-
-    @SuppressWarnings("deprecation")
-    private void log(String msg) {
-        if (!this.getConfig().getBoolean("debug-log")) {
-            return;
-        }
-        Timestamp currentTimestamp = new Timestamp(Calendar.getInstance().getTime().getTime());
-
-        File file = new File("plugins/TimeIsMoney/log.txt");
-        try {
-            if (!file.exists()) {
-                file.createNewFile();
-            }
-            FileReader pr = new FileReader(file);
-            int number;
-            StringBuffer text = new StringBuffer();
-            while ((number = pr.read()) != -1) {
-
-                text.append((char) number);
-            }
-            text.append(currentTimestamp.toGMTString()).append(":").append(msg).append("\n");
-            PrintWriter pw = new PrintWriter(file);
-            pw.print(text);
-
-            pw.close();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    private void sendMessage(Player p, String msg) {
-        if (msg == null) return;
-        if (msg.length() == 0) return;
-        p.sendMessage(CC(msg));
-    }
-
-    private void sendActionbar(final Player p, final String msg) {
-        if (msg.length() == 0) return;
-        int times = finalconfig.getInt("display-messages-in-actionbar-time");
-        if (times == 1) {
-            if (actionBarUtils != null) {
-                actionBarUtils.sendActionBarMessage(p, msg);
-            }
-        } else if (times > 1) {
-            if (actionBarUtils != null) {
-                actionBarUtils.sendActionBarMessage(p, msg);
-            }
-            times--;
-            for (int i = 0; i < times; i++) {
-                Bukkit.getScheduler().scheduleSyncDelayedTask(this, () -> actionBarUtils.sendActionBarMessage(p, CC(msg)), 20L * i);
-            }
-        }
-    }
-
-    private boolean unloadPlugin(String pluginName)
-            throws Exception {
-        PluginManager manager = getServer().getPluginManager();
-        SimplePluginManager spmanager = (SimplePluginManager) manager;
-        if (spmanager != null) {
-            Field pluginsField = spmanager.getClass().getDeclaredField("plugins");
-            pluginsField.setAccessible(true);
-            List<Plugin> plugins = (List) pluginsField.get(spmanager);
-
-            Field lookupNamesField = spmanager.getClass().getDeclaredField("lookupNames");
-            lookupNamesField.setAccessible(true);
-            Map<String, Plugin> lookupNames = (Map) lookupNamesField.get(spmanager);
-
-            Field commandMapField = spmanager.getClass().getDeclaredField("commandMap");
-            commandMapField.setAccessible(true);
-            SimpleCommandMap commandMap = (SimpleCommandMap) commandMapField.get(spmanager);
-
-            Field knownCommandsField;
-            Map<String, Command> knownCommands = null;
-            if (commandMap != null) {
-                knownCommandsField = commandMap.getClass().getDeclaredField("knownCommands");
-                knownCommandsField.setAccessible(true);
-                knownCommands = (Map) knownCommandsField.get(commandMap);
-            }
-            Plugin plugin;
-            Iterator<Map.Entry<String, Command>> it;
-            for (Plugin plugin1 : manager.getPlugins()) {
-                if (plugin1.getDescription().getName().equalsIgnoreCase(pluginName)) {
-                    manager.disablePlugin(plugin1);
-                    if ((plugins != null) && (plugins.contains(plugin1))) {
-                        plugins.remove(plugin1);
-                    }
-                    if ((lookupNames != null) && (lookupNames.containsKey(pluginName))) {
-                        lookupNames.remove(pluginName);
-                    }
-                    if (commandMap != null) {
-                        for (it = knownCommands.entrySet().iterator(); it.hasNext(); ) {
-                            Map.Entry<String, Command> entry = it.next();
-                            if ((entry.getValue() instanceof PluginCommand)) {
-                                PluginCommand command = (PluginCommand) entry.getValue();
-                                if (command.getPlugin() == plugin1) {
-                                    command.unregister(commandMap);
-                                    it.remove();
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        } else {
-
-            return true;
-        }
-
-
-        return true;
-    }
-
-    private boolean loadPlugin(String pluginName) {
-        try {
-            PluginManager manager = getServer().getPluginManager();
-            Plugin plugin = manager.loadPlugin(new File("plugins", pluginName + ".jar"));
-            if (plugin == null) {
-                return false;
-            }
-            plugin.onLoad();
-            manager.enablePlugin(plugin);
-        } catch (Exception e) {
-
-            return false;
-        }
-
-        return true;
-    }
-
-    private boolean reloadPlugin(String pluginName)
-            throws Exception {
-        boolean unload = unloadPlugin(pluginName);
-        boolean load = loadPlugin(pluginName);
-
-        if ((unload) && (load)) {
-
-        } else {
-
-            return false;
-        }
-        return true;
-    }
-}
+package de.Linus122.TimeIsMoney;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.PrintWriter;
+import java.lang.reflect.Field;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.UUID;
+
+import com.earth2me.essentials.Essentials;
+import de.Linus122.TimeIsMoney.tools.ActionBarUtils;
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.Server;
+import org.bukkit.command.Command;
+import org.bukkit.command.ConsoleCommandSender;
+import org.bukkit.command.PluginCommand;
+import org.bukkit.command.SimpleCommandMap;
+import org.bukkit.configuration.file.YamlConfiguration;
+import org.bukkit.entity.Player;
+import org.bukkit.plugin.Plugin;
+import org.bukkit.plugin.PluginManager;
+import org.bukkit.plugin.RegisteredServiceProvider;
+import org.bukkit.plugin.SimplePluginManager;
+import org.bukkit.plugin.java.JavaPlugin;
+
+import static de.Linus122.TimeIsMoney.tools.Utils.CC;
+
+public class Main extends JavaPlugin {
+
+    public static net.milkbowl.vault.economy.Economy economy = null;
+    private static ActionBarUtils actionBarUtils = null;
+    private static final int CFG_VERSION = 12;
+    public static String PL_VERSION;
+    public static YamlConfiguration finalconfig;
+    private static List<String> disabledWorlds;
+    private static final HashMap<String, UUID> boundIPs = new HashMap<>();
+    private final List<Payout> payouts = new ArrayList<>();
+    private HashMap<String, Double> payedMoney = new HashMap<>();
+    private final HashMap<UUID, Integer> onlineSeconds = new HashMap<>();
+    private final HashMap<UUID, Location> lastLocation = new HashMap<>();
+    private String message;
+    private String messageActionbar;
+    private final ConsoleCommandSender clogger = this.getServer().getConsoleSender();
+    private int currentDay = 0;
+    private boolean use18Features = true;
+
+    @SuppressWarnings({"deprecation", "unchecked"})
+    @Override
+    public void onEnable() {
+        this.getCommand("timeismoney").setExecutor(new Cmd(this));
+        PL_VERSION = this.getDescription().getVersion();
+        currentDay = (new Date()).getDay();
+
+        File config = new File("plugins/TimeIsMoney/config.yml");
+        if (config.exists()) {
+            YamlConfiguration cfg = YamlConfiguration.loadConfiguration(config);
+            String old_config = "config_old " + cfg.getInt("configuration-version") + ".yml";
+            if (cfg.contains("configuration-version")) {
+                if (cfg.getInt("configuration-version") < CFG_VERSION) {
+                    clogger.sendMessage(CC("[TimeIsMoney] &cYOU ARE USING AN OLD CONFIG-VERSION. The plugin CANT work with this."));
+                    clogger.sendMessage(CC("[TimeIsMoney] &cI have created an new config for you. The old one is saved as config_old.yml."));
+                    config.renameTo(new File("plugins/TimeIsMoney/" + old_config));
+                }
+            }
+            this.saveDefaultConfig();
+            for (String key : cfg.getConfigurationSection("").getKeys(true)) {
+                if (!this.getConfig().contains(key)) {
+                    this.getConfig().set(key, cfg.get(key));
+                }
+            }
+        } else {
+            this.saveDefaultConfig();
+        }
+
+
+        finalconfig = YamlConfiguration.loadConfiguration(config);
+        disabledWorlds = getConfig().getStringList("disabled_in_worlds");
+
+        if (getConfig().getBoolean("enable_atm")) new ATM(this);
+
+        final int seconds = getConfig().getInt("give_money_every_second");
+        Bukkit.getScheduler().runTaskTimerAsynchronously(this, () -> {
+            try {
+                for (Player p : Bukkit.getOnlinePlayers()) {
+                    if (disabledWorlds.contains(p.getWorld().getName())) continue;
+                    if (!boundIPs.containsKey(p.getAddress().getHostName())) {
+                        boundIPs.put(p.getAddress().getHostName(), p.getUniqueId());
+                    }
+                    if (onlineSeconds.containsKey(p.getUniqueId())) {
+
+                        onlineSeconds.put(p.getUniqueId(), onlineSeconds.get(p.getUniqueId()) + 1);
+                    } else {
+                        onlineSeconds.put(p.getUniqueId(), 1);
+                    }
+                    if (onlineSeconds.get(p.getUniqueId()) > seconds) {
+                        pay(p);
+                        onlineSeconds.remove(p.getUniqueId());
+                    }
+                }
+            } catch (NullPointerException e) {
+                //
+            }
+        }, 20L, 20L);
+        Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> {
+            if (currentDay != new Date().getDay()) { //Next day, clear payouts!
+                log("Cleared all payouts");
+                payedMoney.clear();
+                currentDay = new Date().getDay();
+            }
+        }, 20L * 60, 20L * 60 * 15);
+        setupEconomy();
+
+        message = finalconfig.getString("message");
+        message = CC(message);
+        messageActionbar = finalconfig.getString("message_actionbar");
+        messageActionbar = CC(messageActionbar);
+
+        try {
+            FileInputStream fis = new FileInputStream(new File("plugins/TimeIsMoney/payed_today.data"));
+            ObjectInputStream ois = new ObjectInputStream(fis);
+            payedMoney = (HashMap<String, Double>) ((HashMap<String, Double>) ois.readObject()).clone();
+
+            ois.close();
+        } catch (Exception ignored) {
+
+        }
+
+        loadPayouts();
+
+
+        String packageName = this.getServer().getClass().getPackage().getName();
+        // Get full package string of CraftServer.
+        // org.bukkit.craftbukkit.version
+        String Bukkitversion = packageName.substring(packageName.lastIndexOf('.') + 1);
+        // Get the last element of the package
+        try {
+            final Class<?> clazz = Class.forName("de.Linus122.TimeIsMoney.version." + Bukkitversion + ".NBTUtils");
+            // Check if we have a NMSHandler class at that location.
+            if (ActionBarUtils.class.isAssignableFrom(clazz)) { // Make sure it actually implements NMS
+                actionBarUtils = (ActionBarUtils) clazz.getConstructor().newInstance(); // Set our handler
+            }
+
+        } catch (final Exception e) {
+            this.getLogger().severe("Actionbars are not supported on your spigot version, sorry.");
+            use18Features = false;
+            return;
+        }
+
+        if (Bukkit.getPluginManager().isPluginEnabled("Essentials")) {
+            clogger.sendMessage("Time is Money: Essentials found. Hook in it -> Will use Essentials's AFK feature if afk is enabled.");
+        }
+        new Metrics(this);
+        
+        clogger.sendMessage(CC("&aTime is Money &2v" + PL_VERSION + " &astarted."));
+    }
+
+    @Override
+    public void onDisable() {
+        FileOutputStream fos;
+        try {
+            fos = new FileOutputStream(new File("plugins/TimeIsMoney/payed_today.data"));
+            ObjectOutputStream oos = new ObjectOutputStream(fos);
+            oos.writeObject(payedMoney);
+            oos.close();
+        } catch (Exception ignored) {
+
+        }
+    }
+
+    public void reload() {
+        //File config = new File("plugins/TimeIsMoney/config.yml");
+        //finalconfig = YamlConfiguration.loadConfiguration(config);
+        Bukkit.getPluginManager().disablePlugin(this);
+        Bukkit.getPluginManager().enablePlugin(this);
+        //this.onDisable();
+        //this.onEnable();
+        //loadPayouts();
+    }
+
+    private void loadPayouts() {
+        try {
+            payouts.clear();
+            for (String key : finalconfig.getConfigurationSection("payouts").getKeys(false)) {
+                Payout payout = new Payout();
+                payout.max_payout_per_day = finalconfig.getDouble("payouts." + key + ".max_payout_per_day");
+                payout.payout_amount = finalconfig.getDouble("payouts." + key + ".payout_amount");
+                if (finalconfig.getString("payouts." + key + ".permission") != null) {
+                    payout.permission = finalconfig.getString("payouts." + key + ".permission");
+                }
+                if (finalconfig.getString("payouts." + key + ".commands") != null) {
+                    payout.commands = finalconfig.getStringList("payouts." + key + ".commands");
+                }
+
+                if (finalconfig.getString("payouts." + key + ".chance") != null) {
+                    payout.chance = finalconfig.getInt("payouts." + key + ".chance");
+                }
+                payouts.add(payout);
+            }
+            clogger.sendMessage(CC("[TimeIsMoney] &aLoaded " + finalconfig.getConfigurationSection("payouts").getKeys(false).size() + " Payouts!"));
+        } catch (Exception e) {
+            clogger.sendMessage(CC("[TimeIsMoney] &aFailed to load Payouts! (May made a mistake in config.yml?)"));
+        }
+    }
+
+    private boolean setupEconomy() {
+        RegisteredServiceProvider<net.milkbowl.vault.economy.Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
+        if (economyProvider != null) {
+            economy = economyProvider.getProvider();
+        }
+
+        return (economy != null);
+    }
+
+    private Payout getPayOutForPlayer(Player p) {
+        Payout finalpayout = null;
+        if (!this.getConfig().getBoolean("choose-payout-by-chance")) {
+            //by Permission
+            for (Payout payout : payouts) {
+                if (payout.permission.equalsIgnoreCase("")) finalpayout = payout;
+                if (p.hasPermission(payout.permission)) {
+                    finalpayout = payout;
+                }
+            }
+        } else {
+            //by Chance
+            Random rnd = new Random();
+            List<Payout> list = new ArrayList<>();
+            for (Payout payout : payouts) {
+                for (int i = 0; i < payout.chance; i++) list.add(payout);
+            }
+            finalpayout = list.get(rnd.nextInt(list.size() - 1));
+        }
+        return finalpayout;
+    }
+
+    @SuppressWarnings("deprecation")
+    private void pay(Player p) {
+        if (p == null) return;
+
+        //REACHED MAX PAYOUT CHECK
+        double payed = 0;
+        if (payedMoney.containsKey(p.getName())) {
+            payed = payedMoney.get(p.getName());
+        }
+        Payout payout = getPayOutForPlayer(p);
+        if (payout == null) return;
+        if (payout.max_payout_per_day != -1) {
+            if (payed >= payout.max_payout_per_day) { //Reached max payout
+                if (finalconfig.getBoolean("display-messages-in-chat")) {
+                    sendMessage(p, finalconfig.getString("message_payoutlimit_reached"));
+                }
+                if (finalconfig.getBoolean("display-messages-in-actionbar") && use18Features) {
+                    sendActionbar(p, finalconfig.getString("message_payoutlimit_reached_actionbar"));
+                }
+                return;
+            }
+        }
+
+        if (!finalconfig.getBoolean("allow-multiple-accounts")) {
+            if (boundIPs.containsKey(p.getAddress().getHostName())) {
+                if (!boundIPs.get(p.getAddress().getHostName()).equals(p.getUniqueId())) {
+                    sendMessage(p, finalconfig.getString("message_multiple_ips"));
+                    return;
+                }
+            }
+        }
+
+        //AFK CHECK
+        if (!finalconfig.getBoolean("afk_payout") && !p.hasPermission("tim.afkbypass")) {
+            //ESENTIALS_AFK_FEATURE
+            if (Bukkit.getServer().getPluginManager().isPluginEnabled("Essentials")) {
+                Essentials essentials = (com.earth2me.essentials.Essentials) Bukkit.getServer().getPluginManager().getPlugin("Essentials");
+                if (essentials.getUser(p).isAfk()) {
+                    //AFK
+                    if (finalconfig.getBoolean("display-messages-in-chat")) {
+                        sendMessage(p, finalconfig.getString("message_afk"));
+                    }
+                    if (finalconfig.getBoolean("display-messages-in-actionbar") && use18Features) {
+                        sendActionbar(p, finalconfig.getString("message_afk_actionbar"));
+                    }
+                    return;
+                }
+            } else
+                //PLUGIN_AFK_FEATURE
+                if (lastLocation.containsKey(p.getUniqueId())) { //AntiAFK
+                    if (lastLocation.get(p.getUniqueId()).getX() == p.getLocation().getX() && lastLocation.get(p.getUniqueId()).getY() == p.getLocation().getY() && lastLocation.get(p.getUniqueId()).getZ() == p.getLocation().getZ() || lastLocation.get(p.getUniqueId()).getYaw() == p.getLocation().getYaw()) {
+                        //AFK
+                        if (finalconfig.getBoolean("display-messages-in-chat")) {
+                            sendMessage(p, finalconfig.getString("message_afk"));
+                        }
+                        if (finalconfig.getBoolean("display-messages-in-actionbar") && use18Features) {
+                            sendActionbar(p, finalconfig.getString("message_afk_actionbar"));
+                        }
+                        return;
+                    }
+                }
+        }
+
+        //DEPOSIT
+        if (finalconfig.getBoolean("store-money-in-bank")) {
+            ATM.depositBank(p, payout.payout_amount);
+        } else {
+            double before = 0;
+            if (economy.hasAccount(p)) {
+                before = economy.getBalance(p);
+            }
+
+            economy.depositPlayer(p, payout.payout_amount);
+            log(p.getName() + ": Deposited: " + payout.payout_amount + " Balance-before: " + before + " Balance-now: " + economy.getBalance(p));
+
+        }
+        if (finalconfig.getBoolean("display-messages-in-chat")) {
+            sendMessage(p, message.replace("%money%", economy.format(payout.payout_amount)));
+        }
+        if (finalconfig.getBoolean("display-messages-in-actionbar") && use18Features) {
+            sendActionbar(p, messageActionbar.replace("%money%", economy.format(payout.payout_amount)));
+        }
+        for (String cmd : payout.commands) {
+            dispatchCommandSync(cmd.replace("/", "").replaceAll("%player%", p.getName()));
+        }
+
+        //ADD PAYED MONEY
+        if (payedMoney.containsKey(p.getName())) {
+            payedMoney.put(p.getName(), payedMoney.get(p.getName()) + payout.payout_amount);
+        } else {
+            payedMoney.put(p.getName(), payout.payout_amount);
+        }
+
+        lastLocation.put(p.getUniqueId(), p.getLocation());
+
+    }
+
+    private void dispatchCommandSync(final String cmd) {
+        final Server server = this.getServer();
+
+        this.getServer().getScheduler().runTask(this, () -> server.dispatchCommand(server.getConsoleSender(), cmd));
+    }
+
+    @SuppressWarnings("deprecation")
+    private void log(String msg) {
+        if (!this.getConfig().getBoolean("debug-log")) {
+            return;
+        }
+        Timestamp currentTimestamp = new Timestamp(Calendar.getInstance().getTime().getTime());
+
+        File file = new File("plugins/TimeIsMoney/log.txt");
+        try {
+            if (!file.exists()) {
+                file.createNewFile();
+            }
+            FileReader pr = new FileReader(file);
+            int number;
+            StringBuffer text = new StringBuffer();
+            while ((number = pr.read()) != -1) {
+
+                text.append((char) number);
+            }
+            text.append(currentTimestamp.toGMTString()).append(":").append(msg).append("\n");
+            PrintWriter pw = new PrintWriter(file);
+            pw.print(text);
+
+            pw.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void sendMessage(Player p, String msg) {
+        if (msg == null) return;
+        if (msg.length() == 0) return;
+        p.sendMessage(CC(msg));
+    }
+
+    private void sendActionbar(final Player p, final String msg) {
+        if (msg.length() == 0) return;
+        int times = finalconfig.getInt("display-messages-in-actionbar-time");
+        if (times == 1) {
+            if (actionBarUtils != null) {
+                actionBarUtils.sendActionBarMessage(p, msg);
+            }
+        } else if (times > 1) {
+            if (actionBarUtils != null) {
+                actionBarUtils.sendActionBarMessage(p, msg);
+            }
+            times--;
+            for (int i = 0; i < times; i++) {
+                Bukkit.getScheduler().scheduleSyncDelayedTask(this, () -> actionBarUtils.sendActionBarMessage(p, CC(msg)), 20L * i);
+            }
+        }
+    }
+
+    private boolean unloadPlugin(String pluginName)
+            throws Exception {
+        PluginManager manager = getServer().getPluginManager();
+        SimplePluginManager spmanager = (SimplePluginManager) manager;
+        if (spmanager != null) {
+            Field pluginsField = spmanager.getClass().getDeclaredField("plugins");
+            pluginsField.setAccessible(true);
+            List<Plugin> plugins = (List) pluginsField.get(spmanager);
+
+            Field lookupNamesField = spmanager.getClass().getDeclaredField("lookupNames");
+            lookupNamesField.setAccessible(true);
+            Map<String, Plugin> lookupNames = (Map) lookupNamesField.get(spmanager);
+
+            Field commandMapField = spmanager.getClass().getDeclaredField("commandMap");
+            commandMapField.setAccessible(true);
+            SimpleCommandMap commandMap = (SimpleCommandMap) commandMapField.get(spmanager);
+
+            Field knownCommandsField;
+            Map<String, Command> knownCommands = null;
+            if (commandMap != null) {
+                knownCommandsField = commandMap.getClass().getDeclaredField("knownCommands");
+                knownCommandsField.setAccessible(true);
+                knownCommands = (Map) knownCommandsField.get(commandMap);
+            }
+            Plugin plugin;
+            Iterator<Map.Entry<String, Command>> it;
+            for (Plugin plugin1 : manager.getPlugins()) {
+                if (plugin1.getDescription().getName().equalsIgnoreCase(pluginName)) {
+                    manager.disablePlugin(plugin1);
+                    if ((plugins != null) && (plugins.contains(plugin1))) {
+                        plugins.remove(plugin1);
+                    }
+                    if ((lookupNames != null) && (lookupNames.containsKey(pluginName))) {
+                        lookupNames.remove(pluginName);
+                    }
+                    if (commandMap != null) {
+                        for (it = knownCommands.entrySet().iterator(); it.hasNext(); ) {
+                            Map.Entry<String, Command> entry = it.next();
+                            if ((entry.getValue() instanceof PluginCommand)) {
+                                PluginCommand command = (PluginCommand) entry.getValue();
+                                if (command.getPlugin() == plugin1) {
+                                    command.unregister(commandMap);
+                                    it.remove();
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        } else {
+
+            return true;
+        }
+
+
+        return true;
+    }
+
+    private boolean loadPlugin(String pluginName) {
+        try {
+            PluginManager manager = getServer().getPluginManager();
+            Plugin plugin = manager.loadPlugin(new File("plugins", pluginName + ".jar"));
+            if (plugin == null) {
+                return false;
+            }
+            plugin.onLoad();
+            manager.enablePlugin(plugin);
+        } catch (Exception e) {
+
+            return false;
+        }
+
+        return true;
+    }
+
+    private boolean reloadPlugin(String pluginName)
+            throws Exception {
+        boolean unload = unloadPlugin(pluginName);
+        boolean load = loadPlugin(pluginName);
+
+        if ((unload) && (load)) {
+
+        } else {
+
+            return false;
+        }
+        return true;
+    }
+}

+ 0 - 0
TimeIsMoney2/src/de/Linus122/TimeIsMoney/Metrics.java → Plugin/src/main/java/de/Linus122/TimeIsMoney/Metrics.java


+ 12 - 12
TimeIsMoney2/src/de/Linus122/TimeIsMoney/Payout.java → Plugin/src/main/java/de/Linus122/TimeIsMoney/Payout.java

@@ -1,12 +1,12 @@
-package de.Linus122.TimeIsMoney;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Payout {
-	double payout_amount = 0;
-	double max_payout_per_day = 0;
-	String permission = "";
-	int chance = 0;
-	List<String> commands = new ArrayList<>();
-}
+package de.Linus122.TimeIsMoney;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Payout {
+	double payout_amount = 0;
+	double max_payout_per_day = 0;
+	String permission = "";
+	int chance = 0;
+	List<String> commands = new ArrayList<>();
+}

+ 84 - 84
TimeIsMoney2/src/config.yml → Plugin/src/main/resources/config.yml

@@ -1,84 +1,84 @@
-configuration-version: 12
-
-debug-log: false
-
-# You can disable the plugin's payout feature in certain worlds
-disabled_in_worlds:
-- "creative_world"
-
-# You can define if the player gets a payout whether player is afk or not.
-# the permission tim.afkbypass would avoid this for certain user or groups.
-afk_payout: false
-display-messages-in-chat: true
-display-messages-in-actionbar: true
-display-messages-in-actionbar-time: 10
-give_money_every_second: 600
-store-money-in-bank: false
-
-# Define if multiple accounts should get payed with the same ip-address. You may disable this if your players are using multiple accounts per ip.
-allow-multiple-accounts: true
-
-# Payouts will be delivered by "chance" instead "permission".
-choose-payout-by-chance: false
-
-# You can add as many payouts you want. You only can choose between "permission"
-# and "chance", not both.
-payouts:
-  1:
-    payout_amount: 50
-    max_payout_per_day: 1000
-    # chance: 10
-    permission:
-  2:
-    payout_amount: 100
-    max_payout_per_day: 10000
-    commands:
-      - /give %player% diamond 1
-    # chance: 90
-    # You can use any permission name you want. e.g. myserver.donor
-    permission: tim.vip
-
-# Translations
-message: "&aYou earned &c%money% &afor 10 minutes online time!"
-message_payoutlimit_reached: "&cYou have reached the payout limit today. You earned 0$"
-message_afk: "&cYou havn't earned money because you were afk!"
-message_multiple_ips: "&cYou havn't earned money because you're playing with multiple accounts!"
-message_actionbar: "&aYou earned &c%money% &afor 10 minutes online time!"
-message_payoutlimit_reached_actionbar: "&cYou have reached the payout limit today. You got 0$"
-message_afk_actionbar: "&cYou haven't earned money because you were afk!"
-message_atm_noperms: "&cYou don't have the permission to use ATM's!"
-message_atm_nomoneyinbank: "&cYou don't have enough money in bank!"
-message_atm_nomoney: "&cYou don't have enough money!"
-
-# ATM -> Place down a sign with [atm] on the first line to use it!
-enable_atm: true
-atm_title: "&cATM"
-atm_withdraw: "&cWithdraw"
-atm_deposit: "&cDeposit"
-atm_balance: "&cBank balance:"
-atm_worth_gradation:
-  - 10.0
-  - 100.0
-  - 1000.0
-  - 10000.0
-
-
-# You can seperate the ATM balances for different worlds by group them. Just set group-atms to true and write atm_groups as described below.
-# Note: Existing bank accounts will be removed when enabling this feature. 
-group-atms: false
-# Example groups for seperating all worlds:
-#atm_groups:
-#  group1:
-#  - world
-#  group2:
-#  - world_nether
-#  group3:
-#   - world_the_end
-# Example groups for seperating skyblock worlds and survival worlds:
-#atm_groups:
-#  group1:
-#  - ASkyblock_world
-#  - Askyblock_spawn
-#  group2:
-#  - survival_world
-#  - farm_world
+configuration-version: 12
+
+debug-log: false
+
+# You can disable the plugin's payout feature in certain worlds
+disabled_in_worlds:
+- "creative_world"
+
+# You can define if the player gets a payout whether player is afk or not.
+# the permission tim.afkbypass would avoid this for certain user or groups.
+afk_payout: false
+display-messages-in-chat: true
+display-messages-in-actionbar: true
+display-messages-in-actionbar-time: 10
+give_money_every_second: 600
+store-money-in-bank: false
+
+# Define if multiple accounts should get payed with the same ip-address. You may disable this if your players are using multiple accounts per ip.
+allow-multiple-accounts: true
+
+# Payouts will be delivered by "chance" instead "permission".
+choose-payout-by-chance: false
+
+# You can add as many payouts you want. You only can choose between "permission"
+# and "chance", not both.
+payouts:
+  1:
+    payout_amount: 50
+    max_payout_per_day: 1000
+    # chance: 10
+    permission:
+  2:
+    payout_amount: 100
+    max_payout_per_day: 10000
+    commands:
+      - /give %player% diamond 1
+    # chance: 90
+    # You can use any permission name you want. e.g. myserver.donor
+    permission: tim.vip
+
+# Translations
+message: "&aYou earned &c%money% &afor 10 minutes online time!"
+message_payoutlimit_reached: "&cYou have reached the payout limit today. You earned 0$"
+message_afk: "&cYou havn't earned money because you were afk!"
+message_multiple_ips: "&cYou havn't earned money because you're playing with multiple accounts!"
+message_actionbar: "&aYou earned &c%money% &afor 10 minutes online time!"
+message_payoutlimit_reached_actionbar: "&cYou have reached the payout limit today. You got 0$"
+message_afk_actionbar: "&cYou haven't earned money because you were afk!"
+message_atm_noperms: "&cYou don't have the permission to use ATM's!"
+message_atm_nomoneyinbank: "&cYou don't have enough money in bank!"
+message_atm_nomoney: "&cYou don't have enough money!"
+
+# ATM -> Place down a sign with [atm] on the first line to use it!
+enable_atm: true
+atm_title: "&cATM"
+atm_withdraw: "&cWithdraw"
+atm_deposit: "&cDeposit"
+atm_balance: "&cBank balance:"
+atm_worth_gradation:
+  - 10.0
+  - 100.0
+  - 1000.0
+  - 10000.0
+
+
+# You can seperate the ATM balances for different worlds by group them. Just set group-atms to true and write atm_groups as described below.
+# Note: Existing bank accounts will be removed when enabling this feature. 
+group-atms: false
+# Example groups for seperating all worlds:
+#atm_groups:
+#  group1:
+#  - world
+#  group2:
+#  - world_nether
+#  group3:
+#   - world_the_end
+# Example groups for seperating skyblock worlds and survival worlds:
+#atm_groups:
+#  group1:
+#  - ASkyblock_world
+#  - Askyblock_spawn
+#  group2:
+#  - survival_world
+#  - farm_world

+ 54 - 54
TimeIsMoney2/src/plugin.yml → Plugin/src/main/resources/plugin.yml

@@ -1,54 +1,54 @@
-name: TimeIsMoney
-version: 1.9.6.1
-description: Gives money for online time
-author: Linus122
-website: "https://www.spigotmc.org/resources/time-is-money.12409/"
-main: de.Linus122.TimeIsMoney.Main
-
-depend: [Vault]
-softdepend: [Essentials]
-
-commands:
-  timeismoney:
-    description: Reloads the config
-    aliases: tim
-    usage: /<command>
-    permission: tim.reload
-  atm:
-    description: Opens the atm
-    usage: /<command>
-    permission: tim.use
-
-permissions:
-  tim.*:
-    description: Allows you to use all of the TimeIsMoney commands and features
-    children:
-      tim.reload: true
-      tim.admin: true
-      tim.use: true
-      tim.afkbypass: true
-      tim.atm.*: true
-  tim.reload:
-    description: Allows you to reload the config
-    default: op
-  tim.admin:
-    description: Allows you to open the atm of another player
-    default: op
-  tim.use:
-    description: Allows you to open the atm
-    default: op
-  tim.afkbypass:
-    description: Allows you to get paid while afk
-    default: op
-  tim.atm.*:
-    description: Allows you to create and use atm signs
-    default: op
-    children:
-      tim.atm.place: true
-      tim.atm.use: true
-  tim.atm.place:
-    description: Allows you to create atm signs
-    default: op
-  tim.atm.use:
-    description: Allows you to use atm signs
-    default: op
+name: TimeIsMoney
+version: 1.9.6.1
+description: Gives money for online time
+author: Linus122
+website: "https://www.spigotmc.org/resources/time-is-money.12409/"
+main: Main
+
+depend: [Vault]
+softdepend: [Essentials]
+
+commands:
+  timeismoney:
+    description: Reloads the config
+    aliases: tim
+    usage: /<command>
+    permission: tim.reload
+  atm:
+    description: Opens the atm
+    usage: /<command>
+    permission: tim.use
+
+permissions:
+  tim.*:
+    description: Allows you to use all of the TimeIsMoney commands and features
+    children:
+      tim.reload: true
+      tim.admin: true
+      tim.use: true
+      tim.afkbypass: true
+      tim.atm.*: true
+  tim.reload:
+    description: Allows you to reload the config
+    default: op
+  tim.admin:
+    description: Allows you to open the atm of another player
+    default: op
+  tim.use:
+    description: Allows you to open the atm
+    default: op
+  tim.afkbypass:
+    description: Allows you to get paid while afk
+    default: op
+  tim.atm.*:
+    description: Allows you to create and use atm signs
+    default: op
+    children:
+      tim.atm.place: true
+      tim.atm.use: true
+  tim.atm.place:
+    description: Allows you to create atm signs
+    default: op
+  tim.atm.use:
+    description: Allows you to use atm signs
+    default: op

+ 0 - 19
TimeIsMoney2/src/de/Linus122/TimeIsMoney/Utils.java

@@ -1,19 +0,0 @@
-package de.Linus122.TimeIsMoney;
-
-import org.bukkit.ChatColor;
-
-public class Utils {
-
-    public Utils() {
-        throw new RuntimeException("Utils class should not be instantiated!");
-    }
-
-    /**
-     * Utility method which converts &<color> bukkit colors to real bukkit colors which correct symbol
-     * @param s string to convert
-     * @return converted string
-     */
-    public static String CC(String s) {
-        return ChatColor.translateAlternateColorCodes('&', s);
-    }
-}

+ 36 - 0
Tools/pom.xml

@@ -0,0 +1,36 @@
+<?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.TimeIsMoney</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.9.6.1</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>TimeIsMoney Tools</name>
+    <packaging>jar</packaging>
+    <artifactId>Tools</artifactId>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.spigotmc</groupId>
+            <artifactId>spigot-api</artifactId>
+            <version>1.12-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.bukkit</groupId>
+            <artifactId>craftbukkit</artifactId>
+            <version>1.12-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+</project>

+ 1 - 1
TimeIsMoney2/src/de/Linus122/TimeIsMoney/ActionBarUtils.java → Tools/src/main/java/de/Linus122/TimeIsMoney/tools/ActionBarUtils.java

@@ -1,4 +1,4 @@
-package de.Linus122.TimeIsMoney;
+package de.Linus122.TimeIsMoney.tools;
 
 import org.bukkit.entity.Player;
 

+ 19 - 0
Tools/src/main/java/de/Linus122/TimeIsMoney/tools/Utils.java

@@ -0,0 +1,19 @@
+package de.Linus122.TimeIsMoney.tools;
+
+import org.bukkit.ChatColor;
+
+public class Utils {
+	
+	public Utils() {
+		throw new RuntimeException("Utils class should not be instantiated!");
+	}
+	
+	/**
+	 * Utility method which converts &<color> bukkit colors to real bukkit colors which correct symbol
+	 * @param s string to convert
+	 * @return converted string
+	 */
+	public static String CC(String s) {
+		return ChatColor.translateAlternateColorCodes('&', s);
+	}
+}

+ 72 - 0
pom.xml

@@ -0,0 +1,72 @@
+<?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.TimeIsMoney</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.9.6.1</version>
+    <name>TimeIsMoney 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>
+        <module>Tools</module>
+        <module>v1_8_R1</module>
+        <module>v1_8_R2</module>
+        <module>v1_8_R3</module>
+        <module>v1_9_R1</module>
+        <module>v1_9_R2</module>
+        <module>v1_10_R1</module>
+        <module>v1_11_R1</module>
+        <module>v1_12_R1</module>
+    </modules>
+
+    <repositories>
+        <repository>
+            <id>vault-repo</id>
+            <url>http://nexus.hc.to/content/repositories/pub_releases</url>
+        </repository>
+        <repository>
+            <id>spigot-repo</id>
+            <url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
+        </repository>
+        <repository>
+            <id>ess-repo</id>
+            <url>http://repo.ess3.net/content/groups/essentials</url>
+        </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>

+ 41 - 0
v1_10_R1/pom.xml

@@ -0,0 +1,41 @@
+<?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.TimeIsMoney</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.9.6.1</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>TimeIsMoney v1_10_R1</name>
+    <packaging>jar</packaging>
+    <artifactId>v1_10_R1</artifactId>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.spigotmc</groupId>
+            <artifactId>spigot-api</artifactId>
+            <version>1.10.2-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.bukkit</groupId>
+            <artifactId>craftbukkit</artifactId>
+            <version>1.10.2-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>Tools</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+    </dependencies>
+</project>

+ 19 - 19
TimeIsMoney2/src/v1_10_R1/NBTUtils.java → v1_10_R1/src/main/java/de/Linus122/TimeIsMoney/version/v1_10_R1/NBTUtils.java

@@ -1,19 +1,19 @@
-package v1_10_R1;
-
-import de.Linus122.TimeIsMoney.ActionBarUtils;
-import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-
-import net.minecraft.server.v1_10_R1.IChatBaseComponent;
-import net.minecraft.server.v1_10_R1.PacketPlayOutChat;
-
-import static de.Linus122.TimeIsMoney.Utils.CC;
-
-public class NBTUtils implements ActionBarUtils {
-  public void sendActionBarMessage(Player p, String message)
-  {
-	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message)  + "\"}");
-	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
-	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
-  }
-}
+package de.Linus122.TimeIsMoney.version.v1_10_R1;
+
+import de.Linus122.TimeIsMoney.tools.ActionBarUtils;
+import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
+import org.bukkit.entity.Player;
+
+import net.minecraft.server.v1_10_R1.IChatBaseComponent;
+import net.minecraft.server.v1_10_R1.PacketPlayOutChat;
+
+import static de.Linus122.TimeIsMoney.tools.Utils.CC;
+
+public class NBTUtils implements ActionBarUtils {
+  public void sendActionBarMessage(Player p, String message)
+  {
+	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message)  + "\"}");
+	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
+	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
+  }
+}

+ 41 - 0
v1_11_R1/pom.xml

@@ -0,0 +1,41 @@
+<?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.TimeIsMoney</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.9.6.1</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>TimeIsMoney v1_11_R1</name>
+    <packaging>jar</packaging>
+    <artifactId>v1_11_R1</artifactId>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.spigotmc</groupId>
+            <artifactId>spigot-api</artifactId>
+            <version>1.11-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.bukkit</groupId>
+            <artifactId>craftbukkit</artifactId>
+            <version>1.11-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>Tools</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+    </dependencies>
+</project>

+ 19 - 19
TimeIsMoney2/src/v1_11_R1/NBTUtils.java → v1_11_R1/src/main/java/de/Linus122/TimeIsMoney/version/v1_11_R1/NBTUtils.java

@@ -1,19 +1,19 @@
-package v1_11_R1;
-
-import de.Linus122.TimeIsMoney.ActionBarUtils;
-import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-
-import net.minecraft.server.v1_11_R1.IChatBaseComponent;
-import net.minecraft.server.v1_11_R1.PacketPlayOutChat;
-
-import static de.Linus122.TimeIsMoney.Utils.CC;
-
-public class NBTUtils implements ActionBarUtils {
-  public void sendActionBarMessage(Player p, String message)
-  {
-	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message)  + "\"}");
-	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
-	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
-  }
-}
+package de.Linus122.TimeIsMoney.version.v1_11_R1;
+
+import de.Linus122.TimeIsMoney.tools.ActionBarUtils;
+import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer;
+import org.bukkit.entity.Player;
+
+import net.minecraft.server.v1_11_R1.IChatBaseComponent;
+import net.minecraft.server.v1_11_R1.PacketPlayOutChat;
+
+import static de.Linus122.TimeIsMoney.tools.Utils.CC;
+
+public class NBTUtils implements ActionBarUtils {
+  public void sendActionBarMessage(Player p, String message)
+  {
+	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message)  + "\"}");
+	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
+	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
+  }
+}

+ 41 - 0
v1_12_R1/pom.xml

@@ -0,0 +1,41 @@
+<?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.TimeIsMoney</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.9.6.1</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>TimeIsMoney v1_12_R1</name>
+    <packaging>jar</packaging>
+    <artifactId>v1_12_R1</artifactId>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.spigotmc</groupId>
+            <artifactId>spigot-api</artifactId>
+            <version>1.12.2-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.bukkit</groupId>
+            <artifactId>craftbukkit</artifactId>
+            <version>1.12.2-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>Tools</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+    </dependencies>
+</project>

+ 19 - 19
TimeIsMoney2/src/v1_12_R1/NBTUtils.java → v1_12_R1/src/main/java/de/Linus122/TimeIsMoney/version/v1_12_R1/NBTUtils.java

@@ -1,19 +1,19 @@
-package v1_12_R1;
-
-import de.Linus122.TimeIsMoney.ActionBarUtils;
-import net.minecraft.server.v1_12_R1.ChatMessageType;
-import net.minecraft.server.v1_12_R1.IChatBaseComponent;
-import net.minecraft.server.v1_12_R1.PacketPlayOutChat;
-import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-
-import static de.Linus122.TimeIsMoney.Utils.CC;
-
-public class NBTUtils implements ActionBarUtils{
-  public void sendActionBarMessage(Player p, String message)
-  {
-	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message)  + "\"}");
-	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, ChatMessageType.GAME_INFO);
-	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
-  }
-}
+package de.Linus122.TimeIsMoney.version.v1_12_R1;
+
+import de.Linus122.TimeIsMoney.tools.ActionBarUtils;
+import net.minecraft.server.v1_12_R1.ChatMessageType;
+import net.minecraft.server.v1_12_R1.IChatBaseComponent;
+import net.minecraft.server.v1_12_R1.PacketPlayOutChat;
+import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
+import org.bukkit.entity.Player;
+
+import static de.Linus122.TimeIsMoney.tools.Utils.CC;
+
+public class NBTUtils implements ActionBarUtils{
+  public void sendActionBarMessage(Player p, String message)
+  {
+	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message)  + "\"}");
+	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, ChatMessageType.GAME_INFO);
+	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
+  }
+}

+ 41 - 0
v1_8_R1/pom.xml

@@ -0,0 +1,41 @@
+<?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.TimeIsMoney</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.9.6.1</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>TimeIsMoney v1_8_R1</name>
+    <packaging>jar</packaging>
+    <artifactId>v1_8_R1</artifactId>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.spigotmc</groupId>
+            <artifactId>spigot-api</artifactId>
+            <version>1.8-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.bukkit</groupId>
+            <artifactId>craftbukkit</artifactId>
+            <version>1.8-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>Tools</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+    </dependencies>
+</project>

+ 20 - 20
TimeIsMoney2/src/v1_8_R1/NBTUtils.java → v1_8_R1/src/main/java/de/Linus122/TimeIsMoney/version/v1_8_R1/NBTUtils.java

@@ -1,20 +1,20 @@
-package v1_8_R1;
-
-import de.Linus122.TimeIsMoney.ActionBarUtils;
-import net.minecraft.server.v1_8_R1.ChatSerializer;
-import net.minecraft.server.v1_8_R1.IChatBaseComponent;
-import net.minecraft.server.v1_8_R1.PacketPlayOutChat;
-import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-
-import static de.Linus122.TimeIsMoney.Utils.CC;
-
-public class NBTUtils implements ActionBarUtils {
-  @Override
-  public void sendActionBarMessage(Player p, String message)
-  {
-	    IChatBaseComponent icbc = ChatSerializer.a("{\"text\": \"" + CC(message) + "\"}");
-	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
-	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
-  }
-}
+package de.Linus122.TimeIsMoney.version.v1_8_R1;
+
+import de.Linus122.TimeIsMoney.tools.ActionBarUtils;
+import net.minecraft.server.v1_8_R1.ChatSerializer;
+import net.minecraft.server.v1_8_R1.IChatBaseComponent;
+import net.minecraft.server.v1_8_R1.PacketPlayOutChat;
+import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
+import org.bukkit.entity.Player;
+
+import static de.Linus122.TimeIsMoney.tools.Utils.CC;
+
+public class NBTUtils implements ActionBarUtils {
+  @Override
+  public void sendActionBarMessage(Player p, String message)
+  {
+	    IChatBaseComponent icbc = ChatSerializer.a("{\"text\": \"" + CC(message) + "\"}");
+	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
+	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
+  }
+}

+ 41 - 0
v1_8_R2/pom.xml

@@ -0,0 +1,41 @@
+<?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.TimeIsMoney</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.9.6.1</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>TimeIsMoney v1_8_R2</name>
+    <packaging>jar</packaging>
+    <artifactId>v1_8_R2</artifactId>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.spigotmc</groupId>
+            <artifactId>spigot-api</artifactId>
+            <version>1.8.3-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.bukkit</groupId>
+            <artifactId>craftbukkit</artifactId>
+            <version>1.8.3-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>Tools</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+    </dependencies>
+</project>

+ 19 - 19
TimeIsMoney2/src/v1_8_R2/NBTUtils.java → v1_8_R2/src/main/java/de/Linus122/TimeIsMoney/version/v1_8_R2/NBTUtils.java

@@ -1,19 +1,19 @@
-package v1_8_R2;
-
-import de.Linus122.TimeIsMoney.ActionBarUtils;
-import net.minecraft.server.v1_8_R2.IChatBaseComponent;
-import net.minecraft.server.v1_8_R2.PacketPlayOutChat;
-import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-
-import static de.Linus122.TimeIsMoney.Utils.CC;
-
-public class NBTUtils implements ActionBarUtils {
-  @Override
-  public void sendActionBarMessage(Player p, String message)
-  {
-	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message) + "\"}");
-	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
-	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
-  }
-}
+package de.Linus122.TimeIsMoney.version.v1_8_R2;
+
+import de.Linus122.TimeIsMoney.tools.ActionBarUtils;
+import net.minecraft.server.v1_8_R2.IChatBaseComponent;
+import net.minecraft.server.v1_8_R2.PacketPlayOutChat;
+import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
+import org.bukkit.entity.Player;
+
+import static de.Linus122.TimeIsMoney.tools.Utils.CC;
+
+public class NBTUtils implements ActionBarUtils {
+  @Override
+  public void sendActionBarMessage(Player p, String message)
+  {
+	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message) + "\"}");
+	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
+	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
+  }
+}

+ 41 - 0
v1_8_R3/pom.xml

@@ -0,0 +1,41 @@
+<?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.TimeIsMoney</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.9.6.1</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>TimeIsMoney v1_8_R3</name>
+    <packaging>jar</packaging>
+    <artifactId>v1_8_R3</artifactId>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.spigotmc</groupId>
+            <artifactId>spigot-api</artifactId>
+            <version>1.8.8-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.bukkit</groupId>
+            <artifactId>craftbukkit</artifactId>
+            <version>1.8.8-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>Tools</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+    </dependencies>
+</project>

+ 18 - 18
TimeIsMoney2/src/v1_8_R3/NBTUtils.java → v1_8_R3/src/main/java/de/Linus122/TimeIsMoney/version/v1_8_R3/NBTUtils.java

@@ -1,18 +1,18 @@
-package v1_8_R3;
-
-import de.Linus122.TimeIsMoney.ActionBarUtils;
-import net.minecraft.server.v1_8_R3.IChatBaseComponent;
-import net.minecraft.server.v1_8_R3.PacketPlayOutChat;
-import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-
-import static de.Linus122.TimeIsMoney.Utils.CC;
-
-public class NBTUtils implements ActionBarUtils {
-  public void sendActionBarMessage(Player p, String message)
-  {
-	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message)  + "\"}");
-	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
-	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
-  }
-}
+package de.Linus122.TimeIsMoney.version.v1_8_R3;
+
+import de.Linus122.TimeIsMoney.tools.ActionBarUtils;
+import net.minecraft.server.v1_8_R3.IChatBaseComponent;
+import net.minecraft.server.v1_8_R3.PacketPlayOutChat;
+import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
+import org.bukkit.entity.Player;
+
+import static de.Linus122.TimeIsMoney.tools.Utils.CC;
+
+public class NBTUtils implements ActionBarUtils {
+  public void sendActionBarMessage(Player p, String message)
+  {
+	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message)  + "\"}");
+	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
+	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
+  }
+}

+ 41 - 0
v1_9_R1/pom.xml

@@ -0,0 +1,41 @@
+<?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.TimeIsMoney</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.9.6.1</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>TimeIsMoney v1_9_R1</name>
+    <packaging>jar</packaging>
+    <artifactId>v1_9_R1</artifactId>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.spigotmc</groupId>
+            <artifactId>spigot-api</artifactId>
+            <version>1.9-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.bukkit</groupId>
+            <artifactId>craftbukkit</artifactId>
+            <version>1.9-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>Tools</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+    </dependencies>
+</project>

+ 18 - 18
TimeIsMoney2/src/v1_9_R1/NBTUtils.java → v1_9_R1/src/main/java/de/Linus122/TimeIsMoney/version/v1_9_R1/NBTUtils.java

@@ -1,18 +1,18 @@
-package v1_9_R1;
-
-import de.Linus122.TimeIsMoney.ActionBarUtils;
-import net.minecraft.server.v1_9_R1.IChatBaseComponent;
-import net.minecraft.server.v1_9_R1.PacketPlayOutChat;
-import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-
-import static de.Linus122.TimeIsMoney.Utils.CC;
-
-public class NBTUtils implements ActionBarUtils {
-  public void sendActionBarMessage(Player p, String message)
-  {
-	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message) + "\"}");
-	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
-	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
-  }
-}
+package de.Linus122.TimeIsMoney.version.v1_9_R1;
+
+import de.Linus122.TimeIsMoney.tools.ActionBarUtils;
+import net.minecraft.server.v1_9_R1.IChatBaseComponent;
+import net.minecraft.server.v1_9_R1.PacketPlayOutChat;
+import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer;
+import org.bukkit.entity.Player;
+
+import static de.Linus122.TimeIsMoney.tools.Utils.CC;
+
+public class NBTUtils implements ActionBarUtils {
+  public void sendActionBarMessage(Player p, String message)
+  {
+	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message) + "\"}");
+	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
+	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
+  }
+}

+ 41 - 0
v1_9_R2/pom.xml

@@ -0,0 +1,41 @@
+<?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.TimeIsMoney</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.9.6.1</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>TimeIsMoney v1_9_R2</name>
+    <packaging>jar</packaging>
+    <artifactId>v1_9_R2</artifactId>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.spigotmc</groupId>
+            <artifactId>spigot-api</artifactId>
+            <version>1.9.4-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.bukkit</groupId>
+            <artifactId>craftbukkit</artifactId>
+            <version>1.9.4-R0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>de.Linus122.TimeIsMoney</groupId>
+            <artifactId>Tools</artifactId>
+            <version>1.9.6.1</version>
+        </dependency>
+    </dependencies>
+</project>

+ 19 - 19
TimeIsMoney2/src/v1_9_R2/NBTUtils.java → v1_9_R2/src/main/java/de/Linus122/TimeIsMoney/version/v1_9_R2/NBTUtils.java

@@ -1,19 +1,19 @@
-package v1_9_R2;
-
-import de.Linus122.TimeIsMoney.ActionBarUtils;
-import org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-
-import net.minecraft.server.v1_9_R2.IChatBaseComponent;
-import net.minecraft.server.v1_9_R2.PacketPlayOutChat;
-
-import static de.Linus122.TimeIsMoney.Utils.CC;
-
-public class NBTUtils implements ActionBarUtils {
-  public void sendActionBarMessage(Player p, String message)
-  {
-	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message)  + "\"}");
-	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
-	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
-  }
-}
+package de.Linus122.TimeIsMoney.version.v1_9_R2;
+
+import de.Linus122.TimeIsMoney.tools.ActionBarUtils;
+import org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer;
+import org.bukkit.entity.Player;
+
+import net.minecraft.server.v1_9_R2.IChatBaseComponent;
+import net.minecraft.server.v1_9_R2.PacketPlayOutChat;
+
+import static de.Linus122.TimeIsMoney.tools.Utils.CC;
+
+public class NBTUtils implements ActionBarUtils {
+  public void sendActionBarMessage(Player p, String message)
+  {
+	    IChatBaseComponent icbc = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + CC(message)  + "\"}");
+	    PacketPlayOutChat bar = new PacketPlayOutChat(icbc, (byte)2);
+	    ((CraftPlayer)p).getHandle().playerConnection.sendPacket(bar);
+  }
+}