mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-16 04:11:39 +01:00
fix: use formatter args in Check calls
This commit is contained in:
parent
fb7e4b10e0
commit
a5e0641444
@ -172,7 +172,7 @@ public final class NetworkBuffer {
|
||||
|
||||
public <T> @NotNull List<@NotNull T> readCollection(@NotNull Type<T> type, int maxSize) {
|
||||
final int size = read(VAR_INT);
|
||||
Check.argCondition(size > maxSize, "Collection size (" + size + ") is higher than the maximum allowed size (" + maxSize + ")");
|
||||
Check.argCondition(size > maxSize, "Collection size ({0}) is higher than the maximum allowed size ({1})", size, maxSize);
|
||||
final List<T> values = new java.util.ArrayList<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
values.add(read(type));
|
||||
@ -182,7 +182,7 @@ public final class NetworkBuffer {
|
||||
|
||||
public <T> @NotNull List<@NotNull T> readCollection(@NotNull Function<@NotNull NetworkBuffer, @NotNull T> function, int maxSize) {
|
||||
final int size = read(VAR_INT);
|
||||
Check.argCondition(size > maxSize, "Collection size (" + size + ") is higher than the maximum allowed size (" + maxSize + ")");
|
||||
Check.argCondition(size > maxSize, "Collection size ({0}) is higher than the maximum allowed size ({1})", size, maxSize);
|
||||
final List<T> values = new java.util.ArrayList<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
values.add(function.apply(this));
|
||||
|
@ -221,7 +221,7 @@ final class NetworkBufferTypes {
|
||||
buffer -> {
|
||||
final int length = buffer.read(VAR_INT);
|
||||
final int remaining = buffer.nioBuffer.limit() - buffer.readIndex();
|
||||
Check.argCondition(length > remaining, "String is too long (length: " + length + ", readable: " + remaining + ")");
|
||||
Check.argCondition(length > remaining, "String is too long (length: {0}, readable: {1})", length, remaining);
|
||||
byte[] bytes = new byte[length];
|
||||
buffer.nioBuffer.get(buffer.readIndex(), bytes);
|
||||
buffer.readIndex += length;
|
||||
|
Loading…
Reference in New Issue
Block a user