diff options
author | bowser0000 <bowser0000@gmail.com> | 2021-03-18 18:40:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 18:40:02 -0400 |
commit | 23b8350c8e9d2cf9122afe9c787e75ad2bc42b36 (patch) | |
tree | 3a526604c2015478bdc4c30abc518717e91cf783 /src/main/java/me/Danker/features | |
parent | 42449d4110853d43b40c50f96c2814b865d24f8d (diff) | |
parent | 0208030006619bcd61362c2d73ee4f1f6e94f75d (diff) | |
download | SkyblockMod-23b8350c8e9d2cf9122afe9c787e75ad2bc42b36.tar.gz SkyblockMod-23b8350c8e9d2cf9122afe9c787e75ad2bc42b36.tar.bz2 SkyblockMod-23b8350c8e9d2cf9122afe9c787e75ad2bc42b36.zip |
Merge pull request #77 from RabbitType99/InstallerFrame
Added an Installer Frame, ghost loot display, highlight slayer bosses and Arachne, merged all of CuzImClicks Pull requests.
Diffstat (limited to 'src/main/java/me/Danker/features')
7 files changed, 306 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java new file mode 100644 index 0000000..1a9b0b2 --- /dev/null +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -0,0 +1,87 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.handlers.ScoreboardHandler; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.entity.player.AttackEntityEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + + +import java.util.List; + +/** + * @author RabbitType99 + */ + +public class ArachneESP { + + + static Entity arachne = null; + static boolean arachneActive = true; + public static int ARACHANE_COLOUR; + + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + arachne = null; + } + + public boolean inSpidersDen(List<String> scoreboard) { + for (String s : scoreboard) { + if (ScoreboardHandler.cleanSB(s).contains("Spiders Den")) { + return true; + } + } + return false; + } + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + if (!Utils.inSkyblock) return; + if (!inSpidersDen(ScoreboardHandler.getSidebarLines())) return; + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + if (message.contains("Something is awakening")){ + arachneActive = true; + World world = Minecraft.getMinecraft().theWorld; + List<Entity> entities = world.getLoadedEntityList(); + for (Entity e : entities) { + if (e.getName().contains("Arachne") && !e.getName().contains("Arachne's Brood")) { + arachne = e; + } + } + } + if (message.contains("ARACHNE DOWN!")) { + arachneActive = false; + arachne = null; + } + } + + @SubscribeEvent + public void onWorldRender(RenderWorldLastEvent event) { + if (!Utils.inSkyblock) return; + if (arachne != null) { + if (arachneActive && ToggleCommand.highlightArachne) { + AxisAlignedBB aabb = new AxisAlignedBB(arachne.posX - 0.5, arachne.posY - 1, arachne.posZ - 0.5, arachne.posX + 0.5, arachne.posY, arachne.posZ + 0.5); + Utils.draw3DBox(aabb, ARACHANE_COLOUR, event.partialTicks); + } + } + } + +} + diff --git a/src/main/java/me/Danker/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java index 876fb6a..182c0b4 100644 --- a/src/main/java/me/Danker/features/AutoDisplay.java +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -37,6 +37,9 @@ public class AutoDisplay { } 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"; diff --git a/src/main/java/me/Danker/features/BlockAbilities.java b/src/main/java/me/Danker/features/BlockAbilities.java index 19a887c..814fd65 100644 --- a/src/main/java/me/Danker/features/BlockAbilities.java +++ b/src/main/java/me/Danker/features/BlockAbilities.java @@ -27,6 +27,12 @@ public class BlockAbilities { if (ToggleCommand.lividDaggerToggled && item.getDisplayName().contains("Livid Dagger")) { event.setCanceled(true); } + if (ToggleCommand.shadowFuryToggled && item.getDisplayName().contains("Shadow Fury")) { + event.setCanceled(true); + } + if (ToggleCommand.specialHoeRightClick && (item.getDisplayName().contains("Mathematical Hoe") || item.getDisplayName().contains("Potato Hoe") || item.getDisplayName().contains("Wheat Hoe") || item.getDisplayName().contains("Carrot Hoe") || item.getDisplayName().contains("Sugar Cane Hoe") || item.getDisplayName().contains("Nether Warts Hoe"))) { + event.setCanceled(true); + } } else if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock(); @@ -77,6 +83,12 @@ public class BlockAbilities { if (ToggleCommand.lividDaggerToggled && item.getDisplayName().contains("Livid Dagger")) { event.setCanceled(true); } + if (ToggleCommand.shadowFuryToggled && item.getDisplayName().contains("Shadow Fury")) { + event.setCanceled(true); + } + } + if (ToggleCommand.specialHoeRightClick && (item.getDisplayName().contains("Mathematical Hoe") || item.getDisplayName().contains("Potato Hoe") || item.getDisplayName().contains("Wheat Hoe") || item.getDisplayName().contains("Carrot Hoe") || item.getDisplayName().contains("Sugar Cane Hoe") || item.getDisplayName().contains("Nether Warts Hoe"))) { + event.setCanceled(true); } } } diff --git a/src/main/java/me/Danker/features/HideTooltipsInExperiments.java b/src/main/java/me/Danker/features/HideTooltipsInExperiments.java index 5866fc8..6e295e1 100644 --- a/src/main/java/me/Danker/features/HideTooltipsInExperiments.java +++ b/src/main/java/me/Danker/features/HideTooltipsInExperiments.java @@ -29,6 +29,9 @@ public class HideTooltipsInExperiments { if (ToggleCommand.hideTooltipsInExperimentAddonsToggled && (chestName.startsWith("Ultrasequencer (") || chestName.startsWith("Chronomatron ("))) { event.toolTip.clear(); } + if (ToggleCommand.melodyTooltips && chestName.startsWith("Harp")) { + event.toolTip.clear(); + } } } diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java new file mode 100644 index 0000000..17a1c0e --- /dev/null +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -0,0 +1,121 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.handlers.ScoreboardHandler; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.AttachCapabilitiesEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.List; + +/** + * @author CuzImClicks + */ + +public class SlayerESP { + + static Entity zombie = null; + static Entity spider = null; + static Entity wolf = null; + static boolean slayerActive = false; + static boolean slayerStarted = false; + public static int SLAYER_COLOUR; + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + zombie = null; + spider = null; + wolf = null; + } + + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (!Utils.inSkyblock) return; + if (event.phase != TickEvent.Phase.START) return; + + World world = Minecraft.getMinecraft().theWorld; + if (world == null) return; + if (!slayerStarted) return; + if (zombie != null || spider != null || wolf != null) { + return; + } + slayerActive = true; + if (DankersSkyblockMod.tickAmount % 10 == 0 && ToggleCommand.highlightSlayers) { + for (String line : ScoreboardHandler.getSidebarLines()) { + String cleanedLine = ScoreboardHandler.cleanSB(line); + if (cleanedLine.contains("Slay the boss!")) { + slayerActive = true; + List<Entity> entities = world.getLoadedEntityList(); + for (Entity e : entities) { + System.out.println(e.getName()); + if (e.getName().contains("Revenant Horror")) { + zombie = e; + return; + } else if (e.getName().contains("Tarantula Broodfather")) { + spider = e; + return; + } else if (e.getName().contains("Sven Packmaster")) { + wolf = e; + return; + } + + } + break; + } + } + } + } + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + if (!Utils.inSkyblock) return; + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + if (message.contains("SLAYER QUEST STARTED!")) { + slayerStarted = true; + } + if (message.contains("NICE! SLAYER BOSS SLAIN!") || message.contains("SLAYER QUEST COMPLETE!") || message.contains("SLAYER QUEST FAILED!")) { + slayerActive = false; + slayerStarted = false; + zombie = null; + spider = null; + wolf = null; + } + + } + + + @SubscribeEvent + public void onWorldRender(RenderWorldLastEvent event) { + if (!Utils.inSkyblock) return; + if (!slayerStarted) return; + if (slayerActive && ToggleCommand.highlightSlayers) { + if (zombie != null) { + AxisAlignedBB aabb = new AxisAlignedBB(zombie.posX - 0.5, zombie.posY - 2, zombie.posZ - 0.5, zombie.posX + 0.5, zombie.posY, zombie.posZ + 0.5); + Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + return; + } + if (spider != null) { + AxisAlignedBB aabb = new AxisAlignedBB(spider.posX - 0.5, spider.posY - 1, spider.posZ - 0.5, spider.posX + 0.5, spider.posY, spider.posZ + 0.5); + Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + return; + } + if (wolf != null) { + AxisAlignedBB aabb = new AxisAlignedBB(wolf.posX - 0.5, wolf.posY - 1, wolf.posZ - 0.5, wolf.posX + 0.5, wolf.posY, wolf.posZ + 0.5); + Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + return; + } + } + } + +} diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index f51157b..cd34da7 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -900,6 +900,36 @@ public class LootDisplay { EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f7CoinsSpentSession) + "\n" + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f7TimeSpentSession); break; + case "ghost_session": + dropsText = EnumChatFormatting.GOLD + "Bags of Cash:\n" + + EnumChatFormatting.BLUE + "Sorrows:\n" + + EnumChatFormatting.DARK_PURPLE + "Ghosty Boots:\n" + + EnumChatFormatting.DARK_PURPLE + "Voltas:\n" + + EnumChatFormatting.DARK_PURPLE + "Plasmas:" ; // + \n + // EnumChatFormatting.AQUA + "Time Spent:" + + countText = EnumChatFormatting.GOLD + nf.format(LootTracker.bagOfCashSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(LootTracker.sorrowSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.ghostlyBootsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.voltaSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.plasmaSession); //+ "\n" + + // EnumChatFormatting.AQUA + nf.format(LootTracker.ghostsTimeSpentSession); + break; + case "ghost": + dropsText = EnumChatFormatting.GOLD + "Bags of Cash:\n" + + EnumChatFormatting.BLUE + "Sorrows:\n" + + EnumChatFormatting.DARK_PURPLE + "Ghosty Boots:\n" + + EnumChatFormatting.DARK_PURPLE + "Voltas:\n" + + EnumChatFormatting.DARK_PURPLE + "Plasmas:" ; // + \n + // EnumChatFormatting.AQUA + "Time Spent:" + + countText = EnumChatFormatting.GOLD + nf.format(LootTracker.bagOfCashSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(LootTracker.sorrowSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.ghostlyBootsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.voltaSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.plasmaSession); //+ "\n" + + // EnumChatFormatting.AQUA + nf.format(LootTracker.ghostsTimeSpentSession); + break; + + default: System.out.println("Display was an unknown value, turning off."); display = "off"; diff --git a/src/main/java/me/Danker/features/loot/LootTracker.java b/src/main/java/me/Danker/features/loot/LootTracker.java index 68cd8b0..4858569 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -178,6 +178,15 @@ public class LootTracker { public static int witherBoots; public static double f7CoinsSpent; public static double f7TimeSpent; + // Ghosts + public static int sorrows = 0; + public static int bagOfCashs = 0; + public static int voltas = 0; + public static int plasmas = 0; + public static int ghostlyBoots = 0; + // public static double ghostsTimeSpent = -1; + + // Single sessions (No config saves) // Wolf @@ -340,6 +349,14 @@ public class LootTracker { public static int witherBootsSession = 0; public static double f7CoinsSpentSession = 0; public static double f7TimeSpentSession = 0; + // Ghosts + public static int sorrowSession = 0; + public static int bagOfCashSession = 0; + public static int voltaSession = 0; + public static int plasmaSession = 0; + public static int ghostlyBootsSession = 0; + // public static double ghostsSecondsSinceStarts = 0; + static double checkItemsNow = 0; static double itemsChecked = 0; @@ -348,6 +365,7 @@ public class LootTracker { public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + if (!Utils.inSkyblock) return; if (event.type == 2) return; if (message.contains(":")) return; @@ -356,6 +374,8 @@ public class LootTracker { boolean spiderRNG = false; boolean zombieRNG = false; + + // Slayer tracker // T6 books if (message.contains("VERY RARE DROP! (Enchanted Book)") || message.contains("CRAZY RARE DROP! (Enchanted Book)")) { @@ -373,6 +393,7 @@ public class LootTracker { zombieBooks++; ConfigHandler.writeIntConfig("zombie", "book", zombieBooks); } + } } @@ -973,6 +994,35 @@ public class LootTracker { ConfigHandler.writeIntConfig("mythological", "minosInquisitor", minosInquisitors); } } + + + if (message.contains("RARE DROP!")) { + if (message.contains("Sorrow")) { + sorrows++; + sorrowSession++; + ConfigHandler.writeIntConfig("ghosts", "sorrow", sorrows); + } + if (message.contains("Volta")) { + voltas++; + voltaSession++; + ConfigHandler.writeIntConfig("ghosts", "volta", voltas); + } + if (message.contains("Plasma")) { + plasmas++; + plasmaSession++; + ConfigHandler.writeIntConfig("ghosts", "plasma", plasmas); + } + if (message.contains("Ghostly Boots")) { + ghostlyBoots++; + ghostlyBootsSession++; + ConfigHandler.writeIntConfig("ghosts", "ghostlyBoots", ghostlyBoots); + } + if (message.contains("Bag of Cash")) { + bagOfCashs++; + bagOfCashSession++; + ConfigHandler.writeIntConfig("ghosts", "bagOfCash", bagOfCashs); + } + } } @SubscribeEvent |