mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Fixed /mcremove
This commit is contained in:
parent
3c7bcb990e
commit
8c178869b7
@ -15,7 +15,9 @@ 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.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
|
import com.gmail.nossr50.datatypes.SpoutHud;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.spout.SpoutStuff;
|
import com.gmail.nossr50.spout.SpoutStuff;
|
||||||
import com.gmail.nossr50.util.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
@ -100,16 +102,21 @@ public class McremoveCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Force PlayerProfile stuff to update
|
//Force PlayerProfile stuff to update
|
||||||
OfflinePlayer player = plugin.getServer().getOfflinePlayer(playerName);
|
McMMOPlayer mcmmoPlayer = Users.getPlayer(playerName);
|
||||||
PlayerProfile playerProfile = Users.getProfile(player);
|
|
||||||
|
|
||||||
if (playerProfile != null) {
|
if (mcmmoPlayer != null) {
|
||||||
playerProfile.getSpoutHud().removeWidgets();
|
Player player = mcmmoPlayer.getPlayer();
|
||||||
Users.remove(player.getName());
|
SpoutHud spoutHud = mcmmoPlayer.getProfile().getSpoutHud();
|
||||||
|
|
||||||
|
if (spoutHud != null) {
|
||||||
|
spoutHud.removeWidgets();
|
||||||
|
}
|
||||||
|
|
||||||
|
Users.remove(playerName);
|
||||||
|
|
||||||
if (player.isOnline()) {
|
if (player.isOnline()) {
|
||||||
Users.addUser((Player) player);
|
Users.addUser(player);
|
||||||
SpoutStuff.reloadSpoutPlayer((Player) player);
|
SpoutStuff.reloadSpoutPlayer(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user