Use lombok, add new config options for disabling pvp, pve, action bar when disguised, permission to hide name above head

This commit is contained in:
libraryaddict
2020-02-02 11:59:18 +13:00
parent 5f98e57316
commit ed098752f6
14 changed files with 590 additions and 720 deletions

View File

@@ -55,7 +55,7 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter
return true;
}
if (DisguiseConfig.isNameOfPlayerShownAboveDisguise()) {
if (DisguiseConfig.isNameOfPlayerShownAboveDisguise() && !sender.hasPermission("libsdisguises.hidename")) {
if (disguise.getWatcher() instanceof LivingWatcher) {
disguise.getWatcher().setCustomName(getDisplayName(sender));

View File

@@ -96,7 +96,8 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom
return true;
}
if (DisguiseConfig.isNameOfPlayerShownAboveDisguise()) {
if (DisguiseConfig.isNameOfPlayerShownAboveDisguise() &&
!entityTarget.hasPermission("libsdisguises.hidename")) {
if (disguise.getWatcher() instanceof LivingWatcher) {
disguise.getWatcher().setCustomName(getDisplayName(entityTarget));

View File

@@ -170,7 +170,8 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom
Disguise disguise = DisguiseParser
.parseDisguise(sender, entity, getPermNode(), disguiseArgs, permissions);
if (entity instanceof Player && DisguiseConfig.isNameOfPlayerShownAboveDisguise()) {
if (entity instanceof Player && DisguiseConfig.isNameOfPlayerShownAboveDisguise() &&
!entity.hasPermission("libsdisguises.hidename")) {
if (disguise.getWatcher() instanceof LivingWatcher) {
disguise.getWatcher().setCustomName(getDisplayName(entity));
if (DisguiseConfig.isNameAboveHeadAlwaysVisible()) {