mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Fixed /mcremove on existing PlayerProfile
This commit is contained in:
parent
90c8e57ed7
commit
01345a5dc4
@ -11,6 +11,7 @@ Version 1.3.09
|
||||
+ 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 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 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)
|
||||
|
@ -5,6 +5,7 @@ import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -13,6 +14,7 @@ import org.bukkit.entity.Player;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.commands.CommandHelper;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Users;
|
||||
|
||||
@ -96,12 +98,15 @@ public class McremoveCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
//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 (player != null /*&& Users.getProfiles().containsKey(player)*/) {
|
||||
Users.removeUser(player);
|
||||
Users.addUser(player);
|
||||
if (playerProfile != null) {
|
||||
Users.removeUser(playerProfile);
|
||||
|
||||
if (player.isOnline()) {
|
||||
Users.addUser((Player) player);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user