Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
derklaro committed Jul 12, 2024
1 parent 0149153 commit b96ffa3
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 64 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ allprojects {
// packetevents
maven("https://repo.codemc.io/repository/maven-releases/") {
mavenContent {
includeGroup("com.github.retrooper.packetevents")
includeGroup("com.github.retrooper")
}
}
}
Expand All @@ -71,7 +71,7 @@ subprojects {
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "com.diffplug.spotless")
apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "io.github.goooler.shadow")

dependencies {
"compileOnly"(rootProject.libs.annotations)
Expand Down Expand Up @@ -107,7 +107,7 @@ subprojects {

extensions.configure<JavaPluginExtension> {
disableAutoTargetJvm()
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}

tasks.withType<Checkstyle> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
import java.util.concurrent.TimeUnit;
import org.jetbrains.annotations.NotNull;

public final class AsyncPlatformTaskManager implements PlatformTaskManager {
public class AsyncPlatformTaskManager implements PlatformTaskManager {

private static final long ONE_TICK_MS = 1000 / 20;

private final ExecutorService runOnceExecutorService;
private final ScheduledExecutorService scheduledExecutorService;

private AsyncPlatformTaskManager(@NotNull String extensionId) {
protected AsyncPlatformTaskManager(@NotNull String extensionId) {
ThreadFactory runOnceThreadFactory = AsyncTaskThreadFactory.create(extensionId + " NPC-Lib Task #%d");
this.runOnceExecutorService = Executors.newCachedThreadPool(runOnceThreadFactory);

Expand Down
24 changes: 12 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[versions]

# plugins
shadow = "8.1.1"
shadow = "8.1.8"
spotless = "6.25.0"
nexusPublish = "2.0.0-rc-2"
checkstyleTools = "10.13.0"
nexusPublish = "2.0.0"
checkstyleTools = "10.17.0"

# general
gson = "2.10.1"
gson = "2.11.0"
geantyref = "1.3.15"
annotations = "24.1.0"
netty = "4.1.106.Final"
netty = "4.1.111.Final"

# platform api versions
sponge = "10.0.0"
minestom = "5162a00b1e"
paper = "1.20.4-R0.1-SNAPSHOT"
minestom = "79716ab749"
paper = "1.21-R0.1-SNAPSHOT"

# platform extensions
paperLib = "1.0.8"
packetEvents = "2.2.1"
protocolLib = "80aa420099"
packetEvents = "2.4.0"
protocolLib = "4aa344bab2"


[libraries]
Expand All @@ -34,18 +34,18 @@ geantyref = { group = "io.leangen.geantyref", name = "geantyref", version.ref =
# platform api
paper = { group = "io.papermc.paper", name = "paper-api", version.ref = "paper" }
sponge = { group = "org.spongepowered", name = "spongeapi", version.ref = "sponge" }
minestom = { group = "com.github.Minestom", name = "Minestom", version.ref = "minestom" }
minestom = { group = "net.minestom", name = "minestom-snapshots", version.ref = "minestom" }

# platform extensions
paperLib = { group = "io.papermc", name = "paperlib", version.ref = "paperLib" }
protocolLib = { group = "com.github.dmulloy2", name = "ProtocolLib", version.ref = "protocolLib" }
packetEvents = { group = "com.github.retrooper.packetevents", name = "spigot", version.ref = "packetEvents" }
packetEvents = { group = "com.github.retrooper", name = "packetevents-spigot", version.ref = "packetEvents" }

# dummy version, just here for renovate to detect that there is something to update
checkstyleTools = { group = "com.puppycrawl.tools", name = "checkstyle", version.ref = "checkstyleTools" }

[plugins]

shadow = { id = "io.github.goooler.shadow", version.ref = "shadow" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexusPublish" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
26 changes: 1 addition & 25 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,30 +1,6 @@
#
# This file is part of npc-lib, licensed under the MIT License (MIT).
#
# Copyright (c) 2022-2023 Julian M., Pasqual K. and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -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/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# 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 "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@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 ##########################################################################
Expand Down
4 changes: 2 additions & 2 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
before_install:
- sdk update
- sdk install java 17.0.5-zulu
- sdk use java 17.0.5-zulu
- sdk install java 21-zulu
- sdk use java 21-zulu
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import net.minestom.server.item.ItemStack;
import org.jetbrains.annotations.NotNull;

@SuppressWarnings("UnstableApiUsage")
public final class MinestomActionController extends CommonNpcActionController {

private final NpcTracker<Instance, Player, ItemStack, Object> npcTracker;
Expand Down Expand Up @@ -160,7 +159,7 @@ private void handleMove(@NotNull PlayerMoveEvent event) {

private void handlePlayerInstanceSpawn(@NotNull PlayerSpawnEvent event) {
// ensure that we stop tracking the player on NPCs which are not in the same world as the player
String instanceId = event.getSpawnInstance().getUniqueId().toString();
String instanceId = event.getInstance().getUniqueId().toString();
for (Npc<Instance, Player, ItemStack, Object> npc : this.npcTracker.trackedNpcs()) {
if (!npc.position().worldId().equals(instanceId)) {
// the player is no longer in the same world, stop tracking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@
package com.github.juliarn.npclib.minestom;

import com.github.juliarn.npclib.api.PlatformTaskManager;
import com.github.juliarn.npclib.common.task.AsyncPlatformTaskManager;
import net.minestom.server.MinecraftServer;
import net.minestom.server.timer.ExecutionType;
import net.minestom.server.timer.TaskSchedule;
import org.jetbrains.annotations.NotNull;

public final class MinestomPlatformTaskManager implements PlatformTaskManager {
public final class MinestomPlatformTaskManager extends AsyncPlatformTaskManager {

private static final MinestomPlatformTaskManager INSTANCE = new MinestomPlatformTaskManager();

private MinestomPlatformTaskManager() {
super("Minestom");
}

public static @NotNull PlatformTaskManager taskManager() {
Expand All @@ -50,18 +51,4 @@ public void scheduleSync(@NotNull Runnable task) {
public void scheduleDelayedSync(@NotNull Runnable task, int delayTicks) {
MinecraftServer.getSchedulerManager().scheduleTask(task, TaskSchedule.tick(delayTicks), TaskSchedule.stop());
}

@Override
public void scheduleAsync(@NotNull Runnable task) {
MinecraftServer.getSchedulerManager().scheduleNextTick(task, ExecutionType.ASYNC);
}

@Override
public void scheduleDelayedAsync(@NotNull Runnable task, int delayTicks) {
MinecraftServer.getSchedulerManager().scheduleTask(
task,
TaskSchedule.tick(delayTicks),
TaskSchedule.stop(),
ExecutionType.ASYNC);
}
}

0 comments on commit b96ffa3

Please sign in to comment.