@@ -13,6 +13,7 @@ val pluginVersion = version.toString()
1313val paper26_1Version = " 26.1.2.build.74-stable"
1414val paper26_2Version = " 26.2.build.56-alpha"
1515val craftEngineVersion = " 26.7.2"
16+ val sparrowHeartVersion = " 0.72"
1617
1718val paper26_2CompileClasspath = configurations.create(" paper26_2CompileClasspath" ) {
1819 isCanBeConsumed = false
@@ -35,6 +36,7 @@ dependencies {
3536 compileOnly(files(" common/lib/LightAPI-fork-3.5.2.jar" ))
3637
3738 implementation(" net.momirealms:sparrow-yaml:1.0.7" )
39+ implementation(" net.momirealms:sparrow-heart:$sparrowHeartVersion " )
3840
3941 testImplementation(platform(" org.junit:junit-bom:5.13.4" ))
4042 testImplementation(" org.junit.jupiter:junit-jupiter" )
@@ -113,7 +115,7 @@ val compilePaper26_2 = tasks.register<JavaCompile>("compilePaper26_2") {
113115}
114116
115117val verifyPaperOnlyArchitecture = tasks.register(" verifyPaperOnlyArchitecture" ) {
116- description = " Rejects reintroduction of NMS, Armor Stands, or legacy compatibility layers."
118+ description = " Rejects direct in-project NMS, Armor Stands, or legacy compatibility layers."
117119 group = LifecycleBasePlugin .VERIFICATION_GROUP
118120 val sources = sourceSets.main.get().allJava
119121 inputs.files(sources)
@@ -194,6 +196,7 @@ tasks.named<ShadowJar>("shadowJar") {
194196 mergeServiceFiles()
195197
196198 relocate(" net.momirealms.sparrow.yaml" , " com.loohp.interactionvisualizer.libs.sparrow.yaml" )
199+ relocate(" net.momirealms.sparrow.heart" , " com.loohp.interactionvisualizer.libs.sparrow.heart" )
197200
198201 isPreserveFileTimestamps = false
199202 isReproducibleFileOrder = true
@@ -208,6 +211,26 @@ tasks.named<ShadowJar>("shadowJar") {
208211 " CraftEngine must remain compileOnly, but provider classes were bundled:\n " +
209212 bundledCraftEngine.joinToString(" \n " )
210213 }
214+ check(jar.getEntry(" com/loohp/interactionvisualizer/libs/sparrow/heart/SparrowHeart.class" ) != null ) {
215+ " The shaded Sparrow Heart runtime is missing"
216+ }
217+ listOf (" r26_1" , " r26_2" ).forEach { adapter ->
218+ check(jar.getEntry(
219+ " com/loohp/interactionvisualizer/libs/sparrow/heart/impl/$adapter /Heart.class" ,
220+ ) != null ) {
221+ " The shaded Sparrow Heart $adapter adapter is missing"
222+ }
223+ }
224+ val unrelocatedHeart = jar.entries().asSequence()
225+ .map { it.name }
226+ .filter { it.startsWith(" net/momirealms/sparrow/heart/" ) }
227+ .toList()
228+ check(unrelocatedHeart.isEmpty()) {
229+ " Unrelocated Sparrow Heart classes were bundled:\n " + unrelocatedHeart.joinToString(" \n " )
230+ }
231+ check(jar.getEntry(" META-INF/licenses/sparrow-heart.txt" ) != null ) {
232+ " The Sparrow Heart MIT license notice is missing"
233+ }
211234 }
212235 }
213236}
0 commit comments