Add hex color support to translations

This commit is contained in:
libraryaddict 2020-06-27 21:01:58 +12:00
parent 5f2ac293bf
commit ffd6536565
70 changed files with 481 additions and 452 deletions

View File

@ -103,6 +103,11 @@
<version>1.15.2-R0.1-SNAPSHOT</version> <version>1.15.2-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-chat</artifactId>
<version>1.16-R0.1</version>
</dependency>
</dependencies> </dependencies>
<repositories> <repositories>

View File

@ -3,6 +3,7 @@ package me.libraryaddict.disguise.commands;
import lombok.Getter; import lombok.Getter;
import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.LibsDisguises;
import me.libraryaddict.disguise.commands.libsdisguises.*; import me.libraryaddict.disguise.commands.libsdisguises.*;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.LibsPremium;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -113,13 +114,13 @@ public class LibsDisguisesCommand implements CommandExecutor, TabCompleter {
if (command != null) { if (command != null) {
if (!command.hasPermission(sender)) { if (!command.hasPermission(sender)) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
command.onCommand(sender, args); command.onCommand(sender, args);
} else { } else {
sender.sendMessage(LibsMsg.LIBS_COMMAND_WRONG_ARG.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_COMMAND_WRONG_ARG);
} }
} }

View File

@ -28,7 +28,7 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter
} }
if (!(sender instanceof Entity)) { if (!(sender instanceof Entity)) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
@ -77,9 +77,9 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter
disguise.startDisguise(); disguise.startDisguise();
if (disguise.isDisguiseInUse()) { if (disguise.isDisguiseInUse()) {
sender.sendMessage(LibsMsg.DISGUISED.get(disguise.getDisguiseName())); DisguiseUtilities.sendMessage(sender, LibsMsg.DISGUISED, disguise.getDisguiseName());
} else { } else {
sender.sendMessage(LibsMsg.FAILED_DISGIUSE.get(disguise.getDisguiseName())); DisguiseUtilities.sendMessage(sender, LibsMsg.FAILED_DISGIUSE, disguise.getDisguiseName());
} }
return true; return true;
@ -114,22 +114,22 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
if (allowedDisguises.isEmpty()) { if (allowedDisguises.isEmpty()) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return; return;
} }
sender.sendMessage(LibsMsg.DISG_HELP1.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_HELP1);
sender.sendMessage( DisguiseUtilities.sendMessage(sender, LibsMsg.CAN_USE_DISGS,
LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()));
if (allowedDisguises.contains("player")) { 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")) { if (allowedDisguises.contains("dropped_item") || allowedDisguises.contains("falling_block")) {
sender.sendMessage(LibsMsg.DISG_HELP4.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_HELP4);
} }
} }
} }

View File

@ -28,12 +28,12 @@ public class DisguiseEntityCommand extends DisguiseBaseCommand implements TabCom
} }
if (!(sender instanceof Player)) { if (!(sender instanceof Player)) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
if (!getPermissions(sender).hasPermissions()) { if (!getPermissions(sender).hasPermissions()) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
@ -65,8 +65,8 @@ public class DisguiseEntityCommand extends DisguiseBaseCommand implements TabCom
.addInteraction(sender.getName(), new DisguiseEntityInteraction(disguiseArgs), .addInteraction(sender.getName(), new DisguiseEntityInteraction(disguiseArgs),
DisguiseConfig.getDisguiseEntityExpire()); DisguiseConfig.getDisguiseEntityExpire());
sender.sendMessage( DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_ENT_CLICK, DisguiseConfig.getDisguiseEntityExpire(),
LibsMsg.DISG_ENT_CLICK.get(DisguiseConfig.getDisguiseEntityExpire(), testDisguise.getDisguiseName())); testDisguise.getDisguiseName());
return true; return true;
} }
@ -93,22 +93,22 @@ public class DisguiseEntityCommand extends DisguiseBaseCommand implements TabCom
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
if (allowedDisguises.isEmpty()) { if (allowedDisguises.isEmpty()) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return; return;
} }
sender.sendMessage(LibsMsg.DISG_ENT_HELP1.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_ENT_HELP1);
sender.sendMessage( DisguiseUtilities.sendMessage(sender, LibsMsg.CAN_USE_DISGS,
LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()));
if (allowedDisguises.contains("player")) { 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")) { if (allowedDisguises.contains("dropped_item") || allowedDisguises.contains("falling_block")) {
sender.sendMessage(LibsMsg.DISG_ENT_HELP5.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DISG_ENT_HELP5);
} }
} }
} }

View File

@ -34,7 +34,7 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom
DisguisePermissions permissions = getPermissions(sender); DisguisePermissions permissions = getPermissions(sender);
if (!permissions.hasPermissions()) { if (!permissions.hasPermissions()) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
@ -44,7 +44,7 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom
} }
if (args.length == 1) { if (args.length == 1) {
sender.sendMessage(LibsMsg.DPLAYER_SUPPLY.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DPLAYER_SUPPLY);
return true; return true;
} }
@ -92,7 +92,7 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom
} }
if (disguise.isMiscDisguise() && !DisguiseConfig.isMiscDisguisesForLivingEnabled()) { if (disguise.isMiscDisguise() && !DisguiseConfig.isMiscDisguisesForLivingEnabled()) {
sender.sendMessage(LibsMsg.DISABLED_LIVING_TO_MISC.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DISABLED_LIVING_TO_MISC);
return true; return true;
} }
@ -172,22 +172,22 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
if (allowedDisguises.isEmpty()) { if (allowedDisguises.isEmpty()) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return; return;
} }
sender.sendMessage(LibsMsg.D_HELP1.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.D_HELP1);
sender.sendMessage( DisguiseUtilities.sendMessage(sender, LibsMsg.CAN_USE_DISGS,
LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()));
if (allowedDisguises.contains("player")) { 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")) { if (allowedDisguises.contains("dropped_item") || allowedDisguises.contains("falling_block")) {
sender.sendMessage(LibsMsg.D_HELP5.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.D_HELP5);
} }
} }
} }

View File

@ -52,14 +52,14 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom
} }
if (sender.getName().equals("CONSOLE")) { if (sender.getName().equals("CONSOLE")) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
DisguisePermissions permissions = getPermissions(sender); DisguisePermissions permissions = getPermissions(sender);
if (!permissions.hasPermissions()) { if (!permissions.hasPermissions()) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
@ -115,7 +115,7 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom
(starting == 0 ? LibsMsg.DRADIUS_NEEDOPTIONS : LibsMsg.DRADIUS_NEEDOPTIONS_ENTITY).get()); (starting == 0 ? LibsMsg.DRADIUS_NEEDOPTIONS : LibsMsg.DRADIUS_NEEDOPTIONS_ENTITY).get());
return true; return true;
} else if (args.length < 2) { } else if (args.length < 2) {
sender.sendMessage(LibsMsg.DRADIUS_NEEDOPTIONS.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DRADIUS_NEEDOPTIONS);
return true; return true;
} }
@ -127,7 +127,7 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom
int radius = Integer.parseInt(args[starting]); int radius = Integer.parseInt(args[starting]);
if (radius > maxRadius) { if (radius > maxRadius) {
sender.sendMessage(LibsMsg.LIMITED_RADIUS.get(maxRadius)); DisguiseUtilities.sendMessage(sender, LibsMsg.LIMITED_RADIUS, maxRadius);
radius = maxRadius; radius = maxRadius;
} }
@ -202,13 +202,13 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom
} }
if (disguisedEntitys > 0) { if (disguisedEntitys > 0) {
sender.sendMessage(LibsMsg.DISRADIUS.get(disguisedEntitys)); DisguiseUtilities.sendMessage(sender, LibsMsg.DISRADIUS, disguisedEntitys);
} else { } else {
sender.sendMessage(LibsMsg.DISRADIUS_FAIL.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DISRADIUS_FAIL);
} }
if (miscDisguises > 0) { if (miscDisguises > 0) {
sender.sendMessage(LibsMsg.DRADIUS_MISCDISG.get(miscDisguises)); DisguiseUtilities.sendMessage(sender, LibsMsg.DRADIUS_MISCDISG, miscDisguises);
} }
} }
catch (DisguiseParseException ex) { catch (DisguiseParseException ex) {
@ -278,24 +278,24 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
if (allowedDisguises.isEmpty()) { if (allowedDisguises.isEmpty()) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return; return;
} }
sender.sendMessage(LibsMsg.DRADIUS_HELP1.get(maxRadius)); DisguiseUtilities.sendMessage(sender, LibsMsg.DRADIUS_HELP1, maxRadius);
sender.sendMessage( DisguiseUtilities.sendMessage(sender, LibsMsg.CAN_USE_DISGS,
LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()));
if (allowedDisguises.contains("player")) { 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")) { 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);
} }
} }

View File

@ -6,6 +6,7 @@ import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.commands.utils.CopyDisguiseCommand; import me.libraryaddict.disguise.commands.utils.CopyDisguiseCommand;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
import me.libraryaddict.disguise.disguisetypes.PlayerDisguise; import me.libraryaddict.disguise.disguisetypes.PlayerDisguise;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.LibsEntityInteract; import me.libraryaddict.disguise.utilities.LibsEntityInteract;
import me.libraryaddict.disguise.utilities.parser.DisguiseParser; import me.libraryaddict.disguise.utilities.parser.DisguiseParser;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
@ -35,7 +36,7 @@ public class CopyDisguiseInteraction implements LibsEntityInteract {
DisguiseParser.parseToString(disguise), true); DisguiseParser.parseToString(disguise), true);
} }
} else { } else {
player.sendMessage(LibsMsg.TARGET_NOT_DISGUISED.get()); DisguiseUtilities.sendMessage(player, LibsMsg.TARGET_NOT_DISGUISED);
} }
} }
} }

View File

