From 8b4c7c0a2cfd730ffb9342fcd6b28065696bd2c3 Mon Sep 17 00:00:00 2001 From: Yeregorix Date: Mon, 21 Oct 2024 21:23:09 +0200 Subject: [PATCH] Update to SpongeAPI 12 --- build.gradle | 21 ++++++++++++++----- .../autopickup/handler/DropHandler.java | 4 ++-- .../resources/META-INF/sponge_plugins.json | 2 +- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 25fb4cd..0227342 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id 'java-library' - id 'io.github.goooler.shadow' version '8.1.7' + id 'com.gradleup.shadow' version '8.3.3' id 'com.diffplug.spotless' version '6.25.0' } @@ -23,16 +23,18 @@ repositories { configurations { spongevanilla spongeforge + spongeneo } dependencies { - api 'org.spongepowered:spongeapi:11.0.0' + api 'org.spongepowered:spongeapi:12.0.0' - implementation 'net.smoofyuniverse:oreupdater:1.3.1' + implementation 'net.smoofyuniverse:oreupdater:1.4.0' implementation 'net.smoofyuniverse:worldmap:1.3.0' - spongevanilla('org.spongepowered:spongevanilla:1.20.6-11.0.0:universal') { transitive = false } - spongeforge('org.spongepowered:spongeforge:1.20.6-50.0.22-11.0.0:universal') { transitive = false } + spongevanilla('org.spongepowered:spongevanilla:1.21.1-12.0.0-RC1856:universal') { transitive = false } + spongeforge('org.spongepowered:spongeforge:1.21.1-52.0.3-12.0.0-RC1856:universal') { transitive = false } + spongeneo('org.spongepowered:spongeneo:1.21.1-21.1.35-12.0.0-RC1856:universal') { transitive = false } } jar { @@ -76,6 +78,15 @@ tasks.register('setupForgeServer', Copy) { from shadowJar } +tasks.register('setupNeoServer', Copy) { + into 'run/neoforge/mods' + + from configurations.spongeneo + rename('spongeneo-(.*).jar', 'spongeneo.jar') + + from shadowJar +} + spotless { ratchetFrom 'origin/master' diff --git a/src/main/java/net/smoofyuniverse/autopickup/handler/DropHandler.java b/src/main/java/net/smoofyuniverse/autopickup/handler/DropHandler.java index b35977b..e5144bd 100644 --- a/src/main/java/net/smoofyuniverse/autopickup/handler/DropHandler.java +++ b/src/main/java/net/smoofyuniverse/autopickup/handler/DropHandler.java @@ -99,8 +99,8 @@ protected void handlePlayer(C config, List orbs, List items if (config.blacklistItems.contains(stack.type())) continue; - List rejectedList = inv.offer(stack.createStack()).rejectedItems(); - ItemStackSnapshot rejected = rejectedList.isEmpty() ? null : rejectedList.get(0); + List rejectedList = inv.offer(stack).rejectedItems(); + ItemStackSnapshot rejected = rejectedList.isEmpty() ? null : rejectedList.getFirst(); if (rejected == null || rejected.isEmpty()) { it.remove(); diff --git a/src/main/resources/META-INF/sponge_plugins.json b/src/main/resources/META-INF/sponge_plugins.json index d4ae3d2..cda00ef 100644 --- a/src/main/resources/META-INF/sponge_plugins.json +++ b/src/main/resources/META-INF/sponge_plugins.json @@ -25,7 +25,7 @@ "dependencies": [ { "id": "spongeapi", - "version": "11.0.0", + "version": "12.0.0", "load-order": "AFTER", "optional": false }