From 0e75816bcfb369d880c13f57752e3a724781cf55 Mon Sep 17 00:00:00 2001 From: Noah van der Aa Date: Fri, 4 Mar 2022 11:23:28 +0100 Subject: [PATCH] Clarify exception messages for invalid view distances (#7510) --- .../server/Replace-player-chunk-loader-system.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/patches/server/Replace-player-chunk-loader-system.patch b/patches/server/Replace-player-chunk-loader-system.patch index 850037ede..216bbe4c3 100644 --- a/patches/server/Replace-player-chunk-loader-system.patch +++ b/patches/server/Replace-player-chunk-loader-system.patch @@ -326,7 +326,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + public void setSendDistance(final int distance) { + if (distance != -1 && (distance < MIN_VIEW_DISTANCE || distance > MAX_VIEW_DISTANCE + 1)) { -+ throw new IllegalArgumentException(Integer.toString(distance)); ++ throw new IllegalArgumentException("Send distance must be a number between " + MIN_VIEW_DISTANCE + " and " + (MAX_VIEW_DISTANCE + 1) + ", or -1, got: " + distance); + } + this.rawSendDistance = distance; + } @@ -338,7 +338,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + public void setLoadDistance(final int distance) { + if (distance != -1 && (distance < MIN_VIEW_DISTANCE || distance > MAX_VIEW_DISTANCE + 1)) { -+ throw new IllegalArgumentException(Integer.toString(distance)); ++ throw new IllegalArgumentException("Load distance must be a number between " + MIN_VIEW_DISTANCE + " and " + (MAX_VIEW_DISTANCE + 1) + ", or -1, got: " + distance); + } + this.rawLoadDistance = distance; + } @@ -349,7 +349,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + public void setTickDistance(final int distance) { + if (distance < MIN_VIEW_DISTANCE || distance > MAX_VIEW_DISTANCE) { -+ throw new IllegalArgumentException(Integer.toString(distance)); ++ throw new IllegalArgumentException("View distance must be a number between " + MIN_VIEW_DISTANCE + " and " + MAX_VIEW_DISTANCE + ", got: " + distance); + } + this.rawTickDistance = distance; + } @@ -942,7 +942,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + public void setTargetSendViewDistance(final int distance) { + if (distance != -1 && (distance < MIN_VIEW_DISTANCE || distance > MAX_VIEW_DISTANCE + 1)) { -+ throw new IllegalArgumentException(Integer.toString(distance)); ++ throw new IllegalArgumentException("Send view distance must be a number between " + MIN_VIEW_DISTANCE + " and " + (MAX_VIEW_DISTANCE + 1) + " or -1, got: " + distance); + } + this.sendViewDistance = distance; + } @@ -953,7 +953,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + public void setTargetNoTickViewDistance(final int distance) { + if (distance != -1 && (distance < MIN_VIEW_DISTANCE || distance > MAX_VIEW_DISTANCE)) { -+ throw new IllegalArgumentException(Integer.toString(distance)); ++ throw new IllegalArgumentException("Simulation distance must be a number between " + MIN_VIEW_DISTANCE + " and " + MAX_VIEW_DISTANCE + " or -1, got: " + distance); + } + this.loadViewDistance = distance == -1 ? -1 : distance + 1; + } @@ -964,7 +964,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + public void setTargetTickViewDistance(final int distance) { + if (distance != -1 && (distance < MIN_VIEW_DISTANCE || distance > MAX_VIEW_DISTANCE)) { -+ throw new IllegalArgumentException(Integer.toString(distance)); ++ throw new IllegalArgumentException("View distance must be a number between " + MIN_VIEW_DISTANCE + " and " + MAX_VIEW_DISTANCE + " or -1, got: " + distance); + } + this.tickViewDistance = distance; + }