Commits

fonkfader committed c86b414

- little code cleanup

Comments (0)

Files changed (29)

-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
-		<attributes>
-			<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="C:/Program Files/Java/jre6"/>
-			<attribute name="owner.project.facets" value="java"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="lib" path="C:/Users/fonkfader/Dropbox/mcp/Serveur TEST/Vault.jar">
-		<attributes>
-			<attribute name="javadoc_location" value="http://mythcraft.dyndns.org/javadoc/vault/"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="lib" path="C:/Users/fonkfader/Dropbox/mcp/Serveur TEST/plugins/Shopkeepers.jar"/>
-	<classpathentry kind="lib" path="C:/Users/fonkfader/Dropbox/mcp/bukkit-1.4.5-R0.3-20121121.013701-1.jar">
-		<attributes>
-			<attribute name="javadoc_location" value="http://jd.bukkit.org/apidocs/"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="lib" path="C:/Users/fonkfader/Dropbox/mcp/craftbukkit-1.4.5-R0.3-20121122.015533-2.jar">
-		<attributes>
-			<attribute name="javadoc_location" value="http://jd.bukkit.org/apidocs/"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
+		<attributes>
+			<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="C:/Program Files/Java/jre6"/>
+			<attribute name="owner.project.facets" value="java"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="lib" path="/home/fonk/Dropbox/mcp/Serveur TEST/Vault.jar">
+		<attributes>
+			<attribute name="javadoc_location" value="http://mythcraft.dyndns.org/javadoc/vault/"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="lib" path="/home/fonk/Dropbox/mcp/Serveur TEST/plugins/Shopkeepers.jar"/>
+	<classpathentry kind="lib" path="/home/fonk/Dropbox/mcp/bukkit-1.4.5-R0.3-20121121.013701-1.jar">
+		<attributes>
+			<attribute name="javadoc_location" value="http://jd.bukkit.org/apidocs/"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="lib" path="/home/fonk/Dropbox/mcp/craftbukkit-1.4.5-R0.3-20121122.015533-2.jar">
+		<attributes>
+			<attribute name="javadoc_location" value="http://jd.bukkit.org/apidocs/"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

.settings/org.eclipse.jdt.core.prefs

-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6

bin/me/fonkfader/EmeraldEconLink/Checks$1.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/Checks$2.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/Checks$3.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/Checks$4.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/Checks.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/Commands.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/ContenerListener$1.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/ContenerListener$2.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/ContenerListener$3.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/ContenerListener$4.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/ContenerListener$5.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/ContenerListener$6.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/ContenerListener$7.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/ContenerListener$8.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/ContenerListener.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/DropsListeners.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/EmeraldEconLink.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/Signs.class

Binary file modified.

bin/me/fonkfader/EmeraldEconLink/Utils.class

Binary file modified.

src/me/fonkfader/EmeraldEconLink/Checks.java

 package me.fonkfader.EmeraldEconLink;
 
-import java.util.Collection;
 import java.util.Collections;
-import java.util.HashSet;
-
-import net.minecraft.server.Block;
-
-import org.bukkit.ChatColor;
 import org.bukkit.GameMode;
-import org.bukkit.Material;
-import org.bukkit.block.Sign;
-import org.bukkit.command.Command;
-import org.bukkit.command.CommandSender;
 import org.bukkit.entity.Player;
 import org.bukkit.event.EventHandler;
 import org.bukkit.event.Listener;
 import org.bukkit.event.inventory.InventoryType;
 import org.bukkit.event.player.PlayerCommandPreprocessEvent;
