From 28033cdff035f00ddbef738fb17a517fec8706b7 Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Thu, 24 Dec 2020 01:21:04 -0500 Subject: Calculate what Skyblock Year it is for the trivia --- src/main/java/me/Danker/DankersSkyblockMod.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 191d587..231c125 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -613,13 +613,16 @@ public class DankersSkyblockMod { } if (ToggleCommand.oruoToggled && Utils.inDungeons) { - // Don't set every answer to wrong with this question - if (message.contains("What SkyBlock year is it?")) triviaAnswers = null; + if (message.contains("What SkyBlock year is it?")) { + int year = (int) (Math.floor((System.currentTimeMillis() - 1560276000000L)/446400) + 1); - for (String question : triviaSolutions.keySet()) { - if (message.contains(question)) { - triviaAnswers = triviaSolutions.get(question); - break; + triviaAnswers = new String[]{"Year " + year}; + } else { + for (String question : triviaSolutions.keySet()) { + if (message.contains(question)) { + triviaAnswers = triviaSolutions.get(question); + break; + } } } -- cgit