@ -6,6 +6,7 @@ import me.libraryaddict.disguise.DisguiseConfig;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.DisguiseType;
import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.LibsEntityInteract; import me.libraryaddict.disguise.utilities.LibsEntityInteract;
import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; import me.libraryaddict.disguise.utilities.parser.DisguiseParseException;
import me.libraryaddict.disguise.utilities.parser.DisguiseParser; import me.libraryaddict.disguise.utilities.parser.DisguiseParser;
@ -52,7 +53,7 @@ public class DisguiseEntityInteraction implements LibsEntityInteract {
if (disguise.isMiscDisguise() && !DisguiseConfig.isMiscDisguisesForLivingEnabled() && if (disguise.isMiscDisguise() && !DisguiseConfig.isMiscDisguisesForLivingEnabled() &&
entity instanceof LivingEntity) { entity instanceof LivingEntity) {
p.sendMessage(LibsMsg.DISABLED_LIVING_TO_MISC.get()); DisguiseUtilities.sendMessage(p, LibsMsg.DISABLED_LIVING_TO_MISC);
} else { } else {
if (entity instanceof Player && DisguiseConfig.isNameOfPlayerShownAboveDisguise() && if (entity instanceof Player && DisguiseConfig.isNameOfPlayerShownAboveDisguise() &&
!entity.hasPermission("libsdisguises.hidename")) { !entity.hasPermission("libsdisguises.hidename")) {
@ -76,29 +77,37 @@ public class DisguiseEntityInteraction implements LibsEntityInteract {
if (disguise.isDisguiseInUse()) { if (disguise.isDisguiseInUse()) {
if (disguise.isPlayerDisguise()) { if (disguise.isPlayerDisguise()) {
if (entity instanceof Player) { 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 { } else {
p.sendMessage(LibsMsg.LISTEN_ENTITY_ENTITY_DISG_PLAYER.get(entityName, disguiseName)); DisguiseUtilities
.sendMessage(p, LibsMsg.LISTEN_ENTITY_ENTITY_DISG_PLAYER, entityName, disguiseName);
} }
} else { } else {
if (entity instanceof Player) { 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 { } else {
p.sendMessage(LibsMsg.LISTEN_ENTITY_ENTITY_DISG_ENTITY.get(entityName, disguiseName)); DisguiseUtilities
.sendMessage(p, LibsMsg.LISTEN_ENTITY_ENTITY_DISG_ENTITY, entityName, disguiseName);
} }
} }
} else { } else {
if (disguise.isPlayerDisguise()) { if (disguise.isPlayerDisguise()) {
if (entity instanceof Player) { 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 { } 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 { } else {
if (entity instanceof Player) { 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 { } 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);
} }
} }
} }

View File

@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.DisguiseType;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.LibsEntityInteract; import me.libraryaddict.disguise.utilities.LibsEntityInteract;
import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; import me.libraryaddict.disguise.utilities.parser.DisguiseParseException;
import me.libraryaddict.disguise.utilities.parser.DisguiseParser; import me.libraryaddict.disguise.utilities.parser.DisguiseParser;
@ -37,7 +38,7 @@ public class DisguiseModifyInteraction implements LibsEntityInteract {
Disguise disguise = DisguiseAPI.getDisguise(p, entity); Disguise disguise = DisguiseAPI.getDisguise(p, entity);
if (disguise == null) { if (disguise == null) {
p.sendMessage(LibsMsg.UNDISG_PLAYER_FAIL.get(entityName)); DisguiseUtilities.sendMessage(p, LibsMsg.UNDISG_PLAYER_FAIL, entityName);
return; return;
} }
@ -47,7 +48,7 @@ public class DisguiseModifyInteraction implements LibsEntityInteract {
DisguisePerm disguisePerm = new DisguisePerm(disguise.getType()); DisguisePerm disguisePerm = new DisguisePerm(disguise.getType());
if (!perms.isAllowedDisguise(disguisePerm, Arrays.asList(options))) { if (!perms.isAllowedDisguise(disguisePerm, Arrays.asList(options))) {
p.sendMessage(LibsMsg.DMODPLAYER_NOPERM.get()); DisguiseUtilities.sendMessage(p, LibsMsg.DMODPLAYER_NOPERM);
return; return;
} }
@ -55,7 +56,7 @@ public class DisguiseModifyInteraction implements LibsEntityInteract {
DisguiseParser DisguiseParser
.callMethods(p, disguise, perms, disguisePerm, new ArrayList<>(Arrays.asList(options)), options, .callMethods(p, disguise, perms, disguisePerm, new ArrayList<>(Arrays.asList(options)), options,
"DisguiseModifyEntity"); "DisguiseModifyEntity");
p.sendMessage(LibsMsg.LISTENER_MODIFIED_DISG.get()); DisguiseUtilities.sendMessage(p, LibsMsg.LISTENER_MODIFIED_DISG);
} }
catch (DisguiseParseException ex) { catch (DisguiseParseException ex) {
if (ex.getMessage() != null) { if (ex.getMessage() != null) {

View File

@ -2,6 +2,7 @@ package me.libraryaddict.disguise.commands.interactions;
import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.DisguiseType;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.LibsEntityInteract; import me.libraryaddict.disguise.utilities.LibsEntityInteract;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
@ -25,14 +26,14 @@ public class UndisguiseEntityInteraction implements LibsEntityInteract {
DisguiseAPI.undisguiseToAll(entity); DisguiseAPI.undisguiseToAll(entity);
if (entity instanceof Player) if (entity instanceof Player)
p.sendMessage(LibsMsg.LISTEN_UNDISG_PLAYER.get(entityName)); DisguiseUtilities.sendMessage(p, LibsMsg.LISTEN_UNDISG_PLAYER, entityName);
else else
p.sendMessage(LibsMsg.LISTEN_UNDISG_ENT.get(entityName)); DisguiseUtilities.sendMessage(p, LibsMsg.LISTEN_UNDISG_ENT, entityName);
} else { } else {
if (entity instanceof Player) if (entity instanceof Player)
p.sendMessage(LibsMsg.LISTEN_UNDISG_PLAYER_FAIL.get(entityName)); DisguiseUtilities.sendMessage(p, LibsMsg.LISTEN_UNDISG_PLAYER_FAIL, entityName);
else else
p.sendMessage(LibsMsg.LISTEN_UNDISG_ENT_FAIL.get(entityName)); DisguiseUtilities.sendMessage(p, LibsMsg.LISTEN_UNDISG_ENT_FAIL, entityName);
} }
} }
} }

View File

@ -1,6 +1,7 @@
package me.libraryaddict.disguise.commands.libsdisguises; package me.libraryaddict.disguise.commands.libsdisguises;
import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.LibsDisguises;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import me.libraryaddict.disguise.utilities.updates.UpdateChecker; import me.libraryaddict.disguise.utilities.updates.UpdateChecker;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -33,12 +34,12 @@ public class LDChangelog implements LDCommand {
UpdateChecker checker = LibsDisguises.getInstance().getUpdateChecker(); UpdateChecker checker = LibsDisguises.getInstance().getUpdateChecker();
if (checker.isDownloading()) { if (checker.isDownloading()) {
sender.sendMessage(LibsMsg.UPDATE_IN_PROGRESS.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_IN_PROGRESS);
return; return;
} }
if (checker.getUpdate() == null) { if (checker.getUpdate() == null) {
sender.sendMessage(LibsMsg.UPDATE_REQUIRED.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_REQUIRED);
return; return;
} }

View File

@ -2,6 +2,7 @@ package me.libraryaddict.disguise.commands.libsdisguises;
import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.DisguiseConfig;
import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.LibsDisguises;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -34,7 +35,7 @@ public class LDConfig implements LDCommand {
ArrayList<String> returns = DisguiseConfig.doOutput(LibsDisguises.getInstance().getConfig(), true, true); ArrayList<String> returns = DisguiseConfig.doOutput(LibsDisguises.getInstance().getConfig(), true, true);
if (returns.isEmpty()) { if (returns.isEmpty()) {
sender.sendMessage(LibsMsg.USING_DEFAULT_CONFIG.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.USING_DEFAULT_CONFIG);
return; return;
} }

View File

@ -35,9 +35,10 @@ public class LDCount implements LDCommand {
} }
if (counts.isEmpty()) { if (counts.isEmpty()) {
sender.sendMessage(LibsMsg.NO_DISGUISES_IN_USE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_DISGUISES_IN_USE);
} else { } 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<DisguiseType> types = new ArrayList<>(counts.keySet()); ArrayList<DisguiseType> types = new ArrayList<>(counts.keySet());
types.sort((d1, d2) -> String.CASE_INSENSITIVE_ORDER.compare(TranslateType.DISGUISES.get(d1.toReadable()), 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());
} }
} }

View File

@ -29,7 +29,7 @@ public class LDDebugPlayer implements LDCommand {
Disguise disguise = DisguiseAPI.getDisguise(player, entity); Disguise disguise = DisguiseAPI.getDisguise(player, entity);
if (disguise == null) { if (disguise == null) {
player.sendMessage(LibsMsg.TARGET_NOT_DISGUISED.get()); DisguiseUtilities.sendMessage(player, LibsMsg.TARGET_NOT_DISGUISED);
return; return;
} }
@ -100,7 +100,7 @@ public class LDDebugPlayer implements LDCommand {
@Override @Override
public void onCommand(CommandSender sender, String[] args) { public void onCommand(CommandSender sender, String[] args) {
if (!(sender instanceof Player)) { 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); LibsDisguises.getInstance().getListener().addInteraction(sender.getName(), new DebugInteraction(), 60);

View File

@ -35,7 +35,7 @@ public class LDJson implements LDCommand {
@Override @Override
public void onCommand(CommandSender sender, String[] args) { public void onCommand(CommandSender sender, String[] args) {
if (!(sender instanceof Player)) { if (!(sender instanceof Player)) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return; return;
} }

View File

@ -1,6 +1,7 @@
package me.libraryaddict.disguise.commands.libsdisguises; package me.libraryaddict.disguise.commands.libsdisguises;
import me.libraryaddict.disguise.disguisetypes.MetaIndex; import me.libraryaddict.disguise.disguisetypes.MetaIndex;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import me.libraryaddict.disguise.utilities.reflection.NmsVersion;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;
@ -34,7 +35,7 @@ public class LDMetaInfo implements LDCommand {
MetaIndex index = MetaIndex.getMetaIndexByName(args[1]); MetaIndex index = MetaIndex.getMetaIndexByName(args[1]);
if (index == null) { if (index == null) {
sender.sendMessage(LibsMsg.META_NOT_FOUND.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.META_NOT_FOUND);
return; return;
} }
@ -68,8 +69,8 @@ public class LDMetaInfo implements LDCommand {
sender.spigot().sendMessage(builder.create()); sender.spigot().sendMessage(builder.create());
} else { } else {
sender.sendMessage( DisguiseUtilities.sendMessage(sender, LibsMsg.META_VALUES_NO_CLICK,
LibsMsg.META_VALUES_NO_CLICK.get(StringUtils.join(names, LibsMsg.META_VALUE_SEPERATOR.get()))); StringUtils.join(names, LibsMsg.META_VALUE_SEPERATOR.get()));
} }
} }
} }

View File

@ -1,5 +1,6 @@
package me.libraryaddict.disguise.commands.libsdisguises; package me.libraryaddict.disguise.commands.libsdisguises;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.modded.ModdedManager; import me.libraryaddict.disguise.utilities.modded.ModdedManager;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
@ -27,7 +28,7 @@ public class LDMods implements LDCommand {
@Override @Override
public void onCommand(CommandSender sender, String[] args) { public void onCommand(CommandSender sender, String[] args) {
if (ModdedManager.getEntities().isEmpty()) { if (ModdedManager.getEntities().isEmpty()) {
sender.sendMessage(LibsMsg.NO_MODS_LISTENING.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_MODS_LISTENING);
return; return;
} }
@ -43,17 +44,17 @@ public class LDMods implements LDCommand {
} else if (sender instanceof Player) { } else if (sender instanceof Player) {
player = (Player) sender; player = (Player) sender;
} else { } else {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return; return;
} }
if (!player.hasMetadata("forge_mods")) { if (!player.hasMetadata("forge_mods")) {
sender.sendMessage(LibsMsg.NO_MODS.get(player.getName())); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_MODS, player.getName());
return; return;
} }
sender.sendMessage(LibsMsg.MODS_LIST.get(player.getName(), DisguiseUtilities.sendMessage(sender, LibsMsg.MODS_LIST, player.getName(),
StringUtils.join((List<String>) player.getMetadata("forge_mods").get(0).value(), ", "))); StringUtils.join((List<String>) player.getMetadata("forge_mods").get(0).value(), ", "));
} }
@Override @Override

View File

@ -2,6 +2,7 @@ package me.libraryaddict.disguise.commands.libsdisguises;
import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.LibsDisguises;
import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.DisguiseType;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.LibsPremium;
import me.libraryaddict.disguise.utilities.parser.DisguisePerm; import me.libraryaddict.disguise.utilities.parser.DisguisePerm;
import me.libraryaddict.disguise.utilities.parser.DisguisePermissions; import me.libraryaddict.disguise.utilities.parser.DisguisePermissions;
@ -31,7 +32,7 @@ public class LDPermTest implements LDCommand {
@Override @Override
public void onCommand(CommandSender sender, String[] args) { public void onCommand(CommandSender sender, String[] args) {
if (!LibsPremium.isPremium()) { if (!LibsPremium.isPremium()) {
sender.sendMessage(LibsMsg.LIBS_PERM_CHECK_NON_PREM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_CHECK_NON_PREM);
} }
Permissible player; Permissible player;
@ -48,34 +49,34 @@ public class LDPermTest implements LDCommand {
} }
DisguisePermissions permissions = new DisguisePermissions(player, "disguise"); DisguisePermissions permissions = new DisguisePermissions(player, "disguise");
sender.sendMessage(LibsMsg.LIBS_PERM_CHECK_INFO_1.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_CHECK_INFO_1);
sender.sendMessage(LibsMsg.LIBS_PERM_CHECK_INFO_2.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_CHECK_INFO_2);
if (player.hasPermission("libsdisguises.disguise.pig")) { 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))) { if (permissions.isAllowedDisguise(new DisguisePerm(DisguiseType.PIG))) {
sender.sendMessage(LibsMsg.LIBS_PERM_CHECK_SUCCESS.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_CHECK_SUCCESS);
} else { } else {
sender.sendMessage(LibsMsg.LIBS_PERM_CHECK_FAIL.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_PERM_CHECK_FAIL);
} }
} else { } else {
sender.sendMessage(LibsMsg.NORMAL_PERM_CHECK_FAIL.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NORMAL_PERM_CHECK_FAIL);
} }
if (player.hasPermission("libsdisguises.disguise.zombie") || if (player.hasPermission("libsdisguises.disguise.zombie") ||
permissions.isAllowedDisguise(new DisguisePerm(DisguiseType.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"); PluginCommand command = LibsDisguises.getInstance().getCommand("disguise");
if (command == null) { 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())) { } 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 { } 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")) { if (!sender.hasPermission("libsdisguises.seecmd.disguise")) {

View File

@ -1,6 +1,7 @@
package me.libraryaddict.disguise.commands.libsdisguises; package me.libraryaddict.disguise.commands.libsdisguises;
import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.DisguiseConfig;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.sounds.SoundManager; import me.libraryaddict.disguise.utilities.sounds.SoundManager;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -26,7 +27,7 @@ public class LDReload implements LDCommand {
public void onCommand(CommandSender sender, String[] args) { public void onCommand(CommandSender sender, String[] args) {
DisguiseConfig.loadConfig(); DisguiseConfig.loadConfig();
new SoundManager().load(); new SoundManager().load();
sender.sendMessage(LibsMsg.RELOADED_CONFIG.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.RELOADED_CONFIG);
} }
@Override @Override

View File

@ -109,18 +109,18 @@ public class LDScoreboard implements LDCommand {
} }
if (issuesFound == 0) { if (issuesFound == 0) {
sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_NO_ISSUES.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_NO_ISSUES);
} else { } else {
sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_ISSUES.get(issuesFound)); DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_ISSUES, issuesFound);
} }
} else { } 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) { if (DisguiseConfig.getPushingOption() == DisguiseConfig.DisguisePushing.IGNORE_SCOREBOARD) {
sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_DISABLED.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_DISABLED);
} }
Player player; Player player;
@ -134,18 +134,18 @@ public class LDScoreboard implements LDCommand {
} }
if (!DisguiseAPI.isDisguised(player)) { if (!DisguiseAPI.isDisguised(player)) {
sender.sendMessage(LibsMsg.DMODPLAYER_NODISGUISE.get(player.getName())); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODPLAYER_NODISGUISE, player.getName());
return; return;
} }
} else if (sender instanceof Player) { } else if (sender instanceof Player) {
player = (Player) sender; player = (Player) sender;
if (!DisguiseAPI.isDisguised(player)) { if (!DisguiseAPI.isDisguised(player)) {
sender.sendMessage(LibsMsg.NOT_DISGUISED.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NOT_DISGUISED);
return; return;
} }
} else { } else {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return; return;
} }
@ -154,17 +154,17 @@ public class LDScoreboard implements LDCommand {
Team team = board.getEntryTeam(sender.getName()); Team team = board.getEntryTeam(sender.getName());
if (team == null) { if (team == null) {
sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_NO_TEAM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_NO_TEAM);
return; return;
} }
if (team.getOption(Team.Option.COLLISION_RULE) != Team.OptionStatus.NEVER && if (team.getOption(Team.Option.COLLISION_RULE) != Team.OptionStatus.NEVER &&
team.getOption(Team.Option.COLLISION_RULE) != Team.OptionStatus.FOR_OTHER_TEAMS) { 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; return;
} }
sender.sendMessage(LibsMsg.LIBS_SCOREBOARD_SUCCESS.get(team.getName())); DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_SCOREBOARD_SUCCESS, team.getName());
} }
@Override @Override