-import org.bukkit.event.player.PlayerLoginEvent;
-import org.bukkit.event.player.PlayerMoveEvent;
-import org.bukkit.event.player.PlayerPickupItemEvent;
-import org.bukkit.event.server.ServerCommandEvent;
-import org.bukkit.inventory.InventoryView;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.plugin.Plugin;
 import org.bukkit.plugin.java.JavaPlugin;
 
 public class Checks extends JavaPlugin implements Listener{
 	
 private static EmeraldEconLink plugin;
 	
+	@SuppressWarnings("static-access")
 	public Checks (EmeraldEconLink plugin){
 		
 		this.plugin = plugin;}
 			
 			   final int money0 = Utils.totalMoneyinInventory(p);
 			   final int bal0 = (int) EmeraldEconLink.econ.getBalance(p.getName());
-				final int inv0= Utils.countPlayerItem(p,388);
-				final int amountCursor= p.getItemOnCursor().getAmount();
+				
+				
 				
 				task3 = plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
 					public void run() {
 						   int itemId = 0;
 						   int bal1=bal0;
 						  
-						   int inv1=inv0;
+						   
 						   ;
 						   
 						  
 	
    final int money0 = Utils.totalMoneyinInventory(p);
    final int bal0 = (int) EmeraldEconLink.econ.getBalance(p.getName());
-	final int inv0= Utils.countPlayerItem(p,388);
-	final int amountCursor= p.getItemOnCursor().getAmount();
+	
+	
 	
 	task3 = plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
 		public void run() {
 			   int money1 = money0;
 			   int money2 = Utils.totalMoneyinInventory(p);
 			   int bal2 = (int) EmeraldEconLink.econ.getBalance(p.getName());
-			   int item = p.getItemOnCursor().getTypeId();	
-			   int itemId = 0;
+			   
 			   int bal1=bal0;
 			 
-			   int inv1=inv0;
+			   
 			  
 			   if (!Configuration.DisabledWorlds.contains(p.getWorld().getName())) {
 				   
 	
     final int money0 = Utils.totalMoneyinInventory(p);
     final int bal0 = (int) EmeraldEconLink.econ.getBalance(p.getName());
-	final int inv0= Utils.countPlayerItem(p,388);
-	final int amountCursor= p.getItemOnCursor().getAmount();
+	
 	
 	task4 = plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
 		public void run() {
 			   
 			   int money1 = money0;
-			   int money2 = Utils.totalMoneyinInventory(p);
-			   int item = p.getItemOnCursor().getTypeId();	
-			   int itemId = 0;
+			
+			   
+			   
 			   int bal1=bal0;
 			   int bal2 = (int) EmeraldEconLink.econ.getBalance(p.getName());
 			   
-			   int inv1=inv0;
-			   for (int i=0;i<Configuration.itemsId.size();i++){
-					if (item == Configuration.itemsId.get(i)){
-						itemId = Configuration.itemsId.get(i);
-					}
-				}
-				for (int i=0;i<Configuration.blocksId.size();i++){
-					if (item == Configuration.blocksId.get(i)){
-						itemId = Configuration.blocksId.get(i);
-					}
-				}
+			   
 			   
 			   if (!Configuration.DisabledWorlds.contains(p.getWorld().getName())) {
 				   
 	
 	if(e.getMessage().startsWith("/eel"))return;
 	if(e.getMessage().startsWith("/cash"))return;
-	Player p =e.getPlayer();
+	
 
 	compareOnCommand();
 	

src/me/fonkfader/EmeraldEconLink/Commands.java

 package me.fonkfader.EmeraldEconLink;
 
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
 import org.bukkit.ChatColor;
 import org.bukkit.EntityEffect;
 import org.bukkit.Material;
 import org.bukkit.command.Command;
 import org.bukkit.command.CommandExecutor;
 import org.bukkit.command.CommandSender;
-import org.bukkit.configuration.InvalidConfigurationException;
-import org.bukkit.configuration.file.YamlConfiguration;
-import org.bukkit.craftbukkit.libs.org.ibex.nestedvm.util.Seekable.InputStream;
 import org.bukkit.entity.Player;
 import org.bukkit.inventory.ItemStack;
 import org.bukkit.plugin.java.JavaPlugin;
 
 		Player p = null;
 
-		Integer integer = null;
-		boolean hasEmptySlot = false;
-
 		if ((sender instanceof Player)) {
 			p = (Player) sender;
 			final String name = p.getName();
 							Configuration.loadYamls();
 							Configuration.loadConfigVariable();
 							plugin.saveConfig();
-							plugin.server.getScheduler().cancelTask(Checks.task1);
+							EmeraldEconLink.server.getScheduler().cancelTask(Checks.task1);
 							Checks.synctask();
 							p.sendMessage(ChatColor.GOLD+"config reloaded");
 						}else p.sendMessage(Utils.red+Configuration.messageNoPerm);
 					else if (args.length == 2) {
 						
 						try {
-							amount = integer.parseInt(args[1]);
+							amount = Integer.parseInt(args[1]);
 
 						} catch (Exception e) {
 							p.sendMessage(ChatColor.GOLD + command.getUsage());
 
 							if (p.hasPermission("eel.take") || p.isOp()) {
 
-								int totalInInv = Utils.totalMoneyinInventory(p);
+								Utils.totalMoneyinInventory(p);
 																// total
 								int totalMaxInv = Utils.howManyMoneyCanHold(p);
 
 								return false;
 					} else if (args.length == 3) {
 						
-						int itemId = integer.parseInt(args[2]);
+						int itemId = Integer.parseInt(args[2]);
 						int cost=0;
 						
 						if (Configuration.itemsId.contains(itemId))
 							cost = Configuration.itemsCost.get(Configuration.itemsId.indexOf(itemis));
 						}
 						try {
-							amount = integer.parseInt(args[1]);
+							amount = Integer.parseInt(args[1]);
 
 						} catch (Exception e) {
-							p.sendMessage("�c" + command.getUsage());
+							p.sendMessage("�c" + command.getUsage());
 							return true;
 						}
 						int amountItem =0;
-						ItemStack itemGet=null;
-							if (cost!=0){
+						if (cost!=0){
 							amountItem = amount / cost;
-							itemGet = new ItemStack(itemId, amountItem);
+							new ItemStack(itemId, amountItem);
 							}
 						if (args[0].equalsIgnoreCase("send")) {
 
 										if ((p.getInventory().contains(itemId,
 												amountItem)) && (bal > amount)) {
 
-											int totalInInv = Utils.countPlayerItem(p,itemId);
-											int totalMaxInv = Utils.countItemSlots(p,itemId) * 64;
-
+											Utils.countPlayerItem(p,itemId);
 											if (Utils.totalMoneyinInventory(p2) >= amount) {
 
 												int total = amountItem * cost;
 							itemId=0;
 
 							try {
-								item = integer.parseInt(args[2]);
-								amount2 = integer.parseInt(args[1]);
+								item = Integer.parseInt(args[2]);
+								amount2 = Integer.parseInt(args[1]);
 								} catch (Exception e){
 									p.sendMessage(ChatColor.GOLD+ command.getUsage());
 									return true;
 							int cost3=0;
 							itemId=0;
 							try {
-								item = integer.parseInt(args[2]);
-								amount2 = integer.parseInt(args[1]);
+								item = Integer.parseInt(args[2]);
+								amount2 = Integer.parseInt(args[1]);
 								} catch (Exception e){
 									p.sendMessage(ChatColor.GOLD + command.getUsage());
 									return true;
 								}
 							}
 							 if ((item == itemId)&&(itemId!=0)){
-								int totalInInv = Utils.countPlayerItem(p, itemId)*Utils.amountiteminMoney(p, itemId);
-																// total
-								int totalMaxInv = Utils.howManyItemsCanHold(p, itemId)*Utils.amountiteminMoney(p, itemId);
 								ItemStack newItem = new ItemStack(itemId,amount2/cost3);
 
 								

src/me/fonkfader/EmeraldEconLink/Configuration.java

 import java.util.Arrays;
 import java.util.List;
 
-import org.bukkit.Server;
-import org.bukkit.configuration.file.FileConfiguration;
-import org.bukkit.configuration.file.YamlConfiguration;
-
-import com.nisovin.shopkeepers.ShopkeepersPlugin;
-
 public class Configuration {
 	
 	
 	
 	public Configuration (EmeraldEconLink plugin){
 		
-		this.plugin = plugin;}
+		Configuration.plugin = plugin;}
 
 
 
 	
 	
 	loadYamls();
-	if (!plugin.config.contains("EnableItemOnEarnMoney")) {
-		plugin.config.set("EnableItemOnEarnMoney", false);
+	if (!EmeraldEconLink.config.contains("EnableItemOnEarnMoney")) {
+		EmeraldEconLink.config.set("EnableItemOnEarnMoney", false);
 	}
-	if (!plugin.config.contains("DisableChatMessage")) {
-		plugin.config.set("DisableChatMessage", false);
+	if (!EmeraldEconLink.config.contains("DisableChatMessage")) {
+		EmeraldEconLink.config.set("DisableChatMessage", false);
 	}
-	if (!plugin.config.contains("DisabledWorlds")) {
+	if (!EmeraldEconLink.config.contains("DisabledWorlds")) {
 		String[] listOfStrings = { "creative", "otherWorld" };
-		plugin.config.set("DisabledWorlds", Arrays.asList(listOfStrings));
+		EmeraldEconLink.config.set("DisabledWorlds", Arrays.asList(listOfStrings));
 	}
-	if (!plugin.config.contains("itemsId")) {
+	if (!EmeraldEconLink.config.contains("itemsId")) {
 		String[] listOfStrings = {"388"};
-		plugin.config.set("itemsId", Arrays.asList(listOfStrings));
+		EmeraldEconLink.config.set("itemsId", Arrays.asList(listOfStrings));
 	}
-	if (!plugin.config.contains("itemsCost")) {
+	if (!EmeraldEconLink.config.contains("itemsCost")) {
 		String[] listOfStrings = {"10"};
-		plugin.config.set("itemsCost", Arrays.asList(listOfStrings));
+		EmeraldEconLink.config.set("itemsCost", Arrays.asList(listOfStrings));
 	}
-	if (!plugin.config.contains("itemsCanBeBlock")) {
+	if (!EmeraldEconLink.config.contains("itemsCanBeBlock")) {
 		String[] listOfStrings = {"388"};
-		plugin.config.set("itemsCanBeBlock", Arrays.asList(listOfStrings));
+		EmeraldEconLink.config.set("itemsCanBeBlock", Arrays.asList(listOfStrings));
 	}
-	if (!plugin.config.contains("blocksId")) {
+	if (!EmeraldEconLink.config.contains("blocksId")) {
 		String[] listOfStrings = {"133"};
-		plugin.config.set("blocksId", Arrays.asList(listOfStrings));
+		EmeraldEconLink.config.set("blocksId", Arrays.asList(listOfStrings));
 	}
-	if (!plugin.config.contains("infoCommandDisplayName")) {
+	if (!EmeraldEconLink.config.contains("infoCommandDisplayName")) {
 		
-		plugin.config.set("infoCommandDisplayName", "Server currency infos");
+		EmeraldEconLink.config.set("infoCommandDisplayName", "Server currency infos");
 	}
-	if (!plugin.config.contains("signDispenserDisplayName")) {
+	if (!EmeraldEconLink.config.contains("signDispenserDisplayName")) {
 		
-		plugin.config.set("signDispenserDisplayName", "CASH");
+		EmeraldEconLink.config.set("signDispenserDisplayName", "CASH");
 	}
-	if (!plugin.config.contains("signDepositDisplayName")) {
+	if (!EmeraldEconLink.config.contains("signDepositDisplayName")) {
 		
-		plugin.config.set("signDepositDisplayName", "DEPOSIT");
+		EmeraldEconLink.config.set("signDepositDisplayName", "DEPOSIT");
 	}
-	if (!plugin.config.contains("randomItemOnEarnMoney")) {
-		plugin.config.set("oneItemOnEarnMoney", false);
+	if (!EmeraldEconLink.config.contains("randomItemOnEarnMoney")) {
+		EmeraldEconLink.config.set("oneItemOnEarnMoney", false);
 	}
-	if (!plugin.config.contains("tiksPerChecksForEnableItemOnEarnMoney")) {
-		plugin.config.set("tiksPerChecksForEnableItemOnEarnMoney", 100);
+	if (!EmeraldEconLink.config.contains("tiksPerChecksForEnableItemOnEarnMoney")) {
+		EmeraldEconLink.config.set("tiksPerChecksForEnableItemOnEarnMoney", 100);
 	}
 
 	try {
-			plugin.config.save(plugin.configFile);
+			EmeraldEconLink.config.save(EmeraldEconLink.configFile);
 		} catch (IOException e) {
 			e.printStackTrace();
 		}
 }
 
 public static void loadConfigVariable(){
-	messageAdd = plugin.config.getString("message_add");
-	messageRemove =  plugin.config.getString("message_remove");
-	messageHack = plugin.config.getString("message_hack");
-	currencyName = plugin.config.getString("currencyName");
-	itemsId = plugin.config.getIntegerList("itemsId");
-	itemsCost = plugin.config.getIntegerList("itemsCost");
-	itemsCanBeBlock = plugin.config.getIntegerList("itemsCanBeBlock");
-	blocksId = plugin.config.getIntegerList("blocksId");
-	messageAddBank = plugin.config.getString("message_addBank");
-	messageRemoveBank = plugin.config.getString("message_removeBank");
-	messageNoPerm = plugin.config.getString("message_nopermissons");
-	messageNoPlace = plugin.config.getString("message_NoPlace");
-	messageNoPlaceReceive = plugin.config.getString("message_NoPlaceReceive");
-	messageNoEnoughtItems = plugin.config.getString("message_NoEnoughtItem");
-	messageNoEnoughtMoney = plugin.config.getString("message_NoEnoughtMoney");
-	messageSend = plugin.config.getString("message_Send");
-	messageReceive = plugin.config.getString("message_Receive");
-	infoCommandDisplayName = plugin.config.getString("infoCommandDisplayName");
-	signDispenserDisplayName = plugin.config.getString("signDispenserDisplayName");
-	signDepositDisplayName = plugin.config.getString("signDepositDisplayName");
-	EnableItemOnEarnMoney =  plugin.config.getBoolean("EnableItemOnEarnMoney");
-	oneItemOnEarnMoney = plugin.config.getBoolean("oneItemOnEarnMoney");
-	DisabledWorlds = plugin.config.getStringList("DisabledWorlds");
-	DisableChatMessage = plugin.config.getBoolean("DisableChatMessage");
-	tiksPerChecksForEnableItemOnEarnMoney = plugin.config.getLong("tiksPerChecksForEnableItemOnEarnMoney");
+	messageAdd = EmeraldEconLink.config.getString("message_add");
+	messageRemove =  EmeraldEconLink.config.getString("message_remove");
+	messageHack = EmeraldEconLink.config.getString("message_hack");
+	currencyName = EmeraldEconLink.config.getString("currencyName");
+	itemsId = EmeraldEconLink.config.getIntegerList("itemsId");
+	itemsCost = EmeraldEconLink.config.getIntegerList("itemsCost");
+	itemsCanBeBlock = EmeraldEconLink.config.getIntegerList("itemsCanBeBlock");
+	blocksId = EmeraldEconLink.config.getIntegerList("blocksId");
+	messageAddBank = EmeraldEconLink.config.getString("message_addBank");
+	messageRemoveBank = EmeraldEconLink.config.getString("message_removeBank");
+	messageNoPerm = EmeraldEconLink.config.getString("message_nopermissons");
+	messageNoPlace = EmeraldEconLink.config.getString("message_NoPlace");
+	messageNoPlaceReceive = EmeraldEconLink.config.getString("message_NoPlaceReceive");
+	messageNoEnoughtItems = EmeraldEconLink.config.getString("message_NoEnoughtItem");
+	messageNoEnoughtMoney = EmeraldEconLink.config.getString("message_NoEnoughtMoney");
+	messageSend = EmeraldEconLink.config.getString("message_Send");
+	messageReceive = EmeraldEconLink.config.getString("message_Receive");
+	infoCommandDisplayName = EmeraldEconLink.config.getString("infoCommandDisplayName");
+	signDispenserDisplayName = EmeraldEconLink.config.getString("signDispenserDisplayName");
+	signDepositDisplayName = EmeraldEconLink.config.getString("signDepositDisplayName");
+	EnableItemOnEarnMoney =  EmeraldEconLink.config.getBoolean("EnableItemOnEarnMoney");
+	oneItemOnEarnMoney = EmeraldEconLink.config.getBoolean("oneItemOnEarnMoney");
+	DisabledWorlds = EmeraldEconLink.config.getStringList("DisabledWorlds");
+	DisableChatMessage = EmeraldEconLink.config.getBoolean("DisableChatMessage");
+	tiksPerChecksForEnableItemOnEarnMoney = EmeraldEconLink.config.getLong("tiksPerChecksForEnableItemOnEarnMoney");
 }
 
 public static void firstRun() throws Exception {
-	if (!plugin.configFile.exists()) {
-		plugin.configFile.getParentFile().mkdirs();
-		copy(plugin.getResource("plugin.config.yml"), plugin.configFile);
+	if (!EmeraldEconLink.configFile.exists()) {
+		EmeraldEconLink.configFile.getParentFile().mkdirs();
+		copy(plugin.getResource("plugin.config.yml"), EmeraldEconLink.configFile);
 	}
 }
 
 
 public static void loadYamls() {
 	try {
-		plugin.config.load(plugin.configFile);
+		EmeraldEconLink.config.load(EmeraldEconLink.configFile);
 
 	} catch (Exception e) {
 		e.printStackTrace();
 
 public void saveYamls() {
 	try {
-		plugin.config.save(plugin.configFile);
+		EmeraldEconLink.config.save(EmeraldEconLink.configFile);
 	} catch (IOException e) {
 		e.printStackTrace();
 	}

src/me/fonkfader/EmeraldEconLink/ContenerListener.java

 import java.util.List;
 
 import org.bukkit.GameMode;
-import org.bukkit.Material;
-import org.bukkit.command.CommandSender;
-import org.bukkit.configuration.file.FileConfiguration;
 import org.bukkit.entity.Player;
 import org.bukkit.event.EventHandler;
 import org.bukkit.event.Listener;
 import org.bukkit.event.inventory.InventoryClickEvent;
 import org.bukkit.event.inventory.InventoryCloseEvent;
-import org.bukkit.event.inventory.InventoryOpenEvent;
 import org.bukkit.event.inventory.InventoryType;
 import org.bukkit.event.inventory.InventoryType.SlotType;
-import org.bukkit.inventory.ItemStack;
 import org.bukkit.plugin.java.JavaPlugin;
 
-import com.nisovin.shopkeepers.ShopkeepersPlugin;
-
 public class ContenerListener extends JavaPlugin implements Listener {
 
+	@SuppressWarnings("unused")
 	private EmeraldEconLink plugin;
 	
 	public ContenerListener (EmeraldEconLink plugin){
 		
 		final Player p = (Player) e.getWhoClicked();
 		final String name = p.getName();
-		int item = e.getCurrentItem().getTypeId();
 		String skname = null;
 		
 		if (e.isCancelled()){
 				if ((e.getView().countSlots() == slot)
 			&& (e.getView().getTitle().toString() != skname)){
 
-	// si le slot cliqu� correspond a l'inventaire du haut et le
+	// si le slot cliqu� correspond a l'inventaire du haut et le
 	// curseur a deja l'item (pour un depot)
 	if ((e.getRawSlot() < (slot-36))
 			&& (e.getCursor().getType().getId() == itemId)) {
 
-		// si le slot cliqu� est vide
+		// si le slot cliqu� est vide
 		if (e.getCurrentItem().getType().getId() != itemId) {
 
 			if (e.isShiftClick() == true) {
 		final Player p = (Player) e.getWhoClicked();
 		final String name = p.getName();
 		
-		if (((e.getView().getType() == e.getView().getType().MERCHANT) && (e.getView().countSlots() == 39))) {
+		if (((e.getView().getType() == InventoryType.MERCHANT) && (e.getView().countSlots() == 39))) {
 
 
 			if (e.getSlotType() == SlotType.RESULT) {
 		if (e.getCurrentItem() != null) {
 			int amount1 = e.getCurrentItem().getAmount() * cost;
 			int amount2 = e.getCursor().getAmount() * cost;
-			int bal = (int) EmeraldEconLink.econ.getBalance(name);
 			
-			if ((e.getView().getType() == e.getView().getType().FURNACE)
+			if ((e.getView().getType() == InventoryType.FURNACE)
 					&& (e.getView().countSlots() == 39)) {
 
 
 						&& (e.getCursor().getType().getId() == itemId)
 						&& (e.getSlotType() != SlotType.RESULT)) {
 
-					// si le slot cliqu� est vide
+					// si le slot cliqu� est vide
 					if (e.getCurrentItem().getType().getId() != itemId) {
 
 						if (e.isShiftClick() == true) {
 		
 		if (e.getCurrentItem() != null) {
 			
-			int amount1 = e.getCurrentItem().getAmount() * cost;
-			int amount2 = e.getCursor().getAmount() * cost;
-			int bal = (int) EmeraldEconLink.econ.getBalance(name);
 			
-			if ((e.getView().getType() == e.getView().getType().WORKBENCH)
-					|| (e.getView().getType() == e.getView().getType().CRAFTING)) {
+			
+			if ((e.getView().getType() == InventoryType.WORKBENCH)
+					|| (e.getView().getType() == InventoryType.CRAFTING)) {
 
 
 				if (e.getSlotType() == SlotType.RESULT) {
 		final Player p = (Player) e.getWhoClicked();
 		final String name = p.getName();
 		if (e.getCurrentItem() != null) {
-			int amount1 = e.getCurrentItem().getAmount() * cost;
-			int amount2 = e.getCursor().getAmount() * cost;
-			int bal = (int) EmeraldEconLink.econ.getBalance(name);
+	
 			
-			if (e.getView().getType() == e.getView().getType().ANVIL) {
+			if (e.getView().getType() == InventoryType.ANVIL) {
 
 
 				if (e.getRawSlot() == 2) {
 		
 		final Player p = (Player) e.getWhoClicked();
 		final String name = p.getName();
-		int item = e.getCurrentItem().getTypeId();
-		String skname = null;
+		
 		
 		if (e.isCancelled()){
 			return;
 		
 			if (e.getCurrentItem() != null) {
 
-				
-				int bal = (int) EmeraldEconLink.econ.getBalance(name);
-
-	
 				if (e.getView().getType()== InventoryType.BEACON){
 
-	// si le slot cliqu� correspond a l'inventaire du haut et le
+	// si le slot cliqu� correspond a l'inventaire du haut et le
 	// curseur a deja l'item (pour un depot)
 	if ((e.getRawSlot() < (slot-36))
 			&& (e.getCursor().getType().getId() == itemId)) {
 
-		// si le slot cliqu� est vide
+		// si le slot cliqu� est vide
 		if (e.getCurrentItem().getType().getId() != itemId) {
 
 			if (e.isShiftClick())return;
 
 			if (e.isShiftClick()) {
 				
-				int getAmount = e.getCurrentItem().getAmount();
-				
 				if (Utils.howManyItemsCanHold(p, itemId) >=1) {
 					
 					EmeraldEconLink.econ.depositPlayer(name, cost);
 		
 	private List<Integer> money1 = new ArrayList<Integer>();
 	
+	@SuppressWarnings("unused")
 	@EventHandler
 	private void oncreativeclick(InventoryClickEvent e) {
 		Player p = (Player) e.getWhoClicked();
 				   int diff = this.money1.get(0)-money2 ;
 				
 				   if (diff>0) {
-					   plugin.econ.withdrawPlayer(p.getName(), diff);
+					   EmeraldEconLink.econ.withdrawPlayer(p.getName(), diff);
 					   if (!Configuration.DisableChatMessage) {
 				   	   p.sendMessage(Utils.messageRemove(p,diff));
 				   	
 				   int diff = money2-this.money1.get(0) ;
 				
 				   if (diff>0){
-					   plugin.econ.depositPlayer(p.getName(), diff);
+					   EmeraldEconLink.econ.depositPlayer(p.getName(), diff);
 					   if (!Configuration.DisableChatMessage) {
 				   		p.sendMessage(Utils.messageAdd(p,diff));
 				   		

src/me/fonkfader/EmeraldEconLink/DropsListeners.java

 package me.fonkfader.EmeraldEconLink;
 
 import java.util.Collection;
-import java.util.List;
-
 import org.bukkit.Material;
 import org.bukkit.entity.Entity;
 import org.bukkit.entity.EntityType;
-import org.bukkit.entity.Hanging;
 import org.bukkit.entity.ItemFrame;
 import org.bukkit.entity.Player;
 import org.bukkit.event.EventHandler;
 import org.bukkit.event.Listener;
 import org.bukkit.event.block.BlockPlaceEvent;
 import org.bukkit.event.entity.PlayerDeathEvent;
-import org.bukkit.event.hanging.HangingBreakEvent;
-import org.bukkit.event.hanging.HangingPlaceEvent;
 import org.bukkit.event.player.PlayerDropItemEvent;
 import org.bukkit.event.player.PlayerInteractEntityEvent;
 import org.bukkit.event.player.PlayerPickupItemEvent;
 import org.bukkit.inventory.ItemStack;
-import org.bukkit.plugin.java.JavaPlugin;
 
 public class DropsListeners implements Listener{
 
 	
 
+@SuppressWarnings("unused")
 private EmeraldEconLink plugin;
 	
 	public DropsListeners (EmeraldEconLink plugin){
 		String name = p.getName();
 
 		int item = event.getItemDrop().getItemStack().getData().getItemTypeId();
-		int bal = (int) EmeraldEconLink.econ.getBalance(name);
+		
 		int amountItem = event.getItemDrop().getItemStack().getAmount();
 		
 		
 		Player p = (Player) event.getEntity();
 		String name = p.getName();
 		Collection<ItemStack> drops = event.getDrops();
-		int bal = (int) EmeraldEconLink.econ.getBalance(name);
 		int total =0;
 		
 		if (!Configuration.DisabledWorlds.contains(p.getWorld().getName())) {

src/me/fonkfader/EmeraldEconLink/EmeraldEconLink.java

 
 
 import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Arrays;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
 import java.util.logging.Level;
 
-import net.milkbowl.vault.Vault;
 import net.milkbowl.vault.economy.Economy;
 import net.milkbowl.vault.permission.Permission;
 
-import org.bukkit.ChatColor;
 import org.bukkit.Server;
-import org.bukkit.configuration.InvalidConfigurationException;
 import org.bukkit.configuration.file.FileConfiguration;
 import org.bukkit.configuration.file.YamlConfiguration;
 import org.bukkit.event.Listener;
-import org.bukkit.plugin.Plugin;
 import org.bukkit.plugin.RegisteredServiceProvider;
 import org.bukkit.plugin.java.JavaPlugin;
-import com.nisovin.shopkeepers.Shopkeeper;
 import com.nisovin.shopkeepers.ShopkeepersPlugin;
-import me.fonkfader.EmeraldEconLink.Utils;
 import me.fonkfader.EmeraldEconLink.Commands;
 public class EmeraldEconLink extends JavaPlugin implements Listener {
 

src/me/fonkfader/EmeraldEconLink/Signs.java

 package me.fonkfader.EmeraldEconLink;
 
-import java.util.HashSet;
-
-import net.minecraft.server.Block;
-
 import org.bukkit.ChatColor;
 import org.bukkit.Effect;
 import org.bukkit.Material;
 import org.bukkit.Sound;
-import org.bukkit.block.BlockFace;
 import org.bukkit.block.BlockState;
 import org.bukkit.block.Sign;
-import org.bukkit.entity.ItemFrame;
 import org.bukkit.entity.Player;
 import org.bukkit.event.EventHandler;
 import org.bukkit.event.EventPriority;
 
 public class Signs extends JavaPlugin implements Listener{
 	
+@SuppressWarnings("unused")
 private EmeraldEconLink plugin;
 	
 	public Signs (EmeraldEconLink plugin){
 
 	
 	
+	@SuppressWarnings("deprecation")
 	@EventHandler(priority = EventPriority.NORMAL)
 	public void onSigninteract(PlayerInteractEvent e) {
 		Player p = e.getPlayer();
 		
 		String itemName = null;
 		
-		int totalInInv = Utils.countPlayerItem(p,itemId);
-		int totalMaxInv = Utils.countItemSlots(p,itemId) * 64;
 		final int bal = (int) EmeraldEconLink.econ.getBalance(p.getName());
-		Integer integer = null;
+		
 
 		for (int i=0;i<Configuration.itemsId.size();i++){
 			if (item == Configuration.itemsId.get(i)){
 						int amount;
 
 						try {
-							amount = integer.parseInt(s.getLine(3));
+							amount = Integer.parseInt(s.getLine(3));
 
 						} catch (Exception ex) {
 
 						
 							
 							if (s.getLine(3).equalsIgnoreCase(
-									integer.toString(cost))) {
+									Integer.toString(cost))) {
 
-								s.setLine(3, integer.toString(cost * 2));
+								s.setLine(3, Integer.toString(cost * 2));
 								s.update();
 							} else if (s.getLine(3).equalsIgnoreCase(
-									integer.toString(cost * 2))) {
+									Integer.toString(cost * 2))) {
 
-								s.setLine(3, integer.toString(cost * 4));
+								s.setLine(3, Integer.toString(cost * 4));
 								s.update();
 							} else if (s.getLine(3).equalsIgnoreCase(
-									integer.toString(cost * 4))) {
+									Integer.toString(cost * 4))) {
 
-								s.setLine(3, integer.toString(cost * 8));
+								s.setLine(3, Integer.toString(cost * 8));
 								s.update();
 							} else if (s.getLine(3).equalsIgnoreCase(
-									integer.toString(cost * 8))) {
+									Integer.toString(cost * 8))) {
 
-								s.setLine(3, integer.toString(cost * 16));
+								s.setLine(3, Integer.toString(cost * 16));
 								s.update();
 							} else if (s.getLine(3).equalsIgnoreCase(
-									integer.toString(cost * 16))) {
+									Integer.toString(cost * 16))) {
 
-								s.setLine(3, integer.toString(cost * 32));
+								s.setLine(3, Integer.toString(cost * 32));
 								s.update();
 							} else if (s.getLine(3).equalsIgnoreCase(
-									integer.toString(cost * 32))) {
-								s.setLine(3, integer.toString(cost * 64));
+									Integer.toString(cost * 32))) {
+								s.setLine(3, Integer.toString(cost * 64));
 								s.update();
 							} else if (s.getLine(3).equalsIgnoreCase(
-									integer.toString(cost * 64))) {
-								s.setLine(3, integer.toString(cost));
+									Integer.toString(cost * 64))) {
+								s.setLine(3, Integer.toString(cost));
 								s.update();
 							}
 						}
 									i++;
 									itemName = Material.getMaterial(Configuration.itemsId.get(i)).toString();
 									s.setLine(2, itemName);
-									s.setLine(3, integer.toString(Configuration.itemsCost.get(i)));
+									s.setLine(3, Integer.toString(Configuration.itemsCost.get(i)));
 									s.update();
 									i--;
 									stop=1;
 								}else if ((s.getLine(2).equalsIgnoreCase(itemName))&&(i==Configuration.itemsId.size()-1)&&(stop==0)){
 									itemName = Material.getMaterial(Configuration.itemsId.get(0)).toString();
 									s.setLine(2, itemName);
-									s.setLine(3, integer.toString(Configuration.itemsCost.get(0)));
+									s.setLine(3, Integer.toString(Configuration.itemsCost.get(0)));
 									s.update();
 									stop=1;
 								}
 								
 							}
 							
-							if (Utils.howManyMoneyCanHold(p) >= integer
+							if (Utils.howManyMoneyCanHold(p) >= Integer
 									.parseInt(s.getLine(3))) {
 
-								if ((bal - Utils.totalMoneyinInventory(p)) >= integer
+								if ((bal - Utils.totalMoneyinInventory(p)) >= Integer
 										.parseInt(s.getLine(3))) {
 
 									s.update();

src/me/fonkfader/EmeraldEconLink/Utils.java

 import java.util.Collections;
 import java.util.List;
 
-import javax.rmi.CORBA.Util;
-import javax.xml.bind.JAXB;
-
-import org.apache.commons.lang.ArrayUtils;
 import org.bukkit.ChatColor;
-import org.bukkit.Material;
-import org.bukkit.block.Block;
 import org.bukkit.entity.Player;
 import org.bukkit.event.inventory.InventoryClickEvent;
-import org.bukkit.event.inventory.InventoryCloseEvent;
 import org.bukkit.event.inventory.InventoryType;
 import org.bukkit.inventory.ItemStack;
-import org.bukkit.plugin.java.JavaPlugin;
-
 import com.google.common.primitives.Ints;
 
 public class Utils {
 
+	@SuppressWarnings("unused")
 	private static EmeraldEconLink plugin;
 	
+	@SuppressWarnings("static-access")
 	public Utils (EmeraldEconLink plugin){
 		
 		this.plugin = plugin;
 	 
 			index++;
 		}
-		int total = 0;
+		
 		if (bestsolution!=null){
 		for (int i =0; i<bestsolution.length;i++) {
 			
 		}
 		
 		
-		int total = 0;
+	
 		if (bestsolution!=null){
 			int sollenght = 0;
 			for (int i =0; i<bestsolution.length;i++) {