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 */
if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) {
//Remove scoreboards
if(Config.getInstance().getScoreboardsEnabled()) {
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
} else if(WorldBlacklist.isWorldBlacklisted(event.getFrom().getWorld()) && Config.getInstance().getScoreboardsEnabled()) {
//This only fires if they are travelling to a non-blacklisted world from a blacklisted world
//Setup scoreboards
ScoreboardManager.setupPlayer(event.getPlayer());