View File

@ -35,7 +35,7 @@ public class LDUpdate implements LDCommand {
UpdateChecker checker = LibsDisguises.getInstance().getUpdateChecker(); UpdateChecker checker = LibsDisguises.getInstance().getUpdateChecker();
if (checker.isDownloading()) { if (checker.isDownloading()) {
sender.sendMessage(LibsMsg.UPDATE_IN_PROGRESS.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_IN_PROGRESS);
return; return;
} }
@ -47,7 +47,7 @@ public class LDUpdate implements LDCommand {
} else if (args[1].equalsIgnoreCase("release")) { } else if (args[1].equalsIgnoreCase("release")) {
releaseBuilds = true; releaseBuilds = true;
} else { } else {
sender.sendMessage(LibsMsg.LIBS_UPDATE_UNKNOWN_BRANCH.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.LIBS_UPDATE_UNKNOWN_BRANCH);
return; return;
} }
@ -56,12 +56,12 @@ public class LDUpdate implements LDCommand {
if (checker.getUpdate() != null && checker.getUpdate().isReleaseBuild() == releaseBuilds && args.length <= 1) { if (checker.getUpdate() != null && checker.getUpdate().isReleaseBuild() == releaseBuilds && args.length <= 1) {
if (checker.isServerLatestVersion()) { if (checker.isServerLatestVersion()) {
sender.sendMessage(LibsMsg.UPDATE_ON_LATEST.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_ON_LATEST);
return; return;
} }
if (checker.isOnLatestUpdate(true)) { if (checker.isOnLatestUpdate(true)) {
sender.sendMessage(LibsMsg.UPDATE_ALREADY_DOWNLOADED.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_ALREADY_DOWNLOADED);
return; return;
} }
} }
@ -76,15 +76,15 @@ public class LDUpdate implements LDCommand {
} }
if (checker.getUpdate() == null) { if (checker.getUpdate() == null) {
sender.sendMessage(LibsMsg.UPDATE_FAILED.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_FAILED);
return; return;
} }
if (checker.isOnLatestUpdate(true)) { if (checker.isOnLatestUpdate(true)) {
if (checker.getLastDownload() != null) { if (checker.getLastDownload() != null) {
sender.sendMessage(LibsMsg.UPDATE_ALREADY_DOWNLOADED.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_ALREADY_DOWNLOADED);
} else { } else {
sender.sendMessage(LibsMsg.UPDATE_ON_LATEST.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_ON_LATEST);
} }
return; return;
@ -105,7 +105,7 @@ public class LDUpdate implements LDCommand {
PluginInformation result = checker.doUpdate(); PluginInformation result = checker.doUpdate();
if (result == null) { if (result == null) {
sender.sendMessage(LibsMsg.UPDATE_FAILED.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.UPDATE_FAILED);
return; return;
} }

View File

@ -23,14 +23,14 @@ public class DisguiseModifyCommand extends DisguiseBaseCommand implements TabCom
@Override @Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!(sender instanceof Entity)) { if (!(sender instanceof Entity)) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
DisguisePermissions permissions = getPermissions(sender); DisguisePermissions permissions = getPermissions(sender);
if (!permissions.hasPermissions()) { if (!permissions.hasPermissions()) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
@ -42,14 +42,14 @@ public class DisguiseModifyCommand extends DisguiseBaseCommand implements TabCom
Disguise disguise = DisguiseAPI.getDisguise((Player) sender, (Entity) sender); Disguise disguise = DisguiseAPI.getDisguise((Player) sender, (Entity) sender);
if (disguise == null) { if (disguise == null) {
sender.sendMessage(LibsMsg.NOT_DISGUISED.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NOT_DISGUISED);
return true; return true;
} }
DisguisePerm disguisePerm = new DisguisePerm(disguise.getType()); DisguisePerm disguisePerm = new DisguisePerm(disguise.getType());
if (!permissions.isAllowedDisguise(disguisePerm)) { if (!permissions.isAllowedDisguise(disguisePerm)) {
sender.sendMessage(LibsMsg.DMODIFY_NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_NO_PERM);
return true; return true;
} }
@ -73,7 +73,7 @@ public class DisguiseModifyCommand extends DisguiseBaseCommand implements TabCom
return true; return true;
} }
sender.sendMessage(LibsMsg.DMODIFY_MODIFIED.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_MODIFIED);
return true; return true;
} }
@ -106,9 +106,9 @@ public class DisguiseModifyCommand extends DisguiseBaseCommand implements TabCom
protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) {
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
sender.sendMessage(LibsMsg.DMODIFY_HELP3.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_HELP3);
sender.sendMessage(LibsMsg.DMODIFY_HELP3.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_HELP3);
sender.sendMessage( DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_HELP3,
LibsMsg.DMODIFY_HELP3.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()));
} }
} }

View File

@ -22,14 +22,14 @@ public class DisguiseModifyEntityCommand extends DisguiseBaseCommand implements
@Override @Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!(sender instanceof Player)) { if (!(sender instanceof Player)) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
DisguisePermissions permissions = getPermissions(sender); DisguisePermissions permissions = getPermissions(sender);
if (!permissions.hasPermissions()) { if (!permissions.hasPermissions()) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
@ -44,7 +44,7 @@ public class DisguiseModifyEntityCommand extends DisguiseBaseCommand implements
new DisguiseModifyInteraction(DisguiseUtilities.split(StringUtils.join(args, " "))), new DisguiseModifyInteraction(DisguiseUtilities.split(StringUtils.join(args, " "))),
DisguiseConfig.getDisguiseEntityExpire()); DisguiseConfig.getDisguiseEntityExpire());
sender.sendMessage(LibsMsg.DMODIFYENT_CLICK.get(DisguiseConfig.getDisguiseEntityExpire())); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFYENT_CLICK, DisguiseConfig.getDisguiseEntityExpire());
return true; return true;
} }
@ -78,8 +78,8 @@ public class DisguiseModifyEntityCommand extends DisguiseBaseCommand implements
protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) {
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
sender.sendMessage(LibsMsg.DMODENT_HELP1.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODENT_HELP1);
sender.sendMessage(LibsMsg.DMODIFY_HELP3 DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_HELP3,
.get( StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()));
} }
} }

