Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
Signed-off-by: odtheking <[email protected]>
  • Loading branch information
odtheking authored Jan 6, 2025
2 parents 7fe1dc9 + f39b2aa commit d32ef4d
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 52 deletions.
14 changes: 7 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ plugins {
idea
java
id("com.github.johnrengelman.shadow") version "8.1.1"
kotlin("jvm") version "2.0.0-Beta1"
id("net.kyori.blossom") version "1.3.1"
id("gg.essential.loom") version "0.10.0.+"
id("dev.architectury.architectury-pack200") version "0.1.3"
id("gg.essential.loom") version "0.10.0.+"
id("net.kyori.blossom") version "1.3.1"
kotlin("jvm") version "2.0.0-Beta1"
}

version = project.findProperty("version") as String
Expand All @@ -23,12 +23,12 @@ allprojects {
maven("https://repo.essential.gg/repository/maven-public/")
}

apply(plugin = "java")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "dev.architectury.architectury-pack200")
apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "net.kyori.blossom")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "gg.essential.loom")
apply(plugin = "dev.architectury.architectury-pack200")
apply(plugin = "net.kyori.blossom")
apply(plugin = "java")

dependencies {
minecraft("com.mojang:minecraft:1.8.9")
Expand Down
15 changes: 0 additions & 15 deletions odin/log4j2.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ object SimonSays : Module(
currentPhase++
phaseClock.update()
}
clickInOrder.clear()
} else if (state.block == Blocks.stone_button) {
if (old.block == Blocks.air && clickInOrder.size > currentPhase + 1) devMessage("was skipped!?!?!")
if (old.block == Blocks.stone_button && state.getValue(BlockButtonStone.POWERED)) {
Expand Down
15 changes: 0 additions & 15 deletions odinclient/log4j2.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import me.odinmain.utils.addVec
import me.odinmain.utils.noControlCodes
import me.odinmain.utils.render.Color
import me.odinmain.utils.render.Renderer
import me.odinmain.utils.skyblock.PlayerUtils.alert
import me.odinmain.utils.skyblock.dungeon.DungeonUtils
import me.odinmain.utils.skyblock.modMessage
import me.odinmain.utils.toAABB
import net.minecraft.entity.Entity
import net.minecraft.entity.item.EntityArmorStand
Expand Down Expand Up @@ -44,13 +44,14 @@ object KeyHighlight : Module(
fun postMetadata(event: PostEntityMetadata) {
if (!DungeonUtils.inDungeons || DungeonUtils.inBoss) return
val entity = mc.theWorld?.getEntityByID(event.packet.entityId) as? EntityArmorStand ?: return
if (currentKey?.entity == entity) return

currentKey = when (entity.name.noControlCodes) {
"Wither Key" -> KeyInfo(entity, witherColor)
"Blood Key" -> KeyInfo(entity, bloodColor)
else -> return
}
if (announceKeySpawn) modMessage("§7Found the §4${entity.name.noControlCodes}§7 key!")
if (announceKeySpawn) alert("${entity.name}§7 spawned!")
}

@SubscribeEvent
Expand Down
8 changes: 5 additions & 3 deletions src/main/kotlin/me/odinmain/features/impl/dungeon/LeapMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ import me.odinmain.utils.equalsOneOf
import me.odinmain.utils.name
import me.odinmain.utils.render.*
import me.odinmain.utils.render.RenderUtils.drawTexturedModalRect
import me.odinmain.utils.skyblock.*
import me.odinmain.utils.skyblock.ClickType
import me.odinmain.utils.skyblock.PlayerUtils.windowClick
import me.odinmain.utils.skyblock.dungeon.DungeonClass
import me.odinmain.utils.skyblock.dungeon.DungeonPlayer
import me.odinmain.utils.skyblock.dungeon.DungeonUtils.leapTeammates
import me.odinmain.utils.skyblock.getItemIndexInContainerChest
import me.odinmain.utils.skyblock.modMessage
import me.odinmain.utils.skyblock.partyMessage
import net.minecraft.client.gui.inventory.GuiChest
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.inventory.ContainerChest
Expand All @@ -28,7 +31,6 @@ import net.minecraftforge.client.event.GuiOpenEvent
import net.minecraftforge.fml.common.Loader
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import org.lwjgl.input.Keyboard
import org.lwjgl.input.Mouse
import org.lwjgl.opengl.Display

object LeapMenu : Module(
Expand Down Expand Up @@ -145,7 +147,7 @@ object LeapMenu : Module(
if (playerToLeap == EMPTY) return
if (playerToLeap.isDead) return modMessage("This player is dead, can't leap.")

leapTo(playerToLeap.name, gui.inventorySlots as ContainerChest)
leapTo(playerToLeap.name, gui)

event.isCanceled = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import me.odinmain.utils.name
import me.odinmain.utils.skyblock.dungeon.DungeonUtils
import me.odinmain.utils.skyblock.dungeon.M7Phases
import me.odinmain.utils.skyblock.partyMessage
import me.odinmain.utils.skyblock.sendCommand
import net.minecraft.inventory.ContainerChest
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent

Expand All @@ -22,13 +23,15 @@ object MelodyMessage : Module(
private val sendMelodyMessage by BooleanSetting("Send Melody Message", true, description = "Sends a message when the melody terminal opens.")
private val melodyMessage by StringSetting("Melody Message", "Melody Terminal start!", 128, description = "Message sent when the melody terminal opens.").withDependency { sendMelodyMessage }
private val melodyProgress by BooleanSetting("Melody Progress", false, description = "Tells the party about melody terminal progress.")
private val melodySendCoords by BooleanSetting("Melody Send Coords", false, description = "Sends the coordinates of the melody terminal.").withDependency { melodyProgress }

private var claySlots = hashMapOf(25 to "Melody terminal is at 25%", 34 to "Melody terminal is at 50%", 43 to "Melody terminal is at 75%")

@SubscribeEvent
fun onGuiLoad(event: TerminalEvent.Opened) {
if (DungeonUtils.getF7Phase() != M7Phases.P3 || event.terminal.type != TerminalTypes.MELODY || mc.currentScreen is TermSimGui) return
if (sendMelodyMessage) partyMessage(melodyMessage)
if (melodySendCoords) sendCommand("od sendcoords")

claySlots = hashMapOf(25 to "Melody terminal is at 25%", 34 to "Melody terminal is at 50%", 43 to "Melody terminal is at 75%")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ object TerminalSolver : Module(
private val backgroundColor by ColorSetting("Background Color", Color(45, 45, 45), true, description = "Background color of the terminal solver.").withDependency { renderType == 0 && showColors }

val customGuiColor by ColorSetting("Custom Gui Color", ColorUtil.moduleButtonColor.withAlpha(.8f), true, description = "Color of the custom gui.").withDependency { renderType == 3 && showColors }
val textColor by ColorSetting("Text Color", Color(220, 220, 220), true, description = "Text color of the terminal solver.").withDependency { showColors }
val panesColor by ColorSetting("Panes Color", Color(0, 170, 170), true, description = "Color of the panes terminal solver.").withDependency { showColors }

val rubixColor1 by ColorSetting("Rubix Color 1", Color(0, 170, 170), true, description = "Color of the rubix terminal solver for 1 click.").withDependency { showColors }
Expand Down Expand Up @@ -237,6 +236,7 @@ object TerminalSolver : Module(
else -> needed - 1
}


if (realNeeded != 0 && renderType != -1) {
val text = if (needed < 3) realNeeded else (realNeeded - 5)
val color = when (text) {
Expand All @@ -247,7 +247,7 @@ object TerminalSolver : Module(
}

if (renderType != 1) Gui.drawRect(event.x, event.y, event.x + 16, event.y + 16, color.rgba)
mcText(text.toString(), event.x + 8f - getMCTextWidth(text.toString()) / 2, event.y + 4.5, 1, textColor, center = false)
mcText(text.toString(), event.x + 8f - getMCTextWidth(text.toString()) / 2, event.y + 4.5, 1, Color.WHITE, center = false)
}
}
TerminalTypes.ORDER -> {
Expand All @@ -263,7 +263,7 @@ object TerminalSolver : Module(
event.isCanceled = true
}
val amount = event.slot.stack?.stackSize?.toString() ?: ""
mcText(amount, event.x + 8.5f - getMCTextWidth(amount) / 2, event.y + 4.5f, 1, textColor, center = false)
mcText(amount, event.x + 8.5f - getMCTextWidth(amount) / 2, event.y + 4.5f, 1, Color.WHITE, center = false)
}
}
TerminalTypes.STARTS_WITH, TerminalTypes.SELECT ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ object OrderGui : TermGui() {
box.h.toFloat() * customScale
)
}
if (index != -1) mcText(amount.toString(), -163 + col * 70 + 26f , -60 + row * 70 + (27f - (textScale*3) - (gap * 0.5)), 2 + textScale, TerminalSolver.textColor)

if (index != -1) mcText(amount.toString(), -163 + col * 70 + 26f , -60 + row * 70 + (27f - (textScale*3) - (gap * 0.5)), 2 + textScale, Color.WHITE)
mcText(amount.toString(), -163 + col * 70 + 26f , -60 + row * 70 + (27f - (textScale*3) - (gap * 0.5)), 2 + textScale, Color.WHITE)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ object RubixGui : TermGui() {
else -> TerminalSolver.oppositeRubixColor1
}
roundedRectangle(box, color)
mcText(text.toString(), -168 + col * 70 + 26f , -110 + row * 70 + (27f - (textScale*3) - (gap * 0.5)), 2 + textScale, TerminalSolver.textColor)
mcText(text.toString(), -168 + col * 70 + 26f , -110 + row * 70 + (27f - (textScale*3) - (gap * 0.5)), 2 + textScale, Color.WHITE)
}

itemIndexMap[pane] = Box(
box.x.toFloat() * customScale + mc.displayWidth / 2,
box.y.toFloat() * customScale + mc.displayHeight / 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ open class TermSimGui(val name: String, val size: Int, private val inv: Inventor
@SubscribeEvent(priority = EventPriority.LOWEST)
fun onPacketSend(event: PacketEvent.Send) {
val packet = event.packet as? C0EPacketClickWindow ?: return
if (OdinMain.mc.currentScreen != this) return
event.isCanceled = true
if (OdinMain.mc.currentScreen !== this) return
delaySlotClick(guiInventorySlots?.get(packet.slotId - 37) ?: return, packet.usedButton)
event.isCanceled = true
}

@SubscribeEvent(priority = EventPriority.LOWEST)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ object Waypoints : Module(
private val pingWaypointTime by NumberSetting("Ping Waypoint Time", 15000L, 0L, 128000L, 1000L, description = "Time to wait before sending the waypoint command.").withDependency { pingLocationToggle && pingLocationDropDown }
private val pingDistance by NumberSetting("Ping Distance", 64.0, 1, 128, 1, description = "Distance to ping location.").withDependency { pingLocationToggle && pingLocationDropDown }


private val partyChatRegex = Regex("^Party > (?:\\[[^]]*?])? ?(\\w{1,16})(?: [ቾ⚒])?: x: (-?\\d+), y: (-?\\d+), z: (-?\\d+).*") // https://regex101.com/r/8K26A1/1
private val allChatRegex = Regex("^(?!Party >).*\\s(?:\\[[^]]*?])? ?(\\w{1,16})(?: [ቾ⚒])?: x: (-?\\d+),? y: (-?\\d+),? z: (-?\\d+).*") // https://regex101.com/r/A3aoyL/1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ object ChatCommands : Module(
}
}
"allinvite", "allinv" -> if (allinvite && channel == ChatChannel.PARTY) sendCommand("p settings allinvite")
"pt", "ptme" -> if (pt && channel == ChatChannel.PARTY) sendCommand("p transfer $name")
"pt", "ptme", "transfer" -> if (pt && channel == ChatChannel.PARTY) sendCommand("p transfer $name")
"downtime", "dt" -> {
if (!dt || channel != ChatChannel.PARTY) return
val reason = message.substringAfter("dt ").takeIf { it != message && !it.contains("!dt") } ?: "No reason given"
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/me/odinmain/utils/skyblock/PlayerUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,16 @@ object PlayerUtils {
private fun sendWindowClick(slotId: Int, button: Int, mode: Int) {
mc.thePlayer?.openContainer?.let {
if (it !is ContainerChest) return
if (slotId !in 0 until it.inventorySlots.size) return

mc.playerController?.windowClick(it.windowId, slotId, button, mode, mc.thePlayer)
}
}

private fun sendWindowClickPacket(slotId: Int, button: Int, mode: Int) {
mc.thePlayer?.openContainer?.let {
if (it !is ContainerChest) return
if (slotId !in 0 until it.inventorySlots.size) return
mc.netHandler?.networkManager?.sendPacket(C0EPacketClickWindow(it.windowId, slotId, button, mode, it.inventory[slotId], it.getNextTransactionID(mc.thePlayer?.inventory)))
}
}
Expand Down

0 comments on commit d32ef4d

Please sign in to comment.