package fr.plx0wn.Rewards;

import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;

import fr.plx0wn.MobsReward;
import fr.plx0wn.Utils;

public class Players implements Listener {

	public static FileConfiguration config = MobsReward.instance.getConfig();
	public static FileConfiguration msgconf = MobsReward.msgconf;

	@SuppressWarnings("deprecation")
	@EventHandler
	public void onEntityKill(EntityDeathEvent e) {

		double playersDeath = config.getDouble("players.death");
		double playersKill = config.getDouble("players.kill");

		if (e.getEntity().getKiller() instanceof Player) {
			Player player = e.getEntity().getKiller();
			EntityType type = e.getEntityType();

			if (type.equals(EntityType.PLAYER)) {
				if (config.getBoolean("enabled.player-death")){
					MobsReward.economy.withdrawPlayer(player.getName(), playersDeath)
							.transactionSuccess();
					player.sendMessage(
							Utils.ColoredString(msgconf.getString("players.death")).replace("<loss>", "" + playersDeath));
				}
				if (config.getBoolean("enabled.player-kill")){
					MobsReward.economy.depositPlayer(player.getName(), playersKill)
							.transactionSuccess();
					player.sendMessage(
							Utils.ColoredString(msgconf.getString("players.kill")).replace("<reward>", "" + playersKill).replace("<player>", e.getEntity().getName()));
				}
			}
		}
	}

}

@@ -952,18 +952,123 @@
 death%22))
+ 
 %7B%0A
+%09%09%09%09%09if (player.hasPermission(%22rewards.players.death%22) %7C%7C player.hasPermission(%22rewards.players.*%22)) %7B%0A%09
 %09%09%09%09%09Mob
@@ -1129,24 +1129,16 @@
 rsDeath)
-%0A%09%09%09%09%09%09%09
 .transac
@@ -1149,32 +1149,33 @@
 Success();%0A%09%09%09%09%09
+%09
 player.sendMessa
@@ -1173,32 +1173,24 @@
 sendMessage(
-%0A%09%09%09%09%09%09%09
 Utils.Colore
@@ -1250,17 +1250,25 @@
 %3Closs%3E%22,
- 
+%0A%09%09%09%09%09%09%09%09
 %22%22 + pla
@@ -1276,24 +1276,31 @@
 ersDeath));%0A
+%09%09%09%09%09%7D%0A
 %09%09%09%09%7D%0A%09%09%09%09if
@@ -1342,18 +1342,122 @@
 -kill%22))
+ 
 %7B%0A
+%09%09%09%09%09if (player.hasPermission(%22rewards.players.kill%22) %7C%7C player.hasPermission(%22rewards.players.*%22)) %7B%0A%09
 %09%09%09%09%09Mob
@@ -1516,24 +1516,16 @@
 ersKill)
-%0A%09%09%09%09%09%09%09
 .transac
@@ -1540,24 +1540,25 @@
 ess();%0A%09%09%09%09%09
+%09
 player.sendM
@@ -1564,24 +1564,16 @@
 Message(
-%0A%09%09%09%09%09%09%09
 Utils.Co
@@ -1618,16 +1618,25 @@
 .kill%22))
+%0A%09%09%09%09%09%09%09%09
 .replace
@@ -1709,24 +1709,31 @@
 etName()));%0A
+%09%09%09%09%09%7D%0A
 %09%09%09%09%7D%0A%09%09%09%7D%0A%09

Update Players.java