only add/remove scoreboards when teleporting if scoreboards are enabled (#4400)

This commit is contained in:
steve4744 2021-01-25 22:14:35 +00:00 committed by GitHub
parent 52ac1cc522
commit a225d604ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,10 +72,12 @@ public class PlayerListener implements Listener {
/* WORLD BLACKLIST CHECK */ /* WORLD BLACKLIST CHECK */
if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) { if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) {
//Remove scoreboards //Remove scoreboards
if(Config.getInstance().getScoreboardsEnabled()) {
ScoreboardManager.teardownPlayer(event.getPlayer()); ScoreboardManager.teardownPlayer(event.getPlayer());
}
return; return;
} else if(WorldBlacklist.isWorldBlacklisted(event.getFrom().getWorld())) { } else if(WorldBlacklist.isWorldBlacklisted(event.getFrom().getWorld()) && Config.getInstance().getScoreboardsEnabled()) {
//This only fires if they are traveling to a non-blacklisted world from a blacklisted world //This only fires if they are travelling to a non-blacklisted world from a blacklisted world
//Setup scoreboards //Setup scoreboards
ScoreboardManager.setupPlayer(event.getPlayer()); ScoreboardManager.setupPlayer(event.getPlayer());