diff --git a/pom.xml b/pom.xml index 32a3f40c..6eeb149c 100644 --- a/pom.xml +++ b/pom.xml @@ -103,6 +103,11 @@ 1.15.2-R0.1-SNAPSHOT provided + + net.md-5 + bungeecord-chat + 1.16-R0.1 + diff --git a/src/main/java/me/libraryaddict/disguise/commands/LibsDisguisesCommand.java b/src/main/java/me/libraryaddict/disguise/commands/LibsDisguisesCommand.java index 434e6eba..f521e010 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/LibsDisguisesCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/LibsDisguisesCommand.java @@ -3,6 +3,7 @@ package me.libraryaddict.disguise.commands; import lombok.Getter; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.commands.libsdisguises.*; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.ChatColor; @@ -113,13 +114,13 @@ public class LibsDisguisesCommand implements CommandExecutor, TabCompleter { if (command != null) { if (!command.hasPermission(sender)) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } command.onCommand(sender, args); } else { - sender.sendMessage(LibsMsg.LIBS_COMMAND_WRONG_ARG.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_COMMAND_WRONG_ARG); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java index da85557d..5c3a9730 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java @@ -28,7 +28,7 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter } if (!(sender instanceof Entity)) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } @@ -77,9 +77,9 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter disguise.startDisguise(); if (disguise.isDisguiseInUse()) { - sender.sendMessage(LibsMsg.DISGUISED.get(disguise.getDisguiseName())); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISGUISED, disguise.getDisguiseName()); } else { - sender.sendMessage(LibsMsg.FAILED_DISGIUSE.get(disguise.getDisguiseName())); + DisguiseUtilities.sendMessage(sender, LibsMsg.FAILED_DISGIUSE, disguise.getDisguiseName()); } return true; @@ -114,22 +114,22 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter ArrayList allowedDisguises = getAllowedDisguises(permissions); if (allowedDisguises.isEmpty()) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return; } - sender.sendMessage(LibsMsg.DISG_HELP1.get()); - sender.sendMessage( - LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_HELP1); + DisguiseUtilities.sendMessage(sender, LibsMsg.CAN_USE_DISGS, + StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())); if (allowedDisguises.contains("player")) { - sender.sendMessage(LibsMsg.DISG_HELP2.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_HELP2); } - sender.sendMessage(LibsMsg.DISG_HELP3.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_HELP3); if (allowedDisguises.contains("dropped_item") || allowedDisguises.contains("falling_block")) { - sender.sendMessage(LibsMsg.DISG_HELP4.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_HELP4); } } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseEntityCommand.java b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseEntityCommand.java index cd246539..a623275b 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseEntityCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseEntityCommand.java @@ -28,12 +28,12 @@ public class DisguiseEntityCommand extends DisguiseBaseCommand implements TabCom } if (!(sender instanceof Player)) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } if (!getPermissions(sender).hasPermissions()) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } @@ -65,8 +65,8 @@ public class DisguiseEntityCommand extends DisguiseBaseCommand implements TabCom .addInteraction(sender.getName(), new DisguiseEntityInteraction(disguiseArgs), DisguiseConfig.getDisguiseEntityExpire()); - sender.sendMessage( - LibsMsg.DISG_ENT_CLICK.get(DisguiseConfig.getDisguiseEntityExpire(), testDisguise.getDisguiseName())); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_ENT_CLICK, DisguiseConfig.getDisguiseEntityExpire(), + testDisguise.getDisguiseName()); return true; } @@ -93,22 +93,22 @@ public class DisguiseEntityCommand extends DisguiseBaseCommand implements TabCom ArrayList allowedDisguises = getAllowedDisguises(permissions); if (allowedDisguises.isEmpty()) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return; } - sender.sendMessage(LibsMsg.DISG_ENT_HELP1.get()); - sender.sendMessage( - LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_ENT_HELP1); + DisguiseUtilities.sendMessage(sender, LibsMsg.CAN_USE_DISGS, + StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())); if (allowedDisguises.contains("player")) { - sender.sendMessage(LibsMsg.DISG_ENT_HELP3.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_ENT_HELP3); } - sender.sendMessage(LibsMsg.DISG_ENT_HELP4.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_ENT_HELP4); if (allowedDisguises.contains("dropped_item") || allowedDisguises.contains("falling_block")) { - sender.sendMessage(LibsMsg.DISG_ENT_HELP5.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_ENT_HELP5); } } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java index f2168c7c..8c2bfe57 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java @@ -34,7 +34,7 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom DisguisePermissions permissions = getPermissions(sender); if (!permissions.hasPermissions()) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } @@ -44,7 +44,7 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom } if (args.length == 1) { - sender.sendMessage(LibsMsg.DPLAYER_SUPPLY.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DPLAYER_SUPPLY); return true; } @@ -92,7 +92,7 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom } if (disguise.isMiscDisguise() && !DisguiseConfig.isMiscDisguisesForLivingEnabled()) { - sender.sendMessage(LibsMsg.DISABLED_LIVING_TO_MISC.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISABLED_LIVING_TO_MISC); return true; } @@ -172,22 +172,22 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom ArrayList allowedDisguises = getAllowedDisguises(permissions); if (allowedDisguises.isEmpty()) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return; } - sender.sendMessage(LibsMsg.D_HELP1.get()); - sender.sendMessage( - LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); + DisguiseUtilities.sendMessage(sender, LibsMsg.D_HELP1); + DisguiseUtilities.sendMessage(sender, LibsMsg.CAN_USE_DISGS, + StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())); if (allowedDisguises.contains("player")) { - sender.sendMessage(LibsMsg.D_HELP3.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.D_HELP3); } - sender.sendMessage(LibsMsg.D_HELP4.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.D_HELP4); if (allowedDisguises.contains("dropped_item") || allowedDisguises.contains("falling_block")) { - sender.sendMessage(LibsMsg.D_HELP5.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.D_HELP5); } } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java index 6adf126e..7ba22df5 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java @@ -52,14 +52,14 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom } if (sender.getName().equals("CONSOLE")) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } DisguisePermissions permissions = getPermissions(sender); if (!permissions.hasPermissions()) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } @@ -115,7 +115,7 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom (starting == 0 ? LibsMsg.DRADIUS_NEEDOPTIONS : LibsMsg.DRADIUS_NEEDOPTIONS_ENTITY).get()); return true; } else if (args.length < 2) { - sender.sendMessage(LibsMsg.DRADIUS_NEEDOPTIONS.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DRADIUS_NEEDOPTIONS); return true; } @@ -127,7 +127,7 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom int radius = Integer.parseInt(args[starting]); if (radius > maxRadius) { - sender.sendMessage(LibsMsg.LIMITED_RADIUS.get(maxRadius)); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIMITED_RADIUS, maxRadius); radius = maxRadius; } @@ -202,13 +202,13 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom } if (disguisedEntitys > 0) { - sender.sendMessage(LibsMsg.DISRADIUS.get(disguisedEntitys)); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISRADIUS, disguisedEntitys); } else { - sender.sendMessage(LibsMsg.DISRADIUS_FAIL.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DISRADIUS_FAIL); } if (miscDisguises > 0) { - sender.sendMessage(LibsMsg.DRADIUS_MISCDISG.get(miscDisguises)); + DisguiseUtilities.sendMessage(sender, LibsMsg.DRADIUS_MISCDISG, miscDisguises); } } catch (DisguiseParseException ex) { @@ -278,24 +278,24 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom ArrayList allowedDisguises = getAllowedDisguises(permissions); if (allowedDisguises.isEmpty()) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return; } - sender.sendMessage(LibsMsg.DRADIUS_HELP1.get(maxRadius)); - sender.sendMessage( - LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); + DisguiseUtilities.sendMessage(sender, LibsMsg.DRADIUS_HELP1, maxRadius); + DisguiseUtilities.sendMessage(sender, LibsMsg.CAN_USE_DISGS, + StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())); if (allowedDisguises.contains("player")) { - sender.sendMessage(LibsMsg.DRADIUS_HELP3.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DRADIUS_HELP3); } - sender.sendMessage(LibsMsg.DRADIUS_HELP4.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DRADIUS_HELP4); if (allowedDisguises.contains("dropped_item") || allowedDisguises.contains("falling_block")) { - sender.sendMessage(LibsMsg.DRADIUS_HELP5.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DRADIUS_HELP5); } - sender.sendMessage(LibsMsg.DRADIUS_HELP6.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DRADIUS_HELP6); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/interactions/CopyDisguiseInteraction.java b/src/main/java/me/libraryaddict/disguise/commands/interactions/CopyDisguiseInteraction.java index d2c684d3..1f4bc933 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/interactions/CopyDisguiseInteraction.java +++ b/src/main/java/me/libraryaddict/disguise/commands/interactions/CopyDisguiseInteraction.java @@ -6,6 +6,7 @@ import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.commands.utils.CopyDisguiseCommand; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.PlayerDisguise; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsEntityInteract; import me.libraryaddict.disguise.utilities.parser.DisguiseParser; import me.libraryaddict.disguise.utilities.translations.LibsMsg; @@ -35,7 +36,7 @@ public class CopyDisguiseInteraction implements LibsEntityInteract { DisguiseParser.parseToString(disguise), true); } } else { - player.sendMessage(LibsMsg.TARGET_NOT_DISGUISED.get()); + DisguiseUtilities.sendMessage(player, LibsMsg.TARGET_NOT_DISGUISED); } } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/interactions/DisguiseEntityInteraction.java b/src/main/java/me/libraryaddict/disguise/commands/interactions/DisguiseEntityInteraction.java index 3c05978f..2464f44e 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/interactions/DisguiseEntityInteraction.java +++ b/src/main/java/me/libraryaddict/disguise/commands/interactions/DisguiseEntityInteraction.java @@ -6,6 +6,7 @@ import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsEntityInteract; import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; import me.libraryaddict.disguise.utilities.parser.DisguiseParser; @@ -52,7 +53,7 @@ public class DisguiseEntityInteraction implements LibsEntityInteract { if (disguise.isMiscDisguise() && !DisguiseConfig.isMiscDisguisesForLivingEnabled() && entity instanceof LivingEntity) { - p.sendMessage(LibsMsg.DISABLED_LIVING_TO_MISC.get()); + DisguiseUtilities.sendMessage(p, LibsMsg.DISABLED_LIVING_TO_MISC); } else { if (entity instanceof Player && DisguiseConfig.isNameOfPlayerShownAboveDisguise() && !entity.hasPermission("libsdisguises.hidename")) { @@ -76,29 +77,37 @@ public class DisguiseEntityInteraction implements LibsEntityInteract { if (disguise.isDisguiseInUse()) { if (disguise.isPlayerDisguise()) { if (entity instanceof Player) { - p.sendMessage(LibsMsg.LISTEN_ENTITY_PLAYER_DISG_PLAYER.get(entityName, disguiseName)); + DisguiseUtilities + .sendMessage(p, LibsMsg.LISTEN_ENTITY_PLAYER_DISG_PLAYER, entityName, disguiseName); } else { - p.sendMessage(LibsMsg.LISTEN_ENTITY_ENTITY_DISG_PLAYER.get(entityName, disguiseName)); + DisguiseUtilities + .sendMessage(p, LibsMsg.LISTEN_ENTITY_ENTITY_DISG_PLAYER, entityName, disguiseName); } } else { if (entity instanceof Player) { - p.sendMessage(LibsMsg.LISTEN_ENTITY_PLAYER_DISG_ENTITY.get(entityName, disguiseName)); + DisguiseUtilities + .sendMessage(p, LibsMsg.LISTEN_ENTITY_PLAYER_DISG_ENTITY, entityName, disguiseName); } else { - p.sendMessage(LibsMsg.LISTEN_ENTITY_ENTITY_DISG_ENTITY.get(entityName, disguiseName)); + DisguiseUtilities + .sendMessage(p, LibsMsg.LISTEN_ENTITY_ENTITY_DISG_ENTITY, entityName, disguiseName); } } } else { if (disguise.isPlayerDisguise()) { if (entity instanceof Player) { - p.sendMessage(LibsMsg.LISTEN_ENTITY_PLAYER_DISG_PLAYER_FAIL.get(entityName, disguiseName)); + DisguiseUtilities.sendMessage(p, LibsMsg.LISTEN_ENTITY_PLAYER_DISG_PLAYER_FAIL, entityName, + disguiseName); } else { - p.sendMessage(LibsMsg.LISTEN_ENTITY_ENTITY_DISG_PLAYER_FAIL.get(entityName, disguiseName)); + DisguiseUtilities.sendMessage(p, LibsMsg.LISTEN_ENTITY_ENTITY_DISG_PLAYER_FAIL, entityName, + disguiseName); } } else { if (entity instanceof Player) { - p.sendMessage(LibsMsg.LISTEN_ENTITY_PLAYER_DISG_ENTITY_FAIL.get(entityName, disguiseName)); + DisguiseUtilities.sendMessage(p, LibsMsg.LISTEN_ENTITY_PLAYER_DISG_ENTITY_FAIL, entityName, + disguiseName); } else { - p.sendMessage(LibsMsg.LISTEN_ENTITY_ENTITY_DISG_ENTITY_FAIL.get(entityName, disguiseName)); + DisguiseUtilities.sendMessage(p, LibsMsg.LISTEN_ENTITY_ENTITY_DISG_ENTITY_FAIL, entityName, + disguiseName); } } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/interactions/DisguiseModifyInteraction.java b/src/main/java/me/libraryaddict/disguise/commands/interactions/DisguiseModifyInteraction.java index 46dde47b..087b793e 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/interactions/DisguiseModifyInteraction.java +++ b/src/main/java/me/libraryaddict/disguise/commands/interactions/DisguiseModifyInteraction.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.DisguiseType; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsEntityInteract; import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; import me.libraryaddict.disguise.utilities.parser.DisguiseParser; @@ -37,7 +38,7 @@ public class DisguiseModifyInteraction implements LibsEntityInteract { Disguise disguise = DisguiseAPI.getDisguise(p, entity); if (disguise == null) { - p.sendMessage(LibsMsg.UNDISG_PLAYER_FAIL.get(entityName)); + DisguiseUtilities.sendMessage(p, LibsMsg.UNDISG_PLAYER_FAIL, entityName); return; } @@ -47,7 +48,7 @@ public class DisguiseModifyInteraction implements LibsEntityInteract { DisguisePerm disguisePerm = new DisguisePerm(disguise.getType()); if (!perms.isAllowedDisguise(disguisePerm, Arrays.asList(options))) { - p.sendMessage(LibsMsg.DMODPLAYER_NOPERM.get()); + DisguiseUtilities.sendMessage(p, LibsMsg.DMODPLAYER_NOPERM); return; } @@ -55,7 +56,7 @@ public class DisguiseModifyInteraction implements LibsEntityInteract { DisguiseParser .callMethods(p, disguise, perms, disguisePerm, new ArrayList<>(Arrays.asList(options)), options, "DisguiseModifyEntity"); - p.sendMessage(LibsMsg.LISTENER_MODIFIED_DISG.get()); + DisguiseUtilities.sendMessage(p, LibsMsg.LISTENER_MODIFIED_DISG); } catch (DisguiseParseException ex) { if (ex.getMessage() != null) { diff --git a/src/main/java/me/libraryaddict/disguise/commands/interactions/UndisguiseEntityInteraction.java b/src/main/java/me/libraryaddict/disguise/commands/interactions/UndisguiseEntityInteraction.java index bcca411a..437460b7 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/interactions/UndisguiseEntityInteraction.java +++ b/src/main/java/me/libraryaddict/disguise/commands/interactions/UndisguiseEntityInteraction.java @@ -2,6 +2,7 @@ package me.libraryaddict.disguise.commands.interactions; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.disguisetypes.DisguiseType; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsEntityInteract; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.entity.Entity; @@ -25,14 +26,14 @@ public class UndisguiseEntityInteraction implements LibsEntityInteract { DisguiseAPI.undisguiseToAll(entity); if (entity instanceof Player) - p.sendMessage(LibsMsg.LISTEN_UNDISG_PLAYER.get(entityName)); + DisguiseUtilities.sendMessage(p, LibsMsg.LISTEN_UNDISG_PLAYER, entityName); else - p.sendMessage(LibsMsg.LISTEN_UNDISG_ENT.get(entityName)); + DisguiseUtilities.sendMessage(p, LibsMsg.LISTEN_UNDISG_ENT, entityName); } else { if (entity instanceof Player) - p.sendMessage(LibsMsg.LISTEN_UNDISG_PLAYER_FAIL.get(entityName)); + DisguiseUtilities.sendMessage(p, LibsMsg.LISTEN_UNDISG_PLAYER_FAIL, entityName); else - p.sendMessage(LibsMsg.LISTEN_UNDISG_ENT_FAIL.get(entityName)); + DisguiseUtilities.sendMessage(p, LibsMsg.LISTEN_UNDISG_ENT_FAIL, entityName); } } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDChangelog.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDChangelog.java index a1e92921..2d3255bb 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDChangelog.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDChangelog.java @@ -1,6 +1,7 @@ package me.libraryaddict.disguise.commands.libsdisguises; import me.libraryaddict.disguise.LibsDisguises; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.updates.UpdateChecker; import org.bukkit.ChatColor; @@ -33,12 +34,12 @@ public class LDChangelog implements LDCommand { UpdateChecker checker = LibsDisguises.getInstance().getUpdateChecker(); if (checker.isDownloading()) { - sender.sendMessage(LibsMsg.UPDATE_IN_PROGRESS.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_IN_PROGRESS); return; } if (checker.getUpdate() == null) { - sender.sendMessage(LibsMsg.UPDATE_REQUIRED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_REQUIRED); return; } diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDConfig.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDConfig.java index dec19b05..da310c66 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDConfig.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDConfig.java @@ -2,6 +2,7 @@ package me.libraryaddict.disguise.commands.libsdisguises; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; @@ -34,7 +35,7 @@ public class LDConfig implements LDCommand { ArrayList returns = DisguiseConfig.doOutput(LibsDisguises.getInstance().getConfig(), true, true); if (returns.isEmpty()) { - sender.sendMessage(LibsMsg.USING_DEFAULT_CONFIG.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.USING_DEFAULT_CONFIG); return; } diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDCount.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDCount.java index 19955269..51f23518 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDCount.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDCount.java @@ -35,9 +35,10 @@ public class LDCount implements LDCommand { } if (counts.isEmpty()) { - sender.sendMessage(LibsMsg.NO_DISGUISES_IN_USE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_DISGUISES_IN_USE); } else { - sender.sendMessage(LibsMsg.ACTIVE_DISGUISES_COUNT.get(counts.values().stream().reduce(Integer::sum).get())); + DisguiseUtilities.sendMessage(sender, LibsMsg.ACTIVE_DISGUISES_COUNT, + counts.values().stream().reduce(Integer::sum).get()); ArrayList types = new ArrayList<>(counts.keySet()); types.sort((d1, d2) -> String.CASE_INSENSITIVE_ORDER.compare(TranslateType.DISGUISES.get(d1.toReadable()), @@ -54,7 +55,7 @@ public class LDCount implements LDCommand { } } - sender.sendMessage(LibsMsg.ACTIVE_DISGUISES.get(builder.toString())); + DisguiseUtilities.sendMessage(sender, LibsMsg.ACTIVE_DISGUISES, builder.toString()); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDDebugPlayer.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDDebugPlayer.java index 81ae10a8..eaff506a 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDDebugPlayer.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDDebugPlayer.java @@ -29,7 +29,7 @@ public class LDDebugPlayer implements LDCommand { Disguise disguise = DisguiseAPI.getDisguise(player, entity); if (disguise == null) { - player.sendMessage(LibsMsg.TARGET_NOT_DISGUISED.get()); + DisguiseUtilities.sendMessage(player, LibsMsg.TARGET_NOT_DISGUISED); return; } @@ -100,7 +100,7 @@ public class LDDebugPlayer implements LDCommand { @Override public void onCommand(CommandSender sender, String[] args) { if (!(sender instanceof Player)) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); } LibsDisguises.getInstance().getListener().addInteraction(sender.getName(), new DebugInteraction(), 60); diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDJson.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDJson.java index f0ee24ab..fd982b76 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDJson.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDJson.java @@ -35,7 +35,7 @@ public class LDJson implements LDCommand { @Override public void onCommand(CommandSender sender, String[] args) { if (!(sender instanceof Player)) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return; } diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMetaInfo.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMetaInfo.java index 6a5bc0a0..faac7440 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMetaInfo.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMetaInfo.java @@ -1,6 +1,7 @@ package me.libraryaddict.disguise.commands.libsdisguises; import me.libraryaddict.disguise.disguisetypes.MetaIndex; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import net.md_5.bungee.api.chat.ClickEvent; @@ -34,7 +35,7 @@ public class LDMetaInfo implements LDCommand { MetaIndex index = MetaIndex.getMetaIndexByName(args[1]); if (index == null) { - sender.sendMessage(LibsMsg.META_NOT_FOUND.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.META_NOT_FOUND); return; } @@ -68,8 +69,8 @@ public class LDMetaInfo implements LDCommand { sender.spigot().sendMessage(builder.create()); } else { - sender.sendMessage( - LibsMsg.META_VALUES_NO_CLICK.get(StringUtils.join(names, LibsMsg.META_VALUE_SEPERATOR.get()))); + DisguiseUtilities.sendMessage(sender, LibsMsg.META_VALUES_NO_CLICK, + StringUtils.join(names, LibsMsg.META_VALUE_SEPERATOR.get())); } } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMods.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMods.java index f24b02f8..1dea1b20 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMods.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMods.java @@ -1,5 +1,6 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.modded.ModdedManager; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.apache.commons.lang.StringUtils; @@ -27,7 +28,7 @@ public class LDMods implements LDCommand { @Override public void onCommand(CommandSender sender, String[] args) { if (ModdedManager.getEntities().isEmpty()) { - sender.sendMessage(LibsMsg.NO_MODS_LISTENING.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_MODS_LISTENING); return; } @@ -43,17 +44,17 @@ public class LDMods implements LDCommand { } else if (sender instanceof Player) { player = (Player) sender; } else { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return; } if (!player.hasMetadata("forge_mods")) { - sender.sendMessage(LibsMsg.NO_MODS.get(player.getName())); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_MODS, player.getName()); return; } - sender.sendMessage(LibsMsg.MODS_LIST.get(player.getName(), - StringUtils.join((List) player.getMetadata("forge_mods").get(0).value(), ", "))); + DisguiseUtilities.sendMessage(sender, LibsMsg.MODS_LIST, player.getName(), + StringUtils.join((List) player.getMetadata("forge_mods").get(0).value(), ", ")); } @Override diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDPermTest.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDPermTest.java index e90e5903..b1c36ce6 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDPermTest.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDPermTest.java @@ -2,6 +2,7 @@ package me.libraryaddict.disguise.commands.libsdisguises; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.DisguiseType; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.parser.DisguisePerm; import me.libraryaddict.disguise.utilities.parser.DisguisePermissions; @@ -31,7 +32,7 @@ public class LDPermTest implements LDCommand { @Override public void onCommand(CommandSender sender, String[] args) { if (!LibsPremium.isPremium()) { - sender.sendMessage(LibsMsg.LIBS_PERM_CHECK_NON_PREM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_CHECK_NON_PREM); } Permissible player; @@ -48,34 +49,34 @@ public class LDPermTest implements LDCommand { } DisguisePermissions permissions = new DisguisePermissions(player, "disguise"); - sender.sendMessage(LibsMsg.LIBS_PERM_CHECK_INFO_1.get()); - sender.sendMessage(LibsMsg.LIBS_PERM_CHECK_INFO_2.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_CHECK_INFO_1); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_CHECK_INFO_2); if (player.hasPermission("libsdisguises.disguise.pig")) { - sender.sendMessage(LibsMsg.NORMAL_PERM_CHECK_SUCCESS.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NORMAL_PERM_CHECK_SUCCESS); if (permissions.isAllowedDisguise(new DisguisePerm(DisguiseType.PIG))) { - sender.sendMessage(LibsMsg.LIBS_PERM_CHECK_SUCCESS.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_CHECK_SUCCESS); } else { - sender.sendMessage(LibsMsg.LIBS_PERM_CHECK_FAIL.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_CHECK_FAIL); } } else { - sender.sendMessage(LibsMsg.NORMAL_PERM_CHECK_FAIL.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NORMAL_PERM_CHECK_FAIL); } if (player.hasPermission("libsdisguises.disguise.zombie") || permissions.isAllowedDisguise(new DisguisePerm(DisguiseType.ZOMBIE))) { - sender.sendMessage(LibsMsg.LIBS_PERM_CHECK_ZOMBIE_PERMISSIONS.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_CHECK_ZOMBIE_PERMISSIONS); } PluginCommand command = LibsDisguises.getInstance().getCommand("disguise"); if (command == null) { - sender.sendMessage(LibsMsg.LIBS_PERM_CHECK_COMMAND_UNREGISTERED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_CHECK_COMMAND_UNREGISTERED); } else if (player.hasPermission(command.getPermission())) { - sender.sendMessage(LibsMsg.LIBS_PERM_COMMAND_SUCCESS.get(command.getPermission())); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_COMMAND_SUCCESS, command.getPermission()); } else { - sender.sendMessage(LibsMsg.LIBS_PERM_COMMAND_FAIL.get(command.getPermission())); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_COMMAND_FAIL, command.getPermission()); } if (!sender.hasPermission("libsdisguises.seecmd.disguise")) { diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDReload.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDReload.java index b80af15d..67cf6046 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDReload.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDReload.java @@ -1,6 +1,7 @@ package me.libraryaddict.disguise.commands.libsdisguises; import me.libraryaddict.disguise.DisguiseConfig; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.sounds.SoundManager; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.command.CommandSender; @@ -26,7 +27,7 @@ public class LDReload implements LDCommand { public void onCommand(CommandSender sender, String[] args) { DisguiseConfig.loadConfig(); new SoundManager().load(); - sender.sendMessage(LibsMsg.RELOADED_CONFIG.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.RELOADED_CONFIG); } @Override diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDScoreboard.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDScoreboard.java index fa6761d5..4a63beaa 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDScoreboard.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDScoreboard.java @@ -109,18 +109,18 @@ public class LDScoreboard implements LDCommand { } if (issuesFound == 0) { - sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_NO_ISSUES.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_NO_ISSUES); } else { - sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_ISSUES.get(issuesFound)); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_ISSUES, issuesFound); } } else { - sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_NAMES_DISABLED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_NAMES_DISABLED); } - sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_IGNORE_TEST.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_IGNORE_TEST); if (DisguiseConfig.getPushingOption() == DisguiseConfig.DisguisePushing.IGNORE_SCOREBOARD) { - sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_DISABLED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_DISABLED); } Player player; @@ -134,18 +134,18 @@ public class LDScoreboard implements LDCommand { } if (!DisguiseAPI.isDisguised(player)) { - sender.sendMessage(LibsMsg.DMODPLAYER_NODISGUISE.get(player.getName())); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODPLAYER_NODISGUISE, player.getName()); return; } } else if (sender instanceof Player) { player = (Player) sender; if (!DisguiseAPI.isDisguised(player)) { - sender.sendMessage(LibsMsg.NOT_DISGUISED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NOT_DISGUISED); return; } } else { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return; } @@ -154,17 +154,17 @@ public class LDScoreboard implements LDCommand { Team team = board.getEntryTeam(sender.getName()); if (team == null) { - sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_NO_TEAM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_NO_TEAM); return; } if (team.getOption(Team.Option.COLLISION_RULE) != Team.OptionStatus.NEVER && team.getOption(Team.Option.COLLISION_RULE) != Team.OptionStatus.FOR_OTHER_TEAMS) { - sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_NO_TEAM_PUSH.get(team.getName())); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_NO_TEAM_PUSH, team.getName()); return; } - sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_SUCCESS.get(team.getName())); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_SUCCESS, team.getName()); } @Override diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java index ee6e0338..bed00cfe 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java @@ -35,7 +35,7 @@ public class LDUpdate implements LDCommand { UpdateChecker checker = LibsDisguises.getInstance().getUpdateChecker(); if (checker.isDownloading()) { - sender.sendMessage(LibsMsg.UPDATE_IN_PROGRESS.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_IN_PROGRESS); return; } @@ -47,7 +47,7 @@ public class LDUpdate implements LDCommand { } else if (args[1].equalsIgnoreCase("release")) { releaseBuilds = true; } else { - sender.sendMessage(LibsMsg.LIBS_UPDATE_UNKNOWN_BRANCH.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_UPDATE_UNKNOWN_BRANCH); return; } @@ -56,12 +56,12 @@ public class LDUpdate implements LDCommand { if (checker.getUpdate() != null && checker.getUpdate().isReleaseBuild() == releaseBuilds && args.length <= 1) { if (checker.isServerLatestVersion()) { - sender.sendMessage(LibsMsg.UPDATE_ON_LATEST.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_ON_LATEST); return; } if (checker.isOnLatestUpdate(true)) { - sender.sendMessage(LibsMsg.UPDATE_ALREADY_DOWNLOADED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_ALREADY_DOWNLOADED); return; } } @@ -76,15 +76,15 @@ public class LDUpdate implements LDCommand { } if (checker.getUpdate() == null) { - sender.sendMessage(LibsMsg.UPDATE_FAILED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_FAILED); return; } if (checker.isOnLatestUpdate(true)) { if (checker.getLastDownload() != null) { - sender.sendMessage(LibsMsg.UPDATE_ALREADY_DOWNLOADED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_ALREADY_DOWNLOADED); } else { - sender.sendMessage(LibsMsg.UPDATE_ON_LATEST.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_ON_LATEST); } return; @@ -105,7 +105,7 @@ public class LDUpdate implements LDCommand { PluginInformation result = checker.doUpdate(); if (result == null) { - sender.sendMessage(LibsMsg.UPDATE_FAILED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_FAILED); return; } diff --git a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyCommand.java b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyCommand.java index e4e9eb76..bbc7bd6f 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyCommand.java @@ -23,14 +23,14 @@ public class DisguiseModifyCommand extends DisguiseBaseCommand implements TabCom @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (!(sender instanceof Entity)) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } DisguisePermissions permissions = getPermissions(sender); if (!permissions.hasPermissions()) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } @@ -42,14 +42,14 @@ public class DisguiseModifyCommand extends DisguiseBaseCommand implements TabCom Disguise disguise = DisguiseAPI.getDisguise((Player) sender, (Entity) sender); if (disguise == null) { - sender.sendMessage(LibsMsg.NOT_DISGUISED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NOT_DISGUISED); return true; } DisguisePerm disguisePerm = new DisguisePerm(disguise.getType()); if (!permissions.isAllowedDisguise(disguisePerm)) { - sender.sendMessage(LibsMsg.DMODIFY_NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_NO_PERM); return true; } @@ -73,7 +73,7 @@ public class DisguiseModifyCommand extends DisguiseBaseCommand implements TabCom return true; } - sender.sendMessage(LibsMsg.DMODIFY_MODIFIED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_MODIFIED); return true; } @@ -106,9 +106,9 @@ public class DisguiseModifyCommand extends DisguiseBaseCommand implements TabCom protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { ArrayList allowedDisguises = getAllowedDisguises(permissions); - sender.sendMessage(LibsMsg.DMODIFY_HELP3.get()); - sender.sendMessage(LibsMsg.DMODIFY_HELP3.get()); - sender.sendMessage( - LibsMsg.DMODIFY_HELP3.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_HELP3); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_HELP3); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_HELP3, + StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyEntityCommand.java b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyEntityCommand.java index 10600a5d..f8abd83c 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyEntityCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyEntityCommand.java @@ -22,14 +22,14 @@ public class DisguiseModifyEntityCommand extends DisguiseBaseCommand implements @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (!(sender instanceof Player)) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } DisguisePermissions permissions = getPermissions(sender); if (!permissions.hasPermissions()) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } @@ -44,7 +44,7 @@ public class DisguiseModifyEntityCommand extends DisguiseBaseCommand implements new DisguiseModifyInteraction(DisguiseUtilities.split(StringUtils.join(args, " "))), DisguiseConfig.getDisguiseEntityExpire()); - sender.sendMessage(LibsMsg.DMODIFYENT_CLICK.get(DisguiseConfig.getDisguiseEntityExpire())); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFYENT_CLICK, DisguiseConfig.getDisguiseEntityExpire()); return true; } @@ -78,8 +78,8 @@ public class DisguiseModifyEntityCommand extends DisguiseBaseCommand implements protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { ArrayList allowedDisguises = getAllowedDisguises(permissions); - sender.sendMessage(LibsMsg.DMODENT_HELP1.get()); - sender.sendMessage(LibsMsg.DMODIFY_HELP3 - .get( StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODENT_HELP1); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_HELP3, + StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java index 7d9d283f..59105960 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java @@ -28,7 +28,7 @@ public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements DisguisePermissions permissions = getPermissions(sender); if (!permissions.hasPermissions()) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } @@ -71,14 +71,14 @@ public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements disguise = DisguiseAPI.getDisguise(entityTarget); if (disguise == null) { - sender.sendMessage(LibsMsg.DMODPLAYER_NODISGUISE.get(entityTarget.getName())); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODPLAYER_NODISGUISE, entityTarget.getName()); return true; } DisguisePerm disguisePerm = new DisguisePerm(disguise.getType()); if (!permissions.isAllowedDisguise(disguisePerm)) { - sender.sendMessage(LibsMsg.DMODPLAYER_NOPERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODPLAYER_NOPERM); return true; } @@ -102,7 +102,7 @@ public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements return true; } - sender.sendMessage(LibsMsg.DMODPLAYER_MODIFIED.get(entityTarget.getName())); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODPLAYER_MODIFIED, entityTarget.getName()); return true; } @@ -161,8 +161,8 @@ public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { ArrayList allowedDisguises = getAllowedDisguises(permissions); - sender.sendMessage(LibsMsg.DMODPLAYER_HELP1.get()); - sender.sendMessage( - LibsMsg.DMODIFY_HELP3.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODPLAYER_HELP1); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_HELP3, + StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyRadiusCommand.java b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyRadiusCommand.java index 2d334b23..b2dfab87 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyRadiusCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyRadiusCommand.java @@ -47,14 +47,14 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (sender.getName().equals("CONSOLE")) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } DisguisePermissions permissions = getPermissions(sender); if (!permissions.hasPermissions()) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } @@ -109,7 +109,7 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements (starting == 0 ? LibsMsg.DMODRADIUS_NEEDOPTIONS : LibsMsg.DMODRADIUS_NEEDOPTIONS_ENTITY).get()); return true; } else if (args.length < 2) { - sender.sendMessage(LibsMsg.DMODRADIUS_NEEDOPTIONS.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS_NEEDOPTIONS); return true; } @@ -121,7 +121,7 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements int radius = Integer.parseInt(args[starting]); if (radius > maxRadius) { - sender.sendMessage(LibsMsg.LIMITED_RADIUS.get(maxRadius)); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIMITED_RADIUS, maxRadius); radius = maxRadius; } @@ -188,13 +188,13 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements } if (noPermission > 0) { - sender.sendMessage(LibsMsg.DMODRADIUS_NOPERM.get(noPermission)); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS_NOPERM, noPermission); } if (modifiedDisguises > 0) { - sender.sendMessage(LibsMsg.DMODRADIUS.get(modifiedDisguises)); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS, modifiedDisguises); } else { - sender.sendMessage(LibsMsg.DMODRADIUS_NOENTS.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS_NOENTS); } return true; @@ -245,7 +245,7 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements int radius = Integer.parseInt(args[starting]); if (radius > maxRadius) { - sender.sendMessage(LibsMsg.LIMITED_RADIUS.get(maxRadius)); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIMITED_RADIUS, maxRadius); radius = maxRadius; } @@ -287,11 +287,11 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { ArrayList allowedDisguises = getAllowedDisguises(permissions); - sender.sendMessage(LibsMsg.DMODRADIUS_HELP1.get(maxRadius)); - sender.sendMessage( - LibsMsg.DMODIFY_HELP3.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS_HELP1, maxRadius); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_HELP3, + StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())); - sender.sendMessage(LibsMsg.DMODRADIUS_HELP2.get()); - sender.sendMessage(LibsMsg.DMODRADIUS_HELP3.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS_HELP2); + DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS_HELP3); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguiseCommand.java b/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguiseCommand.java index 5d008917..df6303b1 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguiseCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguiseCommand.java @@ -1,6 +1,7 @@ package me.libraryaddict.disguise.commands.undisguise; import me.libraryaddict.disguise.DisguiseAPI; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.ChatColor; @@ -21,19 +22,19 @@ public class UndisguiseCommand implements CommandExecutor { } if (sender.getName().equals("CONSOLE")) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } if (sender.hasPermission("libsdisguises.undisguise") && !"%%__USER__%%".equals(12345 + "")) { if (DisguiseAPI.isDisguised((Entity) sender)) { DisguiseAPI.undisguiseToAll((Player) sender); - sender.sendMessage(LibsMsg.UNDISG.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.UNDISG); } else { - sender.sendMessage(LibsMsg.NOT_DISGUISED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NOT_DISGUISED); } } else { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); } return true; diff --git a/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguiseEntityCommand.java b/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguiseEntityCommand.java index 3e137ac0..9700596f 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguiseEntityCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguiseEntityCommand.java @@ -3,6 +3,7 @@ package me.libraryaddict.disguise.commands.undisguise; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.commands.interactions.UndisguiseEntityInteraction; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.ChatColor; @@ -21,18 +22,18 @@ public class UndisguiseEntityCommand implements CommandExecutor { } if (sender.getName().equals("CONSOLE")) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } if (!sender.hasPermission("libsdisguises.undisguiseentity")) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } LibsDisguises.getInstance().getListener().addInteraction(sender.getName(), new UndisguiseEntityInteraction(), DisguiseConfig.getDisguiseEntityExpire()); - sender.sendMessage(LibsMsg.UND_ENTITY.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.UND_ENTITY); return true; } diff --git a/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguisePlayerCommand.java b/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguisePlayerCommand.java index fa9705c6..149cf145 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguisePlayerCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguisePlayerCommand.java @@ -2,6 +2,7 @@ package me.libraryaddict.disguise.commands.undisguise; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.disguisetypes.DisguiseType; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.Bukkit; @@ -62,12 +63,12 @@ public class UndisguisePlayerCommand implements CommandExecutor, TabCompleter { } if (!sender.hasPermission("libsdisguises.undisguiseplayer")) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } if (args.length == 0) { - sender.sendMessage(LibsMsg.UNDISG_PLAYER_HELP.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.UNDISG_PLAYER_HELP); return true; } diff --git a/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguiseRadiusCommand.java b/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguiseRadiusCommand.java index 3e4600ac..823cab71 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguiseRadiusCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguiseRadiusCommand.java @@ -1,6 +1,7 @@ package me.libraryaddict.disguise.commands.undisguise; import me.libraryaddict.disguise.DisguiseAPI; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.ChatColor; @@ -36,7 +37,7 @@ public class UndisguiseRadiusCommand implements CommandExecutor { } if (sender.getName().equals("CONSOLE")) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } @@ -49,7 +50,7 @@ public class UndisguiseRadiusCommand implements CommandExecutor { } radius = Integer.parseInt(args[0]); if (radius > maxRadius) { - sender.sendMessage(LibsMsg.LIMITED_RADIUS.get(maxRadius)); + DisguiseUtilities.sendMessage(sender, LibsMsg.LIMITED_RADIUS, maxRadius); radius = maxRadius; } } @@ -65,9 +66,9 @@ public class UndisguiseRadiusCommand implements CommandExecutor { } } - sender.sendMessage(LibsMsg.UNDISRADIUS.get(disguisedEntitys)); + DisguiseUtilities.sendMessage(sender, LibsMsg.UNDISRADIUS, disguisedEntitys); } else { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); } return true; } diff --git a/src/main/java/me/libraryaddict/disguise/commands/utils/CopyDisguiseCommand.java b/src/main/java/me/libraryaddict/disguise/commands/utils/CopyDisguiseCommand.java index 3194a65a..8678f914 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/utils/CopyDisguiseCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/utils/CopyDisguiseCommand.java @@ -38,7 +38,7 @@ public class CopyDisguiseCommand implements CommandExecutor { } if (!sender.hasPermission("libsdisguises.copydisguise")) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } @@ -70,7 +70,8 @@ public class CopyDisguiseCommand implements CommandExecutor { .addInteraction(sender.getName(), new CopyDisguiseInteraction(this), DisguiseConfig.getDisguiseEntityExpire()); - sender.sendMessage(LibsMsg.DISGUISECOPY_INTERACT.get(DisguiseConfig.getDisguiseEntityExpire())); + DisguiseUtilities + .sendMessage(sender, LibsMsg.DISGUISECOPY_INTERACT, DisguiseConfig.getDisguiseEntityExpire()); return true; } diff --git a/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseCloneCommand.java b/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseCloneCommand.java index 7b7a4fdf..3d6ad3b2 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseCloneCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseCloneCommand.java @@ -22,13 +22,13 @@ public class DisguiseCloneCommand extends DisguiseBaseCommand implements TabComp @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (sender.getName().equals("CONSOLE")) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } if (!sender.hasPermission("libsdisguises.disguise.disguiseclone")) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } @@ -53,7 +53,7 @@ public class DisguiseCloneCommand extends DisguiseBaseCommand implements TabComp } else if (option.equalsIgnoreCase(LibsMsg.DCLONE_SPRINT.get())) { doSprint = true; } else { - sender.sendMessage(LibsMsg.INVALID_CLONE.get(option)); + DisguiseUtilities.sendMessage(sender, LibsMsg.INVALID_CLONE, option); return true; } } @@ -67,7 +67,7 @@ public class DisguiseCloneCommand extends DisguiseBaseCommand implements TabComp .addInteraction(sender.getName(), new DisguiseCloneInteraction(options), DisguiseConfig.getDisguiseCloneExpire()); - sender.sendMessage(LibsMsg.CLICK_TIMER.get(DisguiseConfig.getDisguiseCloneExpire())); + DisguiseUtilities.sendMessage(sender, LibsMsg.CLICK_TIMER, DisguiseConfig.getDisguiseCloneExpire()); } return true; @@ -103,8 +103,8 @@ public class DisguiseCloneCommand extends DisguiseBaseCommand implements TabComp */ @Override protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { - sender.sendMessage(LibsMsg.CLONE_HELP1.get()); - sender.sendMessage(LibsMsg.CLONE_HELP2.get()); - sender.sendMessage(LibsMsg.CLONE_HELP3.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.CLONE_HELP1); + DisguiseUtilities.sendMessage(sender, LibsMsg.CLONE_HELP2); + DisguiseUtilities.sendMessage(sender, LibsMsg.CLONE_HELP3); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseHelpCommand.java b/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseHelpCommand.java index edae9556..9b9ed589 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseHelpCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseHelpCommand.java @@ -1,6 +1,7 @@ package me.libraryaddict.disguise.commands.utils; import me.libraryaddict.disguise.commands.DisguiseBaseCommand; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.params.ParamInfo; import me.libraryaddict.disguise.utilities.params.ParamInfoManager; import me.libraryaddict.disguise.utilities.parser.DisguiseParser; @@ -47,14 +48,16 @@ public class DisguiseHelpCommand extends DisguiseBaseCommand implements TabCompl if (help != null) { if (help.hasValues() && help.canTranslateValues()) { - sender.sendMessage(LibsMsg.DHELP_HELP4.get(help.getName(), - StringUtils.join(help.getEnums(""), LibsMsg.DHELP_HELP4_SEPERATOR.get()))); + DisguiseUtilities.sendMessage(sender, LibsMsg.DHELP_HELP4, help.getName(), + StringUtils.join(help.getEnums(""), LibsMsg.DHELP_HELP4_SEPERATOR.get())); } else { if (!help.getName().equals(help.getDescriptiveName())) { - sender.sendMessage(LibsMsg.DHELP_HELP6 - .get(help.getName(), help.getDescriptiveName(), help.getDescription())); + DisguiseUtilities + .sendMessage(sender, LibsMsg.DHELP_HELP6, help.getName(), help.getDescriptiveName(), + help.getDescription()); } else { - sender.sendMessage(LibsMsg.DHELP_HELP5.get(help.getName(), help.getDescription())); + DisguiseUtilities + .sendMessage(sender, LibsMsg.DHELP_HELP5, help.getName(), help.getDescription()); } } @@ -69,7 +72,7 @@ public class DisguiseHelpCommand extends DisguiseBaseCommand implements TabCompl } if (!perms.isAllowedDisguise(type)) { - sender.sendMessage(LibsMsg.NO_PERM_DISGUISE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM_DISGUISE); return true; } @@ -115,14 +118,14 @@ public class DisguiseHelpCommand extends DisguiseBaseCommand implements TabCompl StringUtils.join(methods, ChatColor.DARK_RED + ", "))); if (ignored > 0) { - sender.sendMessage(LibsMsg.NO_PERMS_USE_OPTIONS.get(ignored)); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERMS_USE_OPTIONS, ignored); } return true; } } - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } @@ -158,13 +161,13 @@ public class DisguiseHelpCommand extends DisguiseBaseCommand implements TabCompl */ @Override protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { - sender.sendMessage(LibsMsg.DHELP_HELP1.get()); - sender.sendMessage(LibsMsg.DHELP_HELP2.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.DHELP_HELP1); + DisguiseUtilities.sendMessage(sender, LibsMsg.DHELP_HELP2); for (ParamInfo s : ParamInfoManager.getParamInfos()) { - sender.sendMessage(LibsMsg.DHELP_HELP3.get(s.getName().replaceAll(" ", "") + + DisguiseUtilities.sendMessage(sender, LibsMsg.DHELP_HELP3, s.getName().replaceAll(" ", "") + (!s.getName().equals(s.getDescriptiveName()) ? " ~ " + s.getDescriptiveName() : ""), - s.getDescription())); + s.getDescription()); } } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseViewSelfCommand.java b/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseViewSelfCommand.java index 3d190aad..47a9ecb8 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseViewSelfCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseViewSelfCommand.java @@ -1,6 +1,7 @@ package me.libraryaddict.disguise.commands.utils; import me.libraryaddict.disguise.DisguiseAPI; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -15,7 +16,7 @@ public class DisguiseViewSelfCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (sender.getName().equals("CONSOLE")) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } @@ -23,10 +24,10 @@ public class DisguiseViewSelfCommand implements CommandExecutor { if (DisguiseAPI.isViewSelfToggled(player)) { DisguiseAPI.setViewDisguiseToggled(player, false); - sender.sendMessage(LibsMsg.VIEW_SELF_OFF.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.VIEW_SELF_OFF); } else { DisguiseAPI.setViewDisguiseToggled(player, true); - sender.sendMessage(LibsMsg.VIEW_SELF_ON.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.VIEW_SELF_ON); } return true; diff --git a/src/main/java/me/libraryaddict/disguise/commands/utils/GrabHeadCommand.java b/src/main/java/me/libraryaddict/disguise/commands/utils/GrabHeadCommand.java index 7d09fd12..a43b78c6 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/utils/GrabHeadCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/utils/GrabHeadCommand.java @@ -33,12 +33,12 @@ public class GrabHeadCommand implements CommandExecutor { } if (!sender.hasPermission("libsdisguises.grabhead")) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } if (!(sender instanceof Player)) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } @@ -61,7 +61,7 @@ public class GrabHeadCommand implements CommandExecutor { private BukkitTask runnable = new BukkitRunnable() { @Override public void run() { - sender.sendMessage(LibsMsg.PLEASE_WAIT.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.PLEASE_WAIT); } }.runTaskTimer(LibsDisguises.getInstance(), 100, 100); @@ -101,7 +101,7 @@ public class GrabHeadCommand implements CommandExecutor { skull.setItemMeta(meta); ((Player) sender).getInventory().addItem(skull); - sender.sendMessage(LibsMsg.GRAB_HEAD_SUCCESS.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_HEAD_SUCCESS); } }.runTask(LibsDisguises.getInstance()); } @@ -113,11 +113,11 @@ public class GrabHeadCommand implements CommandExecutor { } private void sendHelp(CommandSender sender) { - sender.sendMessage(LibsMsg.GRAB_DISG_HELP_1.get()); - sender.sendMessage(LibsMsg.GRAB_DISG_HELP_2.get()); - sender.sendMessage(LibsMsg.GRAB_DISG_HELP_3.get()); - sender.sendMessage(LibsMsg.GRAB_DISG_HELP_4.get()); - sender.sendMessage(LibsMsg.GRAB_DISG_HELP_5.get()); - sender.sendMessage(LibsMsg.GRAB_DISG_HELP_6.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_1); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_2); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_3); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_4); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_5); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_6); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/utils/GrabSkinCommand.java b/src/main/java/me/libraryaddict/disguise/commands/utils/GrabSkinCommand.java index 1d79cce7..c68b829a 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/utils/GrabSkinCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/utils/GrabSkinCommand.java @@ -35,7 +35,7 @@ public class GrabSkinCommand implements CommandExecutor { } if (!sender.hasPermission("libsdisguises.grabskin")) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } @@ -69,7 +69,7 @@ public class GrabSkinCommand implements CommandExecutor { private BukkitTask runnable = new BukkitRunnable() { @Override public void run() { - sender.sendMessage(LibsMsg.PLEASE_WAIT.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.PLEASE_WAIT); } }.runTaskTimer(LibsDisguises.getInstance(), 100, 100); @@ -107,7 +107,7 @@ public class GrabSkinCommand implements CommandExecutor { } DisguiseAPI.addGameProfile(nName, profile); - sender.sendMessage(LibsMsg.GRABBED_SKIN.get(nName)); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRABBED_SKIN, nName); String string = DisguiseUtilities.getGson().toJson(profile); int start = 0; @@ -140,7 +140,7 @@ public class GrabSkinCommand implements CommandExecutor { sender.spigot().sendMessage(builder.create()); } else { - sender.sendMessage(LibsMsg.SKIN_DATA.get(string)); + DisguiseUtilities.sendMessage(sender, LibsMsg.SKIN_DATA, string); } DisguiseUtilities.setGrabSkinCommandUsed(); @@ -153,11 +153,11 @@ public class GrabSkinCommand implements CommandExecutor { } private void sendHelp(CommandSender sender) { - sender.sendMessage(LibsMsg.GRAB_DISG_HELP_1.get()); - sender.sendMessage(LibsMsg.GRAB_DISG_HELP_2.get()); - sender.sendMessage(LibsMsg.GRAB_DISG_HELP_3.get()); - sender.sendMessage(LibsMsg.GRAB_DISG_HELP_4.get()); - sender.sendMessage(LibsMsg.GRAB_DISG_HELP_5.get()); - sender.sendMessage(LibsMsg.GRAB_DISG_HELP_6.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_1); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_2); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_3); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_4); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_5); + DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_6); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/utils/SaveDisguiseCommand.java b/src/main/java/me/libraryaddict/disguise/commands/utils/SaveDisguiseCommand.java index e16c342a..6f417028 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/utils/SaveDisguiseCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/utils/SaveDisguiseCommand.java @@ -35,7 +35,7 @@ public class SaveDisguiseCommand implements CommandExecutor { } if (!sender.hasPermission("libsdisguises.savedisguise")) { - sender.sendMessage(LibsMsg.NO_PERM.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM); return true; } @@ -51,14 +51,14 @@ public class SaveDisguiseCommand implements CommandExecutor { if (args.length == 0) { if (!(sender instanceof Player)) { - sender.sendMessage(LibsMsg.NO_CONSOLE.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE); return true; } Disguise disguise = DisguiseAPI.getDisguise((Entity) sender); if (disguise == null) { - sender.sendMessage(LibsMsg.NOT_DISGUISED.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.NOT_DISGUISED); return true; } @@ -67,13 +67,13 @@ public class SaveDisguiseCommand implements CommandExecutor { try { DisguiseAPI.addCustomDisguise(name, disguiseString); - sender.sendMessage(LibsMsg.CUSTOM_DISGUISE_SAVED.get(name)); + DisguiseUtilities.sendMessage(sender, LibsMsg.CUSTOM_DISGUISE_SAVED, name); } catch (DisguiseParseException e) { if (e.getMessage() != null) { sender.sendMessage(e.getMessage()); } else { - sender.sendMessage(LibsMsg.PARSE_CANT_LOAD.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.PARSE_CANT_LOAD); } } @@ -119,7 +119,7 @@ public class SaveDisguiseCommand implements CommandExecutor { private BukkitTask runnable = new BukkitRunnable() { @Override public void run() { - sender.sendMessage(LibsMsg.PLEASE_WAIT.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.PLEASE_WAIT); } }.runTaskTimer(LibsDisguises.getInstance(), 100, 100); @@ -163,7 +163,7 @@ public class SaveDisguiseCommand implements CommandExecutor { try { DisguiseAPI.addCustomDisguise(name, disguiseString); - sender.sendMessage(LibsMsg.CUSTOM_DISGUISE_SAVED.get(name)); + DisguiseUtilities.sendMessage(sender, LibsMsg.CUSTOM_DISGUISE_SAVED, name); DisguiseUtilities.setSaveDisguiseCommandUsed(); } @@ -171,17 +171,17 @@ public class SaveDisguiseCommand implements CommandExecutor { if (e.getMessage() != null) { sender.sendMessage(e.getMessage()); } else { - sender.sendMessage(LibsMsg.PARSE_CANT_LOAD.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.PARSE_CANT_LOAD); } } } private void sendHelp(CommandSender sender) { - sender.sendMessage(LibsMsg.SAVE_DISG_HELP_1.get()); - sender.sendMessage(LibsMsg.SAVE_DISG_HELP_2.get()); - sender.sendMessage(LibsMsg.SAVE_DISG_HELP_3.get()); - sender.sendMessage(LibsMsg.SAVE_DISG_HELP_4.get()); - sender.sendMessage(LibsMsg.SAVE_DISG_HELP_5.get()); - sender.sendMessage(LibsMsg.SAVE_DISG_HELP_6.get()); + DisguiseUtilities.sendMessage(sender, LibsMsg.SAVE_DISG_HELP_1); + DisguiseUtilities.sendMessage(sender, LibsMsg.SAVE_DISG_HELP_2); + DisguiseUtilities.sendMessage(sender, LibsMsg.SAVE_DISG_HELP_3); + DisguiseUtilities.sendMessage(sender, LibsMsg.SAVE_DISG_HELP_4); + DisguiseUtilities.sendMessage(sender, LibsMsg.SAVE_DISG_HELP_5); + DisguiseUtilities.sendMessage(sender, LibsMsg.SAVE_DISG_HELP_6); } } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/RabbitType.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/RabbitType.java index 9deeef17..6ce9c783 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/RabbitType.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/RabbitType.java @@ -1,7 +1,13 @@ package me.libraryaddict.disguise.disguisetypes; public enum RabbitType { - BLACK(2), BROWN(0), GOLD(4), KILLER_BUNNY(99), PATCHES(3), PEPPER(5), WHITE(1); + BLACK(2), + BROWN(0), + GOLD(4), + KILLER_BUNNY(99), + PATCHES(3), + PEPPER(5), + WHITE(1); public static RabbitType getType(int id) { for (RabbitType type : values()) { diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/BlazeWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/BlazeWatcher.java index 1c37b8d6..675deed4 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/BlazeWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/BlazeWatcher.java @@ -3,22 +3,17 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; -public class BlazeWatcher extends InsentientWatcher -{ - public BlazeWatcher(Disguise disguise) - { +public class BlazeWatcher extends InsentientWatcher { + public BlazeWatcher(Disguise disguise) { super(disguise); } - public boolean isBlazing() - { + public boolean isBlazing() { return getData(MetaIndex.BLAZE_BLAZING) == 1; } - public void setBlazing(boolean isBlazing) - { + public void setBlazing(boolean isBlazing) { setData(MetaIndex.BLAZE_BLAZING, (byte) (isBlazing ? 1 : 0)); sendData(MetaIndex.BLAZE_BLAZING); } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/CreeperWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/CreeperWatcher.java index 486b5b17..7c4c982c 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/CreeperWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/CreeperWatcher.java @@ -3,34 +3,27 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; -public class CreeperWatcher extends InsentientWatcher -{ +public class CreeperWatcher extends InsentientWatcher { - public CreeperWatcher(Disguise disguise) - { + public CreeperWatcher(Disguise disguise) { super(disguise); } - public boolean isIgnited() - { + public boolean isIgnited() { return getData(MetaIndex.CREEPER_IGNITED); } - public boolean isPowered() - { + public boolean isPowered() { return getData(MetaIndex.CREEPER_POWERED); } - public void setIgnited(boolean ignited) - { + public void setIgnited(boolean ignited) { setData(MetaIndex.CREEPER_IGNITED, ignited); sendData(MetaIndex.CREEPER_IGNITED); } - public void setPowered(boolean powered) - { + public void setPowered(boolean powered) { setData(MetaIndex.CREEPER_POWERED, powered); sendData(MetaIndex.CREEPER_POWERED); } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/DonkeyWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/DonkeyWatcher.java index 33d5e2ce..6d16cce6 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/DonkeyWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/DonkeyWatcher.java @@ -7,5 +7,4 @@ public class DonkeyWatcher extends ChestedHorseWatcher { public DonkeyWatcher(Disguise disguise) { super(disguise); } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EnderDragonWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EnderDragonWatcher.java index 3c9cd10f..0cf83f89 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EnderDragonWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EnderDragonWatcher.java @@ -6,21 +6,17 @@ import me.libraryaddict.disguise.disguisetypes.MetaIndex; /** * @author Navid */ -public class EnderDragonWatcher extends InsentientWatcher -{ +public class EnderDragonWatcher extends InsentientWatcher { - public EnderDragonWatcher(Disguise disguise) - { + public EnderDragonWatcher(Disguise disguise) { super(disguise); } - public int getPhase() - { + public int getPhase() { return getData(MetaIndex.ENDER_DRAGON_PHASE); } - public void setPhase(int phase) - { + public void setPhase(int phase) { setData(MetaIndex.ENDER_DRAGON_PHASE, phase); sendData(MetaIndex.ENDER_DRAGON_PHASE); } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/GhastWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/GhastWatcher.java index bf2f1b71..e648336c 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/GhastWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/GhastWatcher.java @@ -3,23 +3,18 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; -public class GhastWatcher extends InsentientWatcher -{ +public class GhastWatcher extends InsentientWatcher { - public GhastWatcher(Disguise disguise) - { + public GhastWatcher(Disguise disguise) { super(disguise); } - public boolean isAggressive() - { + public boolean isAggressive() { return getData(MetaIndex.GHAST_AGRESSIVE); } - public void setAggressive(boolean isAggressive) - { + public void setAggressive(boolean isAggressive) { setData(MetaIndex.GHAST_AGRESSIVE, isAggressive); sendData(MetaIndex.GHAST_AGRESSIVE); } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/IronGolemWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/IronGolemWatcher.java index 1f8c77fb..75b6452d 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/IronGolemWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/IronGolemWatcher.java @@ -2,11 +2,8 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import me.libraryaddict.disguise.disguisetypes.Disguise; -public class IronGolemWatcher extends InsentientWatcher -{ - public IronGolemWatcher(Disguise disguise) - { +public class IronGolemWatcher extends InsentientWatcher { + public IronGolemWatcher(Disguise disguise) { super(disguise); } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ItemFrameWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ItemFrameWatcher.java index 84eaba98..c7ce80d5 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ItemFrameWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ItemFrameWatcher.java @@ -39,5 +39,4 @@ public class ItemFrameWatcher extends FlagWatcher { setData(MetaIndex.ITEMFRAME_ROTATION, rotation % 4); sendData(MetaIndex.ITEMFRAME_ROTATION); } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/MuleWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/MuleWatcher.java index 22ddeaa8..d8695f1d 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/MuleWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/MuleWatcher.java @@ -7,5 +7,4 @@ public class MuleWatcher extends ChestedHorseWatcher { public MuleWatcher(Disguise disguise) { super(disguise); } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/PaintingWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/PaintingWatcher.java index 5b19cd0d..a7ca25f0 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/PaintingWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/PaintingWatcher.java @@ -5,38 +5,31 @@ import me.libraryaddict.disguise.disguisetypes.FlagWatcher; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import org.bukkit.Art; -public class PaintingWatcher extends FlagWatcher -{ +public class PaintingWatcher extends FlagWatcher { private Art painting; - public PaintingWatcher(Disguise disguise) - { + public PaintingWatcher(Disguise disguise) { super(disguise); } @Override - public PaintingWatcher clone(Disguise disguise) - { + public PaintingWatcher clone(Disguise disguise) { PaintingWatcher watcher = (PaintingWatcher) super.clone(disguise); watcher.setArt(getArt()); return watcher; } - public Art getArt() - { + public Art getArt() { return painting; } - public void setArt(Art newPainting) - { + public void setArt(Art newPainting) { this.painting = newPainting; - if (getDisguise().getEntity() != null && getDisguise().getWatcher() == this) - { + if (getDisguise().getEntity() != null && getDisguise().getWatcher() == this) { DisguiseUtilities.refreshTrackers(getDisguise()); } } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/PolarBearWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/PolarBearWatcher.java index 02f78a24..8351cd0a 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/PolarBearWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/PolarBearWatcher.java @@ -3,21 +3,17 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; -public class PolarBearWatcher extends AgeableWatcher -{ - public PolarBearWatcher(Disguise disguise) - { +public class PolarBearWatcher extends AgeableWatcher { + public PolarBearWatcher(Disguise disguise) { super(disguise); } - public void setStanding(boolean standing) - { + public void setStanding(boolean standing) { setData(MetaIndex.POLAR_BEAR_STANDING, standing); sendData(MetaIndex.POLAR_BEAR_STANDING); } - public boolean isStanding() - { + public boolean isStanding() { return getData(MetaIndex.POLAR_BEAR_STANDING); } } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SkeletonHorseWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SkeletonHorseWatcher.java index b8067f69..50b2bc2d 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SkeletonHorseWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SkeletonHorseWatcher.java @@ -7,5 +7,4 @@ public class SkeletonHorseWatcher extends AbstractHorseWatcher { public SkeletonHorseWatcher(Disguise disguise) { super(disguise); } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SpiderWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SpiderWatcher.java index 67ba6ada..2d891ca9 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SpiderWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SpiderWatcher.java @@ -3,21 +3,17 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; -public class SpiderWatcher extends InsentientWatcher -{ - public SpiderWatcher(Disguise disguise) - { +public class SpiderWatcher extends InsentientWatcher { + public SpiderWatcher(Disguise disguise) { super(disguise); } - public void setClimbing(boolean climbing) - { + public void setClimbing(boolean climbing) { setData(MetaIndex.SPIDER_CLIMB, (byte) (climbing ? 1 : 0)); sendData(MetaIndex.SPIDER_CLIMB); } - public boolean isClimbing() - { + public boolean isClimbing() { return getData(MetaIndex.SPIDER_CLIMB) == (byte) 1; } } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SplashPotionWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SplashPotionWatcher.java index c9de129d..98759586 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SplashPotionWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SplashPotionWatcher.java @@ -41,5 +41,4 @@ public class SplashPotionWatcher extends FlagWatcher { DisguiseUtilities.refreshTrackers(getDisguise()); } } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SquidWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SquidWatcher.java index 8afb43e5..3cb89699 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SquidWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/SquidWatcher.java @@ -2,10 +2,8 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import me.libraryaddict.disguise.disguisetypes.Disguise; -public class SquidWatcher extends InsentientWatcher -{ - public SquidWatcher(Disguise disguise) - { +public class SquidWatcher extends InsentientWatcher { + public SquidWatcher(Disguise disguise) { super(disguise); } } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TNTWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TNTWatcher.java index 3ea5d44a..252018fb 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TNTWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TNTWatcher.java @@ -3,10 +3,8 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.FlagWatcher; -public class TNTWatcher extends FlagWatcher -{ - public TNTWatcher(Disguise disguise) - { +public class TNTWatcher extends FlagWatcher { + public TNTWatcher(Disguise disguise) { super(disguise); } } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/VexWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/VexWatcher.java index 217bd4bf..831bfeba 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/VexWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/VexWatcher.java @@ -17,5 +17,4 @@ public class VexWatcher extends InsentientWatcher { public boolean isAngry() { return getData(MetaIndex.VEX_ANGRY) == 1; } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WitherSkullWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WitherSkullWatcher.java index 460185d6..fb07a04f 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WitherSkullWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WitherSkullWatcher.java @@ -4,23 +4,18 @@ import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.FlagWatcher; import me.libraryaddict.disguise.disguisetypes.MetaIndex; -public class WitherSkullWatcher extends FlagWatcher -{ +public class WitherSkullWatcher extends FlagWatcher { - public WitherSkullWatcher(Disguise disguise) - { + public WitherSkullWatcher(Disguise disguise) { super(disguise); } - public boolean isBlue() - { + public boolean isBlue() { return getData(MetaIndex.WITHER_SKULL_BLUE); } - public void setBlue(boolean blue) - { + public void setBlue(boolean blue) { setData(MetaIndex.WITHER_SKULL_BLUE, blue); sendData(MetaIndex.WITHER_SKULL_BLUE); } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WitherWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WitherWatcher.java index f6d2df74..ff5247b5 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WitherWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WitherWatcher.java @@ -6,11 +6,9 @@ import org.bukkit.ChatColor; import java.security.InvalidParameterException; -public class WitherWatcher extends InsentientWatcher -{ +public class WitherWatcher extends InsentientWatcher { - public WitherWatcher(Disguise disguise) - { + public WitherWatcher(Disguise disguise) { super(disguise); } @@ -19,32 +17,25 @@ public class WitherWatcher extends InsentientWatcher * * @return */ - public int getInvulnerability() - { + public int getInvulnerability() { return getData(MetaIndex.WITHER_INVUL); } - public int[] getTargets() - { - return new int[] - { - getData(MetaIndex.WITHER_TARGET_1), getData(MetaIndex.WITHER_TARGET_2), getData(MetaIndex.WITHER_TARGET_3) - }; + public int[] getTargets() { + return new int[]{getData(MetaIndex.WITHER_TARGET_1), getData(MetaIndex.WITHER_TARGET_2), + getData(MetaIndex.WITHER_TARGET_3)}; } /** * Sets the amount of time this Wither is invulnerable for */ - public void setInvulnerability(int invulnerability) - { + public void setInvulnerability(int invulnerability) { setData(MetaIndex.WITHER_INVUL, invulnerability); sendData(MetaIndex.WITHER_INVUL); } - public void setTargets(int... targets) - { - if (targets.length != 3) - { + public void setTargets(int... targets) { + if (targets.length != 3) { throw new InvalidParameterException( ChatColor.RED + "Expected 3 numbers for wither setTargets. Received " + targets.length); } @@ -53,5 +44,4 @@ public class WitherWatcher extends InsentientWatcher setData(MetaIndex.WITHER_TARGET_3, targets[2]); sendData(MetaIndex.WITHER_TARGET_1, MetaIndex.WITHER_TARGET_2, MetaIndex.WITHER_TARGET_3); } - } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ZombieHorseWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ZombieHorseWatcher.java index f83f303d..d5b6a674 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ZombieHorseWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ZombieHorseWatcher.java @@ -7,5 +7,4 @@ public class ZombieHorseWatcher extends AbstractHorseWatcher { public ZombieHorseWatcher(Disguise disguise) { super(disguise); } - } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index f14fd882..e23fca15 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -40,6 +40,7 @@ import org.apache.commons.lang.math.RandomUtils; import org.apache.logging.log4j.util.Strings; import org.bukkit.*; import org.bukkit.boss.KeyedBossBar; +import org.bukkit.command.CommandSender; import org.bukkit.entity.*; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; @@ -280,10 +281,10 @@ public class DisguiseUtilities { if (reference != null && DisguiseUtilities.addClonedDisguise(reference, disguise)) { String entityName = DisguiseType.getType(toClone).toReadable(); - player.sendMessage(LibsMsg.MADE_REF.get(entityName, reference)); - player.sendMessage(LibsMsg.MADE_REF_EXAMPLE.get(reference)); + DisguiseUtilities.sendMessage(player, LibsMsg.MADE_REF, entityName, reference); + DisguiseUtilities.sendMessage(player, LibsMsg.MADE_REF_EXAMPLE, reference); } else { - player.sendMessage(LibsMsg.REF_TOO_MANY.get()); + DisguiseUtilities.sendMessage(player, LibsMsg.REF_TOO_MANY); } } @@ -2056,6 +2057,14 @@ public class DisguiseUtilities { return Strings.isEmpty(player.getPlayerListName()) ? player.getName() : player.getPlayerListName(); } + public static void sendMessage(CommandSender sender, LibsMsg msg, Object... args) { + if (!NmsVersion.v1_16.isSupported()) { + sender.sendMessage(msg.get(args)); + } else { + sender.spigot().sendMessage(msg.getChat(args)); + } + } + public static Logger getLogger() { return LibsDisguises.getInstance().getLogger(); } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerWrappedBlockData.java b/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerWrappedBlockData.java index 602a5d06..17f4a1b5 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerWrappedBlockData.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerWrappedBlockData.java @@ -9,7 +9,8 @@ import java.lang.reflect.Type; /** * Created by libraryaddict on 1/06/2017. */ -public class SerializerWrappedBlockData implements JsonSerializer, JsonDeserializer { +public class SerializerWrappedBlockData implements JsonSerializer, + JsonDeserializer { @Override public JsonElement serialize(WrappedBlockData src, Type typeOfSrc, JsonSerializationContext context) { diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientInteract.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientInteract.java index 4741347a..dd9e463b 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientInteract.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientInteract.java @@ -18,7 +18,7 @@ import me.libraryaddict.disguise.events.DisguiseInteractEvent; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import org.bukkit.Bukkit; import org.bukkit.Material; -import org.bukkit.entity.*; +import org.bukkit.entity.Player; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerModdedClient.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerModdedClient.java index 8f45a65d..d1292573 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerModdedClient.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerModdedClient.java @@ -140,13 +140,13 @@ public class PacketListenerModdedClient extends PacketAdapter { PacketContainer packet1 = new PacketContainer(PacketType.Login.Server.CUSTOM_PAYLOAD); packet1.getIntegers().write(0, packetId1); packet1.getMinecraftKeys().write(0, new com.comphenix.protocol.wrappers.MinecraftKey("fml", "handshake")); - // packet1.getModifier() + // packet1.getModifier() // .write(2, new PacketDataSerializer(Unpooled.wrappedBuffer(ModdedManager.getFmlHandshake()))); PacketContainer packet2 = new PacketContainer(PacketType.Login.Server.CUSTOM_PAYLOAD); packet2.getIntegers().write(0, packetId2); packet2.getMinecraftKeys().write(0, new MinecraftKey("fml", "handshake")); - // packet2.getModifier() + // packet2.getModifier() // .write(2, new PacketDataSerializer(Unpooled.wrappedBuffer(ModdedManager.getFmlRegistries()))); //TODO diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerTabList.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerTabList.java index d8f836e4..1611abbc 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerTabList.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerTabList.java @@ -54,10 +54,8 @@ public class PacketListenerTabList extends PacketAdapter { if (list.isEmpty()) { event.setCancelled(true); - } - else { + } else { event.getPacket().getPlayerInfoDataLists().write(0, list); } } - } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/reflection/FakeBoundingBox.java b/src/main/java/me/libraryaddict/disguise/utilities/reflection/FakeBoundingBox.java index cbd93bdc..fb6a52d5 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/reflection/FakeBoundingBox.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/reflection/FakeBoundingBox.java @@ -23,5 +23,4 @@ public class FakeBoundingBox { public double getZ() { return zMod / 2; } - } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/reflection/LibsProfileLookup.java b/src/main/java/me/libraryaddict/disguise/utilities/reflection/LibsProfileLookup.java index af2b6c2a..a07fb5ca 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/reflection/LibsProfileLookup.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/reflection/LibsProfileLookup.java @@ -5,5 +5,4 @@ import com.comphenix.protocol.wrappers.WrappedGameProfile; public interface LibsProfileLookup { void onLookup(WrappedGameProfile gameProfile); - } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/reflection/LibsProfileLookupCaller.java b/src/main/java/me/libraryaddict/disguise/utilities/reflection/LibsProfileLookupCaller.java index 8415d0e7..f83d3d29 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/reflection/LibsProfileLookupCaller.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/reflection/LibsProfileLookupCaller.java @@ -20,5 +20,4 @@ public class LibsProfileLookupCaller implements ProfileLookupCallback { public void onProfileLookupSucceeded(GameProfile profile) { gameProfile = WrappedGameProfile.fromHandle(profile); } - } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/IAsm.java b/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/IAsm.java index 761e0c3e..b8096d84 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/IAsm.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/IAsm.java @@ -9,7 +9,9 @@ import java.util.Map; * Created by libraryaddict on 17/02/2020. */ public interface IAsm { - Class createClassWithoutMethods(String className, ArrayList> illegalMethods) throws IOException, InvocationTargetException, IllegalAccessException, NoSuchMethodException, NoSuchFieldException; + Class createClassWithoutMethods(String className, + ArrayList> illegalMethods) throws IOException, InvocationTargetException, + IllegalAccessException, NoSuchMethodException, NoSuchFieldException; } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java b/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java index 53126484..5a18aad4 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java @@ -1,9 +1,15 @@ package me.libraryaddict.disguise.utilities.translations; import me.libraryaddict.disguise.utilities.DisguiseUtilities; +import me.libraryaddict.disguise.utilities.reflection.NmsVersion; +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.ComponentBuilder; import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * Created by libraryaddict on 15/06/2017. */ @@ -351,6 +357,15 @@ public enum LibsMsg { SELF_DISGUISE_HIDDEN(ChatColor.GREEN + "Self disguise hidden as it's too tall.."); private final String string; + private static final Pattern hexColor; + + static { + if (NmsVersion.v1_16.isSupported()) { + hexColor = Pattern.compile("<#[0-9a-fA-F]{6}>"); + } else { + hexColor = null; + } + } LibsMsg(String string) { this.string = string; @@ -360,6 +375,35 @@ public enum LibsMsg { return string; } + public BaseComponent[] getChat(Object... strings) { + String string = get(strings); + + if (hexColor == null) { + return new ComponentBuilder().appendLegacy(string).create(); + } + + Matcher match = hexColor.matcher(string); + + ComponentBuilder builder = new ComponentBuilder(); + int lastMatch = 0; + + while (match.find()) { + if (match.start() > lastMatch) { + builder.appendLegacy(string.substring(lastMatch, match.start())); + } + + lastMatch = match.end(); + + builder.color(net.md_5.bungee.api.ChatColor.of(match.group().substring(1, 8))); + } + + if (lastMatch < string.length()) { + builder.appendLegacy(string.substring(lastMatch)); + } + + return builder.create(); + } + public String get(Object... strings) { if (StringUtils.countMatches(getRaw(), "%s") != strings.length) { DisguiseUtilities.getLogger().severe("Mismatch in messages, incorrect parameters supplied for " + name() + diff --git a/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateType.java b/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateType.java index 8b3f1fa1..0c63d5da 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateType.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateType.java @@ -80,7 +80,7 @@ public enum TranslateType { } if (!getFile().exists()) { - DisguiseUtilities.getLogger().info("Translations for " + name() + " missing! Skipping..."); + DisguiseUtilities.getLogger().info("Translations for " + name() + " missing! Saving.."); return; } @@ -182,6 +182,7 @@ public enum TranslateType { writer.write( "# To translate, follow this example 'Original Message': 'My New Message'\n# The Original" + " Message is used as a yaml config key to get your new message!"); + writer.write("\n# To use hex color codes, use <#hexcolor> where hexcolor is the 6 char code"); } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 455ad19a..d6c1cc67 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -9,85 +9,85 @@ authors: [Byteflux, Navid K.] depend: [ProtocolLib] api-version: '1.13' commands: - libsdisguises: - aliases: [libsdisg, ld] - description: Main command for libsdisguises. - disguise: - aliases: [d, dis, disg] - permission: libsdisguises.seecmd.disguise - description: Disguise yourself as an entity. - disguiseentity: - aliases: [dentity, disentity, disgentity] - permission: libsdisguises.seecmd.disguiseentity - description: Disguise an entity as another entity. - disguisehelp: - aliases: [dhelp, dishelp, disghelp] - permission: libsdisguises.seecmd.disguisehelp - description: Help command for LibsDisguises. - disguiseplayer: - aliases: [dplayer, displayer, disgplayer, disguiseuuid, disguuid, duuid] - permission: libsdisguises.seecmd.disguiseplayer - description: Disguise another player as an entity. - disguiseradius: - aliases: [disradius, dradius, disgradius] - permission: libsdisguises.seecmd.disguiseradius - description: Disguise all entities within a radius as an entity. - undisguise: - aliases: [u, und, undis, undisg] - permission: libsdisguises.seecmd.undisguise - description: Undisguise yourself. - undisguiseentity: - aliases: [undisentity, undentity, undisgentity] - permission: libsdisguises.seecmd.undisguiseentity - description: Undisguise an entity. - undisguiseplayer: - aliases: [undisplayer, undplayer, undisgplayer, undisguiseuuid, unduuid, undisguuid] - permission: libsdisguises.seecmd.undisguiseplayer - description: Undisguise a player. - undisguiseradius: - aliases: [undisradius, undradius, undisgradius] - permission: libsdisguises.seecmd.undisguiseradius - description: Undisguise all entities within a radius. - disguiseclone: - aliases: [disguisec, disc, disclone, dclone, clonedisguise, clonedis, cdisguise, cdis, clonedisg, disgclone] - permission: libsdisguises.seecmd.disguiseclone - description: Copy a disguise (or entity) and use it later. - disguiseviewself: - aliases: [dviewself, dvs, disguisevs, disvs, vsd, viewselfdisguise, viewselfd, selfdisguise, selfdisg, selfd] - permission: libsdisguises.seecmd.viewself - description: Toggle seeing your own disguise on or off. - disguisemodify: - aliases: [dmodify, dmod, disgmodify] - permission: libsdisguises.seecmd.disguisemodify - description: Modify your own disguise - disguisemodifyplayer: - aliases: [dmodifyplayer, dmodplayer, disgmodifyplayer, dismodplayer, disgmodplayer] - permission: libsdisguises.seecmd.disguisemodifyplayer - description: Modify the disguise of a player - disguisemodifyradius: - aliases: [dmodifyradius, dmodradius, disgmodradius, dismodradius] - permission: libsdisguises.seecmd.disguisemodifyradius - description: Modify disguises in a radius - disguisemodifyentity: - aliases: [dmodifyentity, dmodentity, disgmodentity, dismodentity] - permission: libsdisguises.seecmd.disguisemodifyentity - description: Modify a disguise by right clicking them - copydisguise: - aliases: [disguisecopy, disgcopy, dcopy, copydisg, copyd] - permission: libsdisguises.seecmd.copydisguise - description: Output a disguise to a usable string - grabskin: - aliases: [uploadskin, skin, saveskin] - permission: libsdisguises.seecmd.grabskin - description: Grab a skin from file, url or player name/uuid - savedisguise: - aliases: [customdisguise, savedisg, customdisg, createdisguise, createdisg] - permission: libsdisguises.seecmd.savedisguise - description: Save a custom disguise to disguises.yml - grabhead: - aliases: [grabskull, playerhead, savehead, gethead] - permission: libsdisguises.seecmd.grabhead - description: Grab the head item of a skin, url or player + libsdisguises: + aliases: [libsdisg, ld] + description: Main command for libsdisguises. + disguise: + aliases: [d, dis, disg] + permission: libsdisguises.seecmd.disguise + description: Disguise yourself as an entity. + disguiseentity: + aliases: [dentity, disentity, disgentity] + permission: libsdisguises.seecmd.disguiseentity + description: Disguise an entity as another entity. + disguisehelp: + aliases: [dhelp, dishelp, disghelp] + permission: libsdisguises.seecmd.disguisehelp + description: Help command for LibsDisguises. + disguiseplayer: + aliases: [dplayer, displayer, disgplayer, disguiseuuid, disguuid, duuid] + permission: libsdisguises.seecmd.disguiseplayer + description: Disguise another player as an entity. + disguiseradius: + aliases: [disradius, dradius, disgradius] + permission: libsdisguises.seecmd.disguiseradius + description: Disguise all entities within a radius as an entity. + undisguise: + aliases: [u, und, undis, undisg] + permission: libsdisguises.seecmd.undisguise + description: Undisguise yourself. + undisguiseentity: + aliases: [undisentity, undentity, undisgentity] + permission: libsdisguises.seecmd.undisguiseentity + description: Undisguise an entity. + undisguiseplayer: + aliases: [undisplayer, undplayer, undisgplayer, undisguiseuuid, unduuid, undisguuid] + permission: libsdisguises.seecmd.undisguiseplayer + description: Undisguise a player. + undisguiseradius: + aliases: [undisradius, undradius, undisgradius] + permission: libsdisguises.seecmd.undisguiseradius + description: Undisguise all entities within a radius. + disguiseclone: + aliases: [disguisec, disc, disclone, dclone, clonedisguise, clonedis, cdisguise, cdis, clonedisg, disgclone] + permission: libsdisguises.seecmd.disguiseclone + description: Copy a disguise (or entity) and use it later. + disguiseviewself: + aliases: [dviewself, dvs, disguisevs, disvs, vsd, viewselfdisguise, viewselfd, selfdisguise, selfdisg, selfd] + permission: libsdisguises.seecmd.viewself + description: Toggle seeing your own disguise on or off. + disguisemodify: + aliases: [dmodify, dmod, disgmodify] + permission: libsdisguises.seecmd.disguisemodify + description: Modify your own disguise + disguisemodifyplayer: + aliases: [dmodifyplayer, dmodplayer, disgmodifyplayer, dismodplayer, disgmodplayer] + permission: libsdisguises.seecmd.disguisemodifyplayer + description: Modify the disguise of a player + disguisemodifyradius: + aliases: [dmodifyradius, dmodradius, disgmodradius, dismodradius] + permission: libsdisguises.seecmd.disguisemodifyradius + description: Modify disguises in a radius + disguisemodifyentity: + aliases: [dmodifyentity, dmodentity, disgmodentity, dismodentity] + permission: libsdisguises.seecmd.disguisemodifyentity + description: Modify a disguise by right clicking them + copydisguise: + aliases: [disguisecopy, disgcopy, dcopy, copydisg, copyd] + permission: libsdisguises.seecmd.copydisguise + description: Output a disguise to a usable string + grabskin: + aliases: [uploadskin, skin, saveskin] + permission: libsdisguises.seecmd.grabskin + description: Grab a skin from file, url or player name/uuid + savedisguise: + aliases: [customdisguise, savedisg, customdisg, createdisguise, createdisg] + permission: libsdisguises.seecmd.savedisguise + description: Save a custom disguise to disguises.yml + grabhead: + aliases: [grabskull, playerhead, savehead, gethead] + permission: libsdisguises.seecmd.grabhead + description: Grab the head item of a skin, url or player permissions: libsdisguises.reload: @@ -133,25 +133,25 @@ permissions: description: See all commands in tab-completion default: true children: - libsdisguises.seecmd.disguise: true - libsdisguises.seecmd.disguiseentity: true - libsdisguises.seecmd.disguisehelp: true - libsdisguises.seecmd.disguiseplayer: true - libsdisguises.seecmd.disguiseradius: true - libsdisguises.seecmd.undisguise: true - libsdisguises.seecmd.undisguiseentity: true - libsdisguises.seecmd.undisguiseplayer: true - libsdisguises.seecmd.undisguiseradius: true - libsdisguises.seecmd.disguiseclone: true - libsdisguises.seecmd.disguiseviewself: true - libsdisguises.seecmd.disguisemodify: true - libsdisguises.seecmd.disguisemodifyplayer: true - libsdisguises.seecmd.disguisemodifyradius: true - libsdisguises.seecmd.disguisemodifyentity: true - libsdisguises.seecmd.copydisguise: true - libsdisguises.seecmd.grabskin: true - libsdisguises.seecmd.savedisguise: true - libsdisguises.seecmd.grabhead: true + libsdisguises.seecmd.disguise: true + libsdisguises.seecmd.disguiseentity: true + libsdisguises.seecmd.disguisehelp: true + libsdisguises.seecmd.disguiseplayer: true + libsdisguises.seecmd.disguiseradius: true + libsdisguises.seecmd.undisguise: true + libsdisguises.seecmd.undisguiseentity: true + libsdisguises.seecmd.undisguiseplayer: true + libsdisguises.seecmd.undisguiseradius: true + libsdisguises.seecmd.disguiseclone: true + libsdisguises.seecmd.disguiseviewself: true + libsdisguises.seecmd.disguisemodify: true + libsdisguises.seecmd.disguisemodifyplayer: true + libsdisguises.seecmd.disguisemodifyradius: true + libsdisguises.seecmd.disguisemodifyentity: true + libsdisguises.seecmd.copydisguise: true + libsdisguises.seecmd.grabskin: true + libsdisguises.seecmd.savedisguise: true + libsdisguises.seecmd.grabhead: true libsdisguises.seecmd.disguiseviewself: description: See the /disguiseviewself command in tab-completion libsdisguises.seecmd.disguise: diff --git a/src/test/java/me/libraryaddict/disguise/disguisetypes/DisguiseCloneTest.java b/src/test/java/me/libraryaddict/disguise/disguisetypes/DisguiseCloneTest.java index 01743245..1792116c 100644 --- a/src/test/java/me/libraryaddict/disguise/disguisetypes/DisguiseCloneTest.java +++ b/src/test/java/me/libraryaddict/disguise/disguisetypes/DisguiseCloneTest.java @@ -19,7 +19,7 @@ public class DisguiseCloneTest { /** * MetaIndex needs ProtocolLib to have initialized so. */ - // @Test + // @Test public void testCloneDisguise() { try { ReflectionManager.registerValues(); diff --git a/src/test/java/me/libraryaddict/disguise/utilities/DisguiseUtilitiesTest.java b/src/test/java/me/libraryaddict/disguise/utilities/DisguiseUtilitiesTest.java index 5bc45911..3d1e4376 100644 --- a/src/test/java/me/libraryaddict/disguise/utilities/DisguiseUtilitiesTest.java +++ b/src/test/java/me/libraryaddict/disguise/utilities/DisguiseUtilitiesTest.java @@ -16,8 +16,10 @@ public class DisguiseUtilitiesTest { Assert.assertArrayEquals(new String[]{"Name 1\\", "Name 2"}, DisguiseUtilities.splitNewLine("Name 1\\\nName 2")); Assert.assertArrayEquals(new String[]{"Name 1\\nName 2"}, DisguiseUtilities.splitNewLine("Name 1\\\\nName 2")); - Assert.assertArrayEquals(new String[]{"Name 1\\","Name 2"}, DisguiseUtilities.splitNewLine("Name 1\\\\\\nName 2")); - Assert.assertArrayEquals(new String[]{"Name 1\\\\nName 2"}, DisguiseUtilities.splitNewLine("Name 1\\\\\\\\nName 2")); + Assert.assertArrayEquals(new String[]{"Name 1\\", "Name 2"}, + DisguiseUtilities.splitNewLine("Name 1\\\\\\nName 2")); + Assert.assertArrayEquals(new String[]{"Name 1\\\\nName 2"}, + DisguiseUtilities.splitNewLine("Name 1\\\\\\\\nName 2")); } @Test