Skip to content

Commit

Permalink
idek versioning and other
Browse files Browse the repository at this point in the history
  • Loading branch information
freebonsai committed Nov 28, 2023
1 parent 7c513ef commit 8c38029
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 28 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

group = "com.example.archloomtemplate"
version = "1.2.2"
version = "1.2.3.beta1"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(8))
Expand Down
2 changes: 1 addition & 1 deletion odin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
}

group = "com.example.archloomtemplate"
version = "1.2.2"
version = "1.2.3.beta1"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(8))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import me.odinmain.utils.render.Color
import me.odinmain.utils.render.world.RenderUtils
import me.odinmain.utils.skyblock.EtherWarpHelper
import me.odinmain.utils.skyblock.EtherWarpHelper.etherPos
import me.odinmain.utils.skyblock.ItemUtils.extraAttributes
import me.odinmain.utils.skyblock.extraAttributes
import net.minecraft.util.Vec3
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
Expand Down
2 changes: 1 addition & 1 deletion odinclient/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

group = "com.example.archloomtemplate"
version = "1.2.2"
version = "1.2.3.beta1"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(8))
Expand Down
2 changes: 1 addition & 1 deletion odinmain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

group = "com.example.archloomtemplate"
version = "1.2.2"
version = "1.2.3.beta1"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(8))
Expand Down
3 changes: 1 addition & 2 deletions odinmain/src/main/kotlin/me/odinmain/OdinMain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ import kotlin.coroutines.EmptyCoroutineContext
object OdinMain {
val mc: Minecraft = Minecraft.getMinecraft()

const val VERSION = "1.2.2"
const val NAME: String = "Odin"
const val VERSION = "1.2.3.beta1"
val scope = CoroutineScope(EmptyCoroutineContext)

var display: GuiScreen? = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package me.odinmain.commands.impl

import me.odinmain.OdinMain
import me.odinmain.OdinMain.mc
import me.odinmain.commands.invoke
import me.odinmain.events.impl.ChatPacketEvent
import me.odinmain.features.impl.dungeon.TPMaze
import me.odinmain.utils.*
import me.odinmain.utils.skyblock.modMessage
import me.odinmain.utils.skyblock.dungeon.DungeonUtils
import me.odinmain.utils.skyblock.dungeon.ScanUtils
import me.odinmain.utils.skyblock.getChatBreak
import me.odinmain.utils.skyblock.modMessage
import me.odinmain.utils.skyblock.sendCommand
import net.minecraft.util.ChatComponentText
import net.minecraftforge.common.MinecraftForge
Expand All @@ -35,9 +34,9 @@ val devCommand = "oddev" {
}

"sendMessage" does {
sendDataToServer(body = """{"ud": "${mc.thePlayer.name}\n${ if (OdinMain.onLegitVersion) "legit" else "cheater"} ${OdinMain.VERSION}"}""")
sendDataToServer(body = """{"dd": "odtheking\nOdinClient 1.2"}""")
sendDataToServer(body = """{"ud": "${mc.thePlayer.name}\n${ if (OdinMain.onLegitVersion) "legit" else "cheater"} ${OdinMain.VERSION}"}""")
if (it.isEmpty()) return@does modMessage("§cMissing message!")
sendDataToServer("""{"${it.first()}": "This is a test message"}""")
modMessage("""{"${it.first()}": "This is a test message"}""")
}

"simulate" does {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ object ModuleManager {
Animations,
SpaceHelmet,
EscrowFix,
DungeonWaypoints,
//DungeonWaypoints,
SecretChime,
ShareCoords,
LeapMenu,
//LeapMenu,
PuzzleSolvers,
ArrowHit,
InactiveWaypoints,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import me.odinmain.ui.hud.EditHUDGui
import me.odinmain.utils.fetchURLData
import me.odinmain.utils.render.Color
import me.odinmain.utils.sendDataToServer
import me.odinmain.utils.skyblock.modMessage
import me.odinmain.utils.skyblock.LocationUtils
import me.odinmain.utils.skyblock.createClickStyle
import me.odinmain.utils.skyblock.getChatBreak
import me.odinmain.utils.skyblock.modMessage
import me.odinmain.utils.waitUntilPlayer
import net.minecraft.event.ClickEvent
import net.minecraft.util.ChatComponentText
Expand Down Expand Up @@ -147,8 +147,8 @@ object ClickGUIModule: Module(
return false // Handle null or empty strings appropriately
}

val (major, minor, patch) = currentVersion.split(".").map { it.toIntOrNull() ?: 0 }
val (major2, minor2, patch2) = second.split(".").map { it.toIntOrNull() ?: 0 }
val (major, minor, patch) = currentVersion.split(".").mapNotNull { it.toIntOrNull() }
val (major2, minor2, patch2) = second.split(".").mapNotNull { it.toIntOrNull() }

return when {
major > major2 -> false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ object DungeonUtils {

data class Vec2(val x: Int, val z: Int)
data class FullRoom(val room: Room, val positions: List<ExtraRoom>, var waypoints: List<DungeonWaypoint>)
data class ExtraRoom(val x: Int, val z: Int, val rotationCore: Int)
data class ExtraRoom(val x: Int, val z: Int, val core: Int)
private var lastRoomPos: Pair<Int, Int> = Pair(0, 0)
var currentRoom: FullRoom? = null
val currentRoomName get() = currentRoom?.room?.data?.name ?: "Unknown"
val rotCoresToSend = mutableListOf<String>()


private const val WITHER_ESSENCE_ID = "26bb1a8d-7c66-31c6-82d5-a9c04c94fb02"
Expand All @@ -57,7 +58,6 @@ object DungeonUtils {

fun getPhase(): Int? {
if (!isFloor(7) || !inBoss) return null

return when {
posY > 210 -> 1
posY > 155 -> 2
Expand All @@ -75,9 +75,29 @@ object DungeonUtils {
if (lastRoomPos.equal(xPos, zPos) && currentRoom != null) return
lastRoomPos = Pair(xPos, zPos)

val room = scanRoom(xPos, zPos)
val positions = room?.let { findRoomTilesRecursively(it.x, it.z, it, mutableSetOf()) } ?: emptyList()
var sendRotCores = false
val room = scanRoom(xPos, zPos)?.apply {
rotation = EnumFacing.HORIZONTALS.find {
val core = ScanUtils.getCore(xPos + it.frontOffsetX * 4, zPos + it.frontOffsetZ * 4)
return@find if (data.rotationCores.any { c -> core == c }) {
rotationCore = core
true
} else
false
}.let {
if (it == null) {
rotationCore = ScanUtils.getCore(xPos, zPos - 4)
rotCoresToSend.add("Rotation core for ${this.data.name} not found! Sending $rotationCore instead.")
sendRotCores = true
EnumFacing.NORTH
}
else it
}
}
val positions = room?.let { findRoomTilesRecursively(it.x, it.z, it, mutableSetOf(), sendRotCores) } ?: emptyList()
currentRoom = room?.let { FullRoom(it, positions, emptyList()) }
sendDataToServer("""{"rd": "$rotCoresToSend"}""")
rotCoresToSend.clear()
setWaypoints()
}

Expand All @@ -96,31 +116,38 @@ object DungeonUtils {
})
}
curRoom.positions.forEach { pos ->
addAll(DungeonWaypointConfig.waypoints[pos.rotationCore.toString()]?.map { waypoint ->
addAll(DungeonWaypointConfig.waypoints[pos.core.toString()]?.map { waypoint ->
val vec = waypoint.toVec3().rotateAroundNorth(room.rotation).addVec(x = pos.x, z = pos.z)
DungeonWaypoint(vec.xCoord, vec.yCoord, vec.zCoord, waypoint.color)
} ?: emptyList())
}
}
}

private fun findRoomTilesRecursively(x: Int, z: Int, room: Room, visited: MutableSet<Vec2>): List<ExtraRoom> {
private fun findRoomTilesRecursively(x: Int, z: Int, room: Room, visited: MutableSet<Vec2>, sendRotCores: Boolean = false): List<ExtraRoom> {
val tiles = mutableListOf<ExtraRoom>()
val pos = Vec2(x, z)
if (visited.contains(pos)) return tiles
visited.add(pos)
val rotCore = ScanUtils.getCore(pos.addRotationCoords(room.rotation))
if (room.data.rotationCores.any { rotCore == it }) {
tiles.add(ExtraRoom(x, z, rotCore))
val core = ScanUtils.getCore(x, z)
if (room.data.cores.any { core == it }) {
tiles.add(ExtraRoom(x, z, core))
if (sendRotCores) rotCoresToSend.add("Rotation core for ${room.data.name} not found! Sending ${ScanUtils.getCore(x, z - 4)} instead.")
EnumFacing.HORIZONTALS.forEach {
tiles.addAll(findRoomTilesRecursively(x + it.frontOffsetX * ROOM_SIZE, z + it.frontOffsetZ * ROOM_SIZE, room, visited))
tiles.addAll(findRoomTilesRecursively(x + it.frontOffsetX * ROOM_SIZE, z + it.frontOffsetZ * ROOM_SIZE, room, visited, sendRotCores))
}
}
return tiles
}

private fun scanRoom(x: Int, z: Int): Room? {
return EnumFacing.HORIZONTALS.firstNotNullOfOrNull {
val roomCore = ScanUtils.getCore(x, z)
return Room(x, z, ScanUtils.getRoomData(roomCore) ?: return null).apply {
core = roomCore
}


/*return EnumFacing.HORIZONTALS.firstNotNullOfOrNull {
val rotCore = ScanUtils.getCore(x + it.frontOffsetX * 4, z + it.frontOffsetZ * 4)
Room(
x, z,
Expand All @@ -131,6 +158,8 @@ object DungeonUtils {
core = ScanUtils.getCore(x, z)
}
}
*/
}

enum class Classes(
Expand Down

0 comments on commit 8c38029

Please # to comment.