Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Adrigamer2950/AdriAPI
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.0.1
Choose a base ref
...
head repository: Adrigamer2950/AdriAPI
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.1.0
Choose a head ref

Commits on Aug 21, 2024

  1. docs: Update README.md

    Adrigamer2950 committed Aug 21, 2024
    Copy the full SHA
    821f1be View commit details
  2. Copy the full SHA
    1c2156a View commit details
  3. docs: Update README.md

    Adrigamer2950 committed Aug 21, 2024
    Copy the full SHA
    377bac3 View commit details

Commits on Aug 24, 2024

  1. Copy the full SHA
    91e9b6f View commit details

Commits on Aug 26, 2024

  1. Copy the full SHA
    b281d96 View commit details
  2. Copy the full SHA
    bc2bfe4 View commit details

Commits on Aug 27, 2024

  1. Copy the full SHA
    1f828a8 View commit details
  2. Copy the full SHA
    996956b View commit details
  3. Copy the full SHA
    d0a8026 View commit details
  4. Copy the full SHA
    d1b7cb8 View commit details
  5. Copy the full SHA
    fe764d8 View commit details
  6. Copy the full SHA
    84cc1ee View commit details
  7. Copy the full SHA
    9484ace View commit details
  8. docs: Update README.md

    Adrigamer2950 committed Aug 27, 2024
    Copy the full SHA
    24f9a93 View commit details
  9. docs: Update README.md

    Adrigamer2950 committed Aug 27, 2024
    Copy the full SHA
    98238ad View commit details
  10. docs: Update README.md

    Adrigamer2950 committed Aug 27, 2024
    Copy the full SHA
    5113711 View commit details

Commits on Aug 28, 2024

  1. docs: Update README.md

    Adrigamer2950 committed Aug 28, 2024
    Copy the full SHA
    ac6c938 View commit details

Commits on Aug 29, 2024

  1. Copy the full SHA
    8032b9c View commit details
  2. Copy the full SHA
    44f6f3d View commit details
  3. Copy the full SHA
    c18bf9c View commit details
  4. Merge pull request #1 from Adrigamer2950/renovate/org.projectlombok-l…

    …ombok-1.x
    
    fix(deps): update dependency org.projectlombok:lombok to v1.18.34
    Adrigamer2950 authored Aug 29, 2024
    Copy the full SHA
    009b138 View commit details
  5. Merge pull request #2 from Adrigamer2950/renovate/gradle-8.x

    chore(deps): update dependency gradle to v8.10
    Adrigamer2950 authored Aug 29, 2024
    Copy the full SHA
    a11a0eb View commit details
  6. Merge pull request #3 from Adrigamer2950/renovate/org.jetbrains-annot…

    …ations-24.x
    
    fix(deps): update dependency org.jetbrains:annotations to v24.1.0
    Adrigamer2950 authored Aug 29, 2024
    Copy the full SHA
    79614d7 View commit details

Commits on Sep 9, 2024

  1. Copy the full SHA
    7341a05 View commit details

Commits on Sep 16, 2024

  1. Copy the full SHA
    94013ab View commit details

Commits on Sep 21, 2024

  1. Copy the full SHA
    0df8a07 View commit details

Commits on Sep 24, 2024

  1. Copy the full SHA
    e2017e6 View commit details

Commits on Sep 25, 2024

  1. Copy the full SHA
    cacb972 View commit details
  2. Copy the full SHA
    a3c95b7 View commit details
  3. Copy the full SHA
    5556b5f View commit details
  4. Copy the full SHA
    ae16c58 View commit details
  5. Merge pull request #6 from Adrigamer2950/renovate/gradle-8.x

    chore(deps): update dependency gradle to v8.10.2
    Adrigamer2950 authored Sep 25, 2024
    Copy the full SHA
    6103d2b View commit details
  6. Copy the full SHA
    97941c3 View commit details
  7. Merge pull request #7 from Adrigamer2950/renovate/org.jetbrains-annot…

    …ations-25.x
    
    chore(deps): update dependency org.jetbrains:annotations to v25
    Adrigamer2950 authored Sep 25, 2024
    Copy the full SHA
    dd0f051 View commit details
  8. Copy the full SHA
    69f9e75 View commit details
  9. Copy the full SHA
    51e333c View commit details

