mirror of
https://github.com/ryandw11/UltraChat.git
synced 2024-12-22 16:57:43 +01:00
commit
0d8168f16e
@ -34,4 +34,7 @@ sjoin-other-show: '&b%p Join/Leave message will now be shown!'
|
|||||||
sjoin-other-hide: '&b%p Join/Leave message will no longer be shown!'
|
sjoin-other-hide: '&b%p Join/Leave message will no longer be shown!'
|
||||||
help-page-error: '&cThere are only two help pages!'
|
help-page-error: '&cThere are only two help pages!'
|
||||||
chat-color-change: 'Your chat color has been changed!'
|
chat-color-change: 'Your chat color has been changed!'
|
||||||
|
no-perm-channel: '&cYou do not have permission for this command.'
|
||||||
|
channel-null: "That channel does not exist!"
|
||||||
|
error-channel-in: "Error: you are currently in the channel"
|
||||||
|
channel-change: "You are now in the channel %s !"
|
||||||
|
@ -40,7 +40,11 @@ public enum Lang {
|
|||||||
SJOIN_OTHER_SHOW("sjoin-other-show", "&b%p Join/Leave message will now be shown!"),
|
SJOIN_OTHER_SHOW("sjoin-other-show", "&b%p Join/Leave message will now be shown!"),
|
||||||
SJOIN_OTHER_HIDE("sjoin-other-hide", "&b%p Join/Leave message will no longer be shown!"),
|
SJOIN_OTHER_HIDE("sjoin-other-hide", "&b%p Join/Leave message will no longer be shown!"),
|
||||||
HELP_PAGE_ERROR("help-page-error", "&cThere are only two help pages!"),
|
HELP_PAGE_ERROR("help-page-error", "&cThere are only two help pages!"),
|
||||||
CHAT_COLOR_CHANGE("chat-color-change", "Your chat color has been changed!");
|
CHAT_COLOR_CHANGE("chat-color-change", "Your chat color has been changed!"),
|
||||||
|
NO_PERM_CHANNEL("no-perm-channel", "&cYou do not have permission for this command."),
|
||||||
|
CHANNEL_NULL("channel-null", "That channel does not exist!"),
|
||||||
|
ERROR_CHANNEL_IN("error-channel-in", "&cError: you are currently in the channel"),
|
||||||
|
CHANNEL_CHANGE("channel-change", "You are now in the channel %s !");
|
||||||
|
|
||||||
|
|
||||||
private String path;
|
private String path;
|
||||||
|
@ -26,7 +26,7 @@ public class ChannelCmd implements CommandExecutor {
|
|||||||
plugin = UltraChat.plugin;
|
plugin = UltraChat.plugin;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command cmd, String s, String[] args) {
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String s, @NotNull String[] args) {
|
||||||
|
|
||||||
|
|
||||||
Player p = (Player) sender;
|
Player p = (Player) sender;
|
||||||
@ -66,19 +66,19 @@ public class ChannelCmd implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(!plugin.channel.contains(args[0])){
|
if(!plugin.channel.contains(args[0])){
|
||||||
p.sendMessage(ChatColor.RED + "That channel does not exsist!");
|
p.sendMessage(Lang.CHANNEL_NULL.toString());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(plugin.data.getString(p.getUniqueId() + ".channel").equalsIgnoreCase(args[0])){
|
if(plugin.data.getString(p.getUniqueId() + ".channel").equalsIgnoreCase(args[0])){
|
||||||
p.sendMessage(ChatColor.RED + "Error: you are currently in the channel");
|
p.sendMessage(Lang.ERROR_CHANNEL_IN.toString());
|
||||||
}
|
}
|
||||||
else if(p.hasPermission(plugin.channel.getString(args[0] + ".permission")) || plugin.channel.getString(args[0] + ".permission").equalsIgnoreCase("none")){
|
else if(p.hasPermission(plugin.channel.getString(args[0] + ".permission")) || plugin.channel.getString(args[0] + ".permission").equalsIgnoreCase("none")){
|
||||||
plugin.data.set(p.getUniqueId() + ".channel", args[0]);
|
plugin.data.set(p.getUniqueId() + ".channel", args[0]);
|
||||||
plugin.saveFile();
|
plugin.saveFile();
|
||||||
p.sendMessage(ChatColor.BLUE + "You are now in the channel " + args[0] + "!");
|
p.sendMessage(Lang.CHANNEL_CHANGE.toString().replace("%s", args[0]));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
p.sendMessage(ChatColor.RED + "You do not have permission to join that channel.");
|
p.sendMessage(Lang.NO_PERM_CHANNEL.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user