mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
world portal: rename and delete now working
This commit is contained in:
@@ -665,10 +665,10 @@ fun magicMismatch(magic: ByteArray, array: ByteArray): Boolean {
|
||||
return !Arrays.equals(array, magic)
|
||||
}
|
||||
fun String.toEntryName(length: Int, charset: Charset): ByteArray {
|
||||
val buffer = ByteArray64(length.toLong())
|
||||
val buf = ByteArray(length)
|
||||
val stringByteArray = this.toByteArray(charset)
|
||||
buffer.appendBytes(stringByteArray.sliceArray(0 until minOf(length, stringByteArray.size)))
|
||||
return buffer.toByteArray()
|
||||
System.arraycopy(stringByteArray, 0, buf, 0, minOf(length, stringByteArray.size))
|
||||
return buf
|
||||
}
|
||||
fun ByteArray.toCanonicalString(charset: Charset): String {
|
||||
var lastIndexOfRealStr = 0
|
||||
|
||||
Reference in New Issue
Block a user