Simplify redundant statements and casts
This commit is contained in:
@@ -22,7 +22,7 @@ public class DisguiseCommand extends BaseDisguiseCommand {
|
||||
sender.sendMessage(ChatColor.RED + "You may not use this command from the console!");
|
||||
return true;
|
||||
}
|
||||
Disguise disguise = null;
|
||||
Disguise disguise;
|
||||
try {
|
||||
disguise = parseDisguise(sender, args);
|
||||
} catch (Exception ex) {
|
||||
|
@@ -57,7 +57,7 @@ public class DisguisePlayerCommand extends BaseDisguiseCommand {
|
||||
}
|
||||
if (DisguiseConfig.isNameOfPlayerShownAboveDisguise()) {
|
||||
if (disguise.getWatcher() instanceof LivingWatcher) {
|
||||
((LivingWatcher) disguise.getWatcher()).setCustomName(((Player) player).getDisplayName());
|
||||
((LivingWatcher) disguise.getWatcher()).setCustomName(player.getDisplayName());
|
||||
if (DisguiseConfig.isNameAboveHeadAlwaysVisible()) {
|
||||
((LivingWatcher) disguise.getWatcher()).setCustomNameVisible(true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user