diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-11-26 16:10:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-26 16:10:11 -0500 |
commit | 016814851e46acdbc7a8fce44746eb67feef5905 (patch) | |
tree | b39ca6496c233efe327dcdff0379f50b5cc6e243 /src/main/java/me/Danker/commands/GetkeyCommand.java | |
parent | 292f5dde43c3e00b78e1d4e772ae336340b0a834 (diff) | |
parent | 16f1cd3c009184e8c8f5c75b9afae9ca531d2fee (diff) | |
download | SkyblockMod-016814851e46acdbc7a8fce44746eb67feef5905.tar.gz SkyblockMod-016814851e46acdbc7a8fce44746eb67feef5905.tar.bz2 SkyblockMod-016814851e46acdbc7a8fce44746eb67feef5905.zip |
Merge pull request #30 from bowser0000/development
Diffstat (limited to 'src/main/java/me/Danker/commands/GetkeyCommand.java')
-rw-r--r-- | src/main/java/me/Danker/commands/GetkeyCommand.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/java/me/Danker/commands/GetkeyCommand.java b/src/main/java/me/Danker/commands/GetkeyCommand.java index 8a650de..e7dd051 100644 --- a/src/main/java/me/Danker/commands/GetkeyCommand.java +++ b/src/main/java/me/Danker/commands/GetkeyCommand.java @@ -4,6 +4,7 @@ import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; +import me.Danker.TheMod; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; @@ -11,7 +12,6 @@ import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; public class GetkeyCommand extends CommandBase implements ICommand { @@ -33,17 +33,16 @@ public class GetkeyCommand extends CommandBase implements ICommand { @Override public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { EntityPlayer player = (EntityPlayer)arg0; - ConfigHandler cf = new ConfigHandler(); Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); - StringSelection stringSelection = new StringSelection(cf.getString("api", "APIKey")); + StringSelection stringSelection = new StringSelection(ConfigHandler.getString("api", "APIKey")); - if (cf.getString("api", "APIKey").equals("")) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Set your API key using /setkey.")); + if (ConfigHandler.getString("api", "APIKey").equals("")) { + player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "API key not set. Set your API key using /setkey.")); } clipboard.setContents(stringSelection, null); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key is " + EnumChatFormatting.DARK_GREEN + cf.getString("api", "APIKey") + "\n" + - EnumChatFormatting.GREEN + "Your set API key has been copied to the clipboard.")); + player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Your set API key is " + TheMod.SECONDARY_COLOUR + ConfigHandler.getString("api", "APIKey") + "\n" + + TheMod.MAIN_COLOUR + " Your set API key has been copied to the clipboard.")); } |