From 3a1917c8a0af4157cc1e6d5f3986e89377f245d8 Mon Sep 17 00:00:00 2001 From: ThatGravyBoat Date: Sun, 11 Jul 2021 18:57:24 -0230 Subject: Added Mining Overlay including drill bar and heat bar Added mana cost display Update Location Stuff Added new mining events stopped scoreboard logging spam removed missing location logging as hypixel dumb and sends the wrong thing once and a while causing it to log useless stuff. Added DEV Commands --- .../skyblockhud/tracker/KillTrackerHandler.java | 54 ---------------------- .../skyblockhud/tracker/TrackerHandler.java | 7 +-- 2 files changed, 4 insertions(+), 57 deletions(-) delete mode 100644 src/main/java/com/thatgravyboat/skyblockhud/tracker/KillTrackerHandler.java (limited to 'src/main/java/com/thatgravyboat/skyblockhud/tracker') diff --git a/src/main/java/com/thatgravyboat/skyblockhud/tracker/KillTrackerHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/tracker/KillTrackerHandler.java deleted file mode 100644 index 5d5615f..0000000 --- a/src/main/java/com/thatgravyboat/skyblockhud/tracker/KillTrackerHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.thatgravyboat.skyblockhud.tracker; - -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; -import net.minecraft.client.Minecraft; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.AttackEntityEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -public class KillTrackerHandler { - - public static final Set attackedEntities = new HashSet<>(); - - @SubscribeEvent - public void onAttack(AttackEntityEvent event) { - if (event.target != null) { - attackedEntities.add(event.target.getUniqueID()); - } - } - - @SubscribeEvent - public void onDeath(LivingDeathEvent event) { - if (false) { - //Used for testing - System.out.println("----------------------------------------------------------------------------------------------------------------"); - System.out.println("Name : " + event.entity.getName()); - System.out.println("UUID : " + event.entity.getUniqueID()); - NBTTagCompound tag = new NBTTagCompound(); - event.entity.writeToNBT(tag); - System.out.println("Tag : " + tag); - System.out.println("Damage : " + getDamageSourceString(event.source)); - System.out.println("----------------------------------------------------------------------------------------------------------------"); - } - - attackedEntities.remove(event.entity.getUniqueID()); - } - - public static String getDamageSourceString(DamageSource source) { - return ("{ " + source.getDamageType() + ", " + source.isDamageAbsolute() + ", " + source.isDifficultyScaled() + ", " + source.isFireDamage() + ", " + source.isProjectile() + ", " + source.isUnblockable() + ", " + source.isExplosion() + ", " + source.isMagicDamage() + ", " + source.isCreativePlayer() + ", " + source.getSourceOfDamage() + " }"); - } - - @SubscribeEvent - public void onWorldChange(EntityJoinWorldEvent event) { - if (event.entity != null) { - if (event.entity.getUniqueID().equals(Minecraft.getMinecraft().thePlayer.getUniqueID())) { - attackedEntities.clear(); - } - } - } -} diff --git a/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java index fa2bacf..f1862d6 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java @@ -6,7 +6,6 @@ import com.thatgravyboat.skyblockhud.core.config.Position; import com.thatgravyboat.skyblockhud.location.LocationHandler; import com.thatgravyboat.skyblockhud.location.Locations; import com.thatgravyboat.skyblockhud.seasons.SeasonDateHandler; -import java.util.*; 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 { public static class TrackerData { @@ -82,14 +83,14 @@ public class TrackerHandler { @SubscribeEvent public void renderOverlay(RenderGameOverlayEvent.Post event) { - if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), trackerIds.containsKey(LocationHandler.getCurrentLocation()), !SkyblockHud.config.trackers.hideTracker)) { + if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), trackerIds.containsKey(LocationHandler.getCurrentLocation())/*,!SkyblockHud.config.trackers.hideTracker*/)) { String trackerId = trackerIds.get(LocationHandler.getCurrentLocation()); Minecraft mc = Minecraft.getMinecraft(); TrackerData tracked = trackers.get(trackerId); Map tracker = tracked.dropTrackers.get(tracked.getDropId(SeasonDateHandler.getCurrentEvent())); if (tracker != null) { - Position pos = SkyblockHud.config.trackers.trackerPosition; + Position pos = null;// SkyblockHud.config.trackers.trackerPosition; int startPos = pos.getAbsX(event.resolution, (tracker.size() >= 6 ? 120 : tracker.size() * 20)); int y = pos.getAbsY(event.resolution, (int) (10 + Math.ceil(tracker.size() / 5d) * 20)); -- cgit