aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-08-18 18:47:12 -0400
committerGitHub <noreply@github.com>2020-08-18 18:47:12 -0400
commit57af29e64bac4bc7fc8ccf8e3af69c4e1d89b448 (patch)
tree4ca77eced2ee0e563a71002b224d333815ad0575 /src/main/java/me/Danker
parent976e2efc4991202cf0d2dc86eb0d38a22be4de48 (diff)
parentda78feeab0e2af3c0f7f382eb79fa6f01d9fc7d2 (diff)
downloadSkyblockMod-57af29e64bac4bc7fc8ccf8e3af69c4e1d89b448.tar.gz
SkyblockMod-57af29e64bac4bc7fc8ccf8e3af69c4e1d89b448.tar.bz2
SkyblockMod-57af29e64bac4bc7fc8ccf8e3af69c4e1d89b448.zip
Merge pull request #10 from Desco1/development
Added clipboard as a parameter for the getkey command
Diffstat (limited to 'src/main/java/me/Danker')
-rw-r--r--src/main/java/me/Danker/commands/DHelpCommand.java2
-rw-r--r--src/main/java/me/Danker/commands/GetkeyCommand.java29
-rw-r--r--src/main/java/me/Danker/commands/PetsCommand.java2
3 files changed, 23 insertions, 10 deletions
diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java
index 0a48213..a2efa94 100644
--- a/src/main/java/me/Danker/commands/DHelpCommand.java
+++ b/src/main/java/me/Danker/commands/DHelpCommand.java
@@ -34,7 +34,7 @@ public class DHelpCommand extends CommandBase {
EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" +
EnumChatFormatting.GOLD + " /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/list>" + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" +
EnumChatFormatting.GOLD + " /setkey <key>" + EnumChatFormatting.AQUA + " - Sets API key.\n" +
- EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey.\n" +
+ EnumChatFormatting.GOLD + " /getkey [clipboard]" + EnumChatFormatting.AQUA + " - Returns key set with /setkey.\n" +
EnumChatFormatting.GOLD + " /loot <zombie/spider/wolf/fishing/catacombs> [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" +
EnumChatFormatting.GOLD + " /display <zombie/spider/wolf/fishing/catacombs/off> [winter/f(1-4)/session]" + EnumChatFormatting.AQUA + " - Text display for trackers. /display fishing winter displays winter sea creatures instead.\n" +
EnumChatFormatting.GOLD + " /resetloot <zombie/spider/wolf/fishing/catacombs/confirm/cancel>" + EnumChatFormatting.AQUA + " - Resets loot for trackers. /resetloot confirm confirms the reset.\n" +
diff --git a/src/main/java/me/Danker/commands/GetkeyCommand.java b/src/main/java/me/Danker/commands/GetkeyCommand.java
index 80354fe..d32a56e 100644
--- a/src/main/java/me/Danker/commands/GetkeyCommand.java
+++ b/src/main/java/me/Danker/commands/GetkeyCommand.java
@@ -1,5 +1,9 @@
package me.Danker.commands;
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.StringSelection;
+
import me.Danker.handlers.ConfigHandler;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
@@ -28,14 +32,23 @@ public class GetkeyCommand extends CommandBase implements ICommand {
@Override
public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException {
- final EntityPlayer player = (EntityPlayer)arg0;
- final ConfigHandler cf = new ConfigHandler();
-
- if (cf.getString("api", "APIKey").equals("")) {
- player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Set your API key using /setkey."));
- } else {
- player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key is " + EnumChatFormatting.DARK_GREEN + cf.getString("api", "APIKey")));
- }
+ EntityPlayer player = (EntityPlayer)arg0;
+ ConfigHandler cf = new ConfigHandler();
+ Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
+ StringSelection stringSelection = new StringSelection(cf.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."));
+ }
+ else if (arg1.length == 0) {
+ player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key is " + EnumChatFormatting.DARK_GREEN + cf.getString("api", "APIKey")));
+ } else if (arg1[0].equalsIgnoreCase("clipboard")){
+ clipboard.setContents(stringSelection, null);
+ player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key has been copied to the clipboard."));
+ } else {
+ player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Wrong command usage: /getkey (clipboard)"));
+ }
+
}
}
diff --git a/src/main/java/me/Danker/commands/PetsCommand.java b/src/main/java/me/Danker/commands/PetsCommand.java
index 75367ab..5d38214 100644
--- a/src/main/java/me/Danker/commands/PetsCommand.java
+++ b/src/main/java/me/Danker/commands/PetsCommand.java
@@ -23,7 +23,7 @@ public class PetsCommand extends CommandBase {
static int petXpToLevel(double xp, String rarity) {
int[] xpPerLevel = {100, 110, 120, 130, 145, 160, 175, 190, 210, 230, 250, 275, 300, 330, 360, 400, 440, 490, 540, 600, 660, 730,
- 800, 880, 860, 1050, 1150, 1260, 1380, 1510, 1650, 1800, 1960, 2130, 2310, 2500, 2700, 2920, 3160, 3420, 3700,
+ 800, 880, 960, 1050, 1150, 1260, 1380, 1510, 1650, 1800, 1960, 2130, 2310, 2500, 2700, 2920, 3160, 3420, 3700,
4000, 4350, 4750, 5200, 5700, 6300, 7000, 7800, 8700, 9700, 10800, 12000, 13300, 14700, 16200, 17800, 19500,
21300, 23200, 25200, 27400, 29800, 32400, 35200, 38200, 41400, 44800, 48400, 52200, 56200, 60400, 64800, 69400,
74200, 79200, 84700, 90700, 97200, 104200, 111700, 119700, 128200, 137200, 146700, 156700, 167700, 179700, 192700,