Skip to content

Commit

Permalink
Added melody sendCoords
Browse files Browse the repository at this point in the history
Fixed some issue with LeapMenu
  • Loading branch information
odtheking committed Jan 6, 2025
1 parent a46a1b0 commit f39b2aa
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 42 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.

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 @@ -126,7 +126,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 f39b2aa

Please sign in to comment.