aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/ComponentHandler.java8
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java12
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java11
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorDraggableList.java13
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiPositionEditor.java2
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/core/util/GuiElementSlider.java9
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/dungeons/DungeonHandler.java7
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/BossbarHandler.java2
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java2
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java2
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java56
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/NpcDialogue.java2
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java2
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/DwarvenIcons.java15
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/HubIcons.java45
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java5
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java6
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java6
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java4
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java2
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java2
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java2
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java7
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/seasons/SeasonDateHandler.java5
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/textures/Textures.java27
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java5
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/utils/ComponentBuilder.java (renamed from src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java)6
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/utils/SpecialColour.java (renamed from src/main/java/com/thatgravyboat/skyblockhud/SpecialColour.java)2
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java (renamed from src/main/java/com/thatgravyboat/skyblockhud/Utils.java)20
29 files changed, 154 insertions, 133 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/ComponentHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/ComponentHandler.java
index ad986c7..279a50f 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/ComponentHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/ComponentHandler.java
@@ -5,9 +5,7 @@ import com.google.common.collect.Ordering;
import com.thatgravyboat.skyblockhud.dungeons.DungeonHandler;
import com.thatgravyboat.skyblockhud.location.*;
import com.thatgravyboat.skyblockhud.seasons.SeasonDateHandler;
-import java.util.Comparator;
-import java.util.List;
-import java.util.regex.Pattern;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.scoreboard.ScorePlayerTeam;
@@ -20,6 +18,10 @@ import net.minecraftforge.fml.common.gameevent.TickEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
+import java.util.Comparator;
+import java.util.List;
+import java.util.regex.Pattern;
+
public class ComponentHandler {
public static final Pattern SCOREBOARD_CHARACTERS = Pattern.compile("[^]\\[a-z A-Z:0-9/'.()+\\d-ยง?]");
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java b/src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java
index 74e82eb..038f99c 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java
@@ -21,11 +21,7 @@ import com.thatgravyboat.skyblockhud.seasons.SeasonDateHandler;
import com.thatgravyboat.skyblockhud.textures.Textures;
import com.thatgravyboat.skyblockhud.tracker.TrackerFileLoader;
import com.thatgravyboat.skyblockhud.tracker.TrackerHandler;
-import java.awt.*;
-import java.awt.datatransfer.StringSelection;
-import java.io.*;
-import java.nio.charset.StandardCharsets;
-import java.util.Set;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.IReloadableResourceManager;
@@ -46,6 +42,12 @@ import net.minecraftforge.fml.common.gameevent.TickEvent;
import net.minecraftforge.fml.common.network.FMLNetworkEvent;
import org.lwjgl.input.Keyboard;
+import java.awt.*;
+import java.awt.datatransfer.StringSelection;
+import java.io.*;
+import java.nio.charset.StandardCharsets;
+import java.util.Set;
+
@Mod(modid = SkyblockHud.MODID, version = SkyblockHud.VERSION)
public class SkyblockHud {
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java b/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java
index 8c71f57..2a71c8b 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java
@@ -1,13 +1,9 @@
package com.thatgravyboat.skyblockhud.api;
-import static com.thatgravyboat.skyblockhud.ComponentHandler.SCOREBOARD_CHARACTERS;
-
-import com.thatgravyboat.skyblockhud.Utils;
import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent;
import com.thatgravyboat.skyblockhud.api.events.SidebarPostEvent;
import com.thatgravyboat.skyblockhud.api.events.SidebarPreGetEvent;
-import java.util.*;
-import java.util.stream.Collectors;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.scoreboard.Score;
import net.minecraft.scoreboard.ScoreObjective;
@@ -17,6 +13,11 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static com.thatgravyboat.skyblockhud.ComponentHandler.SCOREBOARD_CHARACTERS;
+
public class LeaderboardGetter {
private static Map<Integer, String> cachedScores = new HashMap<>();
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorDraggableList.java b/src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorDraggableList.java
index 4b61aa4..5c5d774 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorDraggableList.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiOptionEditorDraggableList.java
@@ -1,15 +1,10 @@
package com.thatgravyboat.skyblockhud.core.config.gui;
-import static com.thatgravyboat.skyblockhud.GuiTextures.DELETE;
-import static com.thatgravyboat.skyblockhud.GuiTextures.button_tex;
-
-import com.thatgravyboat.skyblockhud.Utils;
import com.thatgravyboat.skyblockhud.core.config.struct.ConfigProcessor;
import com.thatgravyboat.skyblockhud.core.util.lerp.LerpUtils;
import com.thatgravyboat.skyblockhud.core.util.render.RenderUtils;
import com.thatgravyboat.skyblockhud.core.util.render.TextRenderUtils;
-import java.util.ArrayList;
-import java.util.List;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
@@ -19,6 +14,12 @@ import net.minecraft.util.EnumChatFormatting;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.thatgravyboat.skyblockhud.GuiTextures.DELETE;
+import static com.thatgravyboat.skyblockhud.GuiTextures.button_tex;
+
public class GuiOptionEditorDraggableList extends GuiOptionEditor {
private String[] exampleText;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiPositionEditor.java b/src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiPositionEditor.java
index cabd342..4f62765 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiPositionEditor.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/core/config/gui/GuiPositionEditor.java
@@ -1,6 +1,6 @@
package com.thatgravyboat.skyblockhud.core.config.gui;
-import com.thatgravyboat.skyblockhud.Utils;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import com.thatgravyboat.skyblockhud.core.config.Position;
import java.io.IOException;
import net.minecraft.client.Minecraft;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/core/util/GuiElementSlider.java b/src/main/java/com/thatgravyboat/skyblockhud/core/util/GuiElementSlider.java
index 674ffe4..536d72f 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/core/util/GuiElementSlider.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/core/util/GuiElementSlider.java
@@ -1,16 +1,17 @@
package com.thatgravyboat.skyblockhud.core.util;
-import static com.thatgravyboat.skyblockhud.GuiTextures.*;
-
-import com.thatgravyboat.skyblockhud.Utils;
import com.thatgravyboat.skyblockhud.core.GuiElement;
-import java.util.function.Consumer;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
+import java.util.function.Consumer;
+
+import static com.thatgravyboat.skyblockhud.GuiTextures.*;
+
public class GuiElementSlider extends GuiElement {
public int x;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/dungeons/DungeonHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/dungeons/DungeonHandler.java
index 2418b13..66f4d09 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/dungeons/DungeonHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/dungeons/DungeonHandler.java
@@ -1,15 +1,16 @@
package com.thatgravyboat.skyblockhud.dungeons;
-import com.thatgravyboat.skyblockhud.Utils;
import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent;
import com.thatgravyboat.skyblockhud.api.events.SidebarPostEvent;
import com.thatgravyboat.skyblockhud.location.LocationHandler;
import com.thatgravyboat.skyblockhud.location.Locations;
+import com.thatgravyboat.skyblockhud.utils.Utils;
+import net.minecraft.client.Minecraft;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import net.minecraft.client.Minecraft;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class DungeonHandler {
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/BossbarHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/BossbarHandler.java
index 21e98fe..6d00789 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/BossbarHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/BossbarHandler.java
@@ -1,7 +1,7 @@
package com.thatgravyboat.skyblockhud.handlers;
import com.thatgravyboat.skyblockhud.SkyblockHud;
-import com.thatgravyboat.skyblockhud.Utils;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import com.thatgravyboat.skyblockhud.location.LocationHandler;
import com.thatgravyboat.skyblockhud.location.Locations;
import com.thatgravyboat.skyblockhud.location.MinesHandler;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java
index 30c2094..dff03b1 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java
@@ -3,7 +3,7 @@ package com.thatgravyboat.skyblockhud.handlers;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.thatgravyboat.skyblockhud.SkyblockHud;
-import com.thatgravyboat.skyblockhud.Utils;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import com.thatgravyboat.skyblockhud.api.events.LocationChangeEvent;
import com.thatgravyboat.skyblockhud.commands.SimpleCommand;
import com.thatgravyboat.skyblockhud.location.LocationCategory;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java
index 7da9c9d..c7bd596 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java
@@ -1,6 +1,6 @@
package com.thatgravyboat.skyblockhud.handlers;
-import com.thatgravyboat.skyblockhud.Utils;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent;
import com.thatgravyboat.skyblockhud.api.events.SidebarPostEvent;
import java.math.RoundingMode;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java
index bf38d49..fb1bd13 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java
@@ -1,19 +1,13 @@
package com.thatgravyboat.skyblockhud.handlers;
-import static com.thatgravyboat.skyblockhud.GuiTextures.mapOverlay;
-
import com.thatgravyboat.skyblockhud.SkyblockHud;
-import com.thatgravyboat.skyblockhud.Utils;
import com.thatgravyboat.skyblockhud.config.KeyBindings;
import com.thatgravyboat.skyblockhud.config.SBHConfig;
import com.thatgravyboat.skyblockhud.core.config.Position;
import com.thatgravyboat.skyblockhud.handlers.mapicons.DwarvenIcons;
import com.thatgravyboat.skyblockhud.handlers.mapicons.HubIcons;
import com.thatgravyboat.skyblockhud.location.LocationHandler;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import javax.vecmath.Vector2f;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiScreen;
@@ -26,6 +20,13 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import org.lwjgl.opengl.GL11;
+import javax.vecmath.Vector2f;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import static com.thatgravyboat.skyblockhud.GuiTextures.mapOverlay;
+
public class MapHandler {
public enum MapIconTypes {
@@ -56,9 +57,13 @@ public class MapHandler {
this.command = command;
}
- public boolean canRender() {
+ public boolean cantRender() {
SBHConfig.Map mapConfig = SkyblockHud.config.map;
- if (mapConfig.showInfoIcons && type.equals(MapIconTypes.INFO)) return true; else if (mapConfig.showMiscIcons && type.equals(MapIconTypes.MISC)) return true; else if (mapConfig.showNpcIcons && type.equals(MapIconTypes.NPC)) return true; else if (mapConfig.showQuestIcons && type.equals(MapIconTypes.QUEST)) return true; else return (mapConfig.showShopIcons && type.equals(MapIconTypes.SHOPS));
+ if (mapConfig.showInfoIcons && type.equals(MapIconTypes.INFO)) return false;
+ else if (mapConfig.showMiscIcons && type.equals(MapIconTypes.MISC)) return false;
+ else if (mapConfig.showNpcIcons && type.equals(MapIconTypes.NPC)) return false;
+ else if (mapConfig.showQuestIcons && type.equals(MapIconTypes.QUEST)) return false;
+ else return (!mapConfig.showShopIcons || !type.equals(MapIconTypes.SHOPS));
}
}
@@ -69,19 +74,20 @@ public class MapHandler {
NETHER(0.5f, 257, 371, 436, 732, 433, 736, new ResourceLocation("skyblockhud", "maps/fort.png"), Collections.emptyList()),
BARN(1.5f, 135, 130, -82, 320, -81, 318, new ResourceLocation("skyblockhud", "maps/barn.png"), Collections.emptyList()),
DWARVEN(0.5f, 409, 461, 206, 160, 202, 166, new ResourceLocation("skyblockhud", "maps/dwarven.png"), DwarvenIcons.dwarvenIcons),
+ CRYSTAL(0.5f, 624, 624, -202, -215.7, -202, -212, new ResourceLocation("skyblockhud", "maps/crystal.png"), Collections.emptyList()),
PARK(1f, 211, 230, 480, 133, 478, 134, new ResourceLocation("skyblockhud", "maps/park.png"), Collections.emptyList());
public float scaleFactor;
public int width;
public int height;
- public int xMiniOffset;
- public int yMiniOffset;
- public int xOffset;
- public int yOffset;
+ public double xMiniOffset;
+ public double yMiniOffset;
+ public double xOffset;
+ public double yOffset;
public ResourceLocation mapTexture;
public List<MapIcon> icons;
- Maps(float scaleFactor, int width, int height, int xMiniOffset, int yMiniOffset, int xOffset, int yOffset, ResourceLocation mapTexture, List<MapIcon> icons) {
+ Maps(float scaleFactor, int width, int height, double xMiniOffset, double yMiniOffset, double xOffset, double yOffset, ResourceLocation mapTexture, List<MapIcon> icons) {
this.scaleFactor = scaleFactor;
this.width = width;
this.height = height;
@@ -108,10 +114,10 @@ public class MapHandler {
Gui.drawModalRectWithCustomSizedTexture(pos.getAbsX(event.resolution, 72), pos.getAbsY(event.resolution, 72), 72, 0, 72, 72, 256, 256);
mc.renderEngine.bindTexture(map.mapTexture);
- int x = mc.thePlayer.getPosition().getX() + map.xMiniOffset;
- int z = mc.thePlayer.getPosition().getZ() + map.yMiniOffset;
- float u = (x / (map.width / 256f)) - 33f;
- float v = (z / (map.height / 256f)) - 28f;
+ double x = mc.thePlayer.getPosition().getX() + map.xMiniOffset;
+ double z = mc.thePlayer.getPosition().getZ() + map.yMiniOffset;
+ float u = (float) ((x / (map.width / 256f)) - 33f);
+ float v = (float) ((z / (map.height / 256f)) - 28f);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP);
@@ -154,8 +160,8 @@ public class MapHandler {
Gui.drawModalRectWithCustomSizedTexture((int) mapX, (int) mapY, 0, 0, (int) (map.width * map.scaleFactor), (int) (map.height * map.scaleFactor), (int) (map.width * map.scaleFactor), (int) (map.height * map.scaleFactor));
drawIcons((int) mapX, (int) mapY);
if (this.mc.thePlayer != null && SkyblockHud.config.map.showPlayerLocation) {
- int x = this.mc.thePlayer.getPosition().getX() + map.xOffset;
- int z = this.mc.thePlayer.getPosition().getZ() + map.yOffset;
+ double x = this.mc.thePlayer.getPosition().getX() + map.xOffset;
+ double z = this.mc.thePlayer.getPosition().getZ() + map.yOffset;
fontRendererObj.drawString("\u2022", (int) (x * map.scaleFactor + mapX), (int) (z * map.scaleFactor + mapY), 0xff0000);
}
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
@@ -165,12 +171,12 @@ public class MapHandler {
public void drawIcons(int startX, int startY) {
if (map.icons == null) return;
for (MapIcon icon : map.icons) {
- if (!icon.canRender()) continue;
+ if (icon.cantRender()) continue;
GlStateManager.enableBlend();
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
this.mc.renderEngine.bindTexture(icon.icon);
- float x = ((icon.position.x + map.xOffset) * map.scaleFactor) + startX - 4;
- float y = ((icon.position.y + map.yOffset) * map.scaleFactor) + startY - 4;
+ double x = ((icon.position.x + map.xOffset) * map.scaleFactor) + startX - 4;
+ double y = ((icon.position.y + map.yOffset) * map.scaleFactor) + startY - 4;
Gui.drawModalRectWithCustomSizedTexture((int) x, (int) y, 0, 0, 8, 8, 8, 8);
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
}
@@ -179,7 +185,7 @@ public class MapHandler {
public void onTooltip(int mouseX, int mouseY, int startX, int startY) {
if (map.icons == null) return;
for (MapIcon icon : map.icons) {
- if (!icon.canRender()) continue;
+ if (icon.cantRender()) continue;
if (Utils.inRangeInclusive(mouseX, (int) ((icon.position.x + map.xOffset) * map.scaleFactor) + startX - 4, (int) ((icon.position.x + map.xOffset) * map.scaleFactor) + startX + 4) && Utils.inRangeInclusive(mouseY, (int) ((icon.position.y + map.yOffset) * map.scaleFactor) + startY - 4, (int) ((icon.position.y + map.yOffset) * map.scaleFactor) + startY + 4)) {
drawHoveringText(Arrays.asList(icon.tooltip.split("\n")), mouseX, mouseY);
break;
@@ -192,7 +198,7 @@ public class MapHandler {
int mapX = (int) ((width / 2f) - ((map.width / 2f) * map.scaleFactor));
int mapY = (int) ((height / 2f) - ((map.height / 2f) * map.scaleFactor));
for (MapIcon icon : map.icons) {
- if (!icon.canRender()) continue;
+ if (icon.cantRender()) continue;
if (Utils.inRangeInclusive(mouseX, (int) ((icon.position.x + map.xOffset) * map.scaleFactor) + mapX - 4, (int) ((icon.position.x + map.xOffset) * map.scaleFactor) + mapX + 4) && Utils.inRangeInclusive(mouseY, (int) ((icon.position.y + map.yOffset) * map.scaleFactor) + mapY - 4, (int) ((icon.position.y + map.yOffset) * map.scaleFactor) + mapY + 4)) {
if (!icon.command.isEmpty()) {
this.mc.thePlayer.sendChatMessage("/" + icon.command);
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/NpcDialogue.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/NpcDialogue.java
index 0e7ccdc..59a5444 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/NpcDialogue.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/NpcDialogue.java
@@ -5,7 +5,7 @@ import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.thatgravyboat.skyblockhud.SkyblockHud;
-import com.thatgravyboat.skyblockhud.Utils;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import com.thatgravyboat.skyblockhud.textures.Textures;
import java.io.BufferedReader;
import java.io.InputStream;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java
index 519aef4..565fc72 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java
@@ -1,6 +1,6 @@
package com.thatgravyboat.skyblockhud.handlers;
-import com.thatgravyboat.skyblockhud.Utils;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent;
import com.thatgravyboat.skyblockhud.api.events.SidebarPostEvent;
import com.thatgravyboat.skyblockhud.api.events.SkyBlockEntityKilled;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/DwarvenIcons.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/DwarvenIcons.java
index f3e4955..b9c0185 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/DwarvenIcons.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/DwarvenIcons.java
@@ -1,11 +1,12 @@
package com.thatgravyboat.skyblockhud.handlers.mapicons;
-import com.thatgravyboat.skyblockhud.ComponentBuilder;
import com.thatgravyboat.skyblockhud.handlers.MapHandler;
+import com.thatgravyboat.skyblockhud.utils.ComponentBuilder;
+import net.minecraft.util.ResourceLocation;
+
+import javax.vecmath.Vector2f;
import java.util.ArrayList;
import java.util.List;
-import javax.vecmath.Vector2f;
-import net.minecraft.util.ResourceLocation;
public class DwarvenIcons {
@@ -20,20 +21,20 @@ public class DwarvenIcons {
}
private static void setupNpcIcons() {
- dwarvenIcons.add(new MapHandler.MapIcon(new Vector2f(181, 135), new ResourceLocation("skyblockhud", "maps/icons/puzzle.png"), new ComponentBuilder().nl("Puzzler", new char[] { 'a', 'l' }).nl("Description", 'l').nl("The Puzzler gives you a small puzzle each day to solve and").nl("gives you 1000 mithril powder.").build(), MapHandler.MapIconTypes.NPC));
+ dwarvenIcons.add(new MapHandler.MapIcon(new Vector2f(181, 135), new ResourceLocation("skyblockhud", "maps/icons/puzzle.png"), new ComponentBuilder().nl("Puzzler", 'a', 'l').nl("Description", 'l').nl("The Puzzler gives you a small puzzle each day to solve and").nl("gives you 1000 mithril powder.").build(), MapHandler.MapIconTypes.NPC));
}
private static void setupMiscIcons() {}
private static void setupInfoIcons() {
- dwarvenIcons.add(new MapHandler.MapIcon(new Vector2f(129, 187), new ResourceLocation("skyblockhud", "maps/icons/crown.png"), new ComponentBuilder().nl("King", new char[] { 'a', 'l' }).nl("Description", 'l').nl("The King allows you to first start commissions and if you click").nl("each king which change every skyblock day you will get").nl("the King Talisman.").nl().apd("Click to open HOTM", new char[] { '6', 'l' }).build(), MapHandler.MapIconTypes.INFO, "hotm"));
+ dwarvenIcons.add(new MapHandler.MapIcon(new Vector2f(129, 187), new ResourceLocation("skyblockhud", "maps/icons/crown.png"), new ComponentBuilder().nl("King", 'a', 'l').nl("Description", 'l').nl("The King allows you to first start commissions and if you click").nl("each king which change every skyblock day you will get").nl("the King Talisman.").nl().apd("Click to open HOTM", '6', 'l').build(), MapHandler.MapIconTypes.INFO, "hotm"));
}
private static void setupShopIcons() {
- dwarvenIcons.add(new MapHandler.MapIcon(new Vector2f(4, 8), new ResourceLocation("skyblockhud", "maps/icons/blacksmith.png"), new ComponentBuilder().nl("Forge", new char[] { 'a', 'l' }).nl("Description", 'l').nl("The Forge is where you can go craft special items").nl("and fuel your drill.").nl("NPCS", new char[] { 'c', 'l' }).nl(" Forger - Allows you to forge special items").nl(" Jotraeline Greatforge - Allows you to refuel your drill.").nl().apd("Click to warp", new char[] { '6', 'l' }).build(), MapHandler.MapIconTypes.SHOPS, "warpforge"));
+ dwarvenIcons.add(new MapHandler.MapIcon(new Vector2f(4, 8), new ResourceLocation("skyblockhud", "maps/icons/blacksmith.png"), new ComponentBuilder().nl("Forge", 'a', 'l').nl("Description", 'l').nl("The Forge is where you can go craft special items").nl("and fuel your drill.").nl("NPCS", 'c', 'l').nl(" Forger - Allows you to forge special items").nl(" Jotraeline Greatforge - Allows you to refuel your drill.").nl().apd("Click to warp", '6', 'l').build(), MapHandler.MapIconTypes.SHOPS, "warpforge"));
}
private static void setupQuestIcons() {
- dwarvenIcons.add(new MapHandler.MapIcon(new Vector2f(67, 204), new ResourceLocation("skyblockhud", "maps/icons/special.png"), new ComponentBuilder().nl("Royal Resident", new char[] { 'a', 'l' }).nl("The Royal Resident is a quest where you right").nl("click them for a bit to obtain and if you continue").nl("to right click them for about 7 hours it will give").apd("the achievement Royal Conversation.").build(), MapHandler.MapIconTypes.QUEST));
+ dwarvenIcons.add(new MapHandler.MapIcon(new Vector2f(67, 204), new ResourceLocation("skyblockhud", "maps/icons/special.png"), new ComponentBuilder().nl("Royal Resident", 'a', 'l').nl("The Royal Resident is a quest where you right").nl("click them for a bit to obtain and if you continue").nl("to right click them for about 7 hours it will give").apd("the achievement Royal Conversation.").build(), MapHandler.MapIconTypes.QUEST));
}
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/HubIcons.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/HubIcons.java
index 443afb7..0d0d40a 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/HubIcons.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/mapicons/HubIcons.java
@@ -1,11 +1,12 @@
package com.thatgravyboat.skyblockhud.handlers.mapicons;
-import com.thatgravyboat.skyblockhud.ComponentBuilder;
import com.thatgravyboat.skyblockhud.handlers.MapHandler;
+import com.thatgravyboat.skyblockhud.utils.ComponentBuilder;
+import net.minecraft.util.ResourceLocation;
+
+import javax.vecmath.Vector2f;
import java.util.ArrayList;
import java.util.List;
-import javax.vecmath.Vector2f;
-import net.minecraft.util.ResourceLocation;
public class HubIcons {
@@ -20,36 +21,36 @@ public class HubIcons {
}
private static void setupNpcIcons() {
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(-2, -34), new ResourceLocation("skyblockhud", "maps/icons/special.png"), new ComponentBuilder().nl("Event Hut", new char[] { 'a', 'l' }).nl("Description", 'l').nl("The Event Hut is where special event npcs").nl("are during some events.").nl("NPCS", new char[] { 'c', 'l' }).nl(" Baker - During New Years").nl(" Jerry - While Winter Island is opened").nl(" Fear Mongerer - During Spooky Festival").apd(" Oringo - During Traveling Zoo").build(), MapHandler.MapIconTypes.NPC));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(135, 142), new ResourceLocation("skyblockhud", "maps/icons/fairy.png"), new ComponentBuilder().nl("Fairy", new char[] { 'a', 'l' }).nl("Description", 'l').nl("The Fairy is where you go when you find fairy souls").apd("to trade them in to get permanent stat upgrades.").build(), MapHandler.MapIconTypes.NPC));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(-2, -34), new ResourceLocation("skyblockhud", "maps/icons/special.png"), new ComponentBuilder().nl("Event Hut", 'a', 'l').nl("Description", 'l').nl("The Event Hut is where special event npcs").nl("are during some events.").nl("NPC'S", 'c', 'l').nl(" Baker - During New Years").nl(" Jerry - While Winter Island is opened").nl(" Fear Mongerer - During Spooky Festival").apd(" Oringo - During Traveling Zoo").build(), MapHandler.MapIconTypes.NPC));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(135, 142), new ResourceLocation("skyblockhud", "maps/icons/fairy.png"), new ComponentBuilder().nl("Fairy", 'a', 'l').nl("Description", 'l').nl("The Fairy is where you go when you find fairy souls").apd("to trade them in to get permanent stat upgrades.").build(), MapHandler.MapIconTypes.NPC));
}
private static void setupShopIcons() {
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(-50, -22), new ResourceLocation("skyblockhud", "maps/icons/building.png"), new ComponentBuilder().nl("Builder's House", new char[] { 'a', 'l' }).nl("NPCS", new char[] { 'c', 'l' }).nl(" Wool Weaver").nl(" Builder").apd(" Mad Redstone Engineer").build(), MapHandler.MapIconTypes.SHOPS));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(-78, -46), new ResourceLocation("skyblockhud", "maps/icons/bar.png"), new ComponentBuilder().nl("Tavern", new char[] { 'a', 'l' }).nl("NPCS", new char[] { 'c', 'l' }).nl(" Bartender").nl(" Maddox the slayer").nl("Description", 'l').nl("The Tavern is where maddox the slayer is located you can").nl("start slayer quests with them to unlock").apd("new items the more slayer bosses you kill.").build(), MapHandler.MapIconTypes.SHOPS));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(36, -82), new ResourceLocation("skyblockhud", "maps/icons/vet.png"), new ComponentBuilder().nl("Vet", new char[] { 'a', 'l' }).nl("NPCS", new char[] { 'c', 'l' }).nl(" Bea").nl(" Zog").nl(" Kat").nl(" George").nl("Description", 'l').nl("The Vet is where you go to upgrade your pet").nl("at Kat or to buy pet upgrade items from Zog").nl("or trade in your pet at George and if you're").apd("a new player you can buy a bee pet from Bea.").build(), MapHandler.MapIconTypes.SHOPS));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(58, -73), new ResourceLocation("skyblockhud", "maps/icons/fishing_merchant.png"), new ComponentBuilder().nl("Fishing Merchant", new char[] { 'a', 'l' }).nl("Description", 'l').nl("The Fishing Merchant allows you to buy").nl("fishing related items and he has his friend").nl("joe whose in the house hes setup").apd("in front of who sells sponges.").build(), MapHandler.MapIconTypes.SHOPS));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(46, -53), new ResourceLocation("skyblockhud", "maps/icons/witch.png"), new ComponentBuilder().nl("Alchemist", new char[] { 'a', 'l' }).nl("Description", 'l').nl("The Alchemist allows you to buy").apd("potion making related items").build(), MapHandler.MapIconTypes.SHOPS));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(-4, -128), new ResourceLocation("skyblockhud", "maps/icons/metal_merchants.png"), new ComponentBuilder().nl("Blacksmith Merchants", new char[] { 'a', 'l' }).nl("Merchants", new char[] { 'c', 'l' }).nl(" Weaponsmith - Weapon Related Items").nl(" Armorsmith - Armor Related Items").apd(" Mine Merchant - Mining Related Items").build(), MapHandler.MapIconTypes.SHOPS));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(-30, -120), new ResourceLocation("skyblockhud", "maps/icons/blacksmith.png"), new ComponentBuilder().nl("Blacksmith", new char[] { 'a', 'l' }).nl("NPCS", new char[] { 'c', 'l' }).nl(" Blacksmith").nl(" Dusk").nl(" Smithmonger").nl("Description", 'l').nl("The Blacksmith lets you reforge your items").nl("while the Smithmonger allows you to buy reforge stones").apd("and Dusk allows you to combine and apply runes.").build(), MapHandler.MapIconTypes.SHOPS));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(124, 180), new ResourceLocation("skyblockhud", "maps/icons/dark_bar.png"), new ComponentBuilder().nl("Dark Bar", new char[] { 'a', 'l' }).nl("NPCS", new char[] { 'c', 'l' }).nl(" Shifty").nl(" Lucius").nl("Description", 'l').nl("The Dark Bar is where you can buy special").nl("brews from Shifty and you can buy special").nl("items from Lucius after buying a certain").apd("amount of items from the Dark Auction.").build(), MapHandler.MapIconTypes.SHOPS));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(92, 185), new ResourceLocation("skyblockhud", "maps/icons/dark_ah.png"), new ComponentBuilder().nl("Dark Auction", new char[] { 'a', 'l' }).nl("Description", 'l').nl("The Dark Auction allows you to buy").nl("super special items from Sirius the").apd("auctioneer in a special auction.").build(), MapHandler.MapIconTypes.SHOPS));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(-245, 52), new ResourceLocation("skyblockhud", "maps/icons/scroll.png"), new ComponentBuilder().nl("Lonely Philosopher", new char[] { 'a', 'l' }).nl("Shop", new char[] { '6', 'l' }).nl(" Travel Scroll to Hub Castle").nl().nl(" Cost").nl(" 150,000 Coins", '6').nl().apd(" Requires ").apd("MVP", 'b').apd("+", 'c').build(), MapHandler.MapIconTypes.SHOPS));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(24, -38), new ResourceLocation("skyblockhud", "maps/icons/tux.png"), new ComponentBuilder().nl("Fashion Shop", new char[] { 'a', 'l' }).nl("NPCS", new char[] { 'c', 'l' }).nl(" Wool Weaver").nl(" Builder").apd(" Mad Redstone Engineer").build(), MapHandler.MapIconTypes.SHOPS));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(-50, -22), new ResourceLocation("skyblockhud", "maps/icons/building.png"), new ComponentBuilder().nl("Builder's House", 'a', 'l').nl("NPCS", 'c', 'l').nl(" Wool Weaver").nl(" Builder").apd(" Mad Redstone Engineer").build(), MapHandler.MapIconTypes.SHOPS));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(-78, -46), new ResourceLocation("skyblockhud", "maps/icons/bar.png"), new ComponentBuilder().nl("Tavern", 'a', 'l').nl("NPCS", 'c', 'l').nl(" Bartender").nl(" Maddox the slayer").nl("Description", 'l').nl("The Tavern is where maddox the slayer is located you can").nl("start slayer quests with them to unlock").apd("new items the more slayer bosses you kill.").build(), MapHandler.MapIconTypes.SHOPS));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(36, -82), new ResourceLocation("skyblockhud", "maps/icons/vet.png"), new ComponentBuilder().nl("Vet", 'a', 'l').nl("NPCS", 'c', 'l').nl(" Bea").nl(" Zog").nl(" Kat").nl(" George").nl("Description", 'l').nl("The Vet is where you go to upgrade your pet").nl("at Kat or to buy pet upgrade items from Zog").nl("or trade in your pet at George and if you're").apd("a new player you can buy a bee pet from Bea.").build(), MapHandler.MapIconTypes.SHOPS));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(58, -73), new ResourceLocation("skyblockhud", "maps/icons/fishing_merchant.png"), new ComponentBuilder().nl("Fishing Merchant", 'a', 'l').nl("Description", 'l').nl("The Fishing Merchant allows you to buy").nl("fishing related items and he has his friend").nl("joe whose in the house hes setup").apd("in front of who sells sponges.").build(), MapHandler.MapIconTypes.SHOPS));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(46, -53), new ResourceLocation("skyblockhud", "maps/icons/witch.png"), new ComponentBuilder().nl("Alchemist", 'a', 'l').nl("Description", 'l').nl("The Alchemist allows you to buy").apd("potion making related items").build(), MapHandler.MapIconTypes.SHOPS));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(-4, -128), new ResourceLocation("skyblockhud", "maps/icons/metal_merchants.png"), new ComponentBuilder().nl("Blacksmith Merchants", 'a', 'l').nl("Merchants", 'c', 'l').nl(" Weaponsmith - Weapon Related Items").nl(" Armorsmith - Armor Related Items").apd(" Mine Merchant - Mining Related Items").build(), MapHandler.MapIconTypes.SHOPS));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(-30, -120), new ResourceLocation("skyblockhud", "maps/icons/blacksmith.png"), new ComponentBuilder().nl("Blacksmith", 'a', 'l').nl("NPCS", 'c', 'l').nl(" Blacksmith").nl(" Dusk").nl(" Smithmonger").nl("Description", 'l').nl("The Blacksmith lets you reforge your items").nl("while the Smithmonger allows you to buy reforge stones").apd("and Dusk allows you to combine and apply runes.").build(), MapHandler.MapIconTypes.SHOPS));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(124, 180), new ResourceLocation("skyblockhud", "maps/icons/dark_bar.png"), new ComponentBuilder().nl("Dark Bar", 'a', 'l').nl("NPCS", 'c', 'l').nl(" Shifty").nl(" Lucius").nl("Description", 'l').nl("The Dark Bar is where you can buy special").nl("brews from Shifty and you can buy special").nl("items from Lucius after buying a certain").apd("amount of items from the Dark Auction.").build(), MapHandler.MapIconTypes.SHOPS));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(92, 185), new ResourceLocation("skyblockhud", "maps/icons/dark_ah.png"), new ComponentBuilder().nl("Dark Auction", 'a', 'l').nl("Description", 'l').nl("The Dark Auction allows you to buy").nl("super special items from Sirius the").apd("auctioneer in a special auction.").build(), MapHandler.MapIconTypes.SHOPS));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(-245, 52), new ResourceLocation("skyblockhud", "maps/icons/scroll.png"), new ComponentBuilder().nl("Lonely Philosopher", 'a', 'l').nl("Shop", '6', 'l').nl(" Travel Scroll to Hub Castle").nl().nl(" Cost").nl(" 150,000 Coins", '6').nl().apd(" Requires ").apd("MVP", 'b').apd("+", 'c').build(), MapHandler.MapIconTypes.SHOPS));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(24, -38), new ResourceLocation("skyblockhud", "maps/icons/tux.png"), new ComponentBuilder().nl("Fashion Shop", 'a', 'l').nl("NPCS", 'c', 'l').nl(" Wool Weaver").nl(" Builder").apd(" Mad Redstone Engineer").build(), MapHandler.MapIconTypes.SHOPS));
}
private static void setupMiscIcons() {
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(-24, -53), new ResourceLocation("skyblockhud", "maps/icons/bank.png"), new ComponentBuilder().nl("Bank", new char[] { 'a', 'l' }).nl("Description", 'l').nl("The Bank is where you can store your money on skyblock").apd("you can also store some items in the vault.").build(), MapHandler.MapIconTypes.MISC));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(-26, -80), new ResourceLocation("skyblockhud", "maps/icons/ah.png"), new ComponentBuilder().nl("Auction House", new char[] { 'a', 'l' }).nl("Description", 'l').nl("The Auction House is where you can auction off your").apd("precious items in skyblock to make a profit.").build(), MapHandler.MapIconTypes.MISC));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(-38, -66), new ResourceLocation("skyblockhud", "maps/icons/bazaar.png"), new ComponentBuilder().nl("Bazaar", new char[] { 'a', 'l' }).nl("Description", 'l').nl("The Bazaar is where you can sell specific items").nl("on a sort of stock market and request and").apd("sell items at a specific price.").build(), MapHandler.MapIconTypes.MISC));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(-24, -53), new ResourceLocation("skyblockhud", "maps/icons/bank.png"), new ComponentBuilder().nl("Bank", 'a', 'l').nl("Description", 'l').nl("The Bank is where you can store your money on skyblock").apd("you can also store some items in the vault.").build(), MapHandler.MapIconTypes.MISC));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(-26, -80), new ResourceLocation("skyblockhud", "maps/icons/ah.png"), new ComponentBuilder().nl("Auction House", 'a', 'l').nl("Description", 'l').nl("The Auction House is where you can auction off your").apd("precious items in skyblock to make a profit.").build(), MapHandler.MapIconTypes.MISC));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(-38, -66), new ResourceLocation("skyblockhud", "maps/icons/bazaar.png"), new ComponentBuilder().nl("Bazaar", 'a', 'l').nl("Description", 'l').nl("The Bazaar is where you can sell specific items").nl("on a sort of stock market and request and").apd("sell items at a specific price.").build(), MapHandler.MapIconTypes.MISC));
}
private static void setupInfoIcons() {
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(8, -95), new ResourceLocation("skyblockhud", "maps/icons/community.png"), new ComponentBuilder().nl("Community Center", new char[] { 'a', 'l' }).nl("Description", 'l').nl("The Community Center is where you can vote").nl("for your favorite election candidate,").nl("access the community shop, upgrade your").apd("account, and help with city projects.").build(), MapHandler.MapIconTypes.INFO));
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(150, 45), new ResourceLocation("skyblockhud", "maps/icons/fishing.png"), new ComponentBuilder().nl("Fisherman's Hut", new char[] { 'a', 'l' }).nl("Description", 'l').nl("This is a spot where people regularly").nl("do their fishing, this is one").apd("of many spots.").build(), MapHandler.MapIconTypes.INFO));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(8, -95), new ResourceLocation("skyblockhud", "maps/icons/community.png"), new ComponentBuilder().nl("Community Center", 'a', 'l').nl("Description", 'l').nl("The Community Center is where you can vote").nl("for your favorite election candidate,").nl("access the community shop, upgrade your").apd("account, and help with city projects.").build(), MapHandler.MapIconTypes.INFO));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(150, 45), new ResourceLocation("skyblockhud", "maps/icons/fishing.png"), new ComponentBuilder().nl("Fisherman's Hut", 'a', 'l').nl("Description", 'l').nl("This is a spot where people regularly").nl("do their fishing, this is one").apd("of many spots.").build(), MapHandler.MapIconTypes.INFO));
}
private static void setupQuestIcons() {
- hubIcons.add(new MapHandler.MapIcon(new Vector2f(-8, -10), new ResourceLocation("skyblockhud", "maps/icons/painter.png"), new ComponentBuilder().nl("Marco", new char[] { 'a', 'l' }).nl("Description", 'l').nl("Marco is an NPC that has no other uses").nl("besides giving you a spray can for").apd("completing a quest.").build(), MapHandler.MapIconTypes.QUEST));
+ hubIcons.add(new MapHandler.MapIcon(new Vector2f(-8, -10), new ResourceLocation("skyblockhud", "maps/icons/painter.png"), new ComponentBuilder().nl("Marco", 'a', 'l').nl("Description", 'l').nl("Marco is an NPC that has no other uses").nl("besides giving you a spray can for").apd("completing a quest.").build(), MapHandler.MapIconTypes.QUEST));
}
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java
index 2e2fae1..11fb40e 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java
@@ -1,11 +1,8 @@
package com.thatgravyboat.skyblockhud.location;
-import com.thatgravyboat.skyblockhud.Utils;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import com.thatgravyboat.skyblockhud.api.events.ProfileSwitchedEvent;
import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent;
-import com.thatgravyboat.skyblockhud.api.events.SidebarPostEvent;
-import com.thatgravyboat.skyblockhud.handlers.CurrencyHandler;
-import java.util.Arrays;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class IslandHandler {
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java b/src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java
index f54999c..4d60baa 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java
@@ -1,10 +1,10 @@
package com.thatgravyboat.skyblockhud.location;
-import static com.thatgravyboat.skyblockhud.handlers.MapHandler.Maps;
-
import com.thatgravyboat.skyblockhud.SkyblockHud;
import com.thatgravyboat.skyblockhud.handlers.MapHandler;
+import static com.thatgravyboat.skyblockhud.handlers.MapHandler.Maps;
+
public enum LocationCategory {
ERROR("error", 34),
ISLAND("island", 43),
@@ -20,7 +20,7 @@ public enum LocationCategory {
JERRY("jerry", 59),
THEEND("the_end", 123),
DWARVENMINES("dwarven_mines", 131, Maps.DWARVEN),
- CRYSTALHOLLOWS("crystal_hollows", 139);
+ CRYSTALHOLLOWS("crystal_hollows", 139, Maps.CRYSTAL);
private final String name;
private final int texturePos;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java
index bc49329..d8cd95e 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java
@@ -1,10 +1,8 @@
package com.thatgravyboat.skyblockhud.mixins;
-import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.*;
-
import com.thatgravyboat.skyblockhud.SkyblockHud;
-import com.thatgravyboat.skyblockhud.Utils;
import com.thatgravyboat.skyblockhud.overlay.MiningHud;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.GuiIngameForge;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
@@ -16,6 +14,8 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
+import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.*;
+
@Mixin(GuiIngameForge.class)
public class MixinGuiIngameForge {
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java
index a1dd5a1..e680bbb 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java
@@ -1,8 +1,8 @@
package com.thatgravyboat.skyblockhud.overlay;
import com.thatgravyboat.skyblockhud.SkyblockHud;
-import com.thatgravyboat.skyblockhud.SpecialColour;
-import com.thatgravyboat.skyblockhud.Utils;
+import com.thatgravyboat.skyblockhud.utils.SpecialColour;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import com.thatgravyboat.skyblockhud.config.SBHConfig;
import com.thatgravyboat.skyblockhud.core.config.Position;
import com.thatgravyboat.skyblockhud.dungeons.Classes;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java
index 8f4ec82..418b4e0 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java
@@ -1,7 +1,7 @@
package com.thatgravyboat.skyblockhud.overlay;
import com.thatgravyboat.skyblockhud.SkyblockHud;
-import com.thatgravyboat.skyblockhud.Utils;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import com.thatgravyboat.skyblockhud.core.config.Position;
import com.thatgravyboat.skyblockhud.textures.Textures;
import net.minecraft.client.Minecraft;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java
index 1259298..40a3b31 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java
@@ -1,7 +1,7 @@
package com.thatgravyboat.skyblockhud.overlay;
import com.thatgravyboat.skyblockhud.SkyblockHud;
-import com.thatgravyboat.skyblockhud.Utils;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import com.thatgravyboat.skyblockhud.handlers.BossbarHandler;
import com.thatgravyboat.skyblockhud.handlers.CurrencyHandler;
import com.thatgravyboat.skyblockhud.handlers.SlayerHandler;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java
index f082a47..3261daf 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java
@@ -2,7 +2,7 @@ package com.thatgravyboat.skyblockhud.overlay;
import com.mojang.realmsclient.gui.ChatFormatting;
import com.thatgravyboat.skyblockhud.SkyblockHud;
-import com.thatgravyboat.skyblockhud.Utils;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import com.thatgravyboat.skyblockhud.core.config.Position;
import com.thatgravyboat.skyblockhud.handlers.HeldItemHandler;
import com.thatgravyboat.skyblockhud.textures.Textures;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java b/src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java
index 1934020..847cdc9 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java
@@ -1,11 +1,9 @@
package com.thatgravyboat.skyblockhud.playerstats;
import com.thatgravyboat.skyblockhud.SkyblockHud;
-import com.thatgravyboat.skyblockhud.Utils;
import com.thatgravyboat.skyblockhud.overlay.MiningHud;
import com.thatgravyboat.skyblockhud.overlay.RPGHud;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IChatComponent;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
@@ -13,6 +11,9 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
public class ActionBarParsing {
private static String lastActionBar = "";
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/seasons/SeasonDateHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/seasons/SeasonDateHandler.java
index bc36b70..45241c5 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/seasons/SeasonDateHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/seasons/SeasonDateHandler.java
@@ -1,10 +1,11 @@
package com.thatgravyboat.skyblockhud.seasons;
-import com.thatgravyboat.skyblockhud.Utils;
import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent;
-import java.util.regex.Pattern;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import java.util.regex.Pattern;
+
public class SeasonDateHandler {
private static Season currentSeason = Season.ERROR;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/textures/Textures.java b/src/main/java/com/thatgravyboat/skyblockhud/textures/Textures.java
index 8a6eb1d..c80b72f 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/textures/Textures.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/textures/Textures.java
@@ -6,14 +6,15 @@ import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.thatgravyboat.skyblockhud.SkyblockHud;
+import net.minecraft.client.resources.IResource;
+import net.minecraft.client.resources.IResourceManager;
+import net.minecraft.client.resources.IResourceManagerReloadListener;
+import net.minecraft.util.ResourceLocation;
+
import java.io.BufferedReader;
-import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.List;
-import net.minecraft.client.resources.IResourceManager;
-import net.minecraft.client.resources.IResourceManagerReloadListener;
-import net.minecraft.util.ResourceLocation;
public class Textures implements IResourceManagerReloadListener {
@@ -39,14 +40,16 @@ public class Textures implements IResourceManagerReloadListener {
DEFAULT_TEXTURE.displayName = "Default";
try {
ResourceLocation stylesData = new ResourceLocation("skyblockhud:data/styles.json");
- InputStream is = resourceManager.getResource(stylesData).getInputStream();
- try (BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {
- JsonObject jsonObject = gson.fromJson(reader, JsonObject.class);
- for (JsonElement json : jsonObject.getAsJsonArray("styles")) {
- styles.add(TextureObject.decode((JsonObject) json));
- }
- if (jsonObject.has("defaultDisplayName") && jsonObject.get("defaultDisplayName").isJsonPrimitive()) {
- DEFAULT_TEXTURE.displayName = jsonObject.get("defaultDisplayName").getAsString();
+
+ for (IResource resource : resourceManager.getAllResources(stylesData)) {
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8))) {
+ JsonObject jsonObject = gson.fromJson(reader, JsonObject.class);
+ for (JsonElement json : jsonObject.getAsJsonArray("styles")) {
+ styles.add(TextureObject.decode((JsonObject) json));
+ }
+ if (DEFAULT_TEXTURE.displayName.equals("Default") && jsonObject.has("defaultDisplayName") && jsonObject.get("defaultDisplayName").isJsonPrimitive()) {
+ DEFAULT_TEXTURE.displayName = jsonObject.get("defaultDisplayName").getAsString();
+ }
}
}
} catch (Exception ignored) {}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java
index 750494f..1b54011 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java
@@ -1,12 +1,11 @@
package com.thatgravyboat.skyblockhud.tracker;
import com.thatgravyboat.skyblockhud.SkyblockHud;
-import com.thatgravyboat.skyblockhud.Utils;
import com.thatgravyboat.skyblockhud.api.events.SkyBlockEntityKilled;
import com.thatgravyboat.skyblockhud.core.config.Position;
import com.thatgravyboat.skyblockhud.location.LocationHandler;
import com.thatgravyboat.skyblockhud.location.Locations;
-import java.util.*;
+import com.thatgravyboat.skyblockhud.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.GlStateManager;
@@ -16,6 +15,8 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import java.util.*;
+
public class TrackerHandler extends Gui {
public static Set<TrackerObject> trackerObjects = new HashSet<>();
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java b/src/main/java/com/thatgravyboat/skyblockhud/utils/ComponentBuilder.java
index b0c17be..1a73e95 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/utils/ComponentBuilder.java
@@ -1,4 +1,4 @@
-package com.thatgravyboat.skyblockhud;
+package com.thatgravyboat.skyblockhud.utils;
public class ComponentBuilder {
@@ -12,7 +12,7 @@ public class ComponentBuilder {
return apd(text, '7');
}
- public ComponentBuilder apd(String text, char[] colors) {
+ public ComponentBuilder apd(String text, char... colors) {
for (char color : colors) {
builder.append("\u00A7").append(color);
}
@@ -36,7 +36,7 @@ public class ComponentBuilder {
return this;
}
- public ComponentBuilder nl(String text, char[] colors) {
+ public ComponentBuilder nl(String text, char... colors) {
apd(text, colors);
builder.append("\n");
return this;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/SpecialColour.java b/src/main/java/com/thatgravyboat/skyblockhud/utils/SpecialColour.java
index 38a48cc..9c1b723 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/SpecialColour.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/utils/SpecialColour.java
@@ -1,4 +1,4 @@
-package com.thatgravyboat.skyblockhud;
+package com.thatgravyboat.skyblockhud.utils;
import java.awt.*;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/Utils.java b/src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java
index be28acc..2a4016f 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java
@@ -1,13 +1,6 @@
-package com.thatgravyboat.skyblockhud;
+package com.thatgravyboat.skyblockhud.utils;
-import java.math.RoundingMode;
-import java.nio.FloatBuffer;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.LinkedList;
-import java.util.Locale;
+import com.thatgravyboat.skyblockhud.SkyblockHud;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.FontRenderer;
@@ -29,6 +22,15 @@ import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;
+import java.math.RoundingMode;
+import java.nio.FloatBuffer;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.Locale;
+
public class Utils {
private static LinkedList<Integer> guiScales = new LinkedList<>();