diff options
author | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-11 18:57:24 -0230 |
---|---|---|
committer | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-11 18:57:24 -0230 |
commit | 3a1917c8a0af4157cc1e6d5f3986e89377f245d8 (patch) | |
tree | 0a25fdc3ad1fc48da3f0d06c501f772ac9cfc353 /src/main/java/com/thatgravyboat/skyblockhud/tracker | |
parent | 5a98a98dfc0009599b90280ae3a1f166de21e6e8 (diff) | |
download | SkyblockHud-Death-Defied-3a1917c8a0af4157cc1e6d5f3986e89377f245d8.tar.gz SkyblockHud-Death-Defied-3a1917c8a0af4157cc1e6d5f3986e89377f245d8.tar.bz2 SkyblockHud-Death-Defied-3a1917c8a0af4157cc1e6d5f3986e89377f245d8.zip |
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
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/tracker')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/tracker/KillTrackerHandler.java | 54 | ||||
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java | 7 |
2 files changed, 4 insertions, 57 deletions
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<UUID> 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<String, ItemStack> 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)); |