diff --git a/ReadMe.md b/ReadMe.md index 04ad6e5c1..d3ae3ab7f 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -55,7 +55,7 @@ I always try to add support for the newest version of minecraft. Mostly it is pr ### Supported versions -Almost all versions (and snapshots!) between 1.7 and the latest one (21w17a as of writing this, snapshot for 1.17). I plan to maintain Minosoft to at least version 1.20, so stay tuned. Support for older protocols will not be dropped as newer protocols are added. And I can only recommend using the latest stable version. +Almost all versions (and snapshots!) between 1.7 and the latest one (21w17a as of writing this, snapshot for 1.17). I plan to maintain Minosoft to at least version 1.20, so stay tuned. Support for older protocols will not be dropped as newer protocols are added. And can still only recommend using the latest stable version, should be the most stable one. ### Unsupported versions @@ -84,7 +84,7 @@ See [Credits](Credits.md). ## Releases and beta -No clue, but still waiting for !21. Also, some features need to be implemented, so not soo soon (but we are getting closer). If you want to get notified about cool new changes, feel free to subscribe to our dev news telegram channel [@MinosoftDevNews]((https://t.me/MinosoftDevNews)) +No clue, but still waiting for !21. Also, some features need to be implemented, so not soo soon (but we are getting closer). If you want to get notified about cool new changes, feel free to subscribe to our dev news telegram channel [@MinosoftDevNews](https://t.me/MinosoftDevNews) ## Compiling and running 1. Install Maven and java 15 (On Ubuntu based distributions: `sudo apt install maven openjdk-15-jdk`). diff --git a/src/main/java/de/bixilon/minosoft/protocol/protocol/InByteBuffer.kt b/src/main/java/de/bixilon/minosoft/protocol/protocol/InByteBuffer.kt index c85c56a97..1c30387fa 100644 --- a/src/main/java/de/bixilon/minosoft/protocol/protocol/InByteBuffer.kt +++ b/src/main/java/de/bixilon/minosoft/protocol/protocol/InByteBuffer.kt @@ -56,7 +56,7 @@ open class InByteBuffer { get() = size - pointer inline fun readArray(length: Int = readVarInt(), reader: () -> T): Array { - check(length <= size) { "Trying to allocate to much memory!" } + check(length <= size) { "Trying to allocate too much memory!" } val array: MutableList = mutableListOf() for (i in 0 until length) { array.add(i, reader()) @@ -69,7 +69,7 @@ open class InByteBuffer { } open fun readByteArray(length: Int = readVarInt()): ByteArray { - check(length <= bytes.size) { "Trying to allocate to much memory!" } + check(length <= bytes.size) { "Trying to allocate too much memory!" } val array = ByteArray(length) System.arraycopy(bytes, pointer, array, 0, length) pointer += length @@ -86,7 +86,7 @@ open class InByteBuffer { } fun readShortArray(length: Int = readVarInt()): ShortArray { - check(length <= bytes.size / Short.SIZE_BYTES) { "Trying to allocate to much memory!" } + check(length <= bytes.size / Short.SIZE_BYTES) { "Trying to allocate too much memory!" } val array = ShortArray(length) for (i in 0 until length) { array[i] = readShort() @@ -108,7 +108,7 @@ open class InByteBuffer { } fun readIntArray(length: Int = readVarInt()): IntArray { - check(length <= bytes.size / Int.SIZE_BYTES) { "Trying to allocate to much memory!" } + check(length <= bytes.size / Int.SIZE_BYTES) { "Trying to allocate too much memory!" } val array = IntArray(length) for (i in 0 until length) { array[i] = readInt() @@ -138,7 +138,7 @@ open class InByteBuffer { @JvmOverloads fun readVarIntArray(length: Int = readVarInt()): IntArray { - check(length <= bytes.size) { "Trying to allocate to much memory!" } + check(length <= bytes.size) { "Trying to allocate too much memory!" } val array = IntArray(length) for (i in 0 until length) { array[i] = readVarInt() @@ -156,7 +156,7 @@ open class InByteBuffer { } fun readLongArray(length: Int = readVarInt()): LongArray { - check(length <= bytes.size / Long.SIZE_BYTES) { "Trying to allocate to much memory!" } + check(length <= bytes.size / Long.SIZE_BYTES) { "Trying to allocate too much memory!" } val array = LongArray(length) for (i in 0 until length) { array[i] = readLong() @@ -180,7 +180,7 @@ open class InByteBuffer { } fun readVarLongArray(length: Int = readVarInt()): LongArray { - check(length <= bytes.size) { "Trying to allocate to much memory!" } + check(length <= bytes.size) { "Trying to allocate too much memory!" } val array = LongArray(length) for (i in 0 until length) { array[i] = readVarLong() @@ -193,7 +193,7 @@ open class InByteBuffer { } fun readFloatArray(length: Int = readVarInt()): FloatArray { - check(length <= bytes.size / Float.SIZE_BYTES) { "Trying to allocate to much memory!" } + check(length <= bytes.size / Float.SIZE_BYTES) { "Trying to allocate too much memory!" } val array = FloatArray(length) for (i in 0 until length) { array[i] = readFloat() @@ -207,7 +207,7 @@ open class InByteBuffer { } fun readDoubleArray(length: Int = readVarInt()): DoubleArray { - check(length <= bytes.size / Double.SIZE_BYTES) { "Trying to allocate to much memory!" } + check(length <= bytes.size / Double.SIZE_BYTES) { "Trying to allocate too much memory!" } val array = DoubleArray(length) for (i in 0 until length) { array[i] = readDouble() diff --git a/src/main/java/de/bixilon/minosoft/protocol/protocol/PlayInByteBuffer.kt b/src/main/java/de/bixilon/minosoft/protocol/protocol/PlayInByteBuffer.kt index 8bf67abe4..25a3a479f 100644 --- a/src/main/java/de/bixilon/minosoft/protocol/protocol/PlayInByteBuffer.kt +++ b/src/main/java/de/bixilon/minosoft/protocol/protocol/PlayInByteBuffer.kt @@ -150,7 +150,7 @@ class PlayInByteBuffer : InByteBuffer { } } - check(length <= ProtocolDefinition.PROTOCOL_PACKET_MAX_SIZE) { "Trying to allocate to much memory" } + check(length <= ProtocolDefinition.PROTOCOL_PACKET_MAX_SIZE) { "Trying to allocate too much memory" } val ret: MutableList = mutableListOf() for (i in 0 until length) {