aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAppability <appable@icloud.com>2022-10-17 16:11:40 -0700
committerAppability <appable@icloud.com>2022-10-17 16:11:40 -0700
commitfcd49c8b59f9c76008b5112a2e296c164b168842 (patch)
treeba3be0850cfe2185a68e6ba9fd862e5c59fd57dc /src
parentd4245bb705c7d8965e6bf63c90614dcfef38dcf7 (diff)
downloadAmbientAddons-fcd49c8b59f9c76008b5112a2e296c164b168842.tar.gz
AmbientAddons-fcd49c8b59f9c76008b5112a2e296c164b168842.tar.bz2
AmbientAddons-fcd49c8b59f9c76008b5112a2e296c164b168842.zip
trapper esp
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/com/ambientaddons/AmbientAddons.kt8
-rw-r--r--src/main/kotlin/com/ambientaddons/commands/AmbientCommand.kt4
-rw-r--r--src/main/kotlin/com/ambientaddons/config/Config.kt28
-rw-r--r--src/main/kotlin/com/ambientaddons/features/Trapper.kt71
-rw-r--r--src/main/kotlin/com/ambientaddons/features/display/WitherShieldOverlay.kt6
-rw-r--r--src/main/kotlin/com/ambientaddons/features/dungeon/AutoBuyChest.kt12
-rw-r--r--src/main/kotlin/com/ambientaddons/features/dungeon/CloseChest.kt4
-rw-r--r--src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt9
-rw-r--r--src/main/kotlin/com/ambientaddons/features/dungeon/DungeonReady.kt5
-rw-r--r--src/main/kotlin/com/ambientaddons/features/dungeon/IgnoreCarpet.kt4
-rw-r--r--src/main/kotlin/com/ambientaddons/features/dungeon/ShortbowClicker.kt4
-rw-r--r--src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt8
-rw-r--r--src/main/kotlin/com/ambientaddons/features/keybinds/SendLastMessageKeybind.kt6
-rw-r--r--src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt6
-rw-r--r--src/main/kotlin/com/ambientaddons/features/misc/CancelInteractions.kt6
-rw-r--r--src/main/kotlin/com/ambientaddons/features/misc/KuudraReady.kt5
-rw-r--r--src/main/kotlin/com/ambientaddons/utils/SBLocation.kt (renamed from src/main/kotlin/com/ambientaddons/utils/SkyBlock.kt)3
-rw-r--r--src/main/kotlin/com/ambientaddons/utils/dungeon/DungeonPlayers.kt4
-rw-r--r--src/main/kotlin/com/ambientaddons/utils/render/EntityUtils.kt94
19 files changed, 231 insertions, 56 deletions
diff --git a/src/main/kotlin/com/ambientaddons/AmbientAddons.kt b/src/main/kotlin/com/ambientaddons/AmbientAddons.kt
index a7c6458..f0ecfcf 100644
--- a/src/main/kotlin/com/ambientaddons/AmbientAddons.kt
+++ b/src/main/kotlin/com/ambientaddons/AmbientAddons.kt
@@ -1,6 +1,7 @@
import com.ambientaddons.commands.AmbientCommand
import com.ambientaddons.config.Config
import com.ambientaddons.config.PersistentData
+import com.ambientaddons.features.Trapper
import com.ambientaddons.features.display.WitherShieldOverlay
import com.ambientaddons.features.dungeon.*
import com.ambientaddons.features.dungeon.terminals.MelodyHelper
@@ -9,7 +10,7 @@ import com.ambientaddons.features.keybinds.PerspectiveKeybind
import com.ambientaddons.features.keybinds.SendLastMessageKeybind
import com.ambientaddons.features.misc.CancelInteractions
import com.ambientaddons.features.misc.KuudraReady
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import com.ambientaddons.utils.dungeon.DungeonPlayers
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiScreen
@@ -50,7 +51,7 @@ class AmbientAddons {
ClientCommandHandler.instance.registerCommand(AmbientCommand())
listOf(
this,
- SkyBlock,
+ SBLocation,
AutoBuyChest,
CloseChest,
CancelInteractions,
@@ -63,7 +64,8 @@ class AmbientAddons {
MelodyHelper,
WitherShieldOverlay,
KuudraReady,
- DungeonHighlights
+ DungeonHighlights,
+ Trapper
).forEach(MinecraftForge.EVENT_BUS::register)
keyBinds.values.forEach(ClientRegistry::registerKeyBinding)
}
diff --git a/src/main/kotlin/com/ambientaddons/commands/AmbientCommand.kt b/src/main/kotlin/com/ambientaddons/commands/AmbientCommand.kt
index c09998e..e86f137 100644
--- a/src/main/kotlin/com/ambientaddons/commands/AmbientCommand.kt
+++ b/src/main/kotlin/com/ambientaddons/commands/AmbientCommand.kt
@@ -3,7 +3,7 @@ package com.ambientaddons.commands
import AmbientAddons
import com.ambientaddons.config.Config
import com.ambientaddons.utils.Extensions.withModPrefix
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import gg.essential.universal.UChat
import net.minecraft.command.CommandBase
import net.minecraft.command.ICommandSender
@@ -20,7 +20,7 @@ class AmbientCommand : CommandBase() {
override fun processCommand(sender: ICommandSender?, args: Array<String>) {
when (args.getOrNull(0)) {
null -> AmbientAddons.currentGui = Config.gui()
- "location" -> UChat.chat(SkyBlock.toString().withModPrefix())
+ "location" -> UChat.chat(SBLocation.toString().withModPrefix())
"buy" -> AutoBuyCommand.processCommand(args.drop(1))
else -> UChat.chat("§cUnknown argument!")
}
diff --git a/src/main/kotlin/com/ambientaddons/config/Config.kt b/src/main/kotlin/com/ambientaddons/config/Config.kt
index 00017c3..9035f6e 100644
--- a/src/main/kotlin/com/ambientaddons/config/Config.kt
+++ b/src/main/kotlin/com/ambientaddons/config/Config.kt
@@ -10,6 +10,8 @@ object Config : Vigilant(
) {
var kuudraReady = false
+ var autoTrapper = false
+ var trapperEsp = false
var batHighlight = 0
var batColor = Color.CYAN
@@ -20,8 +22,6 @@ object Config : Vigilant(
var bestiaryHighlight = 0
var bestiaryColor = Color.MAGENTA
-
-
var blockLowReroll = false
var autoBuyChest = 0
var autoReady = 0
@@ -41,11 +41,25 @@ object Config : Vigilant(
init {
category("Misc") {
- switch(
- ::kuudraReady,
- name = "Automatically ready in Kuudra",
- description = "Automatically clicks the ready pane when the ready GUI is opened."
- )
+ subcategory("Kuudra") {
+ switch(
+ ::kuudraReady,
+ name = "Automatically ready in Kuudra",
+ description = "Automatically clicks the ready pane when the ready GUI is opened."
+ )
+ }
+ subcategory("Trevor the Trapper") {
+ switch(
+ ::autoTrapper,
+ name = "Automatically start trapper quests",
+ description = "Automatically performs the useless chat message click. This is analogous to SBE's crystal hollows renew feature."
+ )
+ switch(
+ ::trapperEsp,
+ name = "Highlight trapper animals",
+ description = "Highlights trapper quests with a beacon beam and box. Legal, as Hypixel uses the glowing status effect for clients that support it."
+ )
+ }
}
category("Highlights") {
diff --git a/src/main/kotlin/com/ambientaddons/features/Trapper.kt b/src/main/kotlin/com/ambientaddons/features/Trapper.kt
new file mode 100644
index 0000000..184358a
--- /dev/null
+++ b/src/main/kotlin/com/ambientaddons/features/Trapper.kt
@@ -0,0 +1,71 @@
+package com.ambientaddons.features
+
+import AmbientAddons.Companion.config
+import AmbientAddons.Companion.mc
+import com.ambientaddons.utils.Area
+import com.ambientaddons.utils.SBLocation
+import com.ambientaddons.utils.render.EntityUtils
+import net.minecraft.entity.Entity
+import net.minecraft.entity.EntityLiving
+import net.minecraft.entity.passive.*
+import net.minecraftforge.client.event.ClientChatReceivedEvent
+import net.minecraftforge.client.event.RenderWorldLastEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import java.awt.Color
+
+object Trapper {
+ private var color: Color? = null
+ private val trapperRegex =
+ Regex("^§e\\[NPC\\] Trevor The Trapper§f: §rYou can find your §(?<color>[0-9a-f])\\w+ §fanimal near the §(?<locationColor>[0-9a-f])(?<location>[\\w ]+)§f.§r$")
+ private val animals =
+ listOf(EntityCow::class, EntityPig::class, EntitySheep::class, EntityCow::class, EntityChicken::class, EntityRabbit::class)
+ private val animalHp: List<Float?> = listOf(100F, 200F, 500F, 1000F, 1024F, 2048F)
+
+ fun isTrapperAnimal(entity: Entity): Boolean =
+ entity.ticksExisted >= 10 && (entity::class in animals) && animalHp.contains((entity as? EntityLiving)?.maxHealth)
+
+ @SubscribeEvent
+ fun onChat(event: ClientChatReceivedEvent) {
+ if (SBLocation.area != Area.FarmingIslands || event.message == null || event.type == 2.toByte()) return
+ if (config.autoTrapper) {
+ val siblings = event.message.siblings ?: return
+ if (siblings.getOrNull(0)?.unformattedText == "Accept the trapper's task to hunt the animal?") {
+ val command = siblings.getOrNull(3)?.chatStyle?.chatClickEvent?.value ?: return
+ mc.thePlayer.sendChatMessage(command)
+ }
+ }
+ val matchResult = event.message.formattedText.let { trapperRegex.find(it) }
+ if (matchResult != null) {
+ val colorCode = (matchResult.groups as? MatchNamedGroupCollection)?.get("color")?.value ?: return
+ color = Color(mc.fontRendererObj.getColorCode(colorCode.single()))
+ } else if (
+ event.message.formattedText.startsWith("§r§aKilling the animal rewarded you ") ||
+ event.message.formattedText.startsWith("§r§aYour mob died randomly, you are rewarded ")
+ ) {
+ color = null
+ }
+ }
+
+ @SubscribeEvent
+ fun onRenderWorld(event: RenderWorldLastEvent) {
+ if (SBLocation.area != Area.FarmingIslands || !config.trapperEsp) return
+ mc.theWorld.loadedEntityList.forEach {
+ if (color != null && isTrapperAnimal(it)) {
+ val renderManager = mc.renderManager
+ val x = it.lastTickPosX + (it.posX - it.lastTickPosX) * event.partialTicks - renderManager.viewerPosX - 0.5
+ val y = it.lastTickPosY + (it.posY - it.lastTickPosY) * event.partialTicks - renderManager.viewerPosY
+ val z = it.lastTickPosZ + (it.posZ - it.lastTickPosZ) * event.partialTicks - renderManager.viewerPosZ - 0.5
+ val entityHeight = it.entityBoundingBox.maxY - it.entityBoundingBox.minY
+ EntityUtils.drawEntityBox(
+ it,
+ color!!,
+ outline = true,
+ fill = true,
+ partialTicks = event.partialTicks,
+ esp = true
+ )
+ EntityUtils.renderBeaconBeam(x, y + entityHeight, z, color!!, 1F, event.partialTicks, true)
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/kotlin/com/ambientaddons/features/display/WitherShieldOverlay.kt b/src/main/kotlin/com/ambientaddons/features/display/WitherShieldOverlay.kt
index fa210aa..85801aa 100644
--- a/src/main/kotlin/com/ambientaddons/features/display/WitherShieldOverlay.kt
+++ b/src/main/kotlin/com/ambientaddons/features/display/WitherShieldOverlay.kt
@@ -4,7 +4,7 @@ import AmbientAddons.Companion.config
import AmbientAddons.Companion.mc
import com.ambientaddons.utils.Alignment
import com.ambientaddons.utils.render.OverlayUtils
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import com.ambientaddons.utils.dungeon.TextStyle
import net.minecraft.client.gui.ScaledResolution
import net.minecraftforge.client.event.ClientChatReceivedEvent
@@ -19,7 +19,7 @@ object WitherShieldOverlay {
@SubscribeEvent
fun onRenderOverlay(event: RenderGameOverlayEvent) {
if (event.type != RenderGameOverlayEvent.ElementType.TEXT) return
- if (!SkyBlock.inSkyblock || config.witherShieldDisplay == 0) return
+ if (!SBLocation.inSkyblock || config.witherShieldDisplay == 0) return
val diff = ((witherImpactEndTime - System.currentTimeMillis()) / 1000.0).takeIf { it >= 0 } ?: return
val display = ceil(diff).roundToInt().toString()
val resolution = ScaledResolution(mc)
@@ -31,7 +31,7 @@ object WitherShieldOverlay {
@SubscribeEvent
fun onChat(event: ClientChatReceivedEvent) {
- if (!SkyBlock.inSkyblock || config.witherShieldDisplay == 0) return
+ if (!SBLocation.inSkyblock || config.witherShieldDisplay == 0) return
if (event.type == 2.toByte() && event.message.unformattedText.contains("Wither Impact")) {
if (((witherImpactEndTime - System.currentTimeMillis()) / 1000.0) < 0) {
witherImpactEndTime = System.currentTimeMillis() + 5000
diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/AutoBuyChest.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/AutoBuyChest.kt
index 279402d..f1cd74f 100644
--- a/src/main/kotlin/com/ambientaddons/features/dungeon/AutoBuyChest.kt
+++ b/src/main/kotlin/com/ambientaddons/features/dungeon/AutoBuyChest.kt
@@ -12,7 +12,7 @@ import com.ambientaddons.utils.Extensions.skyblockID
import com.ambientaddons.utils.Extensions.stripControlCodes
import com.ambientaddons.utils.Extensions.withModPrefix
import com.ambientaddons.utils.Area
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import gg.essential.universal.UChat
import net.minecraft.inventory.ContainerChest
import net.minecraft.item.ItemStack
@@ -35,7 +35,7 @@ object AutoBuyChest {
@SubscribeEvent
fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) {
- if (SkyBlock.area != Area.Dungeon || rewardChest == null) return
+ if (SBLocation.area != Area.Dungeon || rewardChest == null) return
if (event.slotId == BUY_SLOT_INDEX) {
hasOpenedChest = true
if (rewardChest == RewardChest.Wood) {
@@ -43,7 +43,7 @@ object AutoBuyChest {
event.isCanceled = true
}
} else if (event.slotId == KISMET_SLOT_INDEX) {
- if (config.blockLowReroll && rewardChest != RewardChest.Bedrock && (rewardChest != RewardChest.Obsidian || SkyBlock.dungeonFloor.toString() != "M4")) {
+ if (config.blockLowReroll && rewardChest != RewardChest.Bedrock && (rewardChest != RewardChest.Obsidian || SBLocation.dungeonFloor.toString() != "M4")) {
UChat.chat("§cBlocked reroll! This low-tier chest should not be rerolled.".withModPrefix())
event.isCanceled = true
return
@@ -58,11 +58,9 @@ object AutoBuyChest {
}
}
-
-
@SubscribeEvent
fun onGuiOpen(event: GuiOpenEvent) {
- if (SkyBlock.area != Area.Dungeon) return
+ if (SBLocation.area != Area.Dungeon) return
if (event.gui == null) return
val chest = event.gui.chest
val chestName = chest?.lowerChestInventory?.name
@@ -82,7 +80,7 @@ object AutoBuyChest {
@SubscribeEvent
fun onGuiDraw(event: GuiScreenEvent.DrawScreenEvent) {
- if (SkyBlock.area != Area.Dungeon || config.autoBuyChest != 2 || rewardChest == null || hasLookedAtChest) return
+ if (SBLocation.area != Area.Dungeon || config.autoBuyChest != 2 || rewardChest == null || hasLookedAtChest) return
val chest = event.gui?.chest ?: return
if (rewardChest == RewardChest.Wood) {
if (!hasOpenedChest) openChest(chest)
diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/CloseChest.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/CloseChest.kt
index 571cd7f..0e996e1 100644
--- a/src/main/kotlin/com/ambientaddons/features/dungeon/CloseChest.kt
+++ b/src/main/kotlin/com/ambientaddons/features/dungeon/CloseChest.kt
@@ -4,7 +4,7 @@ import AmbientAddons.Companion.config
import AmbientAddons.Companion.mc
import com.ambientaddons.events.ReceivePacketEvent
import com.ambientaddons.utils.Area
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import net.minecraft.network.play.client.C0DPacketCloseWindow
import net.minecraft.network.play.server.S2DPacketOpenWindow
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -12,7 +12,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
object CloseChest {
@SubscribeEvent
fun onOpenWindow(event: ReceivePacketEvent) {
- if (!config.closeSecretChests || SkyBlock.area != Area.Dungeon) return
+ if (!config.closeSecretChests || SBLocation.area != Area.Dungeon) return
if (event.packet !is S2DPacketOpenWindow) return
if (event.packet.windowTitle.unformattedText == "Chest") {
mc.netHandler.networkManager.sendPacket(C0DPacketCloseWindow(event.packet.windowId))
diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt
index 258d799..5019151 100644
--- a/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt
+++ b/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt
@@ -4,9 +4,8 @@ import AmbientAddons.Companion.config
import AmbientAddons.Companion.mc
import com.ambientaddons.utils.Area
import com.ambientaddons.utils.Extensions.skyblockID
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import com.ambientaddons.utils.render.EntityUtils
-import gg.essential.universal.UChat
import net.minecraft.entity.Entity
import net.minecraft.entity.boss.EntityWither
import net.minecraft.entity.item.EntityArmorStand
@@ -25,20 +24,20 @@ import java.util.*
object DungeonHighlights {
private val markedArmorStands = mutableSetOf<EntityArmorStand>()
private val starredMobs = mutableSetOf<Entity>()
- private var nearIdkmansry = false
+ private var nearIdkmansry = false
private val idkmansry = UUID.fromString("93ce1cad-833f-46ff-a124-b66d2b99c4fd")
@SubscribeEvent
fun onWorldUnload(event: WorldEvent.Unload) {
markedArmorStands.clear()
starredMobs.clear()
+ nearIdkmansry = false
}
@SubscribeEvent
fun onRenderWorld(event: RenderWorldLastEvent) {
- if (SkyBlock.area != Area.Dungeon) return
- nearIdkmansry = false
+ if (SBLocation.area != Area.Dungeon) return
mc.theWorld.loadedEntityList.forEach { entity ->
if (entity is EntityArmorStand && entity.customNameTag.contains("✯") && !markedArmorStands.contains(entity)) {
if (config.starredHighlight == 0) return@forEach
diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonReady.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonReady.kt
index 3defe7c..76488b1 100644
--- a/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonReady.kt
+++ b/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonReady.kt
@@ -6,9 +6,8 @@ import com.ambientaddons.utils.Extensions.chest
import com.ambientaddons.utils.Extensions.items
import com.ambientaddons.utils.Extensions.stripControlCodes
import com.ambientaddons.utils.Area
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import com.ambientaddons.utils.dungeon.DungeonPlayers
-import gg.essential.universal.UChat
import net.minecraftforge.client.event.GuiScreenEvent
import net.minecraftforge.event.world.WorldEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -28,7 +27,7 @@ object DungeonReady {
@SubscribeEvent
fun onGuiDraw(event: GuiScreenEvent.DrawScreenEvent) {
- if (config.autoReady == 0 || SkyBlock.area != Area.Dungeon) return
+ if (config.autoReady == 0 || SBLocation.area != Area.Dungeon) return
val chest = event.gui?.chest ?: return
val chestName = chest.lowerChestInventory.name
if (chestName == "Start Dungeon?" && !hasClickedStart) {
diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/IgnoreCarpet.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/IgnoreCarpet.kt
index 6f2281e..438ad67 100644
--- a/src/main/kotlin/com/ambientaddons/features/dungeon/IgnoreCarpet.kt
+++ b/src/main/kotlin/com/ambientaddons/features/dungeon/IgnoreCarpet.kt
@@ -1,11 +1,11 @@
package com.ambientaddons.features.dungeon
import AmbientAddons.Companion.config
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
object IgnoreCarpet {
fun shouldIgnoreCarpet(): Boolean {
- if (!SkyBlock.inSkyblock) return false
+ if (!SBLocation.inSkyblock) return false
return if (AmbientAddons.isInitialized()) config.ignoreCarpet else false
}
} \ No newline at end of file
diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/ShortbowClicker.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/ShortbowClicker.kt
index 9ff5d48..7cce15d 100644
--- a/src/main/kotlin/com/ambientaddons/features/dungeon/ShortbowClicker.kt
+++ b/src/main/kotlin/com/ambientaddons/features/dungeon/ShortbowClicker.kt
@@ -3,7 +3,7 @@ package com.ambientaddons.features.dungeon
import AmbientAddons.Companion.config
import AmbientAddons.Companion.mc
import com.ambientaddons.utils.Extensions.skyblockID
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import kotlin.math.roundToLong
@@ -15,7 +15,7 @@ object ShortbowClicker {
@SubscribeEvent
fun onRender(event: RenderWorldLastEvent) {
- if (!SkyBlock.inSkyblock) return
+ if (!SBLocation.inSkyblock) return
if (config.terminatorCps == 0) return
if (!mc.gameSettings.keyBindUseItem.isKeyDown) return
val itemStack = mc.thePlayer?.inventory?.getCurrentItem()
diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt
index 74b23e7..f867b3f 100644
--- a/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt
+++ b/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt
@@ -6,7 +6,7 @@ import com.ambientaddons.events.GuiContainerEvent
import com.ambientaddons.utils.Extensions.chest
import com.ambientaddons.utils.Extensions.items
import com.ambientaddons.utils.Extensions.stripControlCodes
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import net.minecraftforge.client.event.ClientChatReceivedEvent
import net.minecraftforge.client.event.GuiOpenEvent
import net.minecraftforge.event.world.WorldEvent
@@ -27,7 +27,7 @@ object MelodyHelper {
@SubscribeEvent
fun onChat(event: ClientChatReceivedEvent) {
- if (SkyBlock.dungeonFloor?.floor != 7) return
+ if (SBLocation.dungeonFloor?.floor != 7) return
val unformatted = event.message.unformattedText.stripControlCodes()
if (completedStageRegex.matches(unformatted)) {
hasSaidMeowlody = false
@@ -44,7 +44,7 @@ object MelodyHelper {
@SubscribeEvent
fun onGuiOpen(event: GuiOpenEvent) {
- if (SkyBlock.dungeonFloor?.floor != 7) return
+ if (SBLocation.dungeonFloor?.floor != 7) return
if (event.gui == null) return
if (event.gui.chest?.lowerChestInventory?.name == "Click the button on time!") {
if (!hasSaidMeowlody && config.melodyAnnouncement.isNotBlank()) {
@@ -56,7 +56,7 @@ object MelodyHelper {
@SubscribeEvent
fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) {
- if (SkyBlock.dungeonFloor?.floor != 7) return
+ if (SBLocation.dungeonFloor?.floor != 7) return
val chest = event.gui.chest?.lowerChestInventory
if (chest?.name != "Click the button on time!" || isThrottled) return
val colors = chest.items.map { it?.itemDamage }
diff --git a/src/main/kotlin/com/ambientaddons/features/keybinds/SendLastMessageKeybind.kt b/src/main/kotlin/com/ambientaddons/features/keybinds/SendLastMessageKeybind.kt
index b7e5fad..9a0a4f9 100644
--- a/src/main/kotlin/com/ambientaddons/features/keybinds/SendLastMessageKeybind.kt
+++ b/src/main/kotlin/com/ambientaddons/features/keybinds/SendLastMessageKeybind.kt
@@ -3,7 +3,7 @@ package com.ambientaddons.features.keybinds
import AmbientAddons.Companion.keyBinds
import AmbientAddons.Companion.mc
import com.ambientaddons.events.MessageSentEvent
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.InputEvent
@@ -12,7 +12,7 @@ object SendLastMessageKeybind {
@SubscribeEvent
fun onSendChat(event: MessageSentEvent) {
- if (!SkyBlock.onHypixel) return
+ if (!SBLocation.onHypixel) return
if (event.message.startsWith("/pc", ignoreCase = true)) {
lastMessage = event.message.runCatching {
substring(4 until event.message.length)
@@ -24,7 +24,7 @@ object SendLastMessageKeybind {
@SubscribeEvent
fun onKey(event: InputEvent.KeyInputEvent) {
- if (!SkyBlock.onHypixel) return
+ if (!SBLocation.onHypixel) return
if (keyBinds["spamKey"]!!.isPressed && lastMessage != null) {
mc.thePlayer.sendChatMessage("/pc $lastMessage")
}
diff --git a/src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt b/src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt
index b0689c4..2e8be9e 100644
--- a/src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt
+++ b/src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt
@@ -5,7 +5,7 @@ import AmbientAddons.Companion.mc
import com.ambientaddons.events.ItemOverlayEvent
import com.ambientaddons.utils.Extensions.skyblockID
import com.ambientaddons.utils.Extensions.stripControlCodes
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import com.ambientaddons.utils.render.OverlayUtils
import net.minecraftforge.client.event.ClientChatReceivedEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -21,7 +21,7 @@ object BonzoMask {
@SubscribeEvent
fun onChat(event: ClientChatReceivedEvent) {
- if (!SkyBlock.inSkyblock) return
+ if (!SBLocation.inSkyblock) return
val didMaskProc = when (event.message.unformattedText.stripControlCodes()) {
secondWindString -> {
spiritMaskProc = System.currentTimeMillis()
@@ -44,7 +44,7 @@ object BonzoMask {
@SubscribeEvent
fun onRenderItemOverlay(event: ItemOverlayEvent) {
- if (!SkyBlock.inSkyblock) return
+ if (!SBLocation.inSkyblock) return
val durability = when (event.item?.skyblockID) {
"BONZO_MASK" -> (System.currentTimeMillis() - bonzoMaskProc) / 180000.0
"STARRED_BONZO_MASK" -> (System.currentTimeMillis() - fraggedBonzoMaskProc) / 180000.0
diff --git a/src/main/kotlin/com/ambientaddons/features/misc/CancelInteractions.kt b/src/main/kotlin/com/ambientaddons/features/misc/CancelInteractions.kt
index 60f0f8f..3deff17 100644
--- a/src/main/kotlin/com/ambientaddons/features/misc/CancelInteractions.kt
+++ b/src/main/kotlin/com/ambientaddons/features/misc/CancelInteractions.kt
@@ -3,7 +3,7 @@ package com.ambientaddons.features.misc
import AmbientAddons.Companion.config
import AmbientAddons.Companion.mc
import com.ambientaddons.utils.Area
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import net.minecraft.init.Blocks
import net.minecraftforge.event.entity.player.PlayerInteractEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -11,8 +11,8 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
object CancelInteractions {
@SubscribeEvent
fun onPlayerInteract(event: PlayerInteractEvent) {
- if (!SkyBlock.inSkyblock) return
- if (!config.cancelInteractions || SkyBlock.area == Area.PrivateIsland) return
+ if (!SBLocation.inSkyblock) return
+ if (!config.cancelInteractions || SBLocation.area == Area.PrivateIsland) return
if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
if (mc.theWorld?.getBlockState(event.pos)?.block == Blocks.hopper) {
event.isCanceled = true
diff --git a/src/main/kotlin/com/ambientaddons/features/misc/KuudraReady.kt b/src/main/kotlin/com/ambientaddons/features/misc/KuudraReady.kt
index 469d6fe..d9be1dd 100644
--- a/src/main/kotlin/com/ambientaddons/features/misc/KuudraReady.kt
+++ b/src/main/kotlin/com/ambientaddons/features/misc/KuudraReady.kt
@@ -7,8 +7,7 @@ import com.ambientaddons.utils.Extensions.chest
import com.ambientaddons.utils.Extensions.items
import com.ambientaddons.utils.Extensions.lore
import com.ambientaddons.utils.Extensions.stripControlCodes
-import com.ambientaddons.utils.SkyBlock
-import com.ambientaddons.utils.dungeon.DungeonPlayers
+import com.ambientaddons.utils.SBLocation
import net.minecraftforge.client.event.GuiScreenEvent
import net.minecraftforge.event.world.WorldEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -23,7 +22,7 @@ object KuudraReady {
@SubscribeEvent
fun onGuiDraw(event: GuiScreenEvent.DrawScreenEvent) {
- if (!config.kuudraReady || SkyBlock.area != Area.Kuudra) return
+ if (!config.kuudraReady || SBLocation.area != Area.Kuudra) return
val chest = event.gui?.chest ?: return
val chestName = chest.lowerChestInventory.name
if (chestName == "Ready Up" && !hasClickedReady) {
diff --git a/src/main/kotlin/com/ambientaddons/utils/SkyBlock.kt b/src/main/kotlin/com/ambientaddons/utils/SBLocation.kt
index a6bbd57..bfd35eb 100644
--- a/src/main/kotlin/com/ambientaddons/utils/SkyBlock.kt
+++ b/src/main/kotlin/com/ambientaddons/utils/SBLocation.kt
@@ -6,7 +6,6 @@ import com.ambientaddons.utils.Extensions.cleanSB
import com.ambientaddons.utils.Extensions.stripControlCodes
import com.ambientaddons.utils.Extensions.substringBetween
import com.ambientaddons.utils.TabListUtils.fetchTabEntries
-import gg.essential.universal.UChat
import net.minecraft.scoreboard.Score
import net.minecraft.scoreboard.ScorePlayerTeam
import net.minecraftforge.event.world.WorldEvent
@@ -14,7 +13,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent
import net.minecraftforge.fml.common.network.FMLNetworkEvent
-object SkyBlock {
+object SBLocation {
private var areaRegex = Regex("^(?:Area|Dungeon): ([\\w ].+)\$")
var onHypixel = false
var inSkyblock = false
diff --git a/src/main/kotlin/com/ambientaddons/utils/dungeon/DungeonPlayers.kt b/src/main/kotlin/com/ambientaddons/utils/dungeon/DungeonPlayers.kt
index e57443d..b10c58a 100644
--- a/src/main/kotlin/com/ambientaddons/utils/dungeon/DungeonPlayers.kt
+++ b/src/main/kotlin/com/ambientaddons/utils/dungeon/DungeonPlayers.kt
@@ -2,7 +2,7 @@ package com.ambientaddons.utils.dungeon
import com.ambientaddons.utils.Extensions.stripControlCodes
import com.ambientaddons.utils.Area
-import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.SBLocation
import com.ambientaddons.utils.TabListUtils
import com.ambientaddons.utils.text
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -16,7 +16,7 @@ object DungeonPlayers {
@SubscribeEvent
fun onTick(event: ClientTickEvent) {
- if (SkyBlock.area != Area.Dungeon) return
+ if (SBLocation.area != Area.Dungeon) return
if (ticks % 10 == 0) {
val rawPlayers = TabListUtils.fetchTabEntries().let { tabEntries ->
playerSlots.map { tabEntries[it].text.stripControlCodes() }
diff --git a/src/main/kotlin/com/ambientaddons/utils/render/EntityUtils.kt b/src/main/kotlin/com/ambientaddons/utils/render/EntityUtils.kt
index b3abbcf..c5bc2e9 100644
--- a/src/main/kotlin/com/ambientaddons/utils/render/EntityUtils.kt
+++ b/src/main/kotlin/com/ambientaddons/utils/render/EntityUtils.kt
@@ -1,14 +1,21 @@
package com.ambientaddons.utils.render
import AmbientAddons.Companion.mc
+import net.minecraft.client.Minecraft
+import net.minecraft.client.renderer.GlStateManager
import net.minecraft.client.renderer.Tessellator
import net.minecraft.client.renderer.vertex.DefaultVertexFormats
import net.minecraft.entity.Entity
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.util.AxisAlignedBB
import net.minecraft.util.BlockPos
+import net.minecraft.util.MathHelper
+import net.minecraft.util.ResourceLocation
import org.lwjgl.opengl.GL11.*
import java.awt.Color
+import kotlin.math.cos
+import kotlin.math.sin
+
// diretly stolen from Harry282/Skyblock-Client
object EntityUtils {
@@ -145,6 +152,93 @@ object EntityUtils {
glPopMatrix()
}
+ private val beaconBeam = ResourceLocation("textures/entity/beacon_beam.png")
+
+ // from Moulberry/NotEnoughUpdates under LGPL 3.0, presumably from Mojang
+ fun renderBeaconBeam(
+ x: Double, y: Double, z: Double, color: Color, alpha: Float,
+ partialTicks: Float, esp: Boolean
+ ) {
+ val rgb = color.rgb
+ val height = 300
+ val bottomOffset = 0
+ val topOffset = bottomOffset + height
+ val tessellator = Tessellator.getInstance()
+ val worldrenderer = tessellator.worldRenderer
+ if (esp) {
+ GlStateManager.disableDepth()
+ }
+ Minecraft.getMinecraft().textureManager.bindTexture(beaconBeam)
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT.toFloat())
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT.toFloat())
+ GlStateManager.disableLighting()
+ GlStateManager.enableCull()
+ GlStateManager.enableTexture2D()
+ GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ZERO)
+ GlStateManager.enableBlend()
+ GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO)
+ val time = Minecraft.getMinecraft().theWorld.totalWorldTime + partialTicks.toDouble()
+ val d1 = MathHelper.func_181162_h(-time * 0.2 - MathHelper.floor_double(-time * 0.1).toDouble())
+ val r = (rgb shr 16 and 0xFF) / 255f
+ val g = (rgb shr 8 and 0xFF) / 255f
+ val b = (rgb and 0xFF) / 255f
+ val d2 = time * 0.025 * -1.5
+ val d4 = 0.5 + cos(d2 + 2.356194490192345) * 0.2
+ val d5 = 0.5 + sin(d2 + 2.356194490192345) * 0.2
+ val d6 = 0.5 + cos(d2 + Math.PI / 4.0) * 0.2
+ val d7 = 0.5 + sin(d2 + Math.PI / 4.0) * 0.2
+ val d8 = 0.5 + cos(d2 + 3.9269908169872414) * 0.2
+ val d9 = 0.5 + sin(d2 + 3.9269908169872414) * 0.2
+ val d10 = 0.5 + cos(d2 + 5.497787143782138) * 0.2
+ val d11 = 0.5 + sin(d2 + 5.497787143782138) * 0.2
+ val d14 = -1.0 + d1
+ val d15 = height.toDouble() * 2.5 + d14
+ worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR)
+ worldrenderer.pos(x + d4, y + topOffset, z + d5).tex(1.0, d15).color(r, g, b, 1.0f * alpha).endVertex()
+ worldrenderer.pos(x + d4, y + bottomOffset, z + d5).tex(1.0, d14).color(r, g, b, 1.0f).endVertex()
+ worldrenderer.pos(x + d6, y + bottomOffset, z + d7).tex(0.0, d14).color(r, g, b, 1.0f).endVertex()
+ worldrenderer.pos(x + d6, y + topOffset, z + d7).tex(0.0, d15).color(r, g, b, 1.0f * alpha).endVertex()
+ worldrenderer.pos(x + d10, y + topOffset, z + d11).tex(1.0, d15).color(r, g, b, 1.0f * alpha).endVertex()
+ worldrenderer.pos(x + d10, y + bottomOffset, z + d11).tex(1.0, d14).color(r, g, b, 1.0f).endVertex()
+ worldrenderer.pos(x + d8, y + bottomOffset, z + d9).tex(0.0, d14).color(r, g, b, 1.0f).endVertex()
+ worldrenderer.pos(x + d8, y + topOffset, z + d9).tex(0.0, d15).color(r, g, b, 1.0f * alpha).endVertex()
+ worldrenderer.pos(x + d6, y + topOffset, z + d7).tex(1.0, d15).color(r, g, b, 1.0f * alpha).endVertex()
+ worldrenderer.pos(x + d6, y + bottomOffset, z + d7).tex(1.0, d14).color(r, g, b, 1.0f).endVertex()
+ worldrenderer.pos(x + d10, y + bottomOffset, z + d11).tex(0.0, d14).color(r, g, b, 1.0f).endVertex()
+ worldrenderer.pos(x + d10, y + topOffset, z + d11).tex(0.0, d15).color(r, g, b, 1.0f * alpha).endVertex()
+ worldrenderer.pos(x + d8, y + topOffset, z + d9).tex(1.0, d15).color(r, g, b, 1.0f * alpha).endVertex()
+ worldrenderer.pos(x + d8, y + bottomOffset, z + d9).tex(1.0, d14).color(r, g, b, 1.0f).endVertex()
+ worldrenderer.pos(x + d4, y + bottomOffset, z + d5).tex(0.0, d14).color(r, g, b, 1.0f).endVertex()
+ worldrenderer.pos(x + d4, y + topOffset, z + d5).tex(0.0, d15).color(r, g, b, 1.0f * alpha).endVertex()
+ tessellator.draw()
+ GlStateManager.disableCull()
+ val d12 = -1.0 + d1
+ val d13 = height + d12
+ worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR)
+ worldrenderer.pos(x + 0.2, y + topOffset, z + 0.2).tex(1.0, d13).color(r, g, b, 0.25f * alpha).endVertex()
+ worldrenderer.pos(x + 0.2, y + bottomOffset, z + 0.2).tex(1.0, d12).color(r, g, b, 0.25f).endVertex()
+ worldrenderer.pos(x + 0.8, y + bottomOffset, z + 0.2).tex(0.0, d12).color(r, g, b, 0.25f).endVertex()
+ worldrenderer.pos(x + 0.8, y + topOffset, z + 0.2).tex(0.0, d13).color(r, g, b, 0.25f * alpha).endVertex()
+ worldrenderer.pos(x + 0.8, y + topOffset, z + 0.8).tex(1.0, d13).color(r, g, b, 0.25f * alpha).endVertex()
+ worldrenderer.pos(x + 0.8, y + bottomOffset, z + 0.8).tex(1.0, d12).color(r, g, b, 0.25f).endVertex()
+ worldrenderer.pos(x + 0.2, y + bottomOffset, z + 0.8).tex(0.0, d12).color(r, g, b, 0.25f).endVertex()
+ worldrenderer.pos(x + 0.2, y + topOffset, z + 0.8).tex(0.0, d13).color(r, g, b, 0.25f * alpha).endVertex()
+ worldrenderer.pos(x + 0.8, y + topOffset, z + 0.2).tex(1.0, d13).color(r, g, b, 0.25f * alpha).endVertex()
+ worldrenderer.pos(x + 0.8, y + bottomOffset, z + 0.2).tex(1.0, d12).color(r, g, b, 0.25f).endVertex()
+ worldrenderer.pos(x + 0.8, y + bottomOffset, z + 0.8).tex(0.0, d12).color(r, g, b, 0.25f).endVertex()
+ worldrenderer.pos(x + 0.8, y + topOffset, z + 0.8).tex(0.0, d13).color(r, g, b, 0.25f * alpha).endVertex()
+ worldrenderer.pos(x + 0.2, y + topOffset, z + 0.8).tex(1.0, d13).color(r, g, b, 0.25f * alpha).endVertex()
+ worldrenderer.pos(x + 0.2, y + bottomOffset, z + 0.8).tex(1.0, d12).color(r, g, b, 0.25f).endVertex()
+ worldrenderer.pos(x + 0.2, y + bottomOffset, z + 0.2).tex(0.0, d12).color(r, g, b, 0.25f).endVertex()
+ worldrenderer.pos(x + 0.2, y + topOffset, z + 0.2).tex(0.0, d13).color(r, g, b, 0.25f * alpha).endVertex()
+ tessellator.draw()
+ GlStateManager.disableLighting()
+ GlStateManager.enableTexture2D()
+ if (esp) {
+ GlStateManager.enableDepth()
+ }
+ }
+
fun drawEntityBox(entity: Entity, color: Color, outline: Boolean, fill: Boolean, esp: Boolean, partialTicks: Float) {
if (!outline && !fill) return
val renderManager = mc.renderManager