Commits on Sep 26, 2024

  1. Copy the full SHA
    68f21a8 View commit details

Commits on Oct 5, 2024

  1. Copy the full SHA
    cb2adb9 View commit details

Commits on Oct 11, 2024

  1. Copy the full SHA
    3da3f01 View commit details

Commits on Oct 12, 2024

  1. Copy the full SHA
    2dfaf58 View commit details
  2. Merge pull request #8 from Adrigamer2950/renovate/org.jetbrains-annot…

    …ations-26.x
    
    fix(deps): update dependency org.jetbrains:annotations to v26
    Adrigamer2950 authored Oct 12, 2024
    Copy the full SHA
    099970a View commit details

Commits on Oct 14, 2024

  1. Copy the full SHA
    e2e61b0 View commit details

Commits on Oct 26, 2024

  1. Copy the full SHA
    20b1202 View commit details

Commits on Dec 12, 2024

  1. Copy the full SHA
    3599b5e View commit details
  2. Copy the full SHA
    81079e9 View commit details
  3. Copy the full SHA
    fab052c View commit details
  4. Copy the full SHA
    cce560c View commit details
  5. Copy the full SHA
    aa2ca76 View commit details
  6. feat: Add Inventories

    Adrigamer2950 committed Dec 12, 2024
    Copy the full SHA
    873af03 View commit details
  7. Merge pull request #9 from Adrigamer2950/renovate/org.jetbrains-annot…

    …ations-26.x
    
    fix(deps): update dependency org.jetbrains:annotations to v26.0.1
    Adrigamer2950 authored Dec 12, 2024
    Copy the full SHA
    56a1ae3 View commit details
Showing with 856 additions and 302 deletions.
  1. +53 −0 .github/workflows/build.yml
  2. +4 −1 .gitignore
  3. +13 −7 README.md
  4. +100 −18 build.gradle
  5. +2 −2 gradle.properties
  6. BIN gradle/wrapper/gradle-wrapper.jar
  7. +1 −1 gradle/wrapper/gradle-wrapper.properties
  8. +12 −9 gradlew
  9. +94 −92 gradlew.bat
  10. +8 −0 renovate.json
  11. +4 −0 settings.gradle
  12. +6 −4 src/main/java/me/adrigamer2950/adriapi/AdriAPI.java
  13. +3 −0 src/main/java/me/adrigamer2950/adriapi/AdriAPICommand.java
  14. +69 −11 src/main/java/me/adrigamer2950/adriapi/api/APIPlugin.java
  15. +57 −29 src/main/java/me/adrigamer2950/adriapi/api/colors/Colors.java
  16. +73 −32 src/main/java/me/adrigamer2950/adriapi/api/command/Command.java
  17. +3 −3 src/main/java/me/adrigamer2950/adriapi/api/command/SubCommand.java
  18. +0 −7 src/main/java/me/adrigamer2950/adriapi/api/command/interfaces/TabCompleter.java
  19. +11 −2 src/main/java/me/adrigamer2950/adriapi/api/command/manager/CommandManager.java
  20. +5 −8 src/main/java/me/adrigamer2950/adriapi/api/event/command/CommandEvent.java
  21. +15 −2 src/main/java/me/adrigamer2950/adriapi/api/event/command/CommandLoadedEvent.java
  22. +3 −0 src/main/java/me/adrigamer2950/adriapi/api/exceptions/DuplicatedManagerException.java
  23. +3 −0 src/main/java/me/adrigamer2950/adriapi/api/exceptions/command/CommandNotInPluginYMLException.java
  24. +10 −20 src/main/java/me/adrigamer2950/adriapi/api/folia/Scheduler.java
  25. +152 −0 src/main/java/me/adrigamer2950/adriapi/api/inventory/Inventory.java
  26. +18 −0 src/main/java/me/adrigamer2950/adriapi/api/inventory/InventorySize.java
  27. +52 −14 src/main/java/me/adrigamer2950/adriapi/api/logger/APILogger.java
  28. +15 −0 src/main/java/me/adrigamer2950/adriapi/api/user/User.java
  29. +14 −9 src/main/java/me/adrigamer2950/adriapi/api/user/UserImpl.java
  30. +24 −16 src/main/java/me/adrigamer2950/adriapi/api/util/ServerType.java
  31. +31 −0 src/main/java/me/adrigamer2950/adriapi/listeners/InventoriesListener.java
  32. +1 −1 src/main/java/me/adrigamer2950/adriapi/listeners/ManagersListener.java
  33. +0 −14 src/main/resources/plugin.yml
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build

