diff options
author | bowser0000 <bowser0000@gmail.com> | 2021-04-08 08:43:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-08 08:43:19 -0400 |
commit | 14efcd8b81763d1c06a4291eeb6a0f1aaeb770fe (patch) | |
tree | 5b58218f51e6f358e5dd15946580dd7b7159c79a /src/main/java/me/Danker/features/AutoDisplay.java | |
parent | 435d8dfd5a7f36803ceefcbd245e814ec735aced (diff) | |
parent | 8b1c19bff9ca13034e794ef76086e75aaf59bd14 (diff) | |
download | SkyblockMod-1.8.6.tar.gz SkyblockMod-1.8.6.tar.bz2 SkyblockMod-1.8.6.zip |
Merge pull request #91 from bowser0000/developmentv1.8.6
1.8.6
Diffstat (limited to 'src/main/java/me/Danker/features/AutoDisplay.java')
-rw-r--r-- | src/main/java/me/Danker/features/AutoDisplay.java | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java new file mode 100644 index 0000000..182c0b4 --- /dev/null +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -0,0 +1,76 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.features.loot.LootDisplay; +import me.Danker.handlers.ConfigHandler; +import me.Danker.handlers.ScoreboardHandler; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.List; + +public class AutoDisplay { + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + Minecraft mc = Minecraft.getMinecraft(); + World world = mc.theWorld; + EntityPlayerSP player = mc.thePlayer; + if (DankersSkyblockMod.tickAmount % 20 == 0) { + if (LootDisplay.auto && world != null && player != null) { + List<String> scoreboard = ScoreboardHandler.getSidebarLines(); + boolean found = false; + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains("Sven Packmaster")) { + LootDisplay.display = "wolf"; + found = true; + } else if (sCleaned.contains("Tarantula Broodfather")) { + LootDisplay.display = "spider"; + found = true; + } else if (sCleaned.contains("Revenant Horror")) { + LootDisplay.display = "zombie"; + found = true; + } else if (sCleaned.contains("The Mist")){ + LootDisplay.display = "ghost"; + found = true; + } else if (sCleaned.contains("The Catacombs (")) { + if (sCleaned.contains("F1")) { + LootDisplay.display = "catacombs_floor_one"; + } else if (sCleaned.contains("F2")) { + LootDisplay.display = "catacombs_floor_two"; + } else if (sCleaned.contains("F3")) { + LootDisplay.display = "catacombs_floor_three"; + } else if (sCleaned.contains("F4")) { + LootDisplay.display = "catacombs_floor_four"; + } else if (sCleaned.contains("F5")) { + LootDisplay.display = "catacombs_floor_five"; + } else if (sCleaned.contains("F6")) { + LootDisplay.display = "catacombs_floor_six"; + } else if (sCleaned.contains("F7")) { + LootDisplay.display = "catacombs_floor_seven"; + } + found = true; + } + } + for (int i = 0; i < 8; i++) { + ItemStack hotbarItem = player.inventory.getStackInSlot(i); + if (hotbarItem == null) continue; + if (hotbarItem.getDisplayName().contains("Ancestral Spade")) { + LootDisplay.display = "mythological"; + found = true; + } + } + if (!found) LootDisplay.display = "off"; + ConfigHandler.writeStringConfig("misc", "display", LootDisplay.display); + } + } + } + +} |