From 2efda17935bfc73286e579a8b26a36a4920ef5b7 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 11 Aug 2020 09:04:43 +1200 Subject: [PATCH] Fix console being cast to player --- .../libraryaddict/disguise/utilities/DisguiseUtilities.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index 5affbd8c..b228b9cc 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -198,6 +198,10 @@ public class DisguiseUtilities { } public static String getDisplayName(CommandSender player) { + if (!(player instanceof Player)) { + return player.getName(); + } + Team team = ((Player) player).getScoreboard().getEntryTeam(player.getName()); if (team == null) {