Added savePreferences and config option for it, added command to view notify bar, cleaned up code, action bar and custom names now support hex colors, uses a better hex color system conversion

This commit is contained in:
libraryaddict
2020-07-03 17:08:58 +12:00
parent 13fedc4437
commit 3ced8ae9e4
11 changed files with 392 additions and 130 deletions

View File

@@ -0,0 +1,34 @@
package me.libraryaddict.disguise.commands.utils;
import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
* Created by libraryaddict on 2/07/2020.
*/
public class DisguiseViewBarCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender.getName().equals("CONSOLE")) {
DisguiseUtilities.sendMessage(sender, LibsMsg.NO_CONSOLE);
return true;
}
Player player = (Player) sender;
if (DisguiseAPI.isViewBarToggled(player)) {
DisguiseAPI.setViewBarToggled(player, false);
DisguiseUtilities.sendMessage(sender, LibsMsg.VIEW_BAR_OFF);
} else {
DisguiseAPI.setViewBarToggled(player, true);
DisguiseUtilities.sendMessage(sender, LibsMsg.VIEW_BAR_ON);
}
return true;
}
}