View File

@ -28,7 +28,7 @@ public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements
DisguisePermissions permissions = getPermissions(sender); DisguisePermissions permissions = getPermissions(sender);
if (!permissions.hasPermissions()) { if (!permissions.hasPermissions()) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
@ -71,14 +71,14 @@ public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements
disguise = DisguiseAPI.getDisguise(entityTarget); disguise = DisguiseAPI.getDisguise(entityTarget);
if (disguise == null) { if (disguise == null) {
sender.sendMessage(LibsMsg.DMODPLAYER_NODISGUISE.get(entityTarget.getName())); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODPLAYER_NODISGUISE, entityTarget.getName());
return true; return true;
} }
DisguisePerm disguisePerm = new DisguisePerm(disguise.getType()); DisguisePerm disguisePerm = new DisguisePerm(disguise.getType());
if (!permissions.isAllowedDisguise(disguisePerm)) { if (!permissions.isAllowedDisguise(disguisePerm)) {
sender.sendMessage(LibsMsg.DMODPLAYER_NOPERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODPLAYER_NOPERM);
return true; return true;
} }
@ -102,7 +102,7 @@ public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements
return true; return true;
} }
sender.sendMessage(LibsMsg.DMODPLAYER_MODIFIED.get(entityTarget.getName())); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODPLAYER_MODIFIED, entityTarget.getName());
return true; return true;
} }
@ -161,8 +161,8 @@ public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements
protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) {
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
sender.sendMessage(LibsMsg.DMODPLAYER_HELP1.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODPLAYER_HELP1);
sender.sendMessage( DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_HELP3,
LibsMsg.DMODIFY_HELP3.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()));
} }
} }

View File

@ -47,14 +47,14 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements
@Override @Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender.getName().equals("CONSOLE")) { if (sender.getName().equals("CONSOLE")) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
DisguisePermissions permissions = getPermissions(sender); DisguisePermissions permissions = getPermissions(sender);
if (!permissions.hasPermissions()) { if (!permissions.hasPermissions()) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
@ -109,7 +109,7 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements
(starting == 0 ? LibsMsg.DMODRADIUS_NEEDOPTIONS : LibsMsg.DMODRADIUS_NEEDOPTIONS_ENTITY).get()); (starting == 0 ? LibsMsg.DMODRADIUS_NEEDOPTIONS : LibsMsg.DMODRADIUS_NEEDOPTIONS_ENTITY).get());
return true; return true;
} else if (args.length < 2) { } else if (args.length < 2) {
sender.sendMessage(LibsMsg.DMODRADIUS_NEEDOPTIONS.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS_NEEDOPTIONS);
return true; return true;
} }
@ -121,7 +121,7 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements
int radius = Integer.parseInt(args[starting]); int radius = Integer.parseInt(args[starting]);
if (radius > maxRadius) { if (radius > maxRadius) {
sender.sendMessage(LibsMsg.LIMITED_RADIUS.get(maxRadius)); DisguiseUtilities.sendMessage(sender, LibsMsg.LIMITED_RADIUS, maxRadius);
radius = maxRadius; radius = maxRadius;
} }
@ -188,13 +188,13 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements
} }
if (noPermission > 0) { if (noPermission > 0) {
sender.sendMessage(LibsMsg.DMODRADIUS_NOPERM.get(noPermission)); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS_NOPERM, noPermission);
} }
if (modifiedDisguises > 0) { if (modifiedDisguises > 0) {
sender.sendMessage(LibsMsg.DMODRADIUS.get(modifiedDisguises)); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS, modifiedDisguises);
} else { } else {
sender.sendMessage(LibsMsg.DMODRADIUS_NOENTS.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS_NOENTS);
} }
return true; return true;
@ -245,7 +245,7 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements
int radius = Integer.parseInt(args[starting]); int radius = Integer.parseInt(args[starting]);
if (radius > maxRadius) { if (radius > maxRadius) {
sender.sendMessage(LibsMsg.LIMITED_RADIUS.get(maxRadius)); DisguiseUtilities.sendMessage(sender, LibsMsg.LIMITED_RADIUS, maxRadius);
radius = maxRadius; radius = maxRadius;
} }
@ -287,11 +287,11 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements
protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) {
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
sender.sendMessage(LibsMsg.DMODRADIUS_HELP1.get(maxRadius)); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS_HELP1, maxRadius);
sender.sendMessage( DisguiseUtilities.sendMessage(sender, LibsMsg.DMODIFY_HELP3,
LibsMsg.DMODIFY_HELP3.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()));
sender.sendMessage(LibsMsg.DMODRADIUS_HELP2.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS_HELP2);
sender.sendMessage(LibsMsg.DMODRADIUS_HELP3.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DMODRADIUS_HELP3);
} }
} }

View File

@ -1,6 +1,7 @@
package me.libraryaddict.disguise.commands.undisguise; package me.libraryaddict.disguise.commands.undisguise;
import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.LibsPremium;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -21,19 +22,19 @@ public class UndisguiseCommand implements CommandExecutor {
} }
if (sender.getName().equals("CONSOLE")) { if (sender.getName().equals("CONSOLE")) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
if (sender.hasPermission("libsdisguises.undisguise") && !"%%__USER__%%".equals(12345 + "")) { if (sender.hasPermission("libsdisguises.undisguise") && !"%%__USER__%%".equals(12345 + "")) {
if (DisguiseAPI.isDisguised((Entity) sender)) { if (DisguiseAPI.isDisguised((Entity) sender)) {
DisguiseAPI.undisguiseToAll((Player) sender); DisguiseAPI.undisguiseToAll((Player) sender);
sender.sendMessage(LibsMsg.UNDISG.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.UNDISG);
} else { } else {
sender.sendMessage(LibsMsg.NOT_DISGUISED.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NOT_DISGUISED);
} }
} else { } else {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
} }
return true; return true;

View File

@ -3,6 +3,7 @@ package me.libraryaddict.disguise.commands.undisguise;
import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.DisguiseConfig;
import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.LibsDisguises;
import me.libraryaddict.disguise.commands.interactions.UndisguiseEntityInteraction; import me.libraryaddict.disguise.commands.interactions.UndisguiseEntityInteraction;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.LibsPremium;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -21,18 +22,18 @@ public class UndisguiseEntityCommand implements CommandExecutor {
} }
if (sender.getName().equals("CONSOLE")) { if (sender.getName().equals("CONSOLE")) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
if (!sender.hasPermission("libsdisguises.undisguiseentity")) { if (!sender.hasPermission("libsdisguises.undisguiseentity")) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
LibsDisguises.getInstance().getListener().addInteraction(sender.getName(), new UndisguiseEntityInteraction(), LibsDisguises.getInstance().getListener().addInteraction(sender.getName(), new UndisguiseEntityInteraction(),
DisguiseConfig.getDisguiseEntityExpire()); DisguiseConfig.getDisguiseEntityExpire());
sender.sendMessage(LibsMsg.UND_ENTITY.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.UND_ENTITY);
return true; return true;
} }

View File

@ -2,6 +2,7 @@ package me.libraryaddict.disguise.commands.undisguise;
import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.DisguiseType;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.LibsPremium;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -62,12 +63,12 @@ public class UndisguisePlayerCommand implements CommandExecutor, TabCompleter {
} }
if (!sender.hasPermission("libsdisguises.undisguiseplayer")) { if (!sender.hasPermission("libsdisguises.undisguiseplayer")) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
if (args.length == 0) { if (args.length == 0) {
sender.sendMessage(LibsMsg.UNDISG_PLAYER_HELP.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.UNDISG_PLAYER_HELP);
return true; return true;
} }

View File

@ -1,6 +1,7 @@
package me.libraryaddict.disguise.commands.undisguise; package me.libraryaddict.disguise.commands.undisguise;
import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.LibsPremium;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -36,7 +37,7 @@ public class UndisguiseRadiusCommand implements CommandExecutor {
} }
if (sender.getName().equals("CONSOLE")) { if (sender.getName().equals("CONSOLE")) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
@ -49,7 +50,7 @@ public class UndisguiseRadiusCommand implements CommandExecutor {
} }
radius = Integer.parseInt(args[0]); radius = Integer.parseInt(args[0]);
if (radius > maxRadius) { if (radius > maxRadius) {
sender.sendMessage(LibsMsg.LIMITED_RADIUS.get(maxRadius)); DisguiseUtilities.sendMessage(sender, LibsMsg.LIMITED_RADIUS, maxRadius);
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 { } else {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
} }
return true; return true;
} }

View File

@ -38,7 +38,7 @@ public class CopyDisguiseCommand implements CommandExecutor {
} }
if (!sender.hasPermission("libsdisguises.copydisguise")) { if (!sender.hasPermission("libsdisguises.copydisguise")) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
@ -70,7 +70,8 @@ public class CopyDisguiseCommand implements CommandExecutor {
.addInteraction(sender.getName(), new CopyDisguiseInteraction(this), .addInteraction(sender.getName(), new CopyDisguiseInteraction(this),
DisguiseConfig.getDisguiseEntityExpire()); DisguiseConfig.getDisguiseEntityExpire());
sender.sendMessage(LibsMsg.DISGUISECOPY_INTERACT.get(DisguiseConfig.getDisguiseEntityExpire())); DisguiseUtilities
.sendMessage(sender, LibsMsg.DISGUISECOPY_INTERACT, DisguiseConfig.getDisguiseEntityExpire());
return true; return true;
} }

View File

@ -22,13 +22,13 @@ public class DisguiseCloneCommand extends DisguiseBaseCommand implements TabComp
@Override @Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender.getName().equals("CONSOLE")) { if (sender.getName().equals("CONSOLE")) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
if (!sender.hasPermission("libsdisguises.disguise.disguiseclone")) { if (!sender.hasPermission("libsdisguises.disguise.disguiseclone")) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
@ -53,7 +53,7 @@ public class DisguiseCloneCommand extends DisguiseBaseCommand implements TabComp
} else if (option.equalsIgnoreCase(LibsMsg.DCLONE_SPRINT.get())) { } else if (option.equalsIgnoreCase(LibsMsg.DCLONE_SPRINT.get())) {
doSprint = true; doSprint = true;
} else { } else {
sender.sendMessage(LibsMsg.INVALID_CLONE.get(option)); DisguiseUtilities.sendMessage(sender, LibsMsg.INVALID_CLONE, option);
return true; return true;
} }
} }
@ -67,7 +67,7 @@ public class DisguiseCloneCommand extends DisguiseBaseCommand implements TabComp
.addInteraction(sender.getName(), new DisguiseCloneInteraction(options), .addInteraction(sender.getName(), new DisguiseCloneInteraction(options),
DisguiseConfig.getDisguiseCloneExpire()); DisguiseConfig.getDisguiseCloneExpire());
sender.sendMessage(LibsMsg.CLICK_TIMER.get(DisguiseConfig.getDisguiseCloneExpire())); DisguiseUtilities.sendMessage(sender, LibsMsg.CLICK_TIMER, DisguiseConfig.getDisguiseCloneExpire());
} }
return true; return true;
@ -103,8 +103,8 @@ public class DisguiseCloneCommand extends DisguiseBaseCommand implements TabComp
*/ */
@Override @Override
protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) {
sender.sendMessage(LibsMsg.CLONE_HELP1.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.CLONE_HELP1);
sender.sendMessage(LibsMsg.CLONE_HELP2.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.CLONE_HELP2);
sender.sendMessage(LibsMsg.CLONE_HELP3.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.CLONE_HELP3);
} }
} }

