diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..37654af --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Setup (please complete the following information):** + - OS: [e.g. Windows] + - Version [e.g. v1.0.0] + - Software [e.g. Bukkit] + +**Additional context** +Add any other context about the problem here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..24473de --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..d6a7e6a --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,37 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Java CI with Gradle + +on: + push + +jobs: + build: + if: "!contains(github.event.head_commit.message, '--skip')" + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v5 + - name: Set up JDK 21 + uses: actions/setup-java@v5 + with: + java-version: '21' + distribution: 'temurin' + + - name: Grant execute permission to gradlew + run: chmod +x gradlew + # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + + - name: Build with Gradle Wrapper + run: ./gradlew shadowJar \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2321aef --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Build & Release + +on: + push + +permissions: + contents: write + +jobs: + build-and-release: + if: "contains(github.event.head_commit.message, '--release')" + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Java + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: '21' + + - name: Grant execute permission to gradlew + run: chmod +x gradlew + + - name: Build JAR + run: ./gradlew shadowJar + + + - name: Read version from build.gradle + id: get_version + run: | + VERSION=$(grep "^version *= *'" build.gradle | cut -d"'" -f2) + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "Using version $VERSION for tag" + + - name: Create tag + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git tag ${{ env.VERSION }} + git push origin ${{ env.VERSION }} + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + name: Armstrong-${{ env.VERSION }} + tag_name: ${{ env.VERSION }} + files: ./build/libs/*.jar + body_path: ./CHANGELOG.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e7edf1b --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +.gradle/ +build/ +out/ +classes/ +target/ + +*.launch + +.idea/ +*.iml +*.ipr +*.iws + +.settings/ +.vscode/ +bin/ +.classpath +.project + +*.DS_Store + +run/ + +hs_err_*.log +*.hprof +*.jfr \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 844f356..bd4f9a3 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,73 @@ -
+

+ Armstrong logo +

