From 4521e38e38c5de5763173965be389e95cdfab047 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Mon, 8 Nov 2021 21:33:59 +0100 Subject: [PATCH] fix: Don't tab complete commands the actor has no permission to --- .github/CODEOWNERS | 2 +- .github/FUNDING.yml | 2 +- .github/workflows/build.yml | 2 + .github/workflows/validate-gradle-wrapper.yml | 12 -- HEADER.txt | 2 +- LICENSE | 2 +- build.gradle.kts | 14 +- gradlew.bat | 178 +++++++++--------- .../buildersutilities/BuildersUtilities.java | 2 - src/main/resources/LICENSE | 2 +- src/main/resources/config.yml | 2 +- src/main/resources/plugin.yml | 28 ++- 12 files changed, 120 insertions(+), 128 deletions(-) delete mode 100644 .github/workflows/validate-gradle-wrapper.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 369ea69..9f32539 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @Brennian \ No newline at end of file +* @Brennian diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 466c17d..ddc9935 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,4 @@ # These are supported funding model platforms patreon: Arcaniax # Replace with a single Patreon username -custom: https://www.paypal.me/LesleyDom # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] \ No newline at end of file +custom: https://www.paypal.me/LesleyDom # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f25ee7b..bf532ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,8 @@ jobs: steps: - name: "Checkout Repository" uses: "actions/checkout@v2.3.4" + - name : "Validate Gradle Wrapper" + uses : "gradle/wrapper-validation-action@v1.0.4" - name : "Grab SHA" uses : "benjlevesque/short-sha@v1.2" id : "short-sha" diff --git a/.github/workflows/validate-gradle-wrapper.yml b/.github/workflows/validate-gradle-wrapper.yml deleted file mode 100644 index a94b689..0000000 --- a/.github/workflows/validate-gradle-wrapper.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: "validate gradle wrapper" - -on: ["pull_request", "push"] - -jobs: - build: - runs-on: "ubuntu-20.04" - steps: - - name: "Checkout Repository" - uses: "actions/checkout@v2.3.4" - - name: "Validate Gradle Wrapper" - uses: "gradle/wrapper-validation-action@v1.0.4" diff --git a/HEADER.txt b/HEADER.txt index f95713d..bf10d93 100644 --- a/HEADER.txt +++ b/HEADER.txt @@ -19,4 +19,4 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . \ No newline at end of file + along with this program. If not, see . diff --git a/LICENSE b/LICENSE index 23702e5..9d74247 100644 --- a/LICENSE +++ b/LICENSE @@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. \ No newline at end of file +. diff --git a/build.gradle.kts b/build.gradle.kts index 6387f81..298904c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,16 +1,13 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import org.cadixdev.gradle.licenser.LicenseExtension import org.ajoberstar.grgit.Grgit -import org.ec4j.gradle.EditorconfigExtension plugins { java - `java-library` id("org.cadixdev.licenser") version "0.6.1" id("com.github.johnrengelman.shadow") version "7.1.0" id("org.ajoberstar.grgit") version "4.1.0" - id("org.ec4j.editorconfig") version "0.0.3" idea eclipse @@ -41,14 +38,14 @@ repositories { } dependencies { - compileOnlyApi("io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT") - compileOnlyApi("com.mojang:authlib:1.5.25") + compileOnly("io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT") + compileOnly("com.mojang:authlib:1.5.25") implementation("org.bstats:bstats-bukkit:2.2.1") implementation("org.bstats:bstats-base:2.2.1") implementation("com.github.cryptomorin:XSeries:8.4.0") implementation("dev.notmyfault.serverlib:ServerLib:2.3.1") implementation("io.papermc:paperlib:1.0.6") - compileOnlyApi("org.apache.logging.log4j:log4j-api:2.14.1") + compileOnly("org.apache.logging.log4j:log4j-api:2.14.1") } var buildNumber by extra("") @@ -92,10 +89,6 @@ configure { include("**/*.java") } -configure { - includes = listOf("**/*.java") -} - tasks.named("processResources") { filesMatching("plugin.yml") { expand("version" to project.version) @@ -104,5 +97,4 @@ tasks.named("processResources") { tasks.named("build").configure { dependsOn("shadowJar") - dependsOn("editorconfigCheck") } diff --git a/gradlew.bat b/gradlew.bat index ac1b06f..107acd3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/main/java/net/arcaniax/buildersutilities/BuildersUtilities.java b/src/main/java/net/arcaniax/buildersutilities/BuildersUtilities.java index 637f1f1..1810dc4 100644 --- a/src/main/java/net/arcaniax/buildersutilities/BuildersUtilities.java +++ b/src/main/java/net/arcaniax/buildersutilities/BuildersUtilities.java @@ -126,8 +126,6 @@ public final class BuildersUtilities extends JavaPlugin { getCommand("blocks").setExecutor(commandExecutor); getCommand("n").setExecutor(commandExecutor); getCommand("nc").setExecutor(commandExecutor); - getCommand("/1").setExecutor(commandExecutor); - getCommand("/2").setExecutor(commandExecutor); getCommand("/cuboid").setExecutor(commandExecutor); getCommand("/convex").setExecutor(commandExecutor); getCommand("/s").setExecutor(commandExecutor); diff --git a/src/main/resources/LICENSE b/src/main/resources/LICENSE index 23702e5..9d74247 100644 --- a/src/main/resources/LICENSE +++ b/src/main/resources/LICENSE @@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. \ No newline at end of file +. diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index de7b5fd..2c4994b 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -43,4 +43,4 @@ send-error-messages: true # Whether or not Builders-Utilities should send debug messages # Leave it on "false" unless you are debugging Builders-Utilities' events. -send-debug-messages: false \ No newline at end of file +send-debug-messages: false diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index e02c94c..80b7806 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -8,60 +8,72 @@ commands: butil: aliases: bu description: opens toggle menu + permission: builders.util.gui banner: description: opens banner creator aliases: bm + permission: builders.util.banner armorcolor: description: opens armor color creator aliases: color + permission: builders.util.color nc: aliases: noclip description: Toggles NoClip. + permission: builders.util.noclip af: aliases: advfly description: Toggles Advanced fly. + permission: builders.util.advancedfly n: aliases: nv description: Toggles Nightvision. - /1: - description: alias - /2: - description: alias + permission: builders.util.nightvision /r: description: alias + permission: builders.util.aliases /s: description: alias + permission: builders.util.aliases /c: description: alias + permission: builders.util.aliases /f: description: alias + permission: builders.util.aliases /pa: description: alias + permission: builders.util.aliases /derot: description: alias + permission: builders.util.aliases /twist: description: alias + permission: builders.util.aliases /scale: description: alias - /copy: - description: alias + permission: builders.util.aliases /cuboid: description: alias aliases: /cub + permission: builders.util.aliases /flip: description: alias + permission: builders.util.aliases /convex: description: alias aliases: /con + permission: builders.util.aliases blocks: description: Opens secret blocks menu aliases: secretblocks + permission: builders.util.secretblocks ws: description: alias + permission: builders.util.aliases fs: description: alias - bu help: - description: Help command + permission: builders.util.aliases permissions: builders.util.trapdoor: