aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2021-03-28 19:22:35 -0400
committerbowser0000 <bowser0000@gmail.com>2021-03-28 19:22:35 -0400
commit032cbaea86a08b98a239257f464a00a925068fda (patch)
tree4cc9048140cd9117194ac5b164aa8388f3a349a9
parent57e5469f651610a4f07bf8e5266b789d7ca1fe34 (diff)
downloadSkyblockMod-032cbaea86a08b98a239257f464a00a925068fda.tar.gz
SkyblockMod-032cbaea86a08b98a239257f464a00a925068fda.tar.bz2
SkyblockMod-032cbaea86a08b98a239257f464a00a925068fda.zip
Add 20s countdown to golem alert
-rw-r--r--README.md6
-rw-r--r--src/main/java/me/Danker/commands/MoveCommand.java12
-rw-r--r--src/main/java/me/Danker/commands/ScaleCommand.java10
-rw-r--r--src/main/java/me/Danker/features/GolemSpawningAlert.java32
-rw-r--r--src/main/java/me/Danker/gui/DankerGui.java4
-rw-r--r--src/main/java/me/Danker/gui/EditLocationsGui.java22
-rw-r--r--src/main/java/me/Danker/handlers/ConfigHandler.java4
-rw-r--r--src/main/resources/assets/dsm/icons/golem.pngbin0 -> 8454 bytes
8 files changed, 79 insertions, 11 deletions
diff --git a/README.md b/README.md
index f42b153..7c922cc 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,7 @@ Discord Server: https://discord.gg/QsEkNQS
- Hide tooltips in experiment addons
- Hide tooltips in Melody's Harp
- Pet background colors based on level
-- Golem spawning alerts
+- Golem spawning alerts + 20 second timer
- Skill xp/hour tracker
- Show total skill xp instead of progress to next level
- Show time until century cakes run out
@@ -68,8 +68,8 @@ Discord Server: https://discord.gg/QsEkNQS
- /loot <zombie/spider/wolf/fishing/catacombs/mythological/> [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.
- /display <zombie/spider/wolf/fishing/catacombs/mythological/ghosts/auto/off> [winter/festival/spooky/f(1-7)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active.
- /resetloot <zombie/spider/wolf/fishing/catacombs/mythological/confirm/cancel> - - Resets loot for trackers. /resetloot confirm confirms the reset.
-- /move <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer> <x> <y> - Moves text display to specified X and Y coordinates.
-- /scale <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer> <scale (0.1 - 10)> - Scales text display to a specified multipler between 0.1x and 10x.
+- /move <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer/golemtimer> <x> <y> - Moves text display to specified X and Y coordinates.
+- /scale <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer/golemtimer> <scale (0.1 - 10)> - Scales text display to a specified multipler between 0.1x and 10x.
- /slayer [player] - Uses API to get slayer xp of a person. If no name is provided, it checks yours.
- /skills [player] - Uses API to get skill levels of a person. If no name is provided, it checks yours.
- /lobbyskills - Uses API to find the average skills of the lobby, as well the three players with the highest skill average.
diff --git a/src/main/java/me/Danker/commands/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java
index 6dedbaf..6fe2939 100644
--- a/src/main/java/me/Danker/commands/MoveCommand.java
+++ b/src/main/java/me/Danker/commands/MoveCommand.java
@@ -22,6 +22,7 @@ public class MoveCommand extends CommandBase {
public static int[] skillTrackerXY = {0, 0};
public static int[] waterAnswerXY = {0, 0};
public static int[] bonzoTimerXY = {0, 0};
+ public static int[] golemTimerXY = {0 ,0};
@Override
public String getCommandName() {
@@ -30,7 +31,7 @@ public class MoveCommand extends CommandBase {
@Override
public String getCommandUsage(ICommandSender arg0) {
- return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer> <x> <y>";
+ return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer/golemtimer> <x> <y>";
}
public static String usage(ICommandSender arg0) {
@@ -45,7 +46,7 @@ public class MoveCommand extends CommandBase {
@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) {
if (args.length == 1) {
- return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer");
+ return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer", "golemtimer");
}
return null;
}
@@ -123,6 +124,13 @@ public class MoveCommand extends CommandBase {
ConfigHandler.writeIntConfig("locations", "bonzoTimerX", bonzoTimerXY[1]);
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Bonzo's Mask timer has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2]));
break;
+ case "golemtimer":
+ golemTimerXY[0] = Integer.parseInt(arg1[1]);
+ golemTimerXY[1] = Integer.parseInt(arg1[2]);
+ ConfigHandler.writeIntConfig("locations", "golemTimerX", golemTimerXY[0]);
+ ConfigHandler.writeIntConfig("locations", "golemTimerY", golemTimerXY[1]);
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Golem timer has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2]));
+ break;
default:
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0)));
}
diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java
index 17fb60f..b27ac50 100644
--- a/src/main/java/me/Danker/commands/ScaleCommand.java
+++ b/src/main/java/me/Danker/commands/ScaleCommand.java
@@ -22,6 +22,7 @@ public class ScaleCommand extends CommandBase {
public static double skillTrackerScale;
public static double waterAnswerScale;
public static double bonzoTimerScale;
+ public static double golemTimerScale;
@Override
public String getCommandName() {
@@ -30,7 +31,7 @@ public class ScaleCommand extends CommandBase {
@Override
public String getCommandUsage(ICommandSender arg0) {
- return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer> <size (0.1 - 10)>";
+ return "/" + getCommandName() + " <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer/bonzotimer/golemtimer> <size (0.1 - 10)>";
}
public static String usage(ICommandSender arg0) {
@@ -45,7 +46,7 @@ public class ScaleCommand extends CommandBase {
@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) {
if (args.length == 1) {
- return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer");
+ return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer", "golemtimer");
}
return null;
}
@@ -111,6 +112,11 @@ public class ScaleCommand extends CommandBase {
ConfigHandler.writeDoubleConfig("scales", "bonzoTimerScale", bonzoTimerScale);
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Bonzo's Mask timer has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + bonzoTimerScale + "x"));
break;
+ case "golemtimer":
+ golemTimerScale = scaleAmount;
+ ConfigHandler.writeDoubleConfig("scales", "golemTimerScale", golemTimerScale);
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Golem timer has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + golemTimerScale + "x"));
+ break;
default:
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0)));
}
diff --git a/src/main/java/me/Danker/features/GolemSpawningAlert.java b/src/main/java/me/Danker/features/GolemSpawningAlert.java
index 91b647e..de5cb89 100644
--- a/src/main/java/me/Danker/features/GolemSpawningAlert.java
+++ b/src/main/java/me/Danker/features/GolemSpawningAlert.java
@@ -1,14 +1,26 @@
package me.Danker.features;
+import me.Danker.commands.MoveCommand;
+import me.Danker.commands.ScaleCommand;
import me.Danker.commands.ToggleCommand;
+import me.Danker.events.RenderOverlay;
+import me.Danker.handlers.TextRenderer;
import me.Danker.utils.Utils;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.Gui;
import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StringUtils;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import org.lwjgl.opengl.GL11;
public class GolemSpawningAlert {
+ double golemTime = 0;
+ public static final ResourceLocation GOLEM_ICON = new ResourceLocation("dsm", "icons/golem.png");
+ public static String GOLEM_COLOUR;
+
@SubscribeEvent
public void onChat(ClientChatReceivedEvent event) {
String message = StringUtils.stripControlCodes(event.message.getUnformattedText());
@@ -18,9 +30,29 @@ public class GolemSpawningAlert {
if (ToggleCommand.golemAlertToggled) {
if (message.contains("The ground begins to shake as an Endstone Protector rises from below!")) {
+ golemTime = System.currentTimeMillis() / 1000 + 20;
Utils.createTitle(EnumChatFormatting.RED + "GOLEM SPAWNING!", 3);
}
}
}
+ @SubscribeEvent
+ public void renderPlayerInfo(RenderOverlay event) {
+ if (ToggleCommand.golemAlertToggled && Utils.inSkyblock && golemTime > System.currentTimeMillis() / 1000) {
+ Minecraft mc = Minecraft.getMinecraft();
+ double scale = ScaleCommand.golemTimerScale;
+ double scaleReset = Math.pow(scale, -1);
+ GL11.glScaled(scale, scale, scale);
+
+ double timeNow = System.currentTimeMillis() / 1000;
+ mc.getTextureManager().bindTexture(GOLEM_ICON);
+ Gui.drawModalRectWithCustomSizedTexture(MoveCommand.golemTimerXY[0], MoveCommand.golemTimerXY[1], 0, 0, 16, 16, 16, 16);
+
+ String golemText = GOLEM_COLOUR + Utils.getTimeBetween(timeNow, golemTime);
+ new TextRenderer(mc, golemText, MoveCommand.golemTimerXY[0] + 20, MoveCommand.golemTimerXY[1] + 5, 1);
+
+ GL11.glScaled(scaleReset, scaleReset, scaleReset);
+ }
+ }
+
}
diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java
index 796be2b..d8100b5 100644
--- a/src/main/java/me/Danker/gui/DankerGui.java
+++ b/src/main/java/me/Danker/gui/DankerGui.java
@@ -136,7 +136,7 @@ public class DankerGui extends GuiScreen {
petColours = new GuiButton(0, 0, 0, "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled));
expertiseLore = new GuiButton(0, 0, 0, "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled));
gparty = new GuiButton(0, 0, 0, "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled));
- golemAlerts = new GuiButton(0, 0, 0, "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled));
+ golemAlerts = new GuiButton(0, 0, 0, "Golem Spawn Alert And Timer: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled));
rngesusAlert = new GuiButton(0, 0, 0, "RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts));
splitFishing = new GuiButton(0, 0, 0, "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing));
lowHealthNotify = new GuiButton(0, 0, 0, "Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled));
@@ -326,7 +326,7 @@ public class DankerGui extends GuiScreen {
} else if (button == golemAlerts) {
ToggleCommand.golemAlertToggled = !ToggleCommand.golemAlertToggled;
ConfigHandler.writeBooleanConfig("toggles", "GolemAlerts", ToggleCommand.golemAlertToggled);
- golemAlerts.displayString = "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled);
+ golemAlerts.displayString = "Golem Spawn Alert And Timer: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled);
} else if (button == expertiseLore) {
ToggleCommand.expertiseLoreToggled = !ToggleCommand.expertiseLoreToggled;
ConfigHandler.writeBooleanConfig("toggles", "ExpertiseLore", ToggleCommand.expertiseLoreToggled);
diff --git a/src/main/java/me/Danker/gui/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java
index cefe0a3..3a7c94b 100644
--- a/src/main/java/me/Danker/gui/EditLocationsGui.java
+++ b/src/main/java/me/Danker/gui/EditLocationsGui.java
@@ -28,6 +28,7 @@ public class EditLocationsGui extends GuiScreen {
private LocationButton skillTracker;
private LocationButton waterAnswer;
private LocationButton bonzoTimer;
+ private LocationButton golemTimer;
@Override
public boolean doesGuiPauseGame() {
@@ -93,8 +94,8 @@ public class EditLocationsGui extends GuiScreen {
cakeTimer = new LocationButton(0, MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1] + 5, 85 * ScaleCommand.cakeTimerScale, 18 * ScaleCommand.cakeTimerScale, ScaleCommand.cakeTimerScale, CakeTimer.CAKE_COLOUR + " 11h16m", null, null);
skillTracker = new LocationButton(0, MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], 150 * ScaleCommand.skillTrackerScale, 28 * ScaleCommand.skillTrackerScale, ScaleCommand.skillTrackerScale, skillTrackerText, null, null);
waterAnswer = new LocationButton(0, MoveCommand.waterAnswerXY[0], MoveCommand.waterAnswerXY[1], 190 * ScaleCommand.waterAnswerScale, 54 * ScaleCommand.waterAnswerScale, ScaleCommand.waterAnswerScale, waterAnswerText, null, null);
- bonzoTimer = new LocationButton(0, MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1] + 5, 85 * ScaleCommand.bonzoTimerScale, 18 * ScaleCommand.bonzoTimerScale, ScaleCommand.bonzoTimerScale, BonzoMaskTimer.BONZO_COLOR + " 3m30s", null, null);
-
+ bonzoTimer = new LocationButton(0, MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1] + 5, 53 * ScaleCommand.bonzoTimerScale, 18 * ScaleCommand.bonzoTimerScale, ScaleCommand.bonzoTimerScale, BonzoMaskTimer.BONZO_COLOR + " 3m30s", null, null);
+ golemTimer = new LocationButton(0, MoveCommand.golemTimerXY[0], MoveCommand.golemTimerXY[1] + 5, 42 * ScaleCommand.golemTimerScale, 18 * ScaleCommand.golemTimerScale, ScaleCommand.golemTimerScale, GolemSpawningAlert.GOLEM_COLOUR + " 20s", null, null);
this.buttonList.add(coords);
this.buttonList.add(dungeonTimer);
@@ -105,6 +106,7 @@ public class EditLocationsGui extends GuiScreen {
this.buttonList.add(bonzoTimer);
this.buttonList.add(display);
this.buttonList.add(skill50);
+ this.buttonList.add(golemTimer);
}
@Override
@@ -126,6 +128,12 @@ public class EditLocationsGui extends GuiScreen {
Gui.drawModalRectWithCustomSizedTexture(MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1], 0, 0, 16, 16, 16, 16);
GL11.glScaled(bonzoTimerScaleReset, bonzoTimerScaleReset, bonzoTimerScaleReset);
+ double golemTimerScale = ScaleCommand.golemTimerScale;
+ double golemTimerScaleReset = Math.pow(golemTimerScale, -1);
+ GL11.glScaled(golemTimerScale, golemTimerScale, golemTimerScale);
+ mc.getTextureManager().bindTexture(GolemSpawningAlert.GOLEM_ICON);
+ Gui.drawModalRectWithCustomSizedTexture(MoveCommand.golemTimerXY[0], MoveCommand.golemTimerXY[1], 0, 0, 16, 16, 16, 16);
+ GL11.glScaled(golemTimerScaleReset, golemTimerScaleReset, golemTimerScaleReset);
super.drawScreen(mouseX, mouseY, partialTicks);
}
@@ -190,6 +198,12 @@ public class EditLocationsGui extends GuiScreen {
bonzoTimer.xPosition = MoveCommand.bonzoTimerXY[0];
bonzoTimer.yPosition = MoveCommand.bonzoTimerXY[1];
break;
+ case "golemTimer":
+ MoveCommand.golemTimerXY[0] += xMoved;
+ MoveCommand.golemTimerXY[1] += yMoved;
+ golemTimer.xPosition = MoveCommand.golemTimerXY[0];
+ golemTimer.yPosition = MoveCommand.golemTimerXY[1];
+ break;
}
this.buttonList.clear();
initGui();
@@ -220,6 +234,8 @@ public class EditLocationsGui extends GuiScreen {
moving = "waterAnswer";
} else if (button == bonzoTimer) {
moving = "bonzoTimer";
+ } else if (button == golemTimer) {
+ moving = "golemTimer";
}
}
}
@@ -246,6 +262,8 @@ public class EditLocationsGui extends GuiScreen {
ConfigHandler.writeIntConfig("locations", "waterAnswerY", MoveCommand.waterAnswerXY[1]);
ConfigHandler.writeIntConfig("locations", "bonzoTimerX", MoveCommand.bonzoTimerXY[0]);
ConfigHandler.writeIntConfig("locations", "bonzoTimerY", MoveCommand.bonzoTimerXY[1]);
+ ConfigHandler.writeIntConfig("locations", "golemTimerX", MoveCommand.golemTimerXY[0]);
+ ConfigHandler.writeIntConfig("locations", "golemTimerY", MoveCommand.golemTimerXY[1]);
}
}
diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java
index 1551a3e..04f4ccd 100644
--- a/src/main/java/me/Danker/handlers/ConfigHandler.java
+++ b/src/main/java/me/Danker/handlers/ConfigHandler.java
@@ -490,6 +490,8 @@ public class ConfigHandler {
MoveCommand.waterAnswerXY[1] = initInt("locations", "waterAnswerY", 100);
MoveCommand.bonzoTimerXY[0] = initInt("locations", "bonzoTimerX", 40);
MoveCommand.bonzoTimerXY[1] = initInt("locations", "bonzoTimerY", 80);
+ MoveCommand.golemTimerXY[0] = initInt("locations", "golemTimerX", 100);
+ MoveCommand.golemTimerXY[1] = initInt("locations", "golemTimerY", 30);
// Scales
ScaleCommand.coordsScale = initDouble("scales", "coordsScale", 1);
@@ -501,6 +503,7 @@ public class ConfigHandler {
ScaleCommand.skillTrackerScale = initDouble("scales", "skillTrackerScale", 1);
ScaleCommand.waterAnswerScale = initDouble("scales", "waterAnswerScale", 1);
ScaleCommand.bonzoTimerScale = initDouble("scales", "bonzoTimerScale", 1);
+ ScaleCommand.golemTimerScale = initDouble("scales", "golemTimerScale", 1);
// Colours
DankersSkyblockMod.MAIN_COLOUR = initString("colors", "main", EnumChatFormatting.GREEN.toString());
@@ -517,6 +520,7 @@ public class ConfigHandler {
SkillTracker.SKILL_TRACKER_COLOUR = initString("colors", "skillTracker", EnumChatFormatting.AQUA.toString());
TriviaSolver.TRIVIA_WRONG_ANSWER_COLOUR = initString("colors", "triviaWrongAnswer", EnumChatFormatting.RED.toString());
BonzoMaskTimer.BONZO_COLOR = initString("colors", "bonzoDisplay", EnumChatFormatting.RED.toString());
+ GolemSpawningAlert.GOLEM_COLOUR = initString("colors", "golemDisplay", EnumChatFormatting.GOLD.toString());
BlazeSolver.LOWEST_BLAZE_COLOUR = initInt("colors", "blazeLowest", 0xFF0000);
BlazeSolver.HIGHEST_BLAZE_COLOUR = initInt("colors", "blazeHighest", 0x40FF40);
SlayerESP.SLAYER_COLOUR = initInt("colors", "slayerColor", 0x0000FF);
diff --git a/src/main/resources/assets/dsm/icons/golem.png b/src/main/resources/assets/dsm/icons/golem.png
new file mode 100644
index 0000000..33a0c93
--- /dev/null
+++ b/src/main/resources/assets/dsm/icons/golem.png
Binary files differ