aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/Features.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/ApiData.java3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/misc/ApiData.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/misc/CurrentPetDisplay.kt13
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/GuiRender.kt1
6 files changed, 24 insertions, 16 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java
index a45ad3abd..8b4b66524 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/Features.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java
@@ -78,10 +78,13 @@ public class Features {
public Misc misc = new Misc();
@Expose
- @Category(name = "Apis", desc = "Api Data")
+ @Category(name = "Api", desc = "Api Data")
public ApiData apiData = new ApiData();
@Expose
@Category(name = "Debug", desc = "Debug and test stuff.")
public Debug debug = new Debug();
+
+ @Expose
+ public Hidden hidden = new Hidden();
}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/ApiData.java b/src/main/java/at/hannibal2/skyhanni/config/features/ApiData.java
index 86a874fd8..387388bf0 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/ApiData.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/ApiData.java
@@ -7,9 +7,6 @@ import com.google.gson.annotations.Expose;
public class ApiData {
@Expose
- public String apiKey = "";
-
- @Expose
@ConfigOption(name = "Repo Auto Update", desc = "Update the repository on every startup.")
@ConfigEditorBoolean
public boolean repoAutoUpdate = true;
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java
new file mode 100644
index 000000000..2c2472917
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java
@@ -0,0 +1,12 @@
+package at.hannibal2.skyhanni.config.features;
+
+import com.google.gson.annotations.Expose;
+
+public class Hidden {
+
+ @Expose
+ public String apiKey = "";
+
+ @Expose
+ public String currentPet = "";
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/misc/ApiData.kt b/src/main/java/at/hannibal2/skyhanni/misc/ApiData.kt
index 66db57981..b0437e852 100644
--- a/src/main/java/at/hannibal2/skyhanni/misc/ApiData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/misc/ApiData.kt
@@ -17,7 +17,7 @@ class ApiData {
fun onStatusBar(event: LorenzChatEvent) {
val message = event.message
if (message.startsWith("§aYour new API key is §r§b")) {
- SkyHanniMod.feature.apiData.apiKey = message.substring(26)
+ SkyHanniMod.feature.hidden.apiKey = message.substring(26)
LorenzUtils.chat("§b[SkyHanni] A new API Key has been detected and installed")
if (currentProfileName != "") {
@@ -35,7 +35,7 @@ class ApiData {
private fun updateApiData() {
val uuid = Minecraft.getMinecraft().thePlayer.uniqueID.toString().replace("-", "")
- val apiKey = SkyHanniMod.feature.apiData.apiKey
+ val apiKey = SkyHanniMod.feature.hidden.apiKey
if (apiKey.isEmpty()) {
LorenzUtils.error("SkyHanni has no API Key set. Type /api new to reload.")
@@ -72,7 +72,7 @@ class ApiData {
}
private fun loadProfile(playerUuid: String, profileId: String) {
- val apiKey = SkyHanniMod.feature.apiData.apiKey
+ val apiKey = SkyHanniMod.feature.hidden.apiKey
val url = "https://api.hypixel.net/skyblock/profile?key=$apiKey&profile=$profileId"
val jsonObject = APIUtil.getJSONResponse(url)
diff --git a/src/main/java/at/hannibal2/skyhanni/misc/CurrentPetDisplay.kt b/src/main/java/at/hannibal2/skyhanni/misc/CurrentPetDisplay.kt
index 5adf570b5..06284c7c9 100644
--- a/src/main/java/at/hannibal2/skyhanni/misc/CurrentPetDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/misc/CurrentPetDisplay.kt
@@ -11,10 +11,6 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class CurrentPetDisplay {
- companion object {
- var currentPet: String = ""
- }
-
@SubscribeEvent
fun onChatMessage(event: LorenzChatEvent) {
if (!LorenzUtils.inSkyblock) return
@@ -23,15 +19,15 @@ class CurrentPetDisplay {
val message = event.message
if (message.matchRegex("§aYou summoned your §r(.*)§r§a!")) {
- currentPet = message.between("your §r", "§r§a")
+ SkyHanniMod.feature.hidden.currentPet = message.between("your §r", "§r§a")
blocked = true
}
if (message.matchRegex("§cAutopet §eequipped your §7(.*)§e! §a§lVIEW RULE")) {
- currentPet = message.between("] ", "§e!")
+ SkyHanniMod.feature.hidden.currentPet = message.between("] ", "§e!")
blocked = true
}
if (message.matchRegex("§aYou despawned your §r(.*)§r§a!")) {
- currentPet = ""
+ SkyHanniMod.feature.hidden.currentPet = ""
blocked = true
}
@@ -46,8 +42,7 @@ class CurrentPetDisplay {
if (!LorenzUtils.inSkyblock) return
if (!SkyHanniMod.feature.misc.petDisplay) return
- if (currentPet == "") return
- SkyHanniMod.feature.misc.petDisplayPos.renderString(currentPet)
+ SkyHanniMod.feature.misc.petDisplayPos.renderString(SkyHanniMod.feature.hidden.currentPet)
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/GuiRender.kt b/src/main/java/at/hannibal2/skyhanni/utils/GuiRender.kt
index 9ea9f37bb..6d221daa7 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/GuiRender.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/GuiRender.kt
@@ -9,6 +9,7 @@ import net.minecraft.client.renderer.GlStateManager
object GuiRender {
fun Position.renderString(string: String) {
+ if (string == "") return
val textToRender = "§f$string"
GlStateManager.pushMatrix()