Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Commit 8ce07f5

Browse files
committed
/move command, colours and slayer fix
Added /move command to move text displays. Add colour to messages and error messages in chat. Fixed slayer drops not being tracked.
1 parent ec0334b commit 8ce07f5

File tree

9 files changed

+125
-58
lines changed

9 files changed

+125
-58
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ QOL changes that enhances your Hypixel Skyblock experience. Created to add featu
1111
- /setkey [key] - Sets API key.
1212
- /getkey - Returns key set with /setkey.
1313
- /loot [zombie/spider/wolf] - Returns loot received from the slayer quest.
14-
- /display [zombie/spider/wolf/off] - Text display for slayer tracker
14+
- /display [zombie/spider/wolf/off] - Text display for slayer tracker.
15+
- /move [coords/display] [x] [y] - Moves text display to specified X and Y coordinates.
1516

1617
### Notes
1718
- 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.

me/Danker/TheMod.java

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import me.Danker.commands.DisplayCommand;
1010
import me.Danker.commands.GetkeyCommand;
1111
import me.Danker.commands.LootCommand;
12+
import me.Danker.commands.MoveCommand;
1213
import me.Danker.commands.ReloadConfigCommand;
1314
import me.Danker.commands.SetkeyCommand;
1415
import me.Danker.commands.ToggleCommand;
@@ -20,7 +21,6 @@
2021
import net.minecraft.entity.item.EntityItem;
2122
import net.minecraft.entity.player.EntityPlayer;
2223
import net.minecraft.util.AxisAlignedBB;
23-
import net.minecraft.util.ChatComponentText;
2424
import net.minecraft.util.EnumChatFormatting;
2525
import net.minecraft.util.StringUtils;
2626
import net.minecraftforge.client.ClientCommandHandler;
@@ -33,13 +33,14 @@
3333
import net.minecraftforge.fml.common.Mod.EventHandler;
3434
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
3535
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
36+
import net.minecraftforge.fml.common.eventhandler.EventPriority;
3637
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
3738

