aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md5
-rw-r--r--src/main/java/me/Danker/TheMod.java20
-rw-r--r--src/main/java/me/Danker/commands/DHelpCommand.java4
3 files changed, 27 insertions, 2 deletions
diff --git a/README.md b/README.md
index b1d8e52..0054d87 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,7 @@ Discord Server: https://discord.gg/QsEkNQS
- Slayer item tracker (with graphic display) (scalable)
- RNGesus drop alerts (toggleable)
- Click in chat to open Maddox (toggleable)
+- Maddox Menu keybind
- Fishing tracker (with graphic display) (scalable)
- Dungeons tracker (with graphic display) (scalable)
- API commands
@@ -35,10 +36,12 @@ Discord Server: https://discord.gg/QsEkNQS
- /importfishing - Imports your fishing stats from your latest profile to your fishing tracker using the API.
- /sbplayers - Uses API to find how many players are on each Skyblock island.
+## Keybinds
+- Open Maddox menu - M by default.
+
### Notes
- Slayer tracker for token drops and 20% chance drops uses a 12x12x12 bounding box centered on the player to detect the drops. If you are out of the range of the item drop, it will not count on the tracker.
- API commands may take a while depending on your internet connection. The API may also go down.
- If you use too many API commands too fast, you can and will get rate-limited.
- An incorrect API key will result in an HTTP error code of 403.
- Importing fishing uses your sea creature kills, which may not always be exactly correct (e.x. someone else kills your sea creature).
-- If you want the Maddox menu binded to a key, get a chat binding mod and use the command "/dmodopenmaddoxmenu" (Must have chat maddox enabled)
diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java
index c546dbd..79a9d0a 100644
--- a/src/main/java/me/Danker/TheMod.java
+++ b/src/main/java/me/Danker/TheMod.java
@@ -11,6 +11,8 @@ import java.util.Locale;
import java.util.Map;
import java.util.regex.Pattern;
+import org.lwjgl.input.Keyboard;
+
import com.google.gson.JsonObject;
import me.Danker.commands.ArmourCommand;
@@ -39,6 +41,7 @@ import me.Danker.handlers.TextRenderer;
import me.Danker.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
+import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.event.ClickEvent;
import net.minecraft.event.ClickEvent.Action;
@@ -54,6 +57,8 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
+import net.minecraftforge.fml.client.FMLClientHandler;
+import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
@@ -61,6 +66,7 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion;
@@ -80,6 +86,7 @@ public class TheMod
public static String titleText = "";
static int tickAmount = 1;
public static String lastMaddoxCommand = "/cb placeholdervalue";
+ static KeyBinding[] keyBindings = new KeyBinding[1];
@EventHandler
public void init(FMLInitializationEvent event)
@@ -122,6 +129,12 @@ public class TheMod
String patternString = "(" + String.join("|", t6Enchants.keySet()) + ")";
pattern = Pattern.compile(patternString);
+
+ keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod");
+
+ for (int i = 0; i < keyBindings.length; i++) {
+ ClientRegistry.registerKeyBinding(keyBindings[i]);
+ }
}
@EventHandler
@@ -1392,6 +1405,13 @@ public class TheMod
}
}
+ @SubscribeEvent
+ public void onKey(KeyInputEvent event) {
+ if (keyBindings[0].isPressed()) {
+ Minecraft.getMinecraft().thePlayer.sendChatMessage(lastMaddoxCommand);
+ }
+ }
+
public void increaseEmpSC() {
LootCommand lc = new LootCommand();
ConfigHandler cf = new ConfigHandler();
diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java
index b69133e..4118264 100644
--- a/src/main/java/me/Danker/commands/DHelpCommand.java
+++ b/src/main/java/me/Danker/commands/DHelpCommand.java
@@ -31,6 +31,7 @@ public class DHelpCommand extends CommandBase {
player.addChatMessage(new ChatComponentText("\n" + EnumChatFormatting.GOLD + " " + TheMod.MODID + " Version " + TheMod.VERSION + "\n" +
EnumChatFormatting.AQUA + " <> = Mandatory parameter. [] = Optional parameter.\n" +
+ EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" +
EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" +
EnumChatFormatting.GOLD + " /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalerts/aotd/list>" + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" +
EnumChatFormatting.GOLD + " /setkey <key>" + EnumChatFormatting.AQUA + " - Sets API key.\n" +
@@ -47,7 +48,8 @@ public class DHelpCommand extends CommandBase {
EnumChatFormatting.GOLD + " /bank [player]" + EnumChatFormatting.AQUA + " - Uses API to get bank and purse coins of a person. If no name is provided, it checks yours.\n" +
EnumChatFormatting.GOLD + " /armor [player]" + EnumChatFormatting.AQUA + " - Uses API to get armour of a person. If no name is provided, it checks yours.\n" +
EnumChatFormatting.GOLD + " /importfishing" + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n" +
- EnumChatFormatting.GOLD + " /sbplayers" + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n"));
+ EnumChatFormatting.GOLD + " /sbplayers" + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n" +
+ EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n"));
}
}