View File

@ -1,6 +1,7 @@
package me.libraryaddict.disguise.commands.utils; package me.libraryaddict.disguise.commands.utils;
import me.libraryaddict.disguise.commands.DisguiseBaseCommand; 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.ParamInfo;
import me.libraryaddict.disguise.utilities.params.ParamInfoManager; import me.libraryaddict.disguise.utilities.params.ParamInfoManager;
import me.libraryaddict.disguise.utilities.parser.DisguiseParser; import me.libraryaddict.disguise.utilities.parser.DisguiseParser;
@ -47,14 +48,16 @@ public class DisguiseHelpCommand extends DisguiseBaseCommand implements TabCompl
if (help != null) { if (help != null) {
if (help.hasValues() && help.canTranslateValues()) { if (help.hasValues() && help.canTranslateValues()) {
sender.sendMessage(LibsMsg.DHELP_HELP4.get(help.getName(), DisguiseUtilities.sendMessage(sender, LibsMsg.DHELP_HELP4, help.getName(),
StringUtils.join(help.getEnums(""), LibsMsg.DHELP_HELP4_SEPERATOR.get()))); StringUtils.join(help.getEnums(""), LibsMsg.DHELP_HELP4_SEPERATOR.get()));
} else { } else {
if (!help.getName().equals(help.getDescriptiveName())) { if (!help.getName().equals(help.getDescriptiveName())) {
sender.sendMessage(LibsMsg.DHELP_HELP6 DisguiseUtilities
.get(help.getName(), help.getDescriptiveName(), help.getDescription())); .sendMessage(sender, LibsMsg.DHELP_HELP6, help.getName(), help.getDescriptiveName(),
help.getDescription());
} else { } 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)) { if (!perms.isAllowedDisguise(type)) {
sender.sendMessage(LibsMsg.NO_PERM_DISGUISE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM_DISGUISE);
return true; return true;
} }
@ -115,14 +118,14 @@ public class DisguiseHelpCommand extends DisguiseBaseCommand implements TabCompl
StringUtils.join(methods, ChatColor.DARK_RED + ", "))); StringUtils.join(methods, ChatColor.DARK_RED + ", ")));
if (ignored > 0) { if (ignored > 0) {
sender.sendMessage(LibsMsg.NO_PERMS_USE_OPTIONS.get(ignored)); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERMS_USE_OPTIONS, ignored);
} }
return true; return true;
} }
} }
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
@ -158,13 +161,13 @@ public class DisguiseHelpCommand extends DisguiseBaseCommand implements TabCompl
*/ */
@Override @Override
protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) {
sender.sendMessage(LibsMsg.DHELP_HELP1.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DHELP_HELP1);
sender.sendMessage(LibsMsg.DHELP_HELP2.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.DHELP_HELP2);
for (ParamInfo s : ParamInfoManager.getParamInfos()) { 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.getName().equals(s.getDescriptiveName()) ? " ~ " + s.getDescriptiveName() : ""),
s.getDescription())); s.getDescription());
} }
} }
} }

View File

@ -1,6 +1,7 @@
package me.libraryaddict.disguise.commands.utils; package me.libraryaddict.disguise.commands.utils;
import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
@ -15,7 +16,7 @@ public class DisguiseViewSelfCommand implements CommandExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender.getName().equals("CONSOLE")) { if (sender.getName().equals("CONSOLE")) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
@ -23,10 +24,10 @@ public class DisguiseViewSelfCommand implements CommandExecutor {
if (DisguiseAPI.isViewSelfToggled(player)) { if (DisguiseAPI.isViewSelfToggled(player)) {
DisguiseAPI.setViewDisguiseToggled(player, false); DisguiseAPI.setViewDisguiseToggled(player, false);
sender.sendMessage(LibsMsg.VIEW_SELF_OFF.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.VIEW_SELF_OFF);
} else { } else {
DisguiseAPI.setViewDisguiseToggled(player, true); DisguiseAPI.setViewDisguiseToggled(player, true);
sender.sendMessage(LibsMsg.VIEW_SELF_ON.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.VIEW_SELF_ON);
} }
return true; return true;

View File

@ -33,12 +33,12 @@ public class GrabHeadCommand implements CommandExecutor {
} }
if (!sender.hasPermission("libsdisguises.grabhead")) { if (!sender.hasPermission("libsdisguises.grabhead")) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
if (!(sender instanceof Player)) { if (!(sender instanceof Player)) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
@ -61,7 +61,7 @@ public class GrabHeadCommand implements CommandExecutor {
private BukkitTask runnable = new BukkitRunnable() { private BukkitTask runnable = new BukkitRunnable() {
@Override @Override
public void run() { public void run() {
sender.sendMessage(LibsMsg.PLEASE_WAIT.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.PLEASE_WAIT);
} }
}.runTaskTimer(LibsDisguises.getInstance(), 100, 100); }.runTaskTimer(LibsDisguises.getInstance(), 100, 100);
@ -101,7 +101,7 @@ public class GrabHeadCommand implements CommandExecutor {
skull.setItemMeta(meta); skull.setItemMeta(meta);
((Player) sender).getInventory().addItem(skull); ((Player) sender).getInventory().addItem(skull);
sender.sendMessage(LibsMsg.GRAB_HEAD_SUCCESS.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_HEAD_SUCCESS);
} }
}.runTask(LibsDisguises.getInstance()); }.runTask(LibsDisguises.getInstance());
} }
@ -113,11 +113,11 @@ public class GrabHeadCommand implements CommandExecutor {
} }
private void sendHelp(CommandSender sender) { private void sendHelp(CommandSender sender) {
sender.sendMessage(LibsMsg.GRAB_DISG_HELP_1.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_1);
sender.sendMessage(LibsMsg.GRAB_DISG_HELP_2.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_2);
sender.sendMessage(LibsMsg.GRAB_DISG_HELP_3.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_3);
sender.sendMessage(LibsMsg.GRAB_DISG_HELP_4.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_4);
sender.sendMessage(LibsMsg.GRAB_DISG_HELP_5.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_5);
sender.sendMessage(LibsMsg.GRAB_DISG_HELP_6.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_6);
} }
} }

View File

@ -35,7 +35,7 @@ public class GrabSkinCommand implements CommandExecutor {
} }
if (!sender.hasPermission("libsdisguises.grabskin")) { if (!sender.hasPermission("libsdisguises.grabskin")) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
@ -69,7 +69,7 @@ public class GrabSkinCommand implements CommandExecutor {
private BukkitTask runnable = new BukkitRunnable() { private BukkitTask runnable = new BukkitRunnable() {
@Override @Override
public void run() { public void run() {
sender.sendMessage(LibsMsg.PLEASE_WAIT.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.PLEASE_WAIT);
} }
}.runTaskTimer(LibsDisguises.getInstance(), 100, 100); }.runTaskTimer(LibsDisguises.getInstance(), 100, 100);
@ -107,7 +107,7 @@ public class GrabSkinCommand implements CommandExecutor {
} }
DisguiseAPI.addGameProfile(nName, profile); DisguiseAPI.addGameProfile(nName, profile);
sender.sendMessage(LibsMsg.GRABBED_SKIN.get(nName)); DisguiseUtilities.sendMessage(sender, LibsMsg.GRABBED_SKIN, nName);
String string = DisguiseUtilities.getGson().toJson(profile); String string = DisguiseUtilities.getGson().toJson(profile);
int start = 0; int start = 0;
@ -140,7 +140,7 @@ public class GrabSkinCommand implements CommandExecutor {
sender.spigot().sendMessage(builder.create()); sender.spigot().sendMessage(builder.create());
} else { } else {
sender.sendMessage(LibsMsg.SKIN_DATA.get(string)); DisguiseUtilities.sendMessage(sender, LibsMsg.SKIN_DATA, string);
} }
DisguiseUtilities.setGrabSkinCommandUsed(); DisguiseUtilities.setGrabSkinCommandUsed();
@ -153,11 +153,11 @@ public class GrabSkinCommand implements CommandExecutor {
} }
private void sendHelp(CommandSender sender) { private void sendHelp(CommandSender sender) {
sender.sendMessage(LibsMsg.GRAB_DISG_HELP_1.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_1);
sender.sendMessage(LibsMsg.GRAB_DISG_HELP_2.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_2);
sender.sendMessage(LibsMsg.GRAB_DISG_HELP_3.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_3);
sender.sendMessage(LibsMsg.GRAB_DISG_HELP_4.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_4);
sender.sendMessage(LibsMsg.GRAB_DISG_HELP_5.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_5);
sender.sendMessage(LibsMsg.GRAB_DISG_HELP_6.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.GRAB_DISG_HELP_6);
} }
} }

View File