3839
@Mod(modid = TheMod.MODID, version = TheMod.VERSION, clientSideOnly = true)
3940
public class TheMod
4041
{
4142
public static final String MODID = "Danker's Skyblock Mod";
42-
public static final String VERSION = "1.4";
43+
public static final String VERSION = "1.4.1";
4344

4445
static int checkItemsNow = 0;
4546
static int itemsChecked = 0;
@@ -62,16 +63,17 @@ public void preInit(final FMLPreInitializationEvent event) {
6263
ClientCommandHandler.instance.registerCommand(new LootCommand());
6364
ClientCommandHandler.instance.registerCommand(new ReloadConfigCommand());
6465
ClientCommandHandler.instance.registerCommand(new DisplayCommand());
66+
ClientCommandHandler.instance.registerCommand(new MoveCommand());
6567
}
6668

67-
@SubscribeEvent
68-
public void onChat(final ClientChatReceivedEvent event) {
69+
// It randomly broke, so I had to make it the highest priority
70+
@SubscribeEvent(priority = EventPriority.HIGHEST)
71+
public void onChat(ClientChatReceivedEvent event) {
6972
final ToggleCommand tc = new ToggleCommand();
70-
final boolean isGPartyToggled = tc.getToggle("gparty");
7173
String message = event.message.getUnformattedText();
7274

7375
if (!message.contains(":")) {
74-
if (isGPartyToggled) {
76+
if (tc.gpartyToggled) {
7577
if (message.contains(" has invited all members of ")) {
7678
System.out.println(message);
7779
try {
@@ -112,11 +114,15 @@ public void onChat(final ClientChatReceivedEvent event) {
112114
}
113115
}
114116
}
115-
117+
116118
// Wolf
117119
if (message.contains("Talk to Maddox to claim your Wolf Slayer XP!")) {
118120
lc.wolfSvens++;
121+
if (lc.wolfBosses != -1) {
122+
lc.wolfBosses++;
123+
}
119124
cf.writeIntConfig("wolf", "svens", lc.wolfSvens);
125+
cf.writeIntConfig("wolf", "bossRNG", lc.wolfBosses);
120126
}
121127
if (message.contains("VERY RARE DROP! (◆ Spirit Rune ")) {
122128
lc.wolfSpirits++;
@@ -147,7 +153,11 @@ public void onChat(final ClientChatReceivedEvent event) {
147153
// Spider
148154
if (message.contains("Talk to Maddox to claim your Spider Slayer XP!")) {
149155
lc.spiderTarantulas++;
156+
if (lc.spiderBosses != -1) {
157+
lc.spiderBosses++;
158+
}
150159
cf.writeIntConfig("spider", "tarantulas", lc.spiderTarantulas);
160+
cf.writeIntConfig("spider", "bossRNG", lc.spiderBosses);
151161
}
152162

153163
if (message.contains("VERY RARE DROP! (◆ Bite Rune")) {
@@ -182,7 +192,11 @@ public void onChat(final ClientChatReceivedEvent event) {
182192
// Zombie
183193
if (message.contains("Talk to Maddox to claim your Zombie Slayer XP!")) {
184194
lc.zombieRevs++;
195+
if (lc.zombieBosses != -1) {
196+
lc.zombieBosses++;
197+
}
185198
cf.writeIntConfig("zombie", "revs", lc.zombieRevs);
199+
cf.writeIntConfig("wolf", "bossRNG", lc.zombieBosses);
186200
}
187201
// I couldn't find a pic of someone getting this drop, so I'm assuming this works
188202
if (message.contains("VERY RARE DROP! (Revenant Catalyst)")) {
@@ -221,33 +235,18 @@ public void onChat(final ClientChatReceivedEvent event) {
221235
lc.wolfBosses = 0;
222236
cf.writeIntConfig("wolf", "timeRNG", lc.wolfTime);
223237
cf.writeIntConfig("wolf", "bossRNG", 0);
224-
} else {
225-
if (lc.wolfBosses != -1) {
226-
lc.wolfBosses++;
227-
}
228-
cf.writeIntConfig("wolf", "bossRNG", lc.wolfBosses);
229238
}
230239
if (spiderRNG) {
231240
lc.spiderTime = (int) System.currentTimeMillis() / 1000;
232241
lc.spiderBosses = 0;
233242
cf.writeIntConfig("spider", "timeRNG", lc.spiderTime);
234243
cf.writeIntConfig("spider", "bossRNG", 0);
235-
} else {
236-
if (lc.spiderBosses != -1) {
237-
lc.spiderBosses++;
238-
}
239-
cf.writeIntConfig("spider", "bossRNG", lc.spiderBosses);
240244
}
241245
if (zombieRNG) {
242246
lc.zombieTime = (int) System.currentTimeMillis() / 1000;
243247
lc.zombieBosses = 0;
244248
cf.writeIntConfig("zombie", "timeRNG", lc.zombieTime);
245249
cf.writeIntConfig("zombie", "bossRNG", 0);
246-
} else {
247-
if (lc.zombieBosses != -1) {
248-
lc.zombieBosses++;
249-
}
250-
cf.writeIntConfig("wolf", "bossRNG", lc.zombieBosses);
251250
}
252251
}
253252
}
@@ -256,10 +255,9 @@ public void onChat(final ClientChatReceivedEvent event) {
256255
public void renderPlayerInfo(final RenderGameOverlayEvent.Post event) {
257256
if (event.type != RenderGameOverlayEvent.ElementType.EXPERIENCE) return;
258257
final ToggleCommand tc = new ToggleCommand();
259-
final boolean isCoordsToggled = tc.getToggle("coords");
258+
final MoveCommand moc = new MoveCommand();
260259

261-
if (isCoordsToggled) {
262-
ScaledResolution scaled = new ScaledResolution(Minecraft.getMinecraft());
260+
if (tc.coordsToggled) {
263261
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
264262

265263
double xDir = (player.rotationYaw % 360 + 360) % 360;
@@ -268,8 +266,7 @@ public void renderPlayerInfo(final RenderGameOverlayEvent.Post event) {
268266
double yDir = (double) Math.round(player.rotationPitch * 10d) / 10d;
269267

270268
String coordText = (int) player.posX + " / " + (int) player.posY + " / " + (int) player.posZ + " (" + xDir + " / " + yDir + ")";
271-
int height = scaled.getScaledHeight();
272-
new TextRenderer(Minecraft.getMinecraft(), coordText, 5, height - 25, Integer.parseInt("FFFFFF", 16));
269+
new TextRenderer(Minecraft.getMinecraft(), coordText, moc.coordsXY[0], moc.coordsXY[1], Integer.parseInt("FFFFFF", 16));
273270
}
274271

275272
final DisplayCommand ds = new DisplayCommand();
@@ -378,17 +375,17 @@ public void renderPlayerInfo(final RenderGameOverlayEvent.Post event) {
378375
EnumChatFormatting.AQUA + timeBetween + "\n" +
379376
EnumChatFormatting.AQUA + bossesBetween + "\n";
380377
}
381-
new TextRenderer(Minecraft.getMinecraft(), dropsText, 80, 5, Integer.parseInt("FFFFFF", 16));
382-
new TextRenderer(Minecraft.getMinecraft(), countText, 190, 5, Integer.parseInt("FFFFFF", 16));
378+
new TextRenderer(Minecraft.getMinecraft(), dropsText, moc.displayXY[0], moc.displayXY[1], Integer.parseInt("FFFFFF", 16));
379+
new TextRenderer(Minecraft.getMinecraft(), countText, moc.displayXY[0] + 110, moc.displayXY[1], Integer.parseInt("FFFFFF", 16));
383380
}
384381
}
385382

386-
@SubscribeEvent
383+
@SubscribeEvent(priority = EventPriority.HIGHEST)
387384
public void onSound(final PlaySoundEvent event) {
388385
if (event.name.equals("note.pling")) {
389-
// Don't check twice within 5 seconds
386+
// Don't check twice within 3 seconds
390387
checkItemsNow = (int) System.currentTimeMillis() / 1000;
391-
if (checkItemsNow - itemsChecked <= 5) return;
388+
if (checkItemsNow - itemsChecked < 3) return;
392389

393390
final ScoreboardHandler sc = new ScoreboardHandler();
394391
List<String> scoreboard = sc.getSidebarLines();
@@ -401,7 +398,7 @@ public void onSound(final PlaySoundEvent event) {
401398

402399
itemsChecked = (int) System.currentTimeMillis() / 1000;
403400

404-
lc.wolfTeeth += getItems("Wolf Teeth");
401+
lc.wolfTeeth += getItems("Wolf Tooth");
405402
lc.wolfWheels += getItems("Hamster Wheel");
406403
lc.spiderWebs += getItems("Tarantula Web");
407404
lc.spiderTAP += getItems("Toxic Arrow Poison");

me/Danker/commands/DisplayCommand.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import net.minecraft.command.ICommandSender;
77
import net.minecraft.entity.player.EntityPlayer;
88
import net.minecraft.util.ChatComponentText;
9+
import net.minecraft.util.EnumChatFormatting;
910

1011
public class DisplayCommand extends CommandBase {
1112
public static String display;
@@ -30,7 +31,7 @@ public void processCommand(ICommandSender arg0, String[] arg1) throws CommandExc
3031
final EntityPlayer player = (EntityPlayer) arg0;
3132

3233
if (arg1.length == 0) {
33-
player.addChatMessage(new ChatComponentText("Usage: /display [zombie/spider/wolf/off]"));
34+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display [zombie/spider/wolf/off]"));
3435
return;
3536
}
3637

@@ -45,10 +46,10 @@ public void processCommand(ICommandSender arg0, String[] arg1) throws CommandExc
4546
} else if (arg1[0].equalsIgnoreCase("off")) {
4647
display = "off";
4748
} else {
48-
player.addChatMessage(new ChatComponentText("Usage: /display [zombie/spider/wolf/off]"));
49+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display [zombie/spider/wolf/off]"));
4950
return;
5051
}
51-
player.addChatMessage(new ChatComponentText("Display set to " + display + "."));
52+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Display set to " + EnumChatFormatting.DARK_GREEN + display + EnumChatFormatting.GREEN + "."));
5253
cf.writeStringConfig("misc", "display", display);
5354
}
5455

me/Danker/commands/GetkeyCommand.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import net.minecraft.command.ICommandSender;
88
import net.minecraft.entity.player.EntityPlayer;
99
import net.minecraft.util.ChatComponentText;
10+
import net.minecraft.util.EnumChatFormatting;
1011

1112
public class GetkeyCommand extends CommandBase implements ICommand {
1213

@@ -31,9 +32,9 @@ public void processCommand(ICommandSender arg0, String[] arg1) throws CommandExc
3132
final ConfigHandler cf = new ConfigHandler();
3233

3334
if (cf.getString("api", "APIKey").equals("")) {
34-
player.addChatMessage(new ChatComponentText("API key not set. Set your API key using /setkey."));
35+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Set your API key using /setkey."));
3536
} else {
36-
player.addChatMessage(new ChatComponentText("Your set API key is " + cf.getString("api", "APIKey")));
37+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Your set API key is " + EnumChatFormatting.DARK_GREEN + cf.getString("api", "APIKey")));
3738
}
3839
}
3940

me/Danker/commands/LootCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void processCommand(ICommandSender arg0, String[] arg1) throws CommandExc
9797
final EntityPlayer player = (EntityPlayer) arg0;
9898

9999
if (arg1.length == 0) {
100-
player.addChatMessage(new ChatComponentText("Usage: /loot [zombie/spider/wolf]"));
100+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot [zombie/spider/wolf]"));
101101
return;
102102
}
103103

@@ -184,7 +184,7 @@ public void processCommand(ICommandSender arg0, String[] arg1) throws CommandExc
184184
EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" +
185185
EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + " -------------------"));
186186
} else {
187-
player.addChatMessage(new ChatComponentText("Usage: /loot [zombie/spider/wolf]"));
187+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /loot [zombie/spider/wolf]"));
188188
}
189189

190190
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package me.Danker.commands;
2+
3+
import me.Danker.handlers.ConfigHandler;
4+
import net.minecraft.command.CommandBase;
5+
import net.minecraft.command.CommandException;
6+
import net.minecraft.command.ICommandSender;
7+
import net.minecraft.entity.player.EntityPlayer;
8+
import net.minecraft.util.ChatComponentText;
9+
import net.minecraft.util.EnumChatFormatting;
10+
11+
public class MoveCommand extends CommandBase {
12+
13+
public static int[] coordsXY = {0, 0};
14+
public static int[] displayXY = {0, 0};
15+
16+
@Override
17+
public String getCommandName() {
18+
return "move";
19+
}
20+
21+
@Override
22+
public String getCommandUsage(ICommandSender arg0) {
23+
return getCommandName() + " [coords/display] [x] [y]";
24+
}
25+
26+
@Override
27+
public int getRequiredPermissionLevel() {
28+
return 0;
29+
}
30+
31+
@Override
32+
public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException {
33+
final EntityPlayer player = (EntityPlayer)arg0;
34+
final ConfigHandler cf = new ConfigHandler();
35+
36+
if (arg1.length < 2) {
37+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /move [coords/display] [x] [y]"));
38+
return;
39+
}
40+
41+
if (arg1[0].equalsIgnoreCase("coords")) {
42+
coordsXY[0] = Integer.parseInt(arg1[1]);
43+
coordsXY[1] = Integer.parseInt(arg1[2]);
44+
cf.writeIntConfig("locations", "coordsX", coordsXY[0]);
45+
cf.writeIntConfig("locations", "coordsY", coordsXY[1]);
46+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Coords have been moved to " + EnumChatFormatting.DARK_GREEN + arg1[1] + ", " + arg1[2]));
47+
} else if (arg1[0].equalsIgnoreCase("display")) {
48+
displayXY[0] = Integer.parseInt(arg1[1]);
49+
displayXY[1] = Integer.parseInt(arg1[2]);
50+
cf.writeIntConfig("locations", "displayX", displayXY[0]);
51+
cf.writeIntConfig("locations", "displayY", displayXY[1]);
52+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Tracker display has been moved to " + EnumChatFormatting.DARK_GREEN + arg1[1] + ", " + arg1[2]));
53+
} else {
54+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /move [coords/display] [x] [y]"));
55+
}
56+
}
57+
58+
}

me/Danker/commands/SetkeyCommand.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import net.minecraft.command.ICommandSender;
88
import net.minecraft.entity.player.EntityPlayer;
99
import net.minecraft.util.ChatComponentText;
10+
import net.minecraft.util.EnumChatFormatting;
1011

1112
public class SetkeyCommand extends CommandBase implements ICommand {
1213

@@ -30,13 +31,13 @@ public void processCommand(ICommandSender arg0, String[] arg1) throws CommandExc
3031
final EntityPlayer player = (EntityPlayer)arg0;
3132

3233
if (arg1.length == 0) {
33-
player.addChatMessage(new ChatComponentText("Usage: /setkey [key]"));
34+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /setkey [key]"));
3435
return;
3536
}
3637

3738
final ConfigHandler cf = new ConfigHandler();
3839
cf.writeStringConfig("api", "APIKey", arg1[0]);
39-
player.addChatMessage(new ChatComponentText("Set API key to " + arg1[0]));
40+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Set API key to " + EnumChatFormatting.DARK_GREEN + arg1[0]));
4041
}
4142

4243
}

me/Danker/commands/ToggleCommand.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,11 @@
77
import net.minecraft.command.ICommandSender;
88
import net.minecraft.entity.player.EntityPlayer;
99
import net.minecraft.util.ChatComponentText;
10+
import net.minecraft.util.EnumChatFormatting;
1011

1112
public class ToggleCommand extends CommandBase implements ICommand {
1213
public static boolean gpartyToggled;
1314
public static boolean coordsToggled;
14-
15-
public boolean getToggle(String type) {
16-
if (type.equals("gparty")) {
17-
return gpartyToggled;
18-
} else if (type.equals("coords")) {
19-
return coordsToggled;
20-
}
21-
return true;
22-
}
2315

2416
@Override
2517
public String getCommandName() {
@@ -42,23 +34,23 @@ public void processCommand(ICommandSender arg0, String[] arg1) throws CommandExc
4234
final ConfigHandler cf = new ConfigHandler();
4335

4436
if (arg1.length == 0) {
45-
player.addChatMessage(new ChatComponentText("Usage: /toggle [gparty/coords/list]"));
37+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle [gparty/coords/list]"));
4638
return;
4739
}
4840

4941
if (arg1[0].equalsIgnoreCase("gparty")) {
5042
gpartyToggled = !gpartyToggled;
5143
cf.writeBooleanConfig("toggles", "GParty", gpartyToggled);
52-
player.addChatMessage(new ChatComponentText("Guild party notifications has been set to " + gpartyToggled + "."));
44+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Guild party notifications has been set to " + EnumChatFormatting.DARK_GREEN + gpartyToggled + EnumChatFormatting.GREEN + "."));
5345
} else if (arg1[0].equalsIgnoreCase("coords")) {
5446
coordsToggled = !coordsToggled;
5547
cf.writeBooleanConfig("toggles", "Coords", coordsToggled);
56-
player.addChatMessage(new ChatComponentText("Coord/Angle display has been set to " + coordsToggled + "."));
48+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Coord/Angle display has been set to " + EnumChatFormatting.DARK_GREEN + coordsToggled + EnumChatFormatting.GREEN + "."));
5749
} else if (arg1[0].equalsIgnoreCase("list")) {
58-
player.addChatMessage(new ChatComponentText("Guild party notifications: " + gpartyToggled));
59-
player.addChatMessage(new ChatComponentText("Coord/Angle display: " + coordsToggled));
50+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Guild party notifications: " + EnumChatFormatting.DARK_GREEN + gpartyToggled + "\n" +
51+
EnumChatFormatting.GREEN + " Coord/Angle display: " + EnumChatFormatting.DARK_GREEN + coordsToggled));
6052
} else {
61-
player.addChatMessage(new ChatComponentText("Usage: /toggle [gparty/coords/list]"));
53+
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /toggle [gparty/coords/list]"));
6254
}
6355
}
6456
}

0 commit comments

Comments
 (0)