Players moving to a blacklisted world will have scoreboards removed

This commit is contained in:
Robert Chapton 2019-08-19 14:49:21 -07:00
parent 1221069854
commit 665a31fc85
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,6 @@
Version 2.1.102
Scoreboards will now be removed from players who teleport to a blacklisted world
Version 2.1.101
Fixed an exploit where chorus plants could be used to gain automatic XP
Added blast furnace, cartography table, grindstone, lectern, loom, scaffolding, smoker, stonecutter, and sweet berry bush to the list of internal blocks that don't trigger tool readying

View File

@ -27,6 +27,7 @@ import com.gmail.nossr50.skills.salvage.SalvageManager;
import com.gmail.nossr50.skills.taming.TamingManager;
import com.gmail.nossr50.util.*;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillUtils;
import com.gmail.nossr50.util.sounds.SoundManager;
@ -69,8 +70,16 @@ public class PlayerListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerTeleport(PlayerTeleportEvent event) {
/* WORLD BLACKLIST CHECK */
if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld()))
if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) {
//Remove scoreboards
ScoreboardManager.teardownPlayer(event.getPlayer());
return;
} else if(WorldBlacklist.isWorldBlacklisted(event.getFrom().getWorld())) {
//This only fires if they are traveling to a non-blacklisted world from a blacklisted world
//Setup scoreboards
ScoreboardManager.setupPlayer(event.getPlayer());
}
Player player = event.getPlayer();