@ -35,7 +35,7 @@ public class SaveDisguiseCommand implements CommandExecutor {
} }
if (!sender.hasPermission("libsdisguises.savedisguise")) { if (!sender.hasPermission("libsdisguises.savedisguise")) {
sender.sendMessage(LibsMsg.NO_PERM.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_PERM);
return true; return true;
} }
@ -51,14 +51,14 @@ public class SaveDisguiseCommand implements CommandExecutor {
if (args.length == 0) { if (args.length == 0) {
if (!(sender instanceof Player)) { if (!(sender instanceof Player)) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true; return true;
} }
Disguise disguise = DisguiseAPI.getDisguise((Entity) sender); Disguise disguise = DisguiseAPI.getDisguise((Entity) sender);
if (disguise == null) { if (disguise == null) {
sender.sendMessage(LibsMsg.NOT_DISGUISED.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.NOT_DISGUISED);
return true; return true;
} }
@ -67,13 +67,13 @@ public class SaveDisguiseCommand implements CommandExecutor {
try { try {
DisguiseAPI.addCustomDisguise(name, disguiseString); DisguiseAPI.addCustomDisguise(name, disguiseString);
sender.sendMessage(LibsMsg.CUSTOM_DISGUISE_SAVED.get(name)); DisguiseUtilities.sendMessage(sender, LibsMsg.CUSTOM_DISGUISE_SAVED, name);
} }
catch (DisguiseParseException e) { catch (DisguiseParseException e) {
if (e.getMessage() != null) { if (e.getMessage() != null) {
sender.sendMessage(e.getMessage()); sender.sendMessage(e.getMessage());
} else { } 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() { private BukkitTask runnable = new BukkitRunnable() {
@Override @Override
public void run() { public void run() {
sender.sendMessage(LibsMsg.PLEASE_WAIT.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.PLEASE_WAIT);
} }
}.runTaskTimer(LibsDisguises.getInstance(), 100, 100); }.runTaskTimer(LibsDisguises.getInstance(), 100, 100);
@ -163,7 +163,7 @@ public class SaveDisguiseCommand implements CommandExecutor {
try { try {
DisguiseAPI.addCustomDisguise(name, disguiseString); DisguiseAPI.addCustomDisguise(name, disguiseString);
sender.sendMessage(LibsMsg.CUSTOM_DISGUISE_SAVED.get(name)); DisguiseUtilities.sendMessage(sender, LibsMsg.CUSTOM_DISGUISE_SAVED, name);
DisguiseUtilities.setSaveDisguiseCommandUsed(); DisguiseUtilities.setSaveDisguiseCommandUsed();
} }
@ -171,17 +171,17 @@ public class SaveDisguiseCommand implements CommandExecutor {
if (e.getMessage() != null) { if (e.getMessage() != null) {
sender.sendMessage(e.getMessage()); sender.sendMessage(e.getMessage());
} else { } else {
sender.sendMessage(LibsMsg.PARSE_CANT_LOAD.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.PARSE_CANT_LOAD);
} }
} }
} }
private void sendHelp(CommandSender sender) { private void sendHelp(CommandSender sender) {
sender.sendMessage(LibsMsg.SAVE_DISG_HELP_1.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.SAVE_DISG_HELP_1);
sender.sendMessage(LibsMsg.SAVE_DISG_HELP_2.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.SAVE_DISG_HELP_2);
sender.sendMessage(LibsMsg.SAVE_DISG_HELP_3.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.SAVE_DISG_HELP_3);
sender.sendMessage(LibsMsg.SAVE_DISG_HELP_4.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.SAVE_DISG_HELP_4);
sender.sendMessage(LibsMsg.SAVE_DISG_HELP_5.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.SAVE_DISG_HELP_5);
sender.sendMessage(LibsMsg.SAVE_DISG_HELP_6.get()); DisguiseUtilities.sendMessage(sender, LibsMsg.SAVE_DISG_HELP_6);
} }
} }

View File

@ -1,7 +1,13 @@
package me.libraryaddict.disguise.disguisetypes; package me.libraryaddict.disguise.disguisetypes;
public enum RabbitType { 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) { public static RabbitType getType(int id) {
for (RabbitType type : values()) { for (RabbitType type : values()) {

View File

@ -3,22 +3,17 @@ package me.libraryaddict.disguise.disguisetypes.watchers;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
import me.libraryaddict.disguise.disguisetypes.MetaIndex; import me.libraryaddict.disguise.disguisetypes.MetaIndex;
public class BlazeWatcher extends InsentientWatcher public class BlazeWatcher extends InsentientWatcher {
{ public BlazeWatcher(Disguise disguise) {
public BlazeWatcher(Disguise disguise)
{
super(disguise); super(disguise);
} }
public boolean isBlazing() public boolean isBlazing() {
{
return getData(MetaIndex.BLAZE_BLAZING) == 1; return getData(MetaIndex.BLAZE_BLAZING) == 1;
} }
public void setBlazing(boolean isBlazing) public void setBlazing(boolean isBlazing) {
{
setData(MetaIndex.BLAZE_BLAZING, (byte) (isBlazing ? 1 : 0)); setData(MetaIndex.BLAZE_BLAZING, (byte) (isBlazing ? 1 : 0));
sendData(MetaIndex.BLAZE_BLAZING); sendData(MetaIndex.BLAZE_BLAZING);
} }
} }

View File

@ -3,34 +3,27 @@ package me.libraryaddict.disguise.disguisetypes.watchers;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
import me.libraryaddict.disguise.disguisetypes.MetaIndex; 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); super(disguise);
} }
public boolean isIgnited() public boolean isIgnited() {
{
return getData(MetaIndex.CREEPER_IGNITED); return getData(MetaIndex.CREEPER_IGNITED);
} }
public boolean isPowered() public boolean isPowered() {
{
return getData(MetaIndex.CREEPER_POWERED); return getData(MetaIndex.CREEPER_POWERED);
} }
public void setIgnited(boolean ignited) public void setIgnited(boolean ignited) {
{
setData(MetaIndex.CREEPER_IGNITED, ignited); setData(MetaIndex.CREEPER_IGNITED, ignited);
sendData(MetaIndex.CREEPER_IGNITED); sendData(MetaIndex.CREEPER_IGNITED);
} }
public void setPowered(boolean powered) public void setPowered(boolean powered) {
{
setData(MetaIndex.CREEPER_POWERED, powered); setData(MetaIndex.CREEPER_POWERED, powered);
sendData(MetaIndex.CREEPER_POWERED); sendData(MetaIndex.CREEPER_POWERED);
} }
} }

View File

@ -7,5 +7,4 @@ public class DonkeyWatcher extends ChestedHorseWatcher {
public DonkeyWatcher(Disguise disguise) { public DonkeyWatcher(Disguise disguise) {
super(disguise); super(disguise);
} }
} }

View File

@ -6,21 +6,17 @@ import me.libraryaddict.disguise.disguisetypes.MetaIndex;
/** /**
* @author Navid * @author Navid
*/ */
public class EnderDragonWatcher extends InsentientWatcher public class EnderDragonWatcher extends InsentientWatcher {
{
public EnderDragonWatcher(Disguise disguise) public EnderDragonWatcher(Disguise disguise) {
{
super(disguise); super(disguise);
} }
public int getPhase() public int getPhase() {
{
return getData(MetaIndex.ENDER_DRAGON_PHASE); return getData(MetaIndex.ENDER_DRAGON_PHASE);
} }
public void setPhase(int phase) public void setPhase(int phase) {
{
setData(MetaIndex.ENDER_DRAGON_PHASE, phase); setData(MetaIndex.ENDER_DRAGON_PHASE, phase);
sendData(MetaIndex.ENDER_DRAGON_PHASE); sendData(MetaIndex.ENDER_DRAGON_PHASE);
} }

View File

@ -3,23 +3,18 @@ package me.libraryaddict.disguise.disguisetypes.watchers;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
import me.libraryaddict.disguise.disguisetypes.MetaIndex; 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); super(disguise);
} }
public boolean isAggressive() public boolean isAggressive() {
{
return getData(MetaIndex.GHAST_AGRESSIVE); return getData(MetaIndex.GHAST_AGRESSIVE);
} }
public void setAggressive(boolean isAggressive) public void setAggressive(boolean isAggressive) {
{
setData(MetaIndex.GHAST_AGRESSIVE, isAggressive); setData(MetaIndex.GHAST_AGRESSIVE, isAggressive);
sendData(MetaIndex.GHAST_AGRESSIVE); sendData(MetaIndex.GHAST_AGRESSIVE);
} }
} }

View File

@ -2,11 +2,8 @@ package me.libraryaddict.disguise.disguisetypes.watchers;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
public class IronGolemWatcher extends InsentientWatcher public class IronGolemWatcher extends InsentientWatcher {
{ public IronGolemWatcher(Disguise disguise) {
public IronGolemWatcher(Disguise disguise)
{
super(disguise); super(disguise);
} }
} }

View File

@ -39,5 +39,4 @@ public class ItemFrameWatcher extends FlagWatcher {
setData(MetaIndex.ITEMFRAME_ROTATION, rotation % 4); setData(MetaIndex.ITEMFRAME_ROTATION, rotation % 4);
sendData(MetaIndex.ITEMFRAME_ROTATION); sendData(MetaIndex.ITEMFRAME_ROTATION);
} }
} }

View File

@ -7,5 +7,4 @@ public class MuleWatcher extends ChestedHorseWatcher {
public MuleWatcher(Disguise disguise) { public MuleWatcher(Disguise disguise) {
super(disguise); super(disguise);
} }
} }

View File

@ -5,38 +5,31 @@ import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import org.bukkit.Art; import org.bukkit.Art;
public class PaintingWatcher extends FlagWatcher public class PaintingWatcher extends FlagWatcher {
{
private Art painting; private Art painting;
public PaintingWatcher(Disguise disguise) public PaintingWatcher(Disguise disguise) {
{
super(disguise); super(disguise);
} }
@Override @Override
public PaintingWatcher clone(Disguise disguise) public PaintingWatcher clone(Disguise disguise) {
{
PaintingWatcher watcher = (PaintingWatcher) super.clone(disguise); PaintingWatcher watcher = (PaintingWatcher) super.clone(disguise);
watcher.setArt(getArt()); watcher.setArt(getArt());
return watcher; return watcher;
} }
public Art getArt() public Art getArt() {
{
return painting; return painting;
} }
public void setArt(Art newPainting) public void setArt(Art newPainting) {
{
this.painting = newPainting; this.painting = newPainting;
if (getDisguise().getEntity() != null && getDisguise().getWatcher() == this) if (getDisguise().getEntity() != null && getDisguise().getWatcher() == this) {
{
DisguiseUtilities.refreshTrackers(getDisguise()); DisguiseUtilities.refreshTrackers(getDisguise());
} }
} }
} }

View File

@ -3,21 +3,17 @@ package me.libraryaddict.disguise.disguisetypes.watchers;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
import me.libraryaddict.disguise.disguisetypes.MetaIndex; import me.libraryaddict.disguise.disguisetypes.MetaIndex;
public class PolarBearWatcher extends AgeableWatcher public class PolarBearWatcher extends AgeableWatcher {
{ public PolarBearWatcher(Disguise disguise) {
public PolarBearWatcher(Disguise disguise)
{
super(disguise); super(disguise);
} }
public void setStanding(boolean standing) public void setStanding(boolean standing) {
{
setData(MetaIndex.POLAR_BEAR_STANDING, standing); setData(MetaIndex.POLAR_BEAR_STANDING, standing);
sendData(MetaIndex.POLAR_BEAR_STANDING); sendData(MetaIndex.POLAR_BEAR_STANDING);
} }
public boolean isStanding() public boolean isStanding() {
{
return getData(MetaIndex.POLAR_BEAR_STANDING); return getData(MetaIndex.POLAR_BEAR_STANDING);
} }
} }

View File

@ -7,5 +7,4 @@ public class SkeletonHorseWatcher extends AbstractHorseWatcher {
public SkeletonHorseWatcher(Disguise disguise) { public SkeletonHorseWatcher(Disguise disguise) {
super(disguise); super(disguise);
} }
} }

View File

@ -3,21 +3,17 @@ package me.libraryaddict.disguise.disguisetypes.watchers;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
import me.libraryaddict.disguise.disguisetypes.MetaIndex; import me.libraryaddict.disguise.disguisetypes.MetaIndex;
public class SpiderWatcher extends InsentientWatcher public class SpiderWatcher extends InsentientWatcher {
{ public SpiderWatcher(Disguise disguise) {
public SpiderWatcher(Disguise disguise)
{
super(disguise); super(disguise);
} }
public void setClimbing(boolean climbing) public void setClimbing(boolean climbing) {
{
setData(MetaIndex.SPIDER_CLIMB, (byte) (climbing ? 1 : 0)); setData(MetaIndex.SPIDER_CLIMB, (byte) (climbing ? 1 : 0));
sendData(MetaIndex.SPIDER_CLIMB); sendData(MetaIndex.SPIDER_CLIMB);
} }
public boolean isClimbing() public boolean isClimbing() {
{
return getData(MetaIndex.SPIDER_CLIMB) == (byte) 1; return getData(MetaIndex.SPIDER_CLIMB) == (byte) 1;
} }
} }

View File

