mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2026-04-22 19:11:23 +00:00
Compare commits
24 Commits
2.0.1
...
a785e331b3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a785e331b3 | ||
|
|
16462d8d81 | ||
|
|
d06cad1c5f | ||
|
|
7360e4ac2f | ||
|
|
4513804c40 | ||
|
|
1d56d77bdb | ||
|
|
906b13f91e | ||
|
|
c801ce18ec | ||
|
|
75692f0a05 | ||
|
|
018b7fee9b | ||
|
|
3a2b18907e | ||
|
|
6217015862 | ||
|
|
46db1af915 | ||
|
|
772acf4332 | ||
|
|
1cd38294cc | ||
|
|
9e01726b84 | ||
|
|
1176b57886 | ||
|
|
5c54182301 | ||
|
|
47846df0e4 | ||
|
|
b666323c4a | ||
|
|
b484b772cb | ||
|
|
d56eda6512 | ||
|
|
c7a784920d | ||
|
|
e029c1af3b |
0
.deepsource.toml
Normal file → Executable file
0
.deepsource.toml
Normal file → Executable file
0
.github/FUNDING.yml
vendored
Normal file → Executable file
0
.github/FUNDING.yml
vendored
Normal file → Executable file
2
.github/dependabot.yml
vendored
Normal file → Executable file
2
.github/dependabot.yml
vendored
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: maven
|
||||
- package-ecosystem: gradle
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
|
||||
24
.github/workflows/build.yml
vendored
Executable file
24
.github/workflows/build.yml
vendored
Executable file
@@ -0,0 +1,24 @@
|
||||
name: Build with Gradle
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 25
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 25
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v6
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
0
.github/workflows/hangar.yml
vendored
Normal file → Executable file
0
.github/workflows/hangar.yml
vendored
Normal file → Executable file
25
.github/workflows/maven.yml
vendored
25
.github/workflows/maven.yml
vendored
@@ -1,25 +0,0 @@
|
||||
# This workflow will build a Java project with Maven
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||
|
||||
name: Build with Maven
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
0
.github/workflows/modrinth.yml
vendored
Normal file → Executable file
0
.github/workflows/modrinth.yml
vendored
Normal file → Executable file
17
.gitignore
vendored
Normal file → Executable file
17
.gitignore
vendored
Normal file → Executable file
@@ -18,7 +18,6 @@ out/
|
||||
*.ctxt
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
@@ -95,19 +94,9 @@ $RECYCLE.BIN/
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
target/
|
||||
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
.flattened-pom.xml
|
||||
# Gradle
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Common working directory
|
||||
run/
|
||||
|
||||
46
build.gradle.kts
Normal file
46
build.gradle.kts
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
maven("https://repo.rosewooddev.io/repository/public/")
|
||||
mavenCentral()
|
||||
maven("https://jitpack.io")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("io.papermc.paper:paper-api:26.1.1.build.+")
|
||||
compileOnly("dev.rosewood:rosestacker:1.5.39")
|
||||
compileOnly("com.github.hyperdefined:hyperlib:1.0.14:all")
|
||||
}
|
||||
|
||||
group = "lol.hyper"
|
||||
version = "2.0.3"
|
||||
description = "ToolStats"
|
||||
java.sourceCompatibility = JavaVersion.VERSION_25
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
val pluginVersion = version.toString()
|
||||
|
||||
tasks.processResources {
|
||||
filteringCharset = "UTF-8"
|
||||
|
||||
val props = mapOf("version" to pluginVersion)
|
||||
inputs.properties(props)
|
||||
|
||||
filesMatching("paper-plugin.yml") {
|
||||
expand(props)
|
||||
}
|
||||
}
|
||||
5
gradle.properties
Normal file
5
gradle.properties
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was generated by the Gradle 'init' task.
|
||||
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
|
||||
|
||||
org.gradle.configuration-cache=true
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
248
gradlew
vendored
Executable file
248
gradlew
vendored
Executable file
@@ -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/2d6327017519d23b96af35865dc997fcb544fb40/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" "$@"
|
||||
93
gradlew.bat
vendored
Normal file
93
gradlew.bat
vendored
Normal file
@@ -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
|
||||
94
pom.xml
94
pom.xml
@@ -1,94 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ This file is part of ToolStats.
|
||||
~
|
||||
~ ToolStats is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ ToolStats is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with ToolStats. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>lol.hyper</groupId>
|
||||
<artifactId>toolstats</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>ToolStats</name>
|
||||
|
||||
<properties>
|
||||
<java.version>21</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>auto-clean</id>
|
||||
<phase>initialize</phase>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.15.0</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>1.21.11-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.hyperdefined</groupId>
|
||||
<artifactId>hyperlib</artifactId>
|
||||
<version>1.0.9</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
5
settings.gradle.kts
Normal file
5
settings.gradle.kts
Normal file
@@ -0,0 +1,5 @@
|
||||
/*
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
|
||||
rootProject.name = "toolstats"
|
||||
@@ -23,6 +23,7 @@ import lol.hyper.hyperlib.releases.HyperUpdater;
|
||||
import lol.hyper.hyperlib.utils.TextUtils;
|
||||
import lol.hyper.toolstats.commands.CommandToolStats;
|
||||
import lol.hyper.toolstats.events.*;
|
||||
import lol.hyper.toolstats.support.rosestacker.RoseStacker;
|
||||
import lol.hyper.toolstats.tools.*;
|
||||
import lol.hyper.toolstats.tools.config.ConfigTools;
|
||||
import lol.hyper.toolstats.tools.config.ConfigUpdater;
|
||||
@@ -36,7 +37,7 @@ import java.io.File;
|
||||
|
||||
public final class ToolStats extends JavaPlugin {
|
||||
|
||||
public final int CONFIG_VERSION = 15;
|
||||
public final int CONFIG_VERSION = 16;
|
||||
public final ComponentLogger logger = this.getComponentLogger();
|
||||
public final File configFile = new File(this.getDataFolder(), "config.yml");
|
||||
public boolean tokens = false;
|
||||
@@ -74,6 +75,7 @@ public final class ToolStats extends JavaPlugin {
|
||||
public ToolStatsKeys toolStatsKeys;
|
||||
public InventoryClose inventoryClose;
|
||||
public PlayerDrop playerDrop;
|
||||
public RoseStacker roseStacker = null;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
@@ -128,6 +130,10 @@ public final class ToolStats extends JavaPlugin {
|
||||
projectileShoot = new ProjectileShoot(this);
|
||||
inventoryClose = new InventoryClose(this);
|
||||
playerDrop = new PlayerDrop(this);
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("RoseStacker")) {
|
||||
logger.info("RoseStacker has been detected, adding support!");
|
||||
roseStacker = new RoseStacker();
|
||||
}
|
||||
|
||||
Bukkit.getServer().getPluginManager().registerEvents(blockBreak, this);
|
||||
Bukkit.getServer().getPluginManager().registerEvents(chunkPopulate, this);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ToolStatsLoader implements PluginLoader {
|
||||
MavenLibraryResolver resolver = new MavenLibraryResolver();
|
||||
|
||||
resolver.addRepository(new RemoteRepository.Builder("jitpack", "default", "https://jitpack.io").build());
|
||||
resolver.addDependency(new Dependency(new DefaultArtifact("com.github.hyperdefined:hyperlib:1.0.9"), null));
|
||||
resolver.addDependency(new Dependency(new DefaultArtifact("com.github.hyperdefined:hyperlib:jar:all:1.0.14"), null));
|
||||
|
||||
classpathBuilder.addLibrary(resolver);
|
||||
}
|
||||
|
||||
@@ -231,7 +231,6 @@ public class CommandToolStats implements BasicCommand {
|
||||
sender.sendMessage(Component.text("Invalid sub-command.", NamedTextColor.RED));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
0
src/main/java/lol/hyper/toolstats/events/AnvilEvent.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/AnvilEvent.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/BlockBreak.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/BlockBreak.java
Normal file → Executable file
23
src/main/java/lol/hyper/toolstats/events/BlockDispenseEvent.java
Normal file → Executable file
23
src/main/java/lol/hyper/toolstats/events/BlockDispenseEvent.java
Normal file → Executable file
@@ -113,6 +113,29 @@ public class BlockDispenseEvent implements Listener {
|
||||
lore = new ArrayList<>();
|
||||
}
|
||||
|
||||
// by request
|
||||
if (newItem.getType() == Material.ELYTRA) {
|
||||
if (!toolStats.config.getBoolean("enabled.elytra-tag")) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Component creationDate = toolStats.itemLore.formatCreationTime(timeCreated, 4, newItem);
|
||||
if (creationDate != null) {
|
||||
container.set(toolStats.toolStatsKeys.getTimeCreated(), PersistentDataType.LONG, timeCreated);
|
||||
container.set(toolStats.toolStatsKeys.getOriginType(), PersistentDataType.INTEGER, 4);
|
||||
lore.add(creationDate);
|
||||
meta.lore(lore);
|
||||
}
|
||||
|
||||
Component itemOwner = toolStats.itemLore.formatOwner(owner.getName(), 4, newItem);
|
||||
if (itemOwner != null) {
|
||||
container.set(toolStats.toolStatsKeys.getItemOwner(), new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.toolStatsKeys.getOriginType(), PersistentDataType.INTEGER, 4);
|
||||
lore.add(itemOwner);
|
||||
meta.lore(lore);
|
||||
}
|
||||
}
|
||||
|
||||
// if creation date is enabled, add it
|
||||
Component creationDate = toolStats.itemLore.formatCreationTime(timeCreated, 2, newItem);
|
||||
if (creationDate != null) {
|
||||
|
||||
0
src/main/java/lol/hyper/toolstats/events/ChunkPopulate.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/ChunkPopulate.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/CraftItem.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/CraftItem.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/CreativeEvent.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/CreativeEvent.java
Normal file → Executable file
87
src/main/java/lol/hyper/toolstats/events/EntityDamage.java
Normal file → Executable file
87
src/main/java/lol/hyper/toolstats/events/EntityDamage.java
Normal file → Executable file
@@ -34,6 +34,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.projectiles.ProjectileSource;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class EntityDamage implements Listener {
|
||||
|
||||
@@ -76,6 +77,9 @@ public class EntityDamage implements Listener {
|
||||
|
||||
if (playerBeingAttacked) {
|
||||
Player player = (Player) event.getEntity();
|
||||
if (player.getGameMode() == GameMode.CREATIVE && !toolStats.config.getBoolean("allow-creative")) {
|
||||
return;
|
||||
}
|
||||
if (player.isBlocking()) {
|
||||
double blockedDamage = -event.getDamage(EntityDamageEvent.DamageModifier.BLOCKING);
|
||||
updateShieldDamage(player.getInventory(), blockedDamage);
|
||||
@@ -85,6 +89,9 @@ public class EntityDamage implements Listener {
|
||||
// player attacks something
|
||||
if (playerAttacking) {
|
||||
Player player = (Player) damager;
|
||||
if (player.getGameMode() == GameMode.CREATIVE && !toolStats.config.getBoolean("allow-creative")) {
|
||||
return;
|
||||
}
|
||||
PlayerInventory playerAttackingInventory = player.getInventory();
|
||||
// make sure the item the player used is an item we want
|
||||
if (!toolStats.itemChecker.isMeleeWeapon(playerAttackingInventory.getItemInMainHand().getType())) {
|
||||
@@ -103,15 +110,15 @@ public class EntityDamage implements Listener {
|
||||
if (modDied) {
|
||||
// player killed another player
|
||||
if (playerBeingAttacked) {
|
||||
updateWeaponKills(playerAttackingInventory, "player");
|
||||
updateWeaponKills(playerAttackingInventory, "player", null);
|
||||
} else {
|
||||
// player kills a regular mob
|
||||
updateWeaponKills(playerAttackingInventory, "mob");
|
||||
updateWeaponKills(playerAttackingInventory, "mob", mobBeingAttacked);
|
||||
if (mobAttackedType == EntityType.WITHER) {
|
||||
updateBossesKilled(playerAttackingInventory, "wither");
|
||||
updateBossesKilled(playerAttackingInventory, "wither", mobBeingAttacked);
|
||||
}
|
||||
if (mobAttackedType == EntityType.ENDER_DRAGON) {
|
||||
updateBossesKilled(playerAttackingInventory, "enderdragon");
|
||||
updateBossesKilled(playerAttackingInventory, "enderdragon", mobBeingAttacked);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,6 +131,9 @@ public class EntityDamage implements Listener {
|
||||
if (damager instanceof Trident trident) {
|
||||
ProjectileSource source = trident.getShooter();
|
||||
if (source instanceof Player player) {
|
||||
if (player.getGameMode() == GameMode.CREATIVE && !toolStats.config.getBoolean("allow-creative")) {
|
||||
return;
|
||||
}
|
||||
// update the trident's tracked damage
|
||||
updateTridentDamage(trident, finalDamage);
|
||||
|
||||
@@ -131,15 +141,15 @@ public class EntityDamage implements Listener {
|
||||
if (modDied) {
|
||||
// if the trident killed a player, update the kills
|
||||
if (playerBeingAttacked) {
|
||||
updateTridentKills(trident, "player");
|
||||
updateTridentKills(trident, "player", null);
|
||||
} else {
|
||||
// the trident killed a mob, update the kills
|
||||
updateTridentKills(trident, "mob");
|
||||
updateTridentKills(trident, "mob", mobBeingAttacked);
|
||||
if (mobAttackedType == EntityType.WITHER) {
|
||||
updateBossesKilled(player.getInventory(), "wither");
|
||||
updateBossesKilled(player.getInventory(), "wither", mobBeingAttacked);
|
||||
}
|
||||
if (mobAttackedType == EntityType.ENDER_DRAGON) {
|
||||
updateBossesKilled(player.getInventory(), "enderdragon");
|
||||
updateBossesKilled(player.getInventory(), "enderdragon", mobBeingAttacked);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,6 +165,9 @@ public class EntityDamage implements Listener {
|
||||
|
||||
// a player shot the arrow
|
||||
if (source instanceof Player shootingPlayer) {
|
||||
if (shootingPlayer.getGameMode() == GameMode.CREATIVE && !toolStats.config.getBoolean("allow-creative")) {
|
||||
return;
|
||||
}
|
||||
// update the player's bow damage
|
||||
updateBowDamage(shootingPlayer.getInventory(), finalDamage);
|
||||
|
||||
@@ -162,15 +175,15 @@ public class EntityDamage implements Listener {
|
||||
if (modDied) {
|
||||
if (playerBeingAttacked) {
|
||||
// player killed another player with an arrow
|
||||
updateBowKills(shootingPlayer.getInventory(), "player");
|
||||
updateBowKills(shootingPlayer.getInventory(), "player", null);
|
||||
} else {
|
||||
// player killed mob with an arrow
|
||||
updateBowKills(shootingPlayer.getInventory(), "mob");
|
||||
updateBowKills(shootingPlayer.getInventory(), "mob", mobBeingAttacked);
|
||||
if (mobAttackedType == EntityType.WITHER) {
|
||||
updateBossesKilledByBow(shootingPlayer.getInventory(), "wither");
|
||||
updateBossesKilledByBow(shootingPlayer.getInventory(), "wither", mobBeingAttacked);
|
||||
}
|
||||
if (mobAttackedType == EntityType.ENDER_DRAGON) {
|
||||
updateBossesKilledByBow(shootingPlayer.getInventory(), "enderdragon");
|
||||
updateBossesKilledByBow(shootingPlayer.getInventory(), "enderdragon", mobBeingAttacked);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -240,7 +253,7 @@ public class EntityDamage implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
private void updateBowKills(PlayerInventory playerInventory, String type) {
|
||||
private void updateBowKills(PlayerInventory playerInventory, String type, LivingEntity entity) {
|
||||
ItemStack heldBow = toolStats.itemChecker.getBow(playerInventory);
|
||||
if (heldBow == null) {
|
||||
return;
|
||||
@@ -251,7 +264,12 @@ public class EntityDamage implements Listener {
|
||||
|
||||
if (type.equalsIgnoreCase("mob")) {
|
||||
// player is shooting a mob
|
||||
ItemMeta newBow = toolStats.itemLore.updateMobKills(heldBow, 1);
|
||||
ItemMeta newBow;
|
||||
int count = 1;
|
||||
if (toolStats.roseStacker != null) {
|
||||
count = toolStats.roseStacker.countMobs(entity);
|
||||
}
|
||||
newBow = toolStats.itemLore.updateMobKills(heldBow, count);
|
||||
if (newBow != null) {
|
||||
if (isMain && isOffHand) {
|
||||
playerInventory.getItemInMainHand().setItemMeta(newBow);
|
||||
@@ -277,16 +295,20 @@ public class EntityDamage implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
private void updateTridentKills(Trident trident, String type) {
|
||||
private void updateTridentKills(Trident trident, String type, LivingEntity entity) {
|
||||
ItemStack newTrident = trident.getItemStack();
|
||||
ItemMeta newKills;
|
||||
ItemMeta newTridentMeta;
|
||||
if (type.equalsIgnoreCase("player")) {
|
||||
newKills = toolStats.itemLore.updatePlayerKills(trident.getItemStack(), 1);
|
||||
newTridentMeta = toolStats.itemLore.updatePlayerKills(trident.getItemStack(), 1);
|
||||
} else {
|
||||
newKills = toolStats.itemLore.updateMobKills(trident.getItemStack(), 1);
|
||||
int count = 1;
|
||||
if (toolStats.roseStacker != null) {
|
||||
count = toolStats.roseStacker.countMobs(entity);
|
||||
}
|
||||
newTridentMeta = toolStats.itemLore.updateMobKills(newTrident, count);
|
||||
}
|
||||
if (newKills != null) {
|
||||
newTrident.setItemMeta(newKills);
|
||||
if (newTridentMeta != null) {
|
||||
newTrident.setItemMeta(newTridentMeta);
|
||||
trident.setItemStack(newTrident);
|
||||
}
|
||||
}
|
||||
@@ -308,29 +330,37 @@ public class EntityDamage implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
private void updateWeaponKills(PlayerInventory playerInventory, String type) {
|
||||
private void updateWeaponKills(PlayerInventory playerInventory, String type, LivingEntity entity) {
|
||||
ItemStack heldWeapon = playerInventory.getItemInMainHand();
|
||||
ItemMeta newHeldWeaponMeta = null;
|
||||
if (type.equalsIgnoreCase("player")) {
|
||||
newHeldWeaponMeta = toolStats.itemLore.updatePlayerKills(heldWeapon, 1);
|
||||
}
|
||||
if (type.equalsIgnoreCase("mob")) {
|
||||
newHeldWeaponMeta = toolStats.itemLore.updateMobKills(heldWeapon, 1);
|
||||
int count = 1;
|
||||
if (toolStats.roseStacker != null) {
|
||||
count = toolStats.roseStacker.countMobs(entity);
|
||||
}
|
||||
newHeldWeaponMeta = toolStats.itemLore.updateMobKills(heldWeapon, count);
|
||||
}
|
||||
if (newHeldWeaponMeta != null) {
|
||||
playerInventory.getItemInMainHand().setItemMeta(newHeldWeaponMeta);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateBossesKilled(PlayerInventory playerInventory, String boss) {
|
||||
private void updateBossesKilled(PlayerInventory playerInventory, String boss, LivingEntity entity) {
|
||||
ItemStack heldWeapon = playerInventory.getItemInMainHand();
|
||||
ItemMeta newHeldWeaponMeta = toolStats.itemLore.updateBossesKilled(heldWeapon, 1, boss);
|
||||
int count = 1;
|
||||
if (toolStats.roseStacker != null) {
|
||||
count = toolStats.roseStacker.countMobs(entity);
|
||||
}
|
||||
ItemMeta newHeldWeaponMeta = toolStats.itemLore.updateBossesKilled(heldWeapon, count, boss);
|
||||
if (newHeldWeaponMeta != null) {
|
||||
playerInventory.getItemInMainHand().setItemMeta(newHeldWeaponMeta);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateBossesKilledByBow(PlayerInventory playerInventory, String boss) {
|
||||
private void updateBossesKilledByBow(PlayerInventory playerInventory, String boss, LivingEntity entity) {
|
||||
ItemStack heldBow = toolStats.itemChecker.getBow(playerInventory);
|
||||
if (heldBow == null) {
|
||||
return;
|
||||
@@ -339,7 +369,12 @@ public class EntityDamage implements Listener {
|
||||
boolean isMain = playerInventory.getItemInMainHand().getType() == Material.BOW || playerInventory.getItemInMainHand().getType() == Material.CROSSBOW;
|
||||
boolean isOffHand = playerInventory.getItemInOffHand().getType() == Material.BOW || playerInventory.getItemInOffHand().getType() == Material.CROSSBOW;
|
||||
|
||||
ItemMeta newHeldWeaponMeta = toolStats.itemLore.updateBossesKilled(heldBow, 1, boss);
|
||||
int count = 1;
|
||||
if (toolStats.roseStacker != null) {
|
||||
count = toolStats.roseStacker.countMobs(entity);
|
||||
}
|
||||
|
||||
ItemMeta newHeldWeaponMeta = toolStats.itemLore.updateBossesKilled(heldBow, count, boss);
|
||||
if (newHeldWeaponMeta != null) {
|
||||
if (isMain && isOffHand) {
|
||||
playerInventory.getItemInMainHand().setItemMeta(newHeldWeaponMeta);
|
||||
|
||||
0
src/main/java/lol/hyper/toolstats/events/EntityDeath.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/EntityDeath.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/GenerateLoot.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/GenerateLoot.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/InventoryClose.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/InventoryClose.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PickupItem.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PickupItem.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PlayerDrop.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PlayerDrop.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PlayerFish.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PlayerFish.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PlayerInteract.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PlayerInteract.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PlayerJoin.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PlayerJoin.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PlayerMove.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PlayerMove.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PrepareCraft.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/PrepareCraft.java
Normal file → Executable file
1
src/main/java/lol/hyper/toolstats/events/ProjectileShoot.java
Normal file → Executable file
1
src/main/java/lol/hyper/toolstats/events/ProjectileShoot.java
Normal file → Executable file
@@ -25,7 +25,6 @@ import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
;
|
||||
|
||||
public class ProjectileShoot implements Listener {
|
||||
|
||||
|
||||
5
src/main/java/lol/hyper/toolstats/events/SheepShear.java
Normal file → Executable file
5
src/main/java/lol/hyper/toolstats/events/SheepShear.java
Normal file → Executable file
@@ -62,6 +62,11 @@ public class SheepShear implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
// make sure they are not a baby
|
||||
if (!sheep.isAdult()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// make sure the sheep is not sheared
|
||||
if (sheep.isSheared()) {
|
||||
return;
|
||||
|
||||
0
src/main/java/lol/hyper/toolstats/events/ShootBow.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/ShootBow.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/VillagerTrade.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/events/VillagerTrade.java
Normal file → Executable file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* This file is part of ToolStats.
|
||||
*
|
||||
* ToolStats is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ToolStats is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ToolStats. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file is part of ToolStats.
|
||||
*
|
||||
* ToolStats is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ToolStats is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ToolStats. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package lol.hyper.toolstats.support.rosestacker;
|
||||
|
||||
import dev.rosewood.rosestacker.api.RoseStackerAPI;
|
||||
import dev.rosewood.rosestacker.stack.StackedEntity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
|
||||
public class RoseStacker {
|
||||
|
||||
private final RoseStackerAPI rsAPI;
|
||||
|
||||
public RoseStacker() {
|
||||
this.rsAPI = RoseStackerAPI.getInstance();
|
||||
}
|
||||
|
||||
public int countMobs(LivingEntity entity) {
|
||||
if (!rsAPI.isEntityStacked(entity)) {
|
||||
// if the entity is not stacked, ignore
|
||||
return 1;
|
||||
}
|
||||
StackedEntity stackedEntity = rsAPI.getStackedEntity(entity);
|
||||
if (stackedEntity == null) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
boolean killAll = stackedEntity.getStackSettings().shouldKillEntireStackOnDeath();
|
||||
// if we kill the entire stack, add the entire stack to the count
|
||||
if (killAll) {
|
||||
return stackedEntity.getStackSize();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
0
src/main/java/lol/hyper/toolstats/tools/HashMaker.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/HashMaker.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/ItemChecker.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/ItemChecker.java
Normal file → Executable file
1
src/main/java/lol/hyper/toolstats/tools/ItemLore.java
Normal file → Executable file
1
src/main/java/lol/hyper/toolstats/tools/ItemLore.java
Normal file → Executable file
@@ -1410,7 +1410,6 @@ public class ItemLore {
|
||||
}
|
||||
List<Component> newLore = updateItemLore(meta, oldLine, newLine);
|
||||
meta.lore(newLore);
|
||||
toolStats.logger.info(meta.toString());
|
||||
return meta;
|
||||
}
|
||||
|
||||
|
||||
0
src/main/java/lol/hyper/toolstats/tools/NumberFormat.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/NumberFormat.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/TokenData.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/TokenData.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/ToolStatsKeys.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/ToolStatsKeys.java
Normal file → Executable file
@@ -53,7 +53,7 @@ public class ConfigTools {
|
||||
String itemName = material.toString().toLowerCase();
|
||||
String itemType = null;
|
||||
// hardcode these
|
||||
if (material == Material.BOW || material == Material.CROSSBOW || material == Material.SHEARS || material == Material.TRIDENT || material == Material.FISHING_ROD) {
|
||||
if (material == Material.BOW || material == Material.CROSSBOW || material == Material.SHEARS || material == Material.TRIDENT || material == Material.FISHING_ROD || material == Material.SHIELD) {
|
||||
switch (material) {
|
||||
case CROSSBOW:
|
||||
case BOW: {
|
||||
@@ -72,6 +72,10 @@ public class ConfigTools {
|
||||
itemType = "fishing-rod";
|
||||
break;
|
||||
}
|
||||
case SHIELD: {
|
||||
itemType = "shield";
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
itemType = itemName.substring(itemName.indexOf('_') + 1);
|
||||
@@ -88,6 +92,7 @@ public class ConfigTools {
|
||||
case "fishing-rod" -> toolStats.config.getBoolean("enabled." + configName + ".fishing-rod");
|
||||
case "mace" -> toolStats.config.getBoolean("enabled." + configName + ".mace");
|
||||
case "spear" -> toolStats.config.getBoolean("enabled." + configName + ".spear");
|
||||
case "shield" -> toolStats.config.getBoolean("enabled." + configName + ".shield");
|
||||
case "helmet", "chestplate", "leggings", "boots" ->
|
||||
toolStats.config.getBoolean("enabled." + configName + ".armor");
|
||||
default -> false;
|
||||
|
||||
1
src/main/java/lol/hyper/toolstats/tools/config/ConfigUpdater.java
Normal file → Executable file
1
src/main/java/lol/hyper/toolstats/tools/config/ConfigUpdater.java
Normal file → Executable file
@@ -42,6 +42,7 @@ public class ConfigUpdater {
|
||||
case 12 -> new Version13(toolStats).update(); // 12 to 13
|
||||
case 13 -> new Version14(toolStats).update(); // 13 to 14
|
||||
case 14 -> new Version15(toolStats).update(); // 14 to 15
|
||||
case 15 -> new Version16(toolStats).update(); // 15 to 16
|
||||
}
|
||||
}
|
||||
}
|
||||
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version10.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version10.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version11.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version11.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version12.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version12.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version13.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version13.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version14.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version14.java
Normal file → Executable file
1
src/main/java/lol/hyper/toolstats/tools/config/versions/Version15.java
Normal file → Executable file
1
src/main/java/lol/hyper/toolstats/tools/config/versions/Version15.java
Normal file → Executable file
@@ -18,7 +18,6 @@
|
||||
package lol.hyper.toolstats.tools.config.versions;
|
||||
|
||||
import lol.hyper.toolstats.ToolStats;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* This file is part of ToolStats.
|
||||
*
|
||||
* ToolStats is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ToolStats is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ToolStats. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package lol.hyper.toolstats.tools.config.versions;
|
||||
|
||||
import lol.hyper.toolstats.ToolStats;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Version16 {
|
||||
|
||||
private final ToolStats toolStats;
|
||||
|
||||
/**
|
||||
* Used for updating from version 15 to 16.
|
||||
*
|
||||
* @param toolStats ToolStats instance.
|
||||
*/
|
||||
public Version16(ToolStats toolStats) {
|
||||
this.toolStats = toolStats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform the config update.
|
||||
*/
|
||||
public void update() {
|
||||
// save the old config first
|
||||
try {
|
||||
toolStats.config.save("plugins" + File.separator + "ToolStats" + File.separator + "config-15.yml");
|
||||
} catch (IOException exception) {
|
||||
toolStats.logger.error("Unable to save config-15.yml!", exception);
|
||||
}
|
||||
|
||||
// we make this super verbose so that admins can see what's being added
|
||||
toolStats.logger.info("Updating config.yml to version 16.");
|
||||
toolStats.config.set("config-version", 16);
|
||||
|
||||
toolStats.logger.info("Adding enabled.crafted-on.shield to config.yml.");
|
||||
toolStats.config.set("enabled.crafted-on.shield", true);
|
||||
toolStats.logger.info("Adding enabled.crafted-by.shield to config.yml.");
|
||||
toolStats.config.set("enabled.crafted-by.shield", true);
|
||||
|
||||
toolStats.logger.info("Adding enabled.traded-on.shield to config.yml.");
|
||||
toolStats.config.set("enabled.traded-on.shield", true);
|
||||
toolStats.logger.info("Adding enabled.traded-by.shield to config.yml.");
|
||||
toolStats.config.set("enabled.traded-by.shield", true);
|
||||
|
||||
toolStats.logger.info("Adding enabled.looted-on.shield to config.yml.");
|
||||
toolStats.config.set("enabled.looted-on.shield", true);
|
||||
toolStats.logger.info("Adding enabled.looted-by.shield to config.yml.");
|
||||
toolStats.config.set("enabled.looted-by.shield", true);
|
||||
|
||||
// save the config and reload it
|
||||
try {
|
||||
toolStats.config.save("plugins" + File.separator + "ToolStats" + File.separator + "config.yml");
|
||||
} catch (IOException exception) {
|
||||
toolStats.logger.error("Unable to save config.yml!", exception);
|
||||
}
|
||||
toolStats.loadConfig();
|
||||
toolStats.logger.info("Config has been updated to version 16. A copy of version 6 has been saved as config-15.yml");
|
||||
}
|
||||
}
|
||||
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version6.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version6.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version7.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version7.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version8.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version8.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version9.java
Normal file → Executable file
0
src/main/java/lol/hyper/toolstats/tools/config/versions/Version9.java
Normal file → Executable file
6
src/main/resources/config.yml
Normal file → Executable file
6
src/main/resources/config.yml
Normal file → Executable file
@@ -195,6 +195,7 @@ enabled:
|
||||
mace: true
|
||||
fishing-rod: true
|
||||
spear: true
|
||||
shield: true
|
||||
# Will show "Crafted on <date>"
|
||||
crafted-on:
|
||||
pickaxe: true
|
||||
@@ -208,6 +209,7 @@ enabled:
|
||||
mace: true
|
||||
fishing-rod: true
|
||||
spear: true
|
||||
shield: true
|
||||
# Will show "Fished by <player>"
|
||||
fished-by:
|
||||
pickaxe: true
|
||||
@@ -242,6 +244,7 @@ enabled:
|
||||
armor: true
|
||||
fishing-rod: true
|
||||
spear: true
|
||||
shield: true
|
||||
# Will show "Found on <date>"
|
||||
looted-on:
|
||||
pickaxe: true
|
||||
@@ -254,6 +257,7 @@ enabled:
|
||||
armor: true
|
||||
fishing-rod: true
|
||||
spear: true
|
||||
shield: true
|
||||
# Will show "Traded by <player>"
|
||||
traded-by:
|
||||
pickaxe: true
|
||||
@@ -265,6 +269,7 @@ enabled:
|
||||
bow: true
|
||||
armor: true
|
||||
fishing-rod: true
|
||||
shield: true
|
||||
# Will show "Traded on <date>"
|
||||
traded-on:
|
||||
pickaxe: true
|
||||
@@ -276,6 +281,7 @@ enabled:
|
||||
bow: true
|
||||
armor: true
|
||||
fishing-rod: true
|
||||
shield: true
|
||||
damage-done:
|
||||
sword: true
|
||||
axe: true
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: ToolStats
|
||||
version: ${project.version}
|
||||
version: ${version}
|
||||
main: lol.hyper.toolstats.ToolStats
|
||||
api-version: 1.21
|
||||
api-version: '26.1.1'
|
||||
folia-supported: true
|
||||
author: hyperdefined
|
||||
description: Track various tool stats!
|
||||
@@ -29,4 +29,10 @@ permissions:
|
||||
default: op
|
||||
toolstats.remove:
|
||||
description: Allows the usage of /toolstats remove.
|
||||
default: op
|
||||
default: op
|
||||
|
||||
dependencies:
|
||||
server:
|
||||
RoseStacker:
|
||||
load: BEFORE
|
||||
required: false
|
||||
Reference in New Issue
Block a user