diff --git a/asm/src/main/java/dev/openrs2/asm/ClassVersionUtils.kt b/asm/src/main/java/dev/openrs2/asm/ClassVersionUtils.kt new file mode 100644 index 0000000000..76d4c37908 --- /dev/null +++ b/asm/src/main/java/dev/openrs2/asm/ClassVersionUtils.kt @@ -0,0 +1,15 @@ +package dev.openrs2.asm + +object ClassVersionUtils { + private fun swapWords(v: Int): Int { + return (v shl 16) or (v ushr 16) + } + + fun maxVersion(v1: Int, v2: Int): Int { + return if (swapWords(v1) > swapWords(v2)) { + v1 + } else { + v2 + } + } +}