Skip to content

Commit

Permalink
Update to SpongeAPI 12
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeregorix committed Oct 21, 2024
1 parent ff959d2 commit 8b4c7c0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
21 changes: 16 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}

Expand All @@ -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 {
Expand Down Expand Up @@ -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'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ protected void handlePlayer(C config, List<ExperienceOrb> orbs, List<Item> items
if (config.blacklistItems.contains(stack.type()))
continue;

List<ItemStackSnapshot> rejectedList = inv.offer(stack.createStack()).rejectedItems();
ItemStackSnapshot rejected = rejectedList.isEmpty() ? null : rejectedList.get(0);
List<ItemStackSnapshot> rejectedList = inv.offer(stack).rejectedItems();
ItemStackSnapshot rejected = rejectedList.isEmpty() ? null : rejectedList.getFirst();

if (rejected == null || rejected.isEmpty()) {
it.remove();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/sponge_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dependencies": [
{
"id": "spongeapi",
"version": "11.0.0",
"version": "12.0.0",
"load-order": "AFTER",
"optional": false
}
Expand Down

0 comments on commit 8b4c7c0

Please sign in to comment.