@ -41,5 +41,4 @@ public class SplashPotionWatcher extends FlagWatcher {
DisguiseUtilities.refreshTrackers(getDisguise()); DisguiseUtilities.refreshTrackers(getDisguise());
} }
} }
} }

View File

@ -2,10 +2,8 @@ package me.libraryaddict.disguise.disguisetypes.watchers;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
public class SquidWatcher extends InsentientWatcher public class SquidWatcher extends InsentientWatcher {
{ public SquidWatcher(Disguise disguise) {
public SquidWatcher(Disguise disguise)
{
super(disguise); super(disguise);
} }
} }

View File

@ -3,10 +3,8 @@ package me.libraryaddict.disguise.disguisetypes.watchers;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
import me.libraryaddict.disguise.disguisetypes.FlagWatcher; import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
public class TNTWatcher extends FlagWatcher public class TNTWatcher extends FlagWatcher {
{ public TNTWatcher(Disguise disguise) {
public TNTWatcher(Disguise disguise)
{
super(disguise); super(disguise);
} }
} }

View File

@ -17,5 +17,4 @@ public class VexWatcher extends InsentientWatcher {
public boolean isAngry() { public boolean isAngry() {
return getData(MetaIndex.VEX_ANGRY) == 1; return getData(MetaIndex.VEX_ANGRY) == 1;
} }
} }

View File

@ -4,23 +4,18 @@ import me.libraryaddict.disguise.disguisetypes.Disguise;
import me.libraryaddict.disguise.disguisetypes.FlagWatcher; import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
import me.libraryaddict.disguise.disguisetypes.MetaIndex; 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); super(disguise);
} }
public boolean isBlue() public boolean isBlue() {
{
return getData(MetaIndex.WITHER_SKULL_BLUE); return getData(MetaIndex.WITHER_SKULL_BLUE);
} }
public void setBlue(boolean blue) public void setBlue(boolean blue) {
{
setData(MetaIndex.WITHER_SKULL_BLUE, blue); setData(MetaIndex.WITHER_SKULL_BLUE, blue);
sendData(MetaIndex.WITHER_SKULL_BLUE); sendData(MetaIndex.WITHER_SKULL_BLUE);
} }
} }

View File

@ -6,11 +6,9 @@ import org.bukkit.ChatColor;
import java.security.InvalidParameterException; import java.security.InvalidParameterException;
public class WitherWatcher extends InsentientWatcher public class WitherWatcher extends InsentientWatcher {
{
public WitherWatcher(Disguise disguise) public WitherWatcher(Disguise disguise) {
{
super(disguise); super(disguise);
} }
@ -19,32 +17,25 @@ public class WitherWatcher extends InsentientWatcher
* *
* @return * @return
*/ */
public int getInvulnerability() public int getInvulnerability() {
{
return getData(MetaIndex.WITHER_INVUL); return getData(MetaIndex.WITHER_INVUL);
} }
public int[] getTargets() public int[] getTargets() {
{ return new int[]{getData(MetaIndex.WITHER_TARGET_1), getData(MetaIndex.WITHER_TARGET_2),
return new int[] getData(MetaIndex.WITHER_TARGET_3)};
{
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 * 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); setData(MetaIndex.WITHER_INVUL, invulnerability);
sendData(MetaIndex.WITHER_INVUL); sendData(MetaIndex.WITHER_INVUL);
} }
public void setTargets(int... targets) public void setTargets(int... targets) {
{ if (targets.length != 3) {
if (targets.length != 3)
{
throw new InvalidParameterException( throw new InvalidParameterException(
ChatColor.RED + "Expected 3 numbers for wither setTargets. Received " + targets.length); 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]); setData(MetaIndex.WITHER_TARGET_3, targets[2]);
sendData(MetaIndex.WITHER_TARGET_1, MetaIndex.WITHER_TARGET_2, MetaIndex.WITHER_TARGET_3); sendData(MetaIndex.WITHER_TARGET_1, MetaIndex.WITHER_TARGET_2, MetaIndex.WITHER_TARGET_3);
} }
} }

View File

@ -7,5 +7,4 @@ public class ZombieHorseWatcher extends AbstractHorseWatcher {
public ZombieHorseWatcher(Disguise disguise) { public ZombieHorseWatcher(Disguise disguise) {
super(disguise); super(disguise);
} }
} }

View File

@ -40,6 +40,7 @@ import org.apache.commons.lang.math.RandomUtils;
import org.apache.logging.log4j.util.Strings; import org.apache.logging.log4j.util.Strings;
import org.bukkit.*; import org.bukkit.*;
import org.bukkit.boss.KeyedBossBar; import org.bukkit.boss.KeyedBossBar;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.*; import org.bukkit.entity.*;
import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -280,10 +281,10 @@ public class DisguiseUtilities {
if (reference != null && DisguiseUtilities.addClonedDisguise(reference, disguise)) { if (reference != null && DisguiseUtilities.addClonedDisguise(reference, disguise)) {
String entityName = DisguiseType.getType(toClone).toReadable(); String entityName = DisguiseType.getType(toClone).toReadable();
player.sendMessage(LibsMsg.MADE_REF.get(entityName, reference)); DisguiseUtilities.sendMessage(player, LibsMsg.MADE_REF, entityName, reference);
player.sendMessage(LibsMsg.MADE_REF_EXAMPLE.get(reference)); DisguiseUtilities.sendMessage(player, LibsMsg.MADE_REF_EXAMPLE, reference);
} else { } 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(); 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() { public static Logger getLogger() {
return LibsDisguises.getInstance().getLogger(); return LibsDisguises.getInstance().getLogger();
} }

View File

@ -9,7 +9,8 @@ import java.lang.reflect.Type;
/** /**
* Created by libraryaddict on 1/06/2017. * Created by libraryaddict on 1/06/2017.
*/ */
public class SerializerWrappedBlockData implements JsonSerializer<WrappedBlockData>, JsonDeserializer<WrappedBlockData> { public class SerializerWrappedBlockData implements JsonSerializer<WrappedBlockData>,
JsonDeserializer<WrappedBlockData> {
@Override @Override
public JsonElement serialize(WrappedBlockData src, Type typeOfSrc, JsonSerializationContext context) { public JsonElement serialize(WrappedBlockData src, Type typeOfSrc, JsonSerializationContext context) {

View File

@ -18,7 +18,7 @@ import me.libraryaddict.disguise.events.DisguiseInteractEvent;
import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.*; import org.bukkit.entity.Player;
import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;

View File

@ -140,13 +140,13 @@ public class PacketListenerModdedClient extends PacketAdapter {
PacketContainer packet1 = new PacketContainer(PacketType.Login.Server.CUSTOM_PAYLOAD); PacketContainer packet1 = new PacketContainer(PacketType.Login.Server.CUSTOM_PAYLOAD);
packet1.getIntegers().write(0, packetId1); packet1.getIntegers().write(0, packetId1);
packet1.getMinecraftKeys().write(0, new com.comphenix.protocol.wrappers.MinecraftKey("fml", "handshake")); packet1.getMinecraftKeys().write(0, new com.comphenix.protocol.wrappers.MinecraftKey("fml", "handshake"));
// packet1.getModifier() // packet1.getModifier()
// .write(2, new PacketDataSerializer(Unpooled.wrappedBuffer(ModdedManager.getFmlHandshake()))); // .write(2, new PacketDataSerializer(Unpooled.wrappedBuffer(ModdedManager.getFmlHandshake())));
PacketContainer packet2 = new PacketContainer(PacketType.Login.Server.CUSTOM_PAYLOAD); PacketContainer packet2 = new PacketContainer(PacketType.Login.Server.CUSTOM_PAYLOAD);
packet2.getIntegers().write(0, packetId2); packet2.getIntegers().write(0, packetId2);
packet2.getMinecraftKeys().write(0, new MinecraftKey("fml", "handshake")); packet2.getMinecraftKeys().write(0, new MinecraftKey("fml", "handshake"));
// packet2.getModifier() // packet2.getModifier()
// .write(2, new PacketDataSerializer(Unpooled.wrappedBuffer(ModdedManager.getFmlRegistries()))); // .write(2, new PacketDataSerializer(Unpooled.wrappedBuffer(ModdedManager.getFmlRegistries())));
//TODO //TODO

View File

@ -54,10 +54,8 @@ public class PacketListenerTabList extends PacketAdapter {
if (list.isEmpty()) { if (list.isEmpty()) {
event.setCancelled(true); event.setCancelled(true);
} } else {
else {
event.getPacket().getPlayerInfoDataLists().write(0, list); event.getPacket().getPlayerInfoDataLists().write(0, list);
} }
} }
} }

View File

@ -23,5 +23,4 @@ public class FakeBoundingBox {
public double getZ() { public double getZ() {
return zMod / 2; return zMod / 2;
} }
} }

View File

@ -5,5 +5,4 @@ import com.comphenix.protocol.wrappers.WrappedGameProfile;
public interface LibsProfileLookup { public interface LibsProfileLookup {
void onLookup(WrappedGameProfile gameProfile); void onLookup(WrappedGameProfile gameProfile);
} }

View File

@ -20,5 +20,4 @@ public class LibsProfileLookupCaller implements ProfileLookupCallback {
public void onProfileLookupSucceeded(GameProfile profile) { public void onProfileLookupSucceeded(GameProfile profile) {
gameProfile = WrappedGameProfile.fromHandle(profile); gameProfile = WrappedGameProfile.fromHandle(profile);
} }
} }

View File

@ -9,7 +9,9 @@ import java.util.Map;
* Created by libraryaddict on 17/02/2020. * Created by libraryaddict on 17/02/2020.
*/ */
public interface IAsm { public interface IAsm {
Class<?> createClassWithoutMethods(String className, ArrayList<Map.Entry<String, String>> illegalMethods) throws IOException, InvocationTargetException, IllegalAccessException, NoSuchMethodException, NoSuchFieldException; Class<?> createClassWithoutMethods(String className,
ArrayList<Map.Entry<String, String>> illegalMethods) throws IOException, InvocationTargetException,
IllegalAccessException, NoSuchMethodException, NoSuchFieldException;
} }

View File

@ -1,9 +1,15 @@
package me.libraryaddict.disguise.utilities.translations; package me.libraryaddict.disguise.utilities.translations;
import me.libraryaddict.disguise.utilities.DisguiseUtilities; 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.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** /**
* Created by libraryaddict on 15/06/2017. * 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.."); SELF_DISGUISE_HIDDEN(ChatColor.GREEN + "Self disguise hidden as it's too tall..");
private final String string; 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) { LibsMsg(String string) {
this.string = string; this.string = string;
@ -360,6 +375,35 @@ public enum LibsMsg {
return string; 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) { public String get(Object... strings) {
if (StringUtils.countMatches(getRaw(), "%s") != strings.length) { if (StringUtils.countMatches(getRaw(), "%s") != strings.length) {
DisguiseUtilities.getLogger().severe("Mismatch in messages, incorrect parameters supplied for " + name() + DisguiseUtilities.getLogger().severe("Mismatch in messages, incorrect parameters supplied for " + name() +

View File

@ -80,7 +80,7 @@ public enum TranslateType {
} }
if (!getFile().exists()) { if (!getFile().exists()) {
DisguiseUtilities.getLogger().info("Translations for " + name() + " missing! Skipping..."); DisguiseUtilities.getLogger().info("Translations for " + name() + " missing! Saving..");
return; return;
} }
@ -182,6 +182,7 @@ public enum TranslateType {
writer.write( writer.write(
"# To translate, follow this example 'Original Message': 'My New Message'\n# The Original" + "# 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!"); " 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");
} }
} }

View File

@ -9,85 +9,85 @@ authors: [Byteflux, Navid K.]
depend: [ProtocolLib] depend: [ProtocolLib]
api-version: '1.13' api-version: '1.13'
commands: commands:
libsdisguises: libsdisguises:
aliases: [libsdisg, ld] aliases: [libsdisg, ld]
description: Main command for libsdisguises. description: Main command for libsdisguises.
disguise: disguise:
aliases: [d, dis, disg] aliases: [d, dis, disg]
permission: libsdisguises.seecmd.disguise permission: libsdisguises.seecmd.disguise
description: Disguise yourself as an entity. description: Disguise yourself as an entity.
disguiseentity: disguiseentity:
aliases: [dentity, disentity, disgentity] aliases: [dentity, disentity, disgentity]
permission: libsdisguises.seecmd.disguiseentity permission: libsdisguises.seecmd.disguiseentity
description: Disguise an entity as another entity. description: Disguise an entity as another entity.
disguisehelp: disguisehelp:
aliases: [dhelp, dishelp, disghelp] aliases: [dhelp, dishelp, disghelp]
permission: libsdisguises.seecmd.disguisehelp permission: libsdisguises.seecmd.disguisehelp
description: Help command for LibsDisguises. description: Help command for LibsDisguises.
disguiseplayer: disguiseplayer:
aliases: [dplayer, displayer, disgplayer, disguiseuuid, disguuid, duuid] aliases: [dplayer, displayer, disgplayer, disguiseuuid, disguuid, duuid]
permission: libsdisguises.seecmd.disguiseplayer permission: libsdisguises.seecmd.disguiseplayer
description: Disguise another player as an entity. description: Disguise another player as an entity.
disguiseradius: disguiseradius:
aliases: [disradius, dradius, disgradius] aliases: [disradius, dradius, disgradius]
permission: libsdisguises.seecmd.disguiseradius permission: libsdisguises.seecmd.disguiseradius
description: Disguise all entities within a radius as an entity. description: Disguise all entities within a radius as an entity.
undisguise: undisguise:
aliases: [u, und, undis, undisg] aliases: [u, und, undis, undisg]
permission: libsdisguises.seecmd.undisguise permission: libsdisguises.seecmd.undisguise
description: Undisguise yourself. description: Undisguise yourself.
undisguiseentity: undisguiseentity:
aliases: [undisentity, undentity, undisgentity] aliases: [undisentity, undentity, undisgentity]
permission: libsdisguises.seecmd.undisguiseentity permission: libsdisguises.seecmd.undisguiseentity
description: Undisguise an entity. description: Undisguise an entity.
undisguiseplayer: undisguiseplayer:
aliases: [undisplayer, undplayer, undisgplayer, undisguiseuuid, unduuid, undisguuid] aliases: [undisplayer, undplayer, undisgplayer, undisguiseuuid, unduuid, undisguuid]
permission: libsdisguises.seecmd.undisguiseplayer permission: libsdisguises.seecmd.undisguiseplayer
description: Undisguise a player. description: Undisguise a player.
undisguiseradius: undisguiseradius:
aliases: [undisradius, undradius, undisgradius] aliases: [undisradius, undradius, undisgradius]
permission: libsdisguises.seecmd.undisguiseradius permission: libsdisguises.seecmd.undisguiseradius
description: Undisguise all entities within a radius. description: Undisguise all entities within a radius.
disguiseclone: disguiseclone:
aliases: [disguisec, disc, disclone, dclone, clonedisguise, clonedis, cdisguise, cdis, clonedisg, disgclone] aliases: [disguisec, disc, disclone, dclone, clonedisguise, clonedis, cdisguise, cdis, clonedisg, disgclone]
permission: libsdisguises.seecmd.disguiseclone permission: libsdisguises.seecmd.disguiseclone
description: Copy a disguise (or entity) and use it later. description: Copy a disguise (or entity) and use it later.
disguiseviewself: disguiseviewself:
aliases: [dviewself, dvs, disguisevs, disvs, vsd, viewselfdisguise, viewselfd, selfdisguise, selfdisg, selfd] aliases: [dviewself, dvs, disguisevs, disvs, vsd, viewselfdisguise, viewselfd, selfdisguise, selfdisg, selfd]
permission: libsdisguises.seecmd.viewself permission: libsdisguises.seecmd.viewself
description: Toggle seeing your own disguise on or off. description: Toggle seeing your own disguise on or off.
disguisemodify: disguisemodify:
aliases: [dmodify, dmod, disgmodify] aliases: [dmodify, dmod, disgmodify]
permission: libsdisguises.seecmd.disguisemodify permission: libsdisguises.seecmd.disguisemodify
description: Modify your own disguise description: Modify your own disguise
disguisemodifyplayer: disguisemodifyplayer:
aliases: [dmodifyplayer, dmodplayer, disgmodifyplayer, dismodplayer, disgmodplayer] aliases: [dmodifyplayer, dmodplayer, disgmodifyplayer, dismodplayer, disgmodplayer]
permission: libsdisguises.seecmd.disguisemodifyplayer permission: libsdisguises.seecmd.disguisemodifyplayer
description: Modify the disguise of a player description: Modify the disguise of a player
disguisemodifyradius: disguisemodifyradius:
aliases: [dmodifyradius, dmodradius, disgmodradius, dismodradius] aliases: [dmodifyradius, dmodradius, disgmodradius, dismodradius]
permission: libsdisguises.seecmd.disguisemodifyradius permission: libsdisguises.seecmd.disguisemodifyradius
description: Modify disguises in a radius description: Modify disguises in a radius
disguisemodifyentity: disguisemodifyentity:
aliases: [dmodifyentity, dmodentity, disgmodentity, dismodentity] aliases: [dmodifyentity, dmodentity, disgmodentity, dismodentity]
permission: libsdisguises.seecmd.disguisemodifyentity permission: libsdisguises.seecmd.disguisemodifyentity
description: Modify a disguise by right clicking them description: Modify a disguise by right clicking them
copydisguise: copydisguise:
aliases: [disguisecopy, disgcopy, dcopy, copydisg, copyd] aliases: [disguisecopy, disgcopy, dcopy, copydisg, copyd]
permission: libsdisguises.seecmd.copydisguise permission: libsdisguises.seecmd.copydisguise
description: Output a disguise to a usable string description: Output a disguise to a usable string
grabskin: grabskin:
aliases: [uploadskin, skin, saveskin] aliases: [uploadskin, skin, saveskin]
permission: libsdisguises.seecmd.grabskin permission: libsdisguises.seecmd.grabskin
description: Grab a skin from file, url or player name/uuid description: Grab a skin from file, url or player name/uuid
savedisguise: savedisguise:
aliases: [customdisguise, savedisg, customdisg, createdisguise, createdisg] aliases: [customdisguise, savedisg, customdisg, createdisguise, createdisg]
permission: libsdisguises.seecmd.savedisguise permission: libsdisguises.seecmd.savedisguise
description: Save a custom disguise to disguises.yml description: Save a custom disguise to disguises.yml
grabhead: grabhead:
aliases: [grabskull, playerhead, savehead, gethead] aliases: [grabskull, playerhead, savehead, gethead]
permission: libsdisguises.seecmd.grabhead permission: libsdisguises.seecmd.grabhead
description: Grab the head item of a skin, url or player description: Grab the head item of a skin, url or player
permissions: permissions:
libsdisguises.reload: libsdisguises.reload:
@ -133,25 +133,25 @@ permissions:
description: See all commands in tab-completion description: See all commands in tab-completion
default: true default: true
children: children:
libsdisguises.seecmd.disguise: true libsdisguises.seecmd.disguise: true
libsdisguises.seecmd.disguiseentity: true libsdisguises.seecmd.disguiseentity: true
libsdisguises.seecmd.disguisehelp: true libsdisguises.seecmd.disguisehelp: true
libsdisguises.seecmd.disguiseplayer: true libsdisguises.seecmd.disguiseplayer: true
libsdisguises.seecmd.disguiseradius: true libsdisguises.seecmd.disguiseradius: true
libsdisguises.seecmd.undisguise: true libsdisguises.seecmd.undisguise: true
libsdisguises.seecmd.undisguiseentity: true libsdisguises.seecmd.undisguiseentity: true
libsdisguises.seecmd.undisguiseplayer: true libsdisguises.seecmd.undisguiseplayer: true
libsdisguises.seecmd.undisguiseradius: true libsdisguises.seecmd.undisguiseradius: true
libsdisguises.seecmd.disguiseclone: true libsdisguises.seecmd.disguiseclone: true
libsdisguises.seecmd.disguiseviewself: true libsdisguises.seecmd.disguiseviewself: true
libsdisguises.seecmd.disguisemodify: true libsdisguises.seecmd.disguisemodify: true
libsdisguises.seecmd.disguisemodifyplayer: true libsdisguises.seecmd.disguisemodifyplayer: true
libsdisguises.seecmd.disguisemodifyradius: true libsdisguises.seecmd.disguisemodifyradius: true
libsdisguises.seecmd.disguisemodifyentity: true libsdisguises.seecmd.disguisemodifyentity: true
libsdisguises.seecmd.copydisguise: true libsdisguises.seecmd.copydisguise: true
libsdisguises.seecmd.grabskin: true libsdisguises.seecmd.grabskin: true
libsdisguises.seecmd.savedisguise: true libsdisguises.seecmd.savedisguise: true
libsdisguises.seecmd.grabhead: true libsdisguises.seecmd.grabhead: true
libsdisguises.seecmd.disguiseviewself: libsdisguises.seecmd.disguiseviewself:
description: See the /disguiseviewself command in tab-completion description: See the /disguiseviewself command in tab-completion
libsdisguises.seecmd.disguise: libsdisguises.seecmd.disguise:

View File

@ -19,7 +19,7 @@ public class DisguiseCloneTest {
/** /**
* MetaIndex needs ProtocolLib to have initialized so. * MetaIndex needs ProtocolLib to have initialized so.
*/ */
// @Test // @Test
public void testCloneDisguise() { public void testCloneDisguise() {
try { try {
ReflectionManager.registerValues(); ReflectionManager.registerValues();

View File

@ -16,8 +16,10 @@ public class DisguiseUtilitiesTest {
Assert.assertArrayEquals(new String[]{"Name 1\\", "Name 2"}, Assert.assertArrayEquals(new String[]{"Name 1\\", "Name 2"},
DisguiseUtilities.splitNewLine("Name 1\\\nName 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\\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\\", "Name 2"},
Assert.assertArrayEquals(new String[]{"Name 1\\\\nName 2"}, DisguiseUtilities.splitNewLine("Name 1\\\\\\\\nName 2")); DisguiseUtilities.splitNewLine("Name 1\\\\\\nName 2"));
Assert.assertArrayEquals(new String[]{"Name 1\\\\nName 2"},
DisguiseUtilities.splitNewLine("Name 1\\\\\\\\nName 2"));
} }
@Test @Test