Fixed /mcremove on existing PlayerProfile

This commit is contained in:
bm01 2012-06-08 20:03:02 +02:00
parent 90c8e57ed7
commit 01345a5dc4
2 changed files with 11 additions and 5 deletions

View File

@ -11,6 +11,7 @@ Version 1.3.09
+ Added compatibility with AntiCheat (Which I highly recommend to prevent cheating) + Added compatibility with AntiCheat (Which I highly recommend to prevent cheating)
+ Added several permission nodes to give individual users special perks (Double/Triple/Quadruple XP) + Added several permission nodes to give individual users special perks (Double/Triple/Quadruple XP)
+ Added API for plugins to add custom tools directly via Spout - repair / abilities do not work ATM + Added API for plugins to add custom tools directly via Spout - repair / abilities do not work ATM
= Fixed /mcremove being applied only after a reload
= Fixed Archery PVE disablement not working properly = Fixed Archery PVE disablement not working properly
= Fixed possible NPE when a projectile is shot by a dispenser or doesn't have any shooter = Fixed possible NPE when a projectile is shot by a dispenser or doesn't have any shooter
= Fixed issue with NoCheatPlus and Serrated Strikes / Skull Splitter (fight.noswing) = Fixed issue with NoCheatPlus and Serrated Strikes / Skull Splitter (fight.noswing)

View File

@ -5,6 +5,7 @@ import java.io.FileReader;
import java.io.FileWriter; import java.io.FileWriter;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -13,6 +14,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
@ -96,12 +98,15 @@ public class McremoveCommand implements CommandExecutor {
} }
//Force PlayerProfile stuff to update //Force PlayerProfile stuff to update
Player player = plugin.getServer().getPlayer(playerName); OfflinePlayer player = plugin.getServer().getOfflinePlayer(playerName);
PlayerProfile playerProfile = Users.getProfile(player);
//TODO fix this if (playerProfile != null) {
if (player != null /*&& Users.getProfiles().containsKey(player)*/) { Users.removeUser(playerProfile);
Users.removeUser(player);
Users.addUser(player); if (player.isOnline()) {
Users.addUser((Player) player);
}
} }
return true; return true;