mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Set player scoreboards to main server scoreboard upon entering a blacklisted world
This commit is contained in:
parent
8a4410cde8
commit
bba35f8a4e
@ -1,3 +1,9 @@
|
|||||||
|
Version 2.1.105
|
||||||
|
mcMMO will reset players scoreboard to the main scoreboard if they move into a blacklisted world
|
||||||
|
|
||||||
|
NOTES:
|
||||||
|
The scoreboard change should result in mcMMO removing scoreboards from players properly when they enter a black listed world. This is a hacky band aid fix as our scoreboard code is archaic and needs to be rewritten in 2.2 and not 2.1. Expect a scoreboard overhaul sometime in the future.
|
||||||
|
|
||||||
Version 2.1.104
|
Version 2.1.104
|
||||||
Fixed a bug resulting in many errors when using Rupture
|
Fixed a bug resulting in many errors when using Rupture
|
||||||
Large update to the Japanese locale (thanks ethernetcat)
|
Large update to the Japanese locale (thanks ethernetcat)
|
||||||
|
@ -13,6 +13,7 @@ import com.gmail.nossr50.util.player.UserManager;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scoreboard.DisplaySlot;
|
import org.bukkit.scoreboard.DisplaySlot;
|
||||||
@ -173,8 +174,13 @@ public class ScoreboardManager {
|
|||||||
dirtyPowerLevels.add(player.getName());
|
dirtyPowerLevels.add(player.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called by PlayerQuitEvent listener
|
// Called by PlayerQuitEvent listener and OnPlayerTeleport under certain circumstances
|
||||||
public static void teardownPlayer(Player player) {
|
public static void teardownPlayer(Player player) {
|
||||||
|
//Hacky world blacklist fix
|
||||||
|
if(player.isOnline() && player.isValid())
|
||||||
|
if(Bukkit.getServer().getScoreboardManager() != null)
|
||||||
|
player.setScoreboard(Bukkit.getServer().getScoreboardManager().getMainScoreboard());
|
||||||
|
|
||||||
ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.remove(player.getName());
|
ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.remove(player.getName());
|
||||||
|
|
||||||
if (wrapper != null && wrapper.revertTask != null) {
|
if (wrapper != null && wrapper.revertTask != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user