on: [
workflow_dispatch,
push
]

jobs:
build:
name: Build & Publish
runs-on: ubuntu-latest

permissions:
contents: read

env:
BUILD_NUMBER: "${{ github.run_number }}"
COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"

steps:
- uses: actions/checkout@v4
name: Checkout sources

- uses: actions/setup-java@v4
name: Set up JDK 17
with:
java-version: '17'
distribution: 'temurin'

- uses: gradle/actions/setup-gradle@v4
name: Setup Gradle

- name: Build Artifact
run: "chmod +x ./gradlew && ./gradlew build $([[ \"$COMMIT_MESSAGE\" == \"release:\"* ]] && echo || echo -PBUILD_NUMBER=$BUILD_NUMBER)"

- uses: actions/upload-artifact@v4
name: Save Artifact
with:
name: "AdriAPI-b${{ github.run_number }}"
path: build/libs/*.jar

- name: Publish Artifact
if: github.repository == 'Adrigamer2950/AdriAPI'
env:
NEXUS_USERNAME: "${{ secrets.NEXUS_USERNAME }}"
NEXUS_PASSWORD: "${{ secrets.NEXUS_PASSWORD }}"
run: "./gradlew publish -PNEXUS_USERNAME=$NEXUS_USERNAME -PNEXUS_PASSWORD=$NEXUS_PASSWORD $([[ \"$COMMIT_MESSAGE\" == \"release:\"* ]] && echo \"\" || echo \"-PBUILD_NUMBER=$BUILD_NUMBER\")"

- name: Publish to Modrinth
if: "${{ github.repository == 'Adrigamer2950/AdriAPI' && startsWith(github.event.head_commit.message, 'release:') }}"
env:
MODRINTH_TOKEN: "${{ secrets.MODRINTH_TOKEN }}"
run: "./gradlew modrinth modrinthSyncBody"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -115,4 +115,7 @@ gradle-app.setting
run/

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
!gradle-wrapper.jar

# VS Code files
.vscode/
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# AdriAPI
<p align="center">
<img src="https://avatars.githubusercontent.com/u/58531641?v=4" height="364" alt="Logo" />
</p>

An API created to make Minecraft Plugin development easier

[![Dev Build Status](https://ci.devadri.es/buildStatus/icon?job=AdriAPI%2FAdriAPI-Dev&subject=Dev%20Build)](https://ci.devadri.es/job/AdriAPI/job/AdriAPI-Dev/)
[![Build Status](https://ci.devadri.es/buildStatus/icon?job=AdriAPI%2FAdriAPI-Release&subject=Release)](https://ci.devadri.es/job/AdriAPI/job/AdriAPI-Release/)

# Docs
Under development...
![Build](https://github.com/Adrigamer2950/AdriAPI/actions/workflows/build.yml/badge.svg)

# Resources
- [CI Server](https://ci.devadri.es/job/AdriAPI)
- [Docs](https://docs.devadri.es)
- [bStats](https://bstats.org/plugin/bukkit/AdriAPI/20135)
- [Repository](https://repo.devadri.es)
- [Maven Repository](https://repo.devadri.es)

# Info

This API is aimed to simplify the development of Bukkit plugins (please use Paper or any fork of Paper instead of CraftBukkit/Spigot),
providing a lot of utilities that will make your life (and mine) easier.

### It's used in my plugins, but you can use it on your own plugins if you want, just make sure to give proper credit!
118 changes: 100 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
//file:noinspection GroovyAssignabilityCheck
//file:noinspection GroovyAccessibility
import xyz.jpenilla.runtask.task.AbstractRun

plugins {
id 'java'
id "maven-publish"
id 'net.minecrell.plugin-yml.bukkit' version '0.6.0'
id "com.modrinth.minotaur" version "2.+"
id "xyz.jpenilla.run-paper" version "2.3.1"
}

group = 'me.adrigamer2950'
version = properties.get("version") + (
project.hasProperty("BUILD_NUMBER") ?
("-DEV" + (
project.property("BUILD_NUMBER") == "0" ? "" : ("-b" + project.property("BUILD_NUMBER")))
)
(project.property("BUILD_NUMBER") == "0" ? "" : ("-b" + project.property("BUILD_NUMBER")))
: ""
)
description = properties.get("description")
author = properties.get("author")

if (project.hasProperty("NEXUS_USERNAME") && project.hasProperty("NEXUS_PASSWORD")) {
@@ -90,18 +92,22 @@ repositories {

dependencies {
// JetBrains Annotations
compileOnly "org.jetbrains:annotations:24.0.1"
compileOnly "org.jetbrains:annotations:26.0.1"

// Folia API
//noinspection VulnerableLibrariesLocal
compileOnly "dev.folia:folia-api:1.20.4-R0.1-SNAPSHOT"

// Lombok
compileOnly 'org.projectlombok:lombok:1.18.32'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
compileOnly 'org.projectlombok:lombok:1.18.36'
annotationProcessor 'org.projectlombok:lombok:1.18.36'

// Ansi
compileOnly 'org.fusesource.jansi:jansi:2.4.1'

// Adventure API
compileOnly "net.kyori:adventure-platform-bukkit:4.3.4"
bukkitLibrary "net.kyori:adventure-platform-bukkit:4.3.4"
}

def targetJavaVersion = 17
@@ -122,17 +128,93 @@ tasks {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
}

processResources {
def props = [
version: version,
description: description,
author: author
]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
bukkit {
name = "AdriAPI"
version = version
main = "me.adrigamer2950.adriapi.AdriAPI"
apiVersion = "1.18"
author = author
description = this.description
website = "https://github.com/Adrigamer2950/AdriAPI"
load = 'STARTUP'
foliaSupported = true

commands {
adriapi {
description = "Main command"
usage = "/adriapi"
}
}
}

modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "adriapi"
versionNumber = version
versionName = rootProject.name + " " + version
versionType = "release"
uploadFile = jar
gameVersions = [
"1.18",
"1.18.1",
"1.18.2",
"1.19",
"1.19.1",
"1.19.2",
"1.19.3",
"1.19.4",
"1.20",
"1.20.1",
"1.20.2",
"1.20.3",
"1.20.4",
"1.20.5",
"1.20.6",
"1.21",
"1.21.1",
"1.21.2",
"1.21.3",
"1.21.4"
]
loaders = [
"bukkit",
"folia",
"paper",
"purpur",
"spigot"
]
syncBodyFrom = rootProject.file("README.md").text
}

runServer {
minecraftVersion("1.20.2")

downloadPlugins {
// ViaVersion
hangar("ViaVersion", "5.2.0")
}
}

tasks.withType(AbstractRun).configureEach {
javaLauncher = javaToolchains.launcherFor {
vendor = JvmVendorSpec.JETBRAINS
languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
jvmArgs(
// Hot Swap
"-XX:+AllowEnhancedClassRedefinition",

// Aikar Flags
"--add-modules=jdk.incubator.vector", "-XX:+UseG1GC", "-XX:+ParallelRefProcEnabled",
"-XX:MaxGCPauseMillis=200", "-XX:+UnlockExperimentalVMOptions", "-XX:+DisableExplicitGC",
"-XX:+AlwaysPreTouch", "-XX:G1NewSizePercent=30", "-XX:G1MaxNewSizePercent=40",
"-XX:G1HeapRegionSize=8M", "-XX:G1ReservePercent=20", "-XX:G1HeapWastePercent=5",
"-XX:G1MixedGCCountTarget=4", "-XX:InitiatingHeapOccupancyPercent=15",
"-XX:G1MixedGCLiveThresholdPercent=90", "-XX:G1RSetUpdatingPauseTimePercent=5",
"-XX:SurvivorRatio=32", "-XX:+PerfDisableSharedMem", "-XX:MaxTenuringThreshold=1",
"-Dusing.aikars.flags=https://mcflags.emc.gs", "-Daikars.new.flags=true"
)

}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version=2.0.1
description=An API created to make Minecraft Plugin development easier
version=2.1.0
description=An API aimed to simplify the development of Bukkit (better use Paper) plugins
author=Adrigamer2950
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
21 changes: 12 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# 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/.
@@ -83,7 +85,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# 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
@@ -144,15 +147,15 @@ 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=SC3045
# 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=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -201,11 +204,11 @@ 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 $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_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" \
Loading