- - ## LunarUtility +### 🚀 Armstrong +[![Discord](https://img.shields.io/discord/1332991105695875123?logo=discord&label=discord)](https://discord.genesis.li) +[![Latest Release](https://img.shields.io/github/v/release/Vaption/Armstrong.svg)](https://github.com/Vaption/Armstrong/releases) +[![License](https://img.shields.io/github/license/Vaption/Armstrong.svg)](https://github.com/Vaption/Armstrong/blob/master/LICENSE) - +**Armstrong** is a simple plugin that utilizes +[LunarClient](https://lunarclient.com)'s [Apollo API](https://github.com/LunarClient/Apollo). +**Found a bug or have a feature idea?** Use the [issues](https://github.com/Vaption/Armstrong/issues) tab! -**LunarUtility** is an a simple plugin that utilizes [LunarClient's](https://github.com/LunarClient) [BukkitAPI](https://github.com/LunarClient/BukkitAPI). +
-If you find any issues, please report them in our issues tab and don't forget to star the repository! -
+## ⚖️ Armstrong vs. LunarUtility +Originally the goal was just to migrate the codebase to use Apollo rather than the old BukkitAPI. +During the migration, I noticed that Apollo (on its own) now does some of what this plugin once did. +Therefore, the waypoints & disabled-mods module have been removed from this plugin (now configurable in Apollo). +The cooldown module implementation was also removed, but will come back to it after some higher priority updates! -# Notice (UPDATE REGARDING THE LUNARCLIENT API) -LunarClient have officially released their new API [Apollo](https://github.com/LunarClient/Apollo).\ -They have removed BukkitAPI from their github which is what LunarUtility depends on.\ -We will be updating this soon to utilize Apollo. +## 🙌 Credits +Armstrong is based off of [LunarUtility](https://github.com/RefineDevelopment/LunarUtility). All credit to the original developers! -## The Team -+ [Dubai](https://github.com/GamerRealm) | Original Author -+ [Komek](https://github.com/Komeek) | Maintainer -+ [kayalust](https://github.com/kayalust) | Contributor +👨‍💻 **Contributors** +- 🏙️ [Dubai](https://github.com/GamerRealm) – Original Author +- 🛠️ [Komek](https://github.com/Komeek) – Maintainer +- 💡 [kayalust](https://github.com/kayalust) – Contributor -## Contact -- [Discord](https://dsc.gg/refine) -- [Mail](mailto:refinedevelopment@gmail.com) -- [Twitter](https://twitter.com/RefineDev) +## 💬 Contact +- [Discord](https://discord.genesis.li) -## Installing -1. Download the jar from releases -2. Download LunarClient's BukkitAPI jar from here -3. Put both jars in all of your servers -4. Edit the configuration file to your liking. +## 📥 Installing +1️⃣ Download the jar from [releases](https://github.com/Vaption/Armstrong/releases) +2️⃣ Download LunarClient's Apollo API jar from [here](https://github.com/LunarClient/Apollo/releases) +3️⃣ Drop **both** jars into all your servers +4️⃣ Edit the configuration files to your liking -## Terms of Use -+ You are not allowed to sell, claim this as your own. Resepect the developer for his contributions and credit them. +## 📜 Terms of Use +- No selling or claiming this project as your own +- Please respect & credit the developers -## Pictures -### Nametag -![2022-02-10_11 38 33](https://user-images.githubusercontent.com/42650369/154859444-55ffb81b-06b9-497a-9ec5-6c16906b2b83.png) +## ✨ Features +
+ 🏷️ Nametag + Enabled by default, configurable in config.yml. + +
-### Kick -![image](https://github.com/RefineDevelopment/LunarUtility/assets/109939794/d3491af0-22bb-4b71-9355-5a9c194dc6ad) +
+ 🔒 Require LunarClient + Disabled by default. Enable by setting REQUIRE-LUNAR to true in config.yml. + +
-### Staff Mods -![2021-10-26_11 26 09](https://user-images.githubusercontent.com/42650369/138829302-7aeaad61-6cf4-426f-954a-43ace12a972f.png) -![2021-10-26_11 26 23](https://user-images.githubusercontent.com/42650369/138829317-7a8c6015-e692-4a84-b1d4-395a286454bb.png) +
+ 🛡️ Staff Mods + Requires armstrong.staff permission. Toggle with /lsm <player>. + +
-### Commands -![2021-10-26_11 25 54](https://user-images.githubusercontent.com/42650369/138830339-36b85f2c-5044-4953-b6da-4e67ee30fe84.png) -![2021-10-26_11 27 38](https://user-images.githubusercontent.com/42650369/138829630-3c2fe296-c3b9-4aae-97f6-0f4b70db5f79.png) +
+ 🌙 Player on Lunar + Requires armstrong.players permission. Check if someone is using LunarClient with /lc <player>. + +
-### Waypoints -![2021-10-26_11 24 51](https://user-images.githubusercontent.com/42650369/138829478-606493b4-072c-429b-897a-c54948407b4b.png) - -### Cooldowns -![2021-10-26_11 26 59](https://user-images.githubusercontent.com/42650369/138830407-ce602bdd-9281-4744-9d3d-105af5223f3f.png) +
+ 📋 All Players on Lunar + Requires armstrong.players permission. Get a list of players on LunarClient with /lc players (or list / users). + +
diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..7f65064 --- /dev/null +++ b/build.gradle @@ -0,0 +1,51 @@ +plugins { + id 'java' + id 'com.gradleup.shadow' version '9.1.0' +} + +group = 'li.genesis.armstrong' +version = '1.0' + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } +} + +repositories { + maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' } + maven { url "https://repo.aikar.co/content/groups/aikar/" } + maven { url 'https://repo.extendedclip.com/releases/' } + maven { url 'https://jitpack.io' } + maven { url 'https://repo.lunarclient.dev' } + mavenCentral() +} + +dependencies { + annotationProcessor 'org.projectlombok:lombok:1.18.24' + compileOnly 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT' + compileOnly 'org.projectlombok:lombok:1.18.24' + compileOnly 'com.lunarclient:apollo-api:1.2.0' + compileOnly 'com.lunarclient:apollo-extra-adventure4:1.2.0' + compileOnly 'me.clip:placeholderapi:2.11.6' + implementation 'co.aikar:acf-paper:0.5.1-SNAPSHOT' + implementation 'org.bstats:bstats-bukkit:3.1.0' +} + +tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' +} + +processResources { + filteringCharset = 'UTF-8' + filesMatching('plugin.yml') { + expand(version: project.version) + } +} + +shadowJar { + archiveClassifier.set('') + relocate 'co.aikar.commands', 'li.genesis.aikar.commands' + relocate 'co.aikar.locales', 'li.genesis.aikar.locales' + relocate 'org.bstats', 'li.genesis.bstats' +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..8bdaf60 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..2e11132 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..adff685 --- /dev/null +++ b/gradlew @@ -0,0 +1,248 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..c4bdd3a --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,93 @@ +@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 +@rem SPDX-License-Identifier: Apache-2.0 +@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=. +@rem This is normally unused +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% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 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! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/modIDs.yml b/modIDs.yml deleted file mode 100644 index 5fc7378..0000000 --- a/modIDs.yml +++ /dev/null @@ -1,59 +0,0 @@ -# LunarClient Mod IDs -# I don't know the IDs for these mods: -# Day Counter, Hit Color, Tab Editor, NameTags, Color Saturation, -# TNT Cooldown, 3D Skins, Pack Display, Chunk Borders, and Better Sounds. -# -# If you know the mod ID for any of these mods or a new mod's ID, please create a PR. - -# 1.7 Visuals - one_seven_visuals -# FPS - fps -# CPS - cps -# Toggle Sneak/Sprint - toggleSneak -# Armor Status - armorstatus -# KeyStrokes - keystrokes -# Coordinates - coo -# Crosshair - crosshair -# Potion Effects - potioneffects -# Direction HUD - directionhud -# Waypoints - waypoints -# Scoreboard - scoreboard -# Potion Counter - potion_counter -# Ping - ping -# Motion Blur - motionbBlur -# Chat - chat -# Scrollable Tooltips - scrollable_tooltips -# UHC Overlay - uhc_overlay -# Cooldowns - cooldowns -# Worldedit CUI - worldedit_cui -# Clock - clock -# StopWatch - stopwatch -# Memory - memory -# Combo - combo -# Reach Dsplay - range -# Time Changer - time_changer -# Server Address - serverAddressMod -# Saturation - saturation -# Item Phsyic - itemPhysic -# Item Tracker - itemTrackerChild -# Shiny Pots - shinyPots -# Block Outline - block_outline -# Screenshot - screenshot -# FOV Mod - fov_mod -# Auto Text Hotkey - textHotKey -# Mumble Link - mumble-link -# Boss Bar - bossbar -# Free Look - freelook -# Nick Hider - nickHider -# Pack Organizer - packorganizer -# Particle Mod - particleMod -# Glint Colorizer - glint_colorizer -# SnapLook - snaplook -# Team Viewer - teamview -# Menu Blur - menu_blur -# Hit Box - hitbox -# Weather Changer - weather_changer -# Lighting - lighting -# Zoom - zoom -# Skyblock Addons - skyblockAddons -# Hypixel Mods - hypixel_mod -# Hypixel Bedwars - hypixel_bedwars diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 8c46138..0000000 --- a/pom.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - 4.0.0 - xyz.refinedev.lunar - LunarUtility - 2.0 - - LunarUtility - - - 1.8 - 1.8 - 1.8 - UTF-8 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - ${java.version} - ${java.version} - - - - org.apache.maven.plugins - maven-shade-plugin - 3.2.4 - - - - co.aikar.commands - xyz.refinedev.core.acf - - - co.aikar.locales - xyz.refinedev.core.locales - - - - - - package - - shade - - - false - - - - - - - - src/main/resources - true - - - - - - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - - - - placeholderapi - https://repo.extendedclip.com/content/repositories/placeholderapi/ - - - - jitpack.io - https://jitpack.io - - - - - - - org.spigotmc - spigot-api - 1.8.8-R0.1-SNAPSHOT - - - - org.projectlombok - lombok - 1.18.24 - - - - com.github.LunarClient - BukkitAPI - v1.0.1 - - - - me.clip - placeholderapi - 2.10.9 - provided - - - - co.aikar - acf-paper - 0.5.1-SNAPSHOT - - - \ No newline at end of file diff --git a/src/main/java/li/genesis/armstrong/Armstrong.java b/src/main/java/li/genesis/armstrong/Armstrong.java new file mode 100644 index 0000000..acaba8e --- /dev/null +++ b/src/main/java/li/genesis/armstrong/Armstrong.java @@ -0,0 +1,73 @@ +package li.genesis.armstrong; + +import li.genesis.armstrong.commands.LunarCommand; +import li.genesis.armstrong.commands.LunarStaffCommand; +import li.genesis.armstrong.hook.PlaceholderAPIHook; +import li.genesis.armstrong.listeners.LunarListener; +import li.genesis.armstrong.listeners.NametagTask; + +import com.lunarclient.apollo.Apollo; +import com.lunarclient.apollo.module.nametag.NametagModule; + +import lombok.Getter; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; +import co.aikar.commands.PaperCommandManager; +import org.bstats.bukkit.Metrics; + +@Getter +public class Armstrong extends JavaPlugin implements Listener { + + @Getter + private static Armstrong instance; + + private PaperCommandManager commandManager; + + @Override + public void onEnable() { + if (getServer().getPluginManager().getPlugin("Apollo-Bukkit") == null || !getServer().getPluginManager().getPlugin("Apollo-Bukkit").isEnabled()) { + getServer().getConsoleSender().sendMessage(ChatColor.RED + "[Armstrong] Apollo-Bukkit is missing!"); + getServer().getConsoleSender().sendMessage(ChatColor.RED + "[Armstrong] Get it from https://github.com/LunarClient/Apollo/releases"); + getServer().getPluginManager().disablePlugin(this); + return; + } + + instance = this; + + this.commandManager = new PaperCommandManager(this); + + this.commandManager.registerCommand(new LunarCommand(this)); + this.commandManager.registerCommand(new LunarStaffCommand()); + + this.saveDefaultConfig(); + this.registerApolloModules(); + + getServer().getPluginManager().registerEvents(this, this); + getServer().getPluginManager().registerEvents(new LunarListener(), this); + + getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "[Armstrong] The plugin has been enabled!"); + + if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { + new PlaceholderAPIHook().register(); + getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "[Armstrong] Placeholder API expansion successfully registered."); + } + + new Metrics(this, 27367); + } + + @Override + public void onDisable() { + getServer().getConsoleSender().sendMessage(ChatColor.RED + "[Armstrong] The plugin has been disabled!"); + } + + private void registerApolloModules() { + if (getConfig().getBoolean("NAMETAG.ENABLE")) { + this.reloadConfig(); + Apollo.getModuleManager().getModule(NametagModule.class); + this.getServer().getScheduler().runTaskTimerAsynchronously(this, + new NametagTask(this), 0, Long.parseLong(Locale.LUNAR_TAG_TICKS.messageFormat())); + } + } +} \ No newline at end of file diff --git a/src/main/java/xyz/refinedev/lunar/Locale.java b/src/main/java/li/genesis/armstrong/Locale.java similarity index 75% rename from src/main/java/xyz/refinedev/lunar/Locale.java rename to src/main/java/li/genesis/armstrong/Locale.java index 862ccbd..a6e2fbf 100644 --- a/src/main/java/xyz/refinedev/lunar/Locale.java +++ b/src/main/java/li/genesis/armstrong/Locale.java @@ -1,13 +1,11 @@ -package xyz.refinedev.lunar; +package li.genesis.armstrong; -import xyz.refinedev.lunar.utils.Utils; +import li.genesis.armstrong.utils.Utils; import java.util.List; public enum Locale { - LUNAR_TAG_1("NAMETAG.FIRST"), LUNAR_TAG_TICKS("NAMETAG.TICKS"), - LUNAR_TAG_2("NAMETAG.SECOND.TAG"), LUNAR_KICK_MESSAGE("REQUIRE-LUNAR.MESSAGE"), LUNAR_COMMAND_RELOAD("MESSAGES.MAIN.RELOAD"), LUNAR_COMMAND_PLAYER("MESSAGES.LUNAR-COMMAND.PLAYER"), @@ -19,7 +17,8 @@ public enum Locale { LUNAR_STAFF_COMMAND_DISABLE_PLAYER("MESSAGES.LUNAR-STAFF-COMMAND.DISABLE.PLAYER"), LUNAR_STAFF_COMMAND_DISABLE_TARGET("MESSAGES.LUNAR-STAFF-COMMAND.DISABLE.TARGET"), LUNAR_STAFF_COMMAND_ENABLE_TO_TARGET("MESSAGES.LUNAR-STAFF-COMMAND.ENABLE.TO-TARGET"), - LUNAR_STAFF_COMMAND_DISABLE_TO_TARGET("MESSAGES.LUNAR-STAFF-COMMAND.DISABLE.TO-TARGET"); + LUNAR_STAFF_COMMAND_DISABLE_TO_TARGET("MESSAGES.LUNAR-STAFF-COMMAND.DISABLE.TO-TARGET"), + LUNAR_STAFF_COMMAND_ENABLE_ERROR("MESSAGES.LUNAR-STAFF-COMMAND.ENABLE.ERROR"); private final String path; @@ -28,10 +27,10 @@ public enum Locale { } public String messageFormat() { - return Utils.translate(LunarUtility.getInstance().getConfig().getString(this.path)); + return Utils.translate(Armstrong.getInstance().getConfig().getString(this.path)); } public final List messageFormatList() { - return Utils.translate(LunarUtility.getInstance().getConfig().getStringList(this.path)); + return Utils.translate(Armstrong.getInstance().getConfig().getStringList(this.path)); } } \ No newline at end of file diff --git a/src/main/java/xyz/refinedev/lunar/commands/LunarCommand.java b/src/main/java/li/genesis/armstrong/commands/LunarCommand.java similarity index 52% rename from src/main/java/xyz/refinedev/lunar/commands/LunarCommand.java rename to src/main/java/li/genesis/armstrong/commands/LunarCommand.java index 4c72db2..71c34f2 100644 --- a/src/main/java/xyz/refinedev/lunar/commands/LunarCommand.java +++ b/src/main/java/li/genesis/armstrong/commands/LunarCommand.java @@ -1,74 +1,80 @@ -package xyz.refinedev.lunar.commands; +package li.genesis.armstrong.commands; + +import li.genesis.armstrong.Locale; +import li.genesis.armstrong.Armstrong; +import li.genesis.armstrong.utils.Utils; + +import com.lunarclient.apollo.Apollo; import co.aikar.commands.BaseCommand; import co.aikar.commands.annotation.*; import co.aikar.commands.bukkit.contexts.OnlinePlayer; -import com.lunarclient.bukkitapi.LunarClientAPI; + import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import xyz.refinedev.lunar.Locale; -import xyz.refinedev.lunar.LunarUtility; -import xyz.refinedev.lunar.utils.Utils; -import java.io.File; import java.util.stream.Collectors; -@CommandAlias(value = "lunarclient|lc") +@CommandAlias(value = "armstrong|lc") public class LunarCommand extends BaseCommand { @Dependency - private final LunarUtility plugin; + private final Armstrong plugin; - public LunarCommand(LunarUtility plugin) { + public LunarCommand(Armstrong plugin) { this.plugin = plugin; } @Default @Syntax(value = "[Player]") @CommandCompletion(value = "@players") + @CommandPermission("armstrong.players") @Description(value = "View a player's LunarClient status.") public void lunarCommand(Player player, @Optional OnlinePlayer target) { - if (target == null) { player.sendMessage(Utils.parsePapi(player, Locale.LUNAR_COMMAND_PLAYER.messageFormat()) - .replace("", player.getDisplayName()) - .replace("", Utils.checkLC(player))); + .replace("", player.getDisplayName()) + .replace("", Utils.lunarStatus(player))); } else { player.sendMessage(Utils.parsePapi(player, Locale.LUNAR_COMMAND_TARGET.messageFormat()) - .replace("", target.getPlayer().getName()) - .replace("", Utils.checkLC(target.getPlayer()))); + .replace("", target.getPlayer().getName()) + .replace("", Utils.lunarStatus(target.getPlayer()))); } } - @Subcommand(value = "users|players|online") + @Subcommand(value = "users|players|list") + @CommandPermission("armstrong.players") @Description(value = "View a list of players using LunarClient.") public void userCommand(CommandSender sender) { + long totalUsers = Bukkit.getOnlinePlayers().stream() + .filter(p -> Apollo.getPlayerManager().hasSupport(p.getUniqueId())) + .count(); - if (LunarClientAPI.getInstance().getPlayersRunningLunarClient().size() == 0) { + if (totalUsers == 0) { sender.sendMessage(ChatColor.RED + "There are no players online using LunarClient!"); return; } String playerLists = Bukkit.getOnlinePlayers().stream() - .filter(player -> LunarClientAPI.getInstance().isRunningLunarClient(player)) - .map(Player::getName) - .collect(Collectors.joining(Locale.LUNAR_USERS_SEPERATOR.messageFormat())); + .filter(p -> Apollo.getPlayerManager().hasSupport(p.getUniqueId())) + .map(Player::getName) + .collect(Collectors.joining(Locale.LUNAR_USERS_SEPERATOR.messageFormat())); Locale.LUNAR_USERS_MESSAGE.messageFormatList().stream() - .map(message -> message - .replace("", String.valueOf(LunarClientAPI.getInstance().getPlayersRunningLunarClient().size())) - .replace("", playerLists)) - .forEach(sender::sendMessage); + .map(message -> message + .replace("", String.valueOf(totalUsers)) + .replace("", playerLists)) + .forEach(sender::sendMessage); } @Subcommand(value = "reload") - @CommandPermission(value = "lunar.reload") - @Description(value = "Reload the LunarUtility plugin configuration.") + @CommandPermission(value = "armstrong.reload") + @Description(value = "Reload the Armstrong plugin configuration.") public void reloadCommand(CommandSender sender) { try { - plugin.getConfig().load(new File(plugin.getDataFolder(), "config.yml")); + plugin.reloadConfig(); sender.sendMessage(Locale.LUNAR_COMMAND_RELOAD.messageFormat()); } catch (Exception e) { sender.sendMessage(ChatColor.RED + "An error occurred!"); diff --git a/src/main/java/li/genesis/armstrong/commands/LunarStaffCommand.java b/src/main/java/li/genesis/armstrong/commands/LunarStaffCommand.java new file mode 100644 index 0000000..05331f8 --- /dev/null +++ b/src/main/java/li/genesis/armstrong/commands/LunarStaffCommand.java @@ -0,0 +1,85 @@ +package li.genesis.armstrong.commands; + +import li.genesis.armstrong.Locale; +import li.genesis.armstrong.utils.Utils; + +import com.lunarclient.apollo.Apollo; +import com.lunarclient.apollo.module.staffmod.StaffMod; +import com.lunarclient.apollo.module.staffmod.StaffModModule; +import com.lunarclient.apollo.player.ApolloPlayer; + +import co.aikar.commands.BaseCommand; +import co.aikar.commands.annotation.CommandAlias; +import co.aikar.commands.annotation.CommandPermission; +import co.aikar.commands.annotation.Default; +import co.aikar.commands.annotation.Description; +import co.aikar.commands.annotation.Syntax; +import co.aikar.commands.bukkit.contexts.OnlinePlayer; + +import org.bukkit.entity.Player; + +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; + +@CommandAlias("lunarstaffmode|lsm") +@CommandPermission("armstrong.staff") +public class LunarStaffCommand extends BaseCommand { + + private final StaffModModule staffModModule; + private final Map> enabledMods = new HashMap<>(); + + public LunarStaffCommand() { + this.staffModModule = Apollo.getModuleManager().getModule(StaffModModule.class); + } + + @Default + @Syntax("[Player]") + @Description("Toggle a player's Lunar Client staff mod(s).") + public void toggleStaff(Player sender, @co.aikar.commands.annotation.Optional OnlinePlayer onlinePlayer) { + Player target = (onlinePlayer == null ? sender : onlinePlayer.getPlayer()); + + Optional apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(target.getUniqueId()); + if (!apolloPlayerOpt.isPresent()) { + sender.sendMessage(Utils.parsePapi(sender, Locale.LUNAR_STAFF_COMMAND_ENABLE_ERROR.messageFormat()) + .replace("", target.getName())); + return; + } + ApolloPlayer apolloPlayer = apolloPlayerOpt.get(); + + StaffMod mod = StaffMod.XRAY; + + UUID targetUUID = target.getUniqueId(); + Set modsForTarget = enabledMods.computeIfAbsent(targetUUID, k -> new HashSet<>()); + + if (modsForTarget.contains(mod)) { + staffModModule.disableStaffMods(apolloPlayer, Collections.singletonList(mod)); + modsForTarget.remove(mod); + + if (onlinePlayer == null) { + sender.sendMessage(Utils.parsePapi(sender, Locale.LUNAR_STAFF_COMMAND_DISABLE_PLAYER.messageFormat())); + } else { + sender.sendMessage(Utils.parsePapi(sender, Locale.LUNAR_STAFF_COMMAND_DISABLE_TARGET.messageFormat()) + .replace("", target.getDisplayName())); + target.sendMessage(Utils.parsePapi(target, Locale.LUNAR_STAFF_COMMAND_DISABLE_TO_TARGET.messageFormat()) + .replace("", sender.getDisplayName())); + } + } else { + staffModModule.enableStaffMods(apolloPlayer, Collections.singletonList(mod)); + modsForTarget.add(mod); + + if (onlinePlayer == null) { + sender.sendMessage(Utils.parsePapi(sender, Locale.LUNAR_STAFF_COMMAND_ENABLE_PLAYER.messageFormat())); + } else { + sender.sendMessage(Utils.parsePapi(sender, Locale.LUNAR_STAFF_COMMAND_ENABLE_TARGET.messageFormat()) + .replace("", target.getDisplayName())); + target.sendMessage(Utils.parsePapi(target, Locale.LUNAR_STAFF_COMMAND_ENABLE_TO_TARGET.messageFormat()) + .replace("", sender.getDisplayName())); + } + } + } +} diff --git a/src/main/java/xyz/refinedev/lunar/hook/PlaceholderAPIHook.java b/src/main/java/li/genesis/armstrong/hook/PlaceholderAPIHook.java similarity index 76% rename from src/main/java/xyz/refinedev/lunar/hook/PlaceholderAPIHook.java rename to src/main/java/li/genesis/armstrong/hook/PlaceholderAPIHook.java index ce1d538..ee0b407 100644 --- a/src/main/java/xyz/refinedev/lunar/hook/PlaceholderAPIHook.java +++ b/src/main/java/li/genesis/armstrong/hook/PlaceholderAPIHook.java @@ -1,15 +1,16 @@ -package xyz.refinedev.lunar.hook; +package li.genesis.armstrong.hook; + +import li.genesis.armstrong.utils.Utils; -import me.clip.placeholderapi.expansion.PlaceholderExpansion; -import xyz.refinedev.lunar.utils.Utils; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; +import me.clip.placeholderapi.expansion.PlaceholderExpansion; public class PlaceholderAPIHook extends PlaceholderExpansion { @Override public @NotNull String getIdentifier() { - return "lunar"; + return "armstrong"; } @Override @@ -19,7 +20,7 @@ public boolean persist() { @Override public @NotNull String getAuthor() { - return "RefineDevelopment"; + return "Vaption"; } @Override @@ -30,9 +31,9 @@ public boolean persist() { @Override public String onPlaceholderRequest(Player player, String identifier) { - // %lunar_status% + // %armstrong_status% if (identifier.equalsIgnoreCase("status")) { - return Utils.checkLC(player); + return Utils.lunarStatus(player); } return null; diff --git a/src/main/java/li/genesis/armstrong/listeners/LunarListener.java b/src/main/java/li/genesis/armstrong/listeners/LunarListener.java new file mode 100644 index 0000000..238b471 --- /dev/null +++ b/src/main/java/li/genesis/armstrong/listeners/LunarListener.java @@ -0,0 +1,32 @@ +package li.genesis.armstrong.listeners; + +import li.genesis.armstrong.Locale; +import li.genesis.armstrong.Armstrong; +import li.genesis.armstrong.utils.Utils; + +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerJoinEvent; + +public class LunarListener implements Listener { + private final Armstrong plugin; + + public LunarListener() { + this.plugin = Armstrong.getInstance(); + } + + @EventHandler + public void onPlayerJoin(PlayerJoinEvent event) { + Player player = event.getPlayer(); + + Bukkit.getScheduler().runTaskLater(plugin, () -> { + if (plugin.getConfig().getBoolean("REQUIRE-LUNAR.ENABLED")) { + if (!Utils.isOnLunar(player)) { + player.kickPlayer(Locale.LUNAR_KICK_MESSAGE.messageFormat().replace("", "\n")); + } + } + }, 20L); + } +} \ No newline at end of file diff --git a/src/main/java/li/genesis/armstrong/listeners/NametagTask.java b/src/main/java/li/genesis/armstrong/listeners/NametagTask.java new file mode 100644 index 0000000..4118e3e --- /dev/null +++ b/src/main/java/li/genesis/armstrong/listeners/NametagTask.java @@ -0,0 +1,116 @@ +package li.genesis.armstrong.listeners; + +import li.genesis.armstrong.Armstrong; +import li.genesis.armstrong.utils.Utils; + +import com.lunarclient.apollo.Apollo; +import com.lunarclient.apollo.module.nametag.Nametag; +import com.lunarclient.apollo.module.nametag.NametagModule; +import com.lunarclient.apollo.player.ApolloPlayer; + +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; + +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.configuration.ConfigurationSection; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class NametagTask implements Runnable { + private final Armstrong plugin; + private final NametagModule nametagModule; + private static final String[] LINE_NAMES = {"FIRST", "SECOND", "THIRD", "FOURTH"}; + + public NametagTask(Armstrong plugin) { + this.plugin = plugin; + this.nametagModule = Apollo.getModuleManager().getModule(NametagModule.class); + } + + @Override + public void run() { + if (nametagModule == null || !plugin.getConfig().getBoolean("NAMETAG.ENABLE", true)) return; + + for (Player target : Bukkit.getOnlinePlayers()) { + if (target.isOnline()) { + updateNametagFor(target); + } + } + } + + public void updateNametagFor(Player target) { + List nametagLines = buildNametagLines(target); + if (nametagLines.isEmpty()) return; + + Nametag nametag = Nametag.builder() + .lines(nametagLines) + .build(); + + for (Player viewer : Bukkit.getOnlinePlayers()) { + if (viewer.isOnline()) { + Optional apolloViewerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId()); + apolloViewerOpt.ifPresent(apolloViewer -> + nametagModule.overrideNametag(apolloViewer, target.getUniqueId(), nametag) + ); + } + } + } + + private List buildNametagLines(Player target) { + List lines = new ArrayList<>(); + + String lunarStatus = Utils.isOnLunar(target) + ? Utils.translate(plugin.getConfig().getString("OTHER.ENABLED", "&aON&r")) + : Utils.translate(plugin.getConfig().getString("OTHER.DISABLED", "&cOFF&r")); + + for (String lineName : LINE_NAMES) { + ConfigurationSection lineSection = plugin.getConfig().getConfigurationSection("NAMETAG." + lineName); + if (lineSection == null || !lineSection.getBoolean("ENABLE", true)) continue; + + String lineContent = processLine(lineSection, target, lunarStatus); + if (!lineContent.isEmpty()) { + lines.add(LegacyComponentSerializer.legacyAmpersand().deserialize(lineContent)); + } + } + + return lines; + } + + private String processLine(ConfigurationSection lineSection, Player target, String lunarStatus) { + ConfigurationSection tiersSection = lineSection.getConfigurationSection("TIERS"); + if (tiersSection == null) return ""; + + return processTieredLine(tiersSection, target, lunarStatus); + } + + private String processTieredLine(ConfigurationSection tiersSection, Player target, String lunarStatus) { + String chosenTemplate = ""; + int highestWeight = Integer.MIN_VALUE; + + for (String key : tiersSection.getKeys(false)) { + ConfigurationSection tier = tiersSection.getConfigurationSection(key); + if (tier == null) continue; + + String perm = tier.getString("permission", ""); + int weight = tier.getInt("weight", 0); + String format = tier.getString("format", ""); + + if ((perm.isEmpty() || target.hasPermission(perm)) && weight > highestWeight) { + highestWeight = weight; + chosenTemplate = format; + } + } + + return chosenTemplate.isEmpty() ? "" : formatLine(chosenTemplate, target, lunarStatus); + } + + private String formatLine(String format, Player target, String lunarStatus) { + String processed = Utils.parsePapi(target, format); + return Utils.translate(processed) + .replace("", target.getDisplayName()) + .replace("", target.getName()) + .replace("", lunarStatus); + } +} diff --git a/src/main/java/li/genesis/armstrong/utils/Utils.java b/src/main/java/li/genesis/armstrong/utils/Utils.java new file mode 100644 index 0000000..0ccc029 --- /dev/null +++ b/src/main/java/li/genesis/armstrong/utils/Utils.java @@ -0,0 +1,42 @@ +package li.genesis.armstrong.utils; + +import li.genesis.armstrong.Armstrong; + +import com.lunarclient.apollo.Apollo; + +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.entity.Player; +import me.clip.placeholderapi.PlaceholderAPI; + +import java.util.List; +import java.util.stream.Collectors; + +public class Utils { + + public static String parsePapi(Player player, String text) { + if (text == null) return ""; + if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) { + return PlaceholderAPI.setPlaceholders(player, text); + } + return text; + } + + public static boolean isOnLunar(Player player) { + return Apollo.getPlayerManager().hasSupport(player.getUniqueId()); + } + + public static String lunarStatus(Player player) { + String path = isOnLunar(player) ? "OTHER.ENABLED" : "OTHER.DISABLED"; + return translate(Armstrong.getInstance().getConfig().getString(path, "")); + } + + public static String translate(String text) { + if (text == null) return ""; + return ChatColor.translateAlternateColorCodes('&', text); + } + + public static List translate(List text) { + return text.stream().map(Utils::translate).collect(Collectors.toList()); + } +} \ No newline at end of file diff --git a/src/main/java/xyz/refinedev/lunar/LunarUtility.java b/src/main/java/xyz/refinedev/lunar/LunarUtility.java deleted file mode 100644 index 37d54b1..0000000 --- a/src/main/java/xyz/refinedev/lunar/LunarUtility.java +++ /dev/null @@ -1,122 +0,0 @@ -package xyz.refinedev.lunar; - -import co.aikar.commands.PaperCommandManager; -import com.google.gson.JsonParser; -import com.lunarclient.bukkitapi.LunarClientAPI; -import com.lunarclient.bukkitapi.cooldown.LCCooldown; -import com.lunarclient.bukkitapi.cooldown.LunarClientAPICooldown; -import com.lunarclient.bukkitapi.nethandler.client.LCPacketModSettings; -import com.lunarclient.bukkitapi.nethandler.client.obj.ModSettings; -import com.lunarclient.bukkitapi.nethandler.client.obj.ServerRule; -import com.lunarclient.bukkitapi.object.LCWaypoint; -import com.lunarclient.bukkitapi.serverrule.LunarClientAPIServerRule; -import lombok.Getter; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.plugin.java.JavaPlugin; -import xyz.refinedev.lunar.commands.LunarCommand; -import xyz.refinedev.lunar.commands.LunarStaffCommand; -import xyz.refinedev.lunar.hook.PlaceholderAPIHook; -import xyz.refinedev.lunar.listeners.LunarListener; -import xyz.refinedev.lunar.listeners.NametagTask; -import xyz.refinedev.lunar.utils.Utils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - - -@Getter -public class LunarUtility extends JavaPlugin { - - @Getter - private static LunarUtility instance; - - private PaperCommandManager commandManager; - private LCPacketModSettings packetModSettings = null; - private final List waypoints = new ArrayList<>(); - - @Override - public void onEnable() { - instance = this; - - this.commandManager = new PaperCommandManager(this); - - this.commandManager.registerCommand(new LunarCommand(this)); - this.commandManager.registerCommand(new LunarStaffCommand()); - - this.saveDefaultConfig(); - this.registerLunar(); - this.loadDisabledMods(); - this.loadWaypoints(); - - getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "LunarUtility 2.0 has been enabled!"); - - if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { - new PlaceholderAPIHook().register(); - getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "Placeholder API expansion successfully registered."); - } - } - - - @Override - public void onDisable() { - getServer().getConsoleSender().sendMessage(ChatColor.RED + "LunarUtility 2.0 has been disabled!"); - } - - private void registerLunar() { - Bukkit.getPluginManager().registerEvents(new LunarListener(this), this); - - if (getConfig().getBoolean("NAMETAG.ENABLE")) { - this.getServer().getScheduler().runTaskTimerAsynchronously(this, new NametagTask(this), 0, Long.parseLong(Locale.LUNAR_TAG_TICKS.messageFormat())); - } - - if (getConfig().getBoolean("COOLDOWN.COMBAT.ENABLE")) { - LunarClientAPICooldown.registerCooldown(new LCCooldown("Combat", getConfig().getInt("COOLDOWN.COMBAT.DELAY"), TimeUnit.SECONDS, Material.getMaterial(getConfig().getString("COOLDOWN.COMBAT.ICON")))); - } - - if (getConfig().getBoolean("COOLDOWN.ENDERPEARL.ENABLE")) { - LunarClientAPICooldown.registerCooldown(new LCCooldown("Enderpearl", getConfig().getInt("COOLDOWN.ENDERPEARL.DELAY"), TimeUnit.SECONDS, Material.getMaterial(getConfig().getString("COOLDOWN.ENDERPEARL.ICON")))); - } - - if (getConfig().getBoolean("COOLDOWN.GAPPLE.ENABLE")) { - LunarClientAPICooldown.registerCooldown(new LCCooldown("Gapple", getConfig().getInt("COOLDOWN.GAPPLE.DELAY"), TimeUnit.SECONDS, Material.getMaterial(getConfig().getString("COOLDOWN.GAPPLE.ICON")))); - } - } - - public void loadWaypoints() { - if (!getConfig().getBoolean("WAYPOINT.ENABLED")) return; - - LunarClientAPIServerRule.setRule(ServerRule.SERVER_HANDLES_WAYPOINTS, true); - - //Original code credit to BukkitImpl - List> maps = getConfig().getMapList("WAYPOINT.WAYPOINTS"); - - maps.stream() - .flatMap(map -> map.entrySet().stream()) - .map(entry -> new JsonParser().parse(String.valueOf(entry.getValue())).getAsJsonObject()) - .map(object -> new LCWaypoint(object.get("name").getAsString(), object.get("x").getAsInt(), object.get("y").getAsInt(), object.get("z").getAsInt(), LunarClientAPI.getInstance().getWorldIdentifier(Bukkit.getWorld(object.get("world").getAsString())), object.get("color").getAsInt(), object.get("forced").getAsBoolean(), object.get("visible").getAsBoolean())) - .forEachOrdered(waypoints::add); - } - - private void loadDisabledMods() { - ModSettings modSettings = new ModSettings(); - - if (getConfig().getBoolean("MODS.DISABLE-ALL-MODS")) { - Utils.getModList().forEach(modName -> modSettings.addModSetting(modName, new ModSettings.ModSetting(false, new HashMap<>()))); - - packetModSettings = new LCPacketModSettings(modSettings); - return; - } - - if (getConfig().getBoolean("MODS.DISABLE-MODS.ENABLED")) { - getConfig().getStringList("MODS.DISABLE-MODS.MODS") - .forEach(modName -> modSettings.addModSetting(modName, new ModSettings.ModSetting(false, new HashMap<>()))); - - packetModSettings = new LCPacketModSettings(modSettings); - } - } -} \ No newline at end of file diff --git a/src/main/java/xyz/refinedev/lunar/commands/LunarStaffCommand.java b/src/main/java/xyz/refinedev/lunar/commands/LunarStaffCommand.java deleted file mode 100644 index 79c068e..0000000 --- a/src/main/java/xyz/refinedev/lunar/commands/LunarStaffCommand.java +++ /dev/null @@ -1,50 +0,0 @@ -package xyz.refinedev.lunar.commands; - -import co.aikar.commands.BaseCommand; -import co.aikar.commands.annotation.*; -import co.aikar.commands.bukkit.contexts.OnlinePlayer; -import com.lunarclient.bukkitapi.LunarClientAPI; -import com.lunarclient.bukkitapi.object.StaffModule; -import org.bukkit.entity.Player; -import xyz.refinedev.lunar.Locale; -import xyz.refinedev.lunar.utils.Utils; - -@CommandAlias(value = "lunarstaffmode|lcstaffmode|lunarstaffmod|lunarstaffmods|lsm") -@CommandPermission(value = "lunar.staff") -public class LunarStaffCommand extends BaseCommand { - - @Default - @Subcommand(value = "enable|add") - @Syntax(value = "[Player]") - @CommandCompletion(value = "@players") - @Description(value = "Enable a player's lunar mods.") - public void enableStaffMods(Player player, @Optional OnlinePlayer onlinePlayer) { - Player target = (onlinePlayer == null ? player : onlinePlayer.getPlayer()); - - LunarClientAPI.getInstance().setStaffModuleState(target, StaffModule.XRAY, true); - - if (onlinePlayer == null) { - player.sendMessage(Utils.parsePapi(player, Locale.LUNAR_STAFF_COMMAND_ENABLE_PLAYER.messageFormat())); - } else { - player.sendMessage(Utils.parsePapi(player, Locale.LUNAR_STAFF_COMMAND_ENABLE_TARGET.messageFormat()).replace("", target.getDisplayName())); - target.sendMessage(Utils.parsePapi(target, Locale.LUNAR_STAFF_COMMAND_ENABLE_TO_TARGET.messageFormat()).replace("", player.getDisplayName())); - } - } - - @Subcommand(value = "disable|remove") - @Syntax(value = "[Player]") - @CommandCompletion(value = "@players") - @Description(value = "Disable a player's lunar mods.") - public void disableStaffMods(Player player, @Optional OnlinePlayer onlinePlayer) { - Player target = (onlinePlayer == null ? player : onlinePlayer.getPlayer()); - - LunarClientAPI.getInstance().setStaffModuleState(target, StaffModule.XRAY, false); - - if (onlinePlayer == null) { - player.sendMessage(Utils.parsePapi(player, Locale.LUNAR_STAFF_COMMAND_DISABLE_PLAYER.messageFormat())); - } else { - player.sendMessage(Utils.parsePapi(player, Locale.LUNAR_STAFF_COMMAND_DISABLE_TARGET.messageFormat()).replace("", target.getDisplayName())); - target.sendMessage(Utils.parsePapi(target, Locale.LUNAR_STAFF_COMMAND_DISABLE_TO_TARGET.messageFormat()).replace("", player.getDisplayName())); - } - } -} \ No newline at end of file diff --git a/src/main/java/xyz/refinedev/lunar/listeners/LunarListener.java b/src/main/java/xyz/refinedev/lunar/listeners/LunarListener.java deleted file mode 100644 index 5ca400a..0000000 --- a/src/main/java/xyz/refinedev/lunar/listeners/LunarListener.java +++ /dev/null @@ -1,76 +0,0 @@ -package xyz.refinedev.lunar.listeners; - -import com.lunarclient.bukkitapi.LunarClientAPI; -import com.lunarclient.bukkitapi.cooldown.LunarClientAPICooldown; -import com.lunarclient.bukkitapi.serverrule.LunarClientAPIServerRule; -import lombok.RequiredArgsConstructor; -import org.bukkit.Bukkit; -import org.bukkit.Material; -import org.bukkit.entity.EnderPearl; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.event.entity.ProjectileLaunchEvent; -import org.bukkit.event.player.PlayerItemConsumeEvent; -import org.bukkit.event.player.PlayerJoinEvent; -import xyz.refinedev.lunar.Locale; -import xyz.refinedev.lunar.LunarUtility; -import xyz.refinedev.lunar.utils.Utils; - -@RequiredArgsConstructor -public class LunarListener implements Listener { - private final LunarUtility plugin; - - @EventHandler - public void onPlayerJoin(PlayerJoinEvent event) { - Player player = event.getPlayer(); - - //Send disabled mod's packet to player - if (plugin.getPacketModSettings() != null) { - LunarClientAPI.getInstance().sendPacket(event.getPlayer(), plugin.getPacketModSettings()); - } - - if (plugin.getConfig().getBoolean("WAYPOINT.ENABLED")) { - plugin.getWaypoints().forEach(waypoint -> LunarClientAPI.getInstance().sendWaypoint(event.getPlayer(), waypoint)); - LunarClientAPIServerRule.sendServerRule(player); - } - - //After 1 second on join, if the player isn't running lc, kick them - Bukkit.getScheduler().runTaskLater(plugin, () -> { - if (!LunarClientAPI.getInstance().isRunningLunarClient(player) && plugin.getConfig().getBoolean("REQUIRE-LUNAR.ENABLED")) { - player.kickPlayer(Locale.LUNAR_KICK_MESSAGE.messageFormat().replace("", "\n")); - } - }, 20L); - } - - @EventHandler - public void onPlayerDamagePlayer(EntityDamageByEntityEvent event) { - if (!plugin.getConfig().getBoolean("COOLDOWN.COMBAT.ENABLE")) return; - if (event.getEntity().getType() != EntityType.PLAYER) return; - if (event.getDamager().getType() != EntityType.PLAYER) return; - - if (Utils.isCompatible()) { - LunarClientAPICooldown.sendCooldown((Player) event.getEntity(), "Combat"); - LunarClientAPICooldown.sendCooldown((Player) event.getDamager(), "Combat"); - } - } - - @EventHandler - public void onPearlLaunch(ProjectileLaunchEvent event) { - if (!(event.getEntity().getShooter() instanceof Player)) return; - - if (Utils.isCompatible() && event.getEntity() instanceof EnderPearl && plugin.getConfig().getBoolean("COOLDOWN.ENDERPEARL.ENABLE")) { - LunarClientAPICooldown.sendCooldown((Player) event.getEntity().getShooter(), "Enderpearl"); - } - } - - @EventHandler - public void onGappleConsume(PlayerItemConsumeEvent event) { - - if (Utils.isCompatible() && event.getItem().getType().equals(Material.GOLDEN_APPLE) && plugin.getConfig().getBoolean("COOLDOWN.GAPPLE.ENABLE")) { - LunarClientAPICooldown.sendCooldown(event.getPlayer(), "Gapple"); - } - } -} \ No newline at end of file diff --git a/src/main/java/xyz/refinedev/lunar/listeners/NametagTask.java b/src/main/java/xyz/refinedev/lunar/listeners/NametagTask.java deleted file mode 100644 index dc47668..0000000 --- a/src/main/java/xyz/refinedev/lunar/listeners/NametagTask.java +++ /dev/null @@ -1,41 +0,0 @@ -package xyz.refinedev.lunar.listeners; - -import com.lunarclient.bukkitapi.LunarClientAPI; -import lombok.RequiredArgsConstructor; -import xyz.refinedev.lunar.Locale; -import xyz.refinedev.lunar.LunarUtility; -import xyz.refinedev.lunar.utils.Utils; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; - -import java.util.ArrayList; -import java.util.List; - -@RequiredArgsConstructor -public class NametagTask implements Runnable { - private final LunarUtility plugin; - - @Override - public void run() { - Bukkit.getOnlinePlayers().forEach(all -> Bukkit.getOnlinePlayers() - .forEach(player -> LunarClientAPI.getInstance().overrideNametag(all, nametagSetup(all), player))); - } - - private List nametagSetup(Player target) { - List tag = new ArrayList<>(); - String lunar = (LunarClientAPI.getInstance().isRunningLunarClient(target) ? Utils.translate(plugin.getConfig().getString("OTHER.ENABLED")) : Utils.translate(plugin.getConfig().getString("OTHER.DISABLED"))); - - tag.add(Utils.parsePapi(target, Locale.LUNAR_TAG_1.messageFormat()) - .replace("", target.getDisplayName()) - .replace("", target.getName()) - .replace("", lunar)); - - if (plugin.getConfig().getBoolean("NAMETAG.SECOND.ENABLE")) { - tag.add(Utils.parsePapi(target, Locale.LUNAR_TAG_2.messageFormat()) - .replace("", target.getDisplayName()) - .replace("", target.getName()) - .replace("", lunar)); - } - return tag; - } -} \ No newline at end of file diff --git a/src/main/java/xyz/refinedev/lunar/utils/Utils.java b/src/main/java/xyz/refinedev/lunar/utils/Utils.java deleted file mode 100644 index 3ce2194..0000000 --- a/src/main/java/xyz/refinedev/lunar/utils/Utils.java +++ /dev/null @@ -1,54 +0,0 @@ -package xyz.refinedev.lunar.utils; - -import com.lunarclient.bukkitapi.LunarClientAPI; -import me.clip.placeholderapi.PlaceholderAPI; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.entity.Player; -import xyz.refinedev.lunar.LunarUtility; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -public class Utils { - public static String parsePapi(Player player, String text) { - return Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null ? PlaceholderAPI.setPlaceholders(player, text) : text; - } - - public static String checkLC(Player player) { - return LunarClientAPI.getInstance().isRunningLunarClient(player) ? translate(LunarUtility.getInstance().getConfig().getString("OTHER.ENABLED")) : translate(LunarUtility.getInstance().getConfig().getString("OTHER.DISABLED")); - } - - public static boolean isCompatible() { - return Bukkit.getServer().getVersion().contains("1.7") || Bukkit.getServer().getVersion().contains("1.8"); - } - - public static String translate(String text) { - return ChatColor.translateAlternateColorCodes('&', text); - } - - public static List translate(List text) { - return text.stream().map(string -> ChatColor.translateAlternateColorCodes('&', string)).collect(Collectors.toList()); - } - - public static List getModList() { - // There is no other way than to list them manually because LunarClientAPI doesn't provide a list of their mod ids - // There are newer mods, but I'm busy so push pr if you find them - - return new ArrayList<>(Arrays.asList( - "one_seven_visuals", "fps", "cps", "skyblockAddons", "toggleSneak", - "hypixel_mod", "armorstatus", "keystrokes", "coords", "crosshair", - "potioneffects", "directionhud", "waypoints", "scoreboard", "potion_counter", - "ping", "motionBlur", "chat", "scrollable_tooltips", "uhc_overlay", - "cooldowns", "worldedit_cui", "clock", "stopwatch", "memory", - "combo", "range", "time_changer", "serverAddressMod", "saturation", - "itemPhysic", "itemTrackerChild", "shinyPots", "block_outline", "screenshot", - "fov_mod", "textHotKey", "mumble-link", "bossbar", "freelook", - "nickHider", "pack_organizer", "hypixel_bedwars", "particleMod", "glint_colorizer", - "snaplook", "teamview", "menu_blur", "hitbox", "hitcolor", - "weather_changer", "lighting", "zoom" - )); - } -} \ No newline at end of file diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index abe4f4f..4512d3f 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,64 +1,101 @@ -######################## -# LunarUtility # -# By RefineDevelopment # -######################## +############################################################################################################### +# # +# Armstrong (aka. LunarUtility) # +# # +# Maintained by Vaption # +# (Originally made by RefineDevelopment) # +# # +############################################################################################################### -#Disabled cooldowns for 1.9+ because of LC API Issue -COOLDOWN: - ENDERPEARL: #Sends cooldown on enderpearl throw - ENABLE: true - ICON: "ENDER_PEARL" - DELAY: 16 - GAPPLE: #Sends cooldown when a gapple is eaten - ENABLE: false - ICON: "GOLDEN_APPLE" - DELAY: 45 - COMBAT: #Sends cooldown when a fight happens | both to the damager and the target - ENABLE: false - ICON: "DIAMOND_SWORD" - DELAY: 30 -#Don't set the cooldown to 0 or else the plugin won't work! -#You have to restart the server whenever you change the delay. +############################################################################################################### +# # +# Set this to true if you want to force LunarClient on your server. # +# People joining with anything else will be kicked from the server. # +# The kick message can be configured below. adds a new line. # +# # +# Color codes are supported (See https://wiki.ess3.net/mc/). # +# # +############################################################################################################### REQUIRE-LUNAR: ENABLED: false - MESSAGE: "&cLunar Client is required to play on the server! &cDownload at &olunarclient.com/download" # adds a new line + MESSAGE: "&cLunar Client is required to play on the server! &cDownload at &olunarclient.com/download" -MODS: - DISABLE-ALL-MODS: false #This list has to be updated always through the plugin (its not auto) - DISABLE-MODS: - ENABLED: false - MODS: - - "skyblockAddons" - -WAYPOINT: - ENABLED: true #If false, it won't load all the waypoints below - WAYPOINTS: - - Spawn: # The same name as the waypoint. - x: 0 - y: 100 - z: 0 - name: "Spawn" - world: "world" - color: 0xFF0000 # MUST be a hexadecimal number of a color - forced: true - visible: true +############################################################################################################### +# # +# In Armstrong, the Nametag module supports a permission-based system (tiers): # +# - You can customize the nametag format based on permissions assigned to players. # +# - Assuming the player has multiple matching permissions, the highest weight has the highest priority. # +# # +# Notes: # +# - Armstrong supports PlaceholderAPI placeholders in nametag formats (if PAPI is installed). # +# - Additionally, you can use , , and placeholders. # +# - You can leave the permission value empty if you want it to apply to all players. # +# - If none of the defined tiers match, the nametag module skips that line for the player. # +# - Armstrong implements four Apollo nametag lines. Adding more manually does not work (for now). # +# # +############################################################################################################### NAMETAG: - ENABLE: true #Needs Restart - TICKS: "40" #1 second = 20 ticks | Every x seconds the nametag should update - FIRST: "&7[ &bLC&7]" + ENABLE: true # Enable the Armstrong Apollo nametag module implementation + TICKS: 40 # Update interval in ticks + FIRST: # The first line of the nametag + ENABLE: true + TIERS: + staff: + permission: "armstrong.nametag.staff" + weight: 100 + format: "&7&o[Staff]" + status: + permission: "armstrong.nametag.status" + weight: 50 + format: "&7[ &bLunarClient&7]" SECOND: ENABLE: true - TAG: "" # use for disguise support + TIERS: + default: + permission: "" + weight: 0 + format: "" + THIRD: + ENABLE: false + TIERS: + vip: + permission: "armstrong.nametag.vip" + weight: 75 + format: "&6[VIP]" + default: + permission: "" + weight: 0 + format: "&7[Player]" + FOURTH: + ENABLE: false + TIERS: + default: + permission: "" + weight: 0 + format: "" + +############################################################################################################### +# # +# The placeholder text that indicates if user is on/off LunarClient # +# This is also used in the %lunar_status% PAPI placeholder, as well as in nametags. # +# # +############################################################################################################### OTHER: - ENABLED: "&aON" - DISABLED: "&cOFF" + ENABLED: "&aON&r" + DISABLED: "&cOFF&r" + +############################################################################################################### +# # +# Messages in the plugin. Can be configured to your liking. # +# # +############################################################################################################### MESSAGES: MAIN: - RELOAD: "&6LunarUtility &ehas been reloaded." + RELOAD: "&6Armstrong &ehas been reloaded." OFFLINE: "&cThat player doesn't exist." LUNAR-COMMAND: PLAYER: "&6You are currently &eLunarClient." @@ -67,7 +104,8 @@ MESSAGES: ENABLE: PLAYER: "&aYou have enabled all LunarClient staff mods." TARGET: "&aYou have enabled all LunarClient staff mods for ." - TO-TARGET: "&aAll LunarClient mods have been enabled for you by ." + TO-TARGET: "&aAll LunarClient staff mods have been enabled for you by ." + ERROR: "&cPlayer is not on LunarClient." DISABLE: PLAYER: "&cYou have disabled your LunarClient staff mods." TARGET: "&6You have disabled &e's &6LunarClient staff mods." @@ -76,6 +114,6 @@ MESSAGES: SEPERATOR: "&7, " MESSAGE: - "&7&m-----------------------" - - "&b&lLunarClient Users &7[/100]" + - "&b&lLunarClient Users &7[]" - "" - "&7&m-----------------------" \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index d79aee3..a51c3e3 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,8 +1,9 @@ -name: LunarUtility -main: xyz.refinedev.lunar.LunarUtility +name: Armstrong +main: li.genesis.armstrong.Armstrong authors: + - Vaption - Dubai - RefineDevelopment -depend: [ LunarClient-API ] -softdepend: [ PlaceholderAPI ] -version: ${project.version} \ No newline at end of file +depend: [] +softdepend: [ Apollo-Bukkit, PlaceholderAPI ] +version: ${version} \ No newline at end of file