aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/handlers
diff options
context:
space:
mode:
authorTymanWasTaken <tyman@tyman.tech>2021-07-06 17:24:20 -0400
committerTymanWasTaken <tyman@tyman.tech>2021-07-06 17:24:20 -0400
commit98ee5a2ae8090c061b1e61e7955d793416991822 (patch)
treee34bb84ed247f08f2931f10d1dfbf6c8b883004c /src/main/java/com/thatgravyboat/skyblockhud/handlers
parentc04ca523f9fb9f7adefa74587db61f76deeae9f0 (diff)
downloadSkyblockHud-Death-Defied-98ee5a2ae8090c061b1e61e7955d793416991822.tar.gz
SkyblockHud-Death-Defied-98ee5a2ae8090c061b1e61e7955d793416991822.tar.bz2
SkyblockHud-Death-Defied-98ee5a2ae8090c061b1e61e7955d793416991822.zip
140?
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/handlers')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java8
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java87
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java4
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/TimeHandler.java7
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeHelper.java5
5 files changed, 13 insertions, 98 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java
index fa0d21c..da27590 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java
@@ -14,13 +14,7 @@ public class HeldItemHandler extends Gui {
public void drawFuelBar(Minecraft mc, int current, int max) {
GenericOverlays.drawSmallBar(mc, 100, 100, (double) current / (double) max, 1.0d, 0xff00ff, 0xffff00, 0);
- drawString(
- mc.fontRendererObj,
- "Fuel - " + Math.round(((double) current / (double) max) * 100) + "%",
- 100,
- 100,
- 0xffffff
- );
+ drawString(mc.fontRendererObj, "Fuel - " + Math.round(((double) current / (double) max) * 100) + "%", 100, 100, 0xffffff);
}
public boolean isDrill(ItemStack stack) {
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java
index 5bc90d8..c8ef43b 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java
@@ -68,72 +68,12 @@ public class MapHandler {
public enum Maps {
HUB(0.5f, 494, 444, 294, 218, 294, 224, new ResourceLocation("skyblockhud", "maps/hub.png"), HubIcons.hubIcons),
- MUSHROOM(
- 1.0f,
- 318,
- 316,
- -84,
- 605,
- -84,
- 612,
- new ResourceLocation("skyblockhud", "maps/mushroom.png"),
- Collections.emptyList()
- ),
- SPIDERS(
- 1.0f,
- 270,
- 238,
- 400,
- 362,
- 400,
- 364,
- new ResourceLocation("skyblockhud", "maps/spidersden.png"),
- Collections.emptyList()
- ),
- 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
- ),
- PARK(
- 1.0f,
- 211,
- 230,
- 480,
- 133,
- 478,
- 134,
- new ResourceLocation("skyblockhud", "maps/park.png"),
- Collections.emptyList()
- );
+ MUSHROOM(1.0f, 318, 316, -84, 605, -84, 612, new ResourceLocation("skyblockhud", "maps/mushroom.png"), Collections.emptyList()),
+ SPIDERS(1.0f, 270, 238, 400, 362, 400, 364, new ResourceLocation("skyblockhud", "maps/spidersden.png"), Collections.emptyList()),
+ 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),
+ PARK(1.0f, 211, 230, 480, 133, 478, 134, new ResourceLocation("skyblockhud", "maps/park.png"), Collections.emptyList());
public float scaleFactor;
public int width;
@@ -170,13 +110,7 @@ public class MapHandler {
@SubscribeEvent
public void renderOverlay(RenderGameOverlayEvent.Post event) {
- if (
- Utils.overlayShouldRender(
- event.type,
- SkyblockHud.hasSkyblockScoreboard(),
- SkyblockHud.config.map.showMiniMap
- )
- ) {
+ if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), SkyblockHud.config.map.showMiniMap)) {
Minecraft mc = Minecraft.getMinecraft();
if (mc.currentScreen instanceof MapScreen) return;
if (LocationHandler.getCurrentLocation().getCategory().getMap() == null) return;
@@ -298,12 +232,7 @@ public class MapHandler {
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;
- fontRendererObj.drawString(
- "\u2022",
- (int) (x * map.scaleFactor + mapX),
- (int) (z * map.scaleFactor + mapY),
- 0xff0000
- );
+ fontRendererObj.drawString("\u2022", (int) (x * map.scaleFactor + mapX), (int) (z * map.scaleFactor + mapY), 0xff0000);
}
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
onTooltip(mouseX, mouseY, (int) mapX, (int) mapY);
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java
index 627be26..b25733b 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java
@@ -82,9 +82,7 @@ public class SlayerHandler {
}
SlayerHandler.currentSlayer = selectedSlayer;
SlayerHandler.slayerTier =
- Utils.whatRomanNumeral(
- slayer.replace(selectedSlayer.getDisplayName().toLowerCase(), "").replace(" ", "")
- );
+ Utils.whatRomanNumeral(slayer.replace(selectedSlayer.getDisplayName().toLowerCase(), "").replace(" ", ""));
break;
}
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/TimeHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/TimeHandler.java
index 91b3835..f1aa222 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/TimeHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/TimeHandler.java
@@ -17,12 +17,9 @@ public class TimeHandler {
if (Pattern.matches("([0-9]*):([0-9]*)(pm|am)", event.formattedLine.toLowerCase().trim())) {
boolean isPm = event.formattedLine.toLowerCase().trim().endsWith("pm");
SimpleDateFormat parseFormat = new SimpleDateFormat("hh:mm a", Locale.CANADA);
- String currentTimeString = event.formattedLine
- .replace(" ", "")
- .replace(isPm ? "pm" : "am", isPm ? " pm" : " am");
+ String currentTimeString = event.formattedLine.replace(" ", "").replace(isPm ? "pm" : "am", isPm ? " pm" : " am");
try {
- time =
- (parseFormat.parse(currentTimeString).getTime() - parseFormat.parse("00:00 am").getTime()) / 1000L;
+ time = (parseFormat.parse(currentTimeString).getTime() - parseFormat.parse("00:00 am").getTime()) / 1000L;
} catch (ParseException ignored) {
LogManager.getLogger().warn("timeformat error: " + currentTimeString);
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeHelper.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeHelper.java
index eda0b6f..a59b0db 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeHelper.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/sbentities/EntityTypeHelper.java
@@ -11,10 +11,7 @@ public class EntityTypeHelper {
public static boolean isZealot(Entity entity) {
if (entity instanceof EntityEnderman) {
EntityEnderman enderman = ((EntityEnderman) entity);
- double maxHealthBase = enderman
- .getAttributeMap()
- .getAttributeInstanceByName("generic.maxHealth")
- .getBaseValue();
+ double maxHealthBase = enderman.getAttributeMap().getAttributeInstanceByName("generic.maxHealth").getBaseValue();
if (
maxHealthBase == 13000d ||
(maxHealthBase == 2000d && enderman.getHeldBlockState().getBlock().equals(Blocks.end_portal_frame))