Fix players being sent they are allowed disguises when they're not
This commit is contained in:
parent
b501147b63
commit
c3fc37182e
@ -112,6 +112,12 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter
|
|||||||
@Override
|
@Override
|
||||||
protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) {
|
protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) {
|
||||||
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
|
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
|
||||||
|
|
||||||
|
if (allowedDisguises.isEmpty()) {
|
||||||
|
sender.sendMessage(LibsMsg.NO_PERM.get());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sender.sendMessage(LibsMsg.DISG_HELP1.get());
|
sender.sendMessage(LibsMsg.DISG_HELP1.get());
|
||||||
sender.sendMessage(
|
sender.sendMessage(
|
||||||
LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
|
LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
|
||||||
|
@ -92,6 +92,11 @@ public class DisguiseEntityCommand 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);
|
||||||
|
|
||||||
|
if (allowedDisguises.isEmpty()) {
|
||||||
|
sender.sendMessage(LibsMsg.NO_PERM.get());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sender.sendMessage(LibsMsg.DISG_ENT_HELP1.get());
|
sender.sendMessage(LibsMsg.DISG_ENT_HELP1.get());
|
||||||
sender.sendMessage(
|
sender.sendMessage(
|
||||||
LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
|
LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
|
||||||
|
@ -171,6 +171,11 @@ public class DisguisePlayerCommand 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);
|
||||||
|
|
||||||
|
if (allowedDisguises.isEmpty()) {
|
||||||
|
sender.sendMessage(LibsMsg.NO_PERM.get());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sender.sendMessage(LibsMsg.D_HELP1.get());
|
sender.sendMessage(LibsMsg.D_HELP1.get());
|
||||||
sender.sendMessage(
|
sender.sendMessage(
|
||||||
LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
|
LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
|
||||||
|
@ -277,6 +277,11 @@ public class DisguiseRadiusCommand 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);
|
||||||
|
|
||||||
|
if (allowedDisguises.isEmpty()) {
|
||||||
|
sender.sendMessage(LibsMsg.NO_PERM.get());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sender.sendMessage(LibsMsg.DRADIUS_HELP1.get(maxRadius));
|
sender.sendMessage(LibsMsg.DRADIUS_HELP1.get(maxRadius));
|
||||||
sender.sendMessage(
|
sender.sendMessage(
|
||||||
LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
|
LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
|
||||||
|
@ -1,17 +1,11 @@
|
|||||||
package me.libraryaddict.disguise.commands.utils;
|
package me.libraryaddict.disguise.commands.utils;
|
||||||
|
|
||||||
import com.comphenix.protocol.wrappers.WrappedGameProfile;
|
import com.comphenix.protocol.wrappers.WrappedGameProfile;
|
||||||
import me.libraryaddict.disguise.DisguiseAPI;
|
|
||||||
import me.libraryaddict.disguise.LibsDisguises;
|
import me.libraryaddict.disguise.LibsDisguises;
|
||||||
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
||||||
import me.libraryaddict.disguise.utilities.LibsPremium;
|
import me.libraryaddict.disguise.utilities.LibsPremium;
|
||||||
import me.libraryaddict.disguise.utilities.SkinUtils;
|
import me.libraryaddict.disguise.utilities.SkinUtils;
|
||||||
import me.libraryaddict.disguise.utilities.reflection.NmsVersion;
|
|
||||||
import me.libraryaddict.disguise.utilities.reflection.ReflectionManager;
|
|
||||||
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.ComponentBuilder;
|
|
||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
@ -121,7 +121,8 @@ public class ParamInfoManager {
|
|||||||
// Add these last as it's what we want to present to be called the least
|
// Add these last as it's what we want to present to be called the least
|
||||||
for (String methodName : new String[]{"setSelfDisguiseVisible", "setHideHeldItemFromSelf",
|
for (String methodName : new String[]{"setSelfDisguiseVisible", "setHideHeldItemFromSelf",
|
||||||
"setHideArmorFromSelf", "setHearSelfDisguise", "setHidePlayer", "setExpires", "setNotifyBar",
|
"setHideArmorFromSelf", "setHearSelfDisguise", "setHidePlayer", "setExpires", "setNotifyBar",
|
||||||
"setBossBarColor", "setBossBarStyle", "setTallDisguisesVisible", "setDynamicName", "setSoundGroup"}) {
|
"setBossBarColor", "setBossBarStyle", "setTallDisguisesVisible", "setDynamicName", "setSoundGroup",
|
||||||
|
"setDisguiseName"}) {
|
||||||
try {
|
try {
|
||||||
Class cl = boolean.class;
|
Class cl = boolean.class;
|
||||||
|
|
||||||
@ -139,6 +140,7 @@ public class ParamInfoManager {
|
|||||||
cl = BarStyle.class;
|
cl = BarStyle.class;
|
||||||
break;
|
break;
|
||||||
case "setSoundGroup":
|
case "setSoundGroup":
|
||||||
|
case "setDisguiseName":
|
||||||
cl = String.class;
|
cl = String.class;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user