Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement Interaction events with Transactions #3994

Open
wants to merge 234 commits into
base: api-11
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
234 commits
Select commit Hold shift + click to select a range
1c9e761
disable SpongeForge during snapshots
Faithcaio Jun 12, 2024
92040fe
Bump MC to 1.21-pre1
Faithcaio May 29, 2024
541c65c
fix ResourceLocation usage
Faithcaio May 29, 2024
e80ee13
moving MUSIC_DISC to vanilla registry jukebox_playable
Faithcaio May 30, 2024
d43e8e0
fix Keys.PAINTING_VARIANT
Faithcaio May 30, 2024
4919220
fix Keys.ACCELERATION
Faithcaio May 30, 2024
f6208af
fix Keys.IS_SADDLED
Faithcaio May 30, 2024
0aad865
fix Keys.ITEM_STACK_SNAPSHOT jukebox
Faithcaio May 30, 2024
67c5989
fix EquipmentGroups
Faithcaio May 31, 2024
a7744ae
fix enchantment data + tags
Faithcaio May 30, 2024
9df5a39
fix FishingRodItemMixin
Faithcaio Jun 1, 2024
4d5582c
fix attributes
Faithcaio May 31, 2024
82a0232
fix exp
Faithcaio May 31, 2024
aef1bb5
Keys.FOOD_CONVERTS_TO
Faithcaio May 30, 2024
888efb7
fix SpongeWorldManager multiworld check
Faithcaio May 30, 2024
a2abe14
fix client
Faithcaio May 31, 2024
515c245
fix ProjectileUtil
Faithcaio May 31, 2024
648a305
fix LivingEntityMixin
Faithcaio Jun 1, 2024
458d932
Bump MC to 1.21-pre2
Faithcaio Jun 1, 2024
667d99f
fix ServerPlayerMixin_HealthScale
Faithcaio Jun 1, 2024
8f282bb
fix multiworld enabled
Faithcaio Jun 1, 2024
d3e9c3c
fix Hanging entity mixins
Faithcaio Jun 1, 2024
674c816
fix HumanEntity
Faithcaio May 30, 2024
f00ea69
fix shadow$dropAllDeathLoot
Faithcaio Jun 1, 2024
2924a33
fix campfire mixins
Faithcaio Jun 1, 2024
7336cf1
fix DyeColorMixin_API
Faithcaio Jun 1, 2024
c4e0131
fix disconnect
Faithcaio Jun 1, 2024
6451d82
fix EntitySelectorParserMixin_API
Faithcaio Jun 1, 2024
8e13111
JigsawPoolElement waterlogging
Faithcaio Jun 1, 2024
affb9b4
fix client
Faithcaio Jun 1, 2024
f615858
fix custom payload
Faithcaio Jun 1, 2024
912d47d
catch mixin errors in packet handling that would otherwise silently i…
Faithcaio Jun 1, 2024
6d8693b
start fixing chunks
Faithcaio Jun 1, 2024
0b9fcd9
Update chunk generation deadlock fix
aromaa Jun 1, 2024
4bcd2f2
update Painting generator
Faithcaio Jun 1, 2024
225ffe6
MC 1.21 Entities
Faithcaio Jun 1, 2024
b2cb897
Bump MC to 1.21-pre3
Faithcaio Jun 5, 2024
5f513bd
fix chunk events
Faithcaio Jun 1, 2024
1bae845
Attack/DamageEntityEvent Rework
Faithcaio May 31, 2024
17be50e
Bump MC to 1.21-pre4
Faithcaio Jun 7, 2024
0ca8af4
fix PrimedTntMixin
Faithcaio Jun 7, 2024
1e4b87b
fix WorldGenRegionMixin_API
Faithcaio Jun 7, 2024
7d48574
portals & dimension changing
Faithcaio May 30, 2024
45e8429
fix recipes and inventory + implement RecipeInputs
Faithcaio May 30, 2024
cbafec8
Keys for auto spin attacks
Faithcaio May 30, 2024
f5e9261
arrow custom knockback
Faithcaio May 30, 2024
f1b9b62
Bump MC to 1.21-rc1
Faithcaio Jun 10, 2024
65ea727
Bump MC to 1.21
Faithcaio Jun 13, 2024
93f63db
fix Enchantments loading later
Faithcaio Jun 13, 2024
de14abf
TrialSpawner and Crafter
Faithcaio Jun 14, 2024
b7f625b
fix advancements and datapack folder
Faithcaio Jun 14, 2024
25db291
Cache block palette results in few hot paths
aromaa Jun 15, 2024
9e2531f
Fire rotation event on respawn
aromaa Jun 15, 2024
f58b22c
fix custom data changes affecting itemstack copy
Faithcaio Jun 16, 2024
7398cec
fix new worlds not respecting custom seed
Faithcaio Jun 16, 2024
58e8b5f
ArtType datapack
Faithcaio Jun 15, 2024
23ccb16
fix attack NPE
Faithcaio Jun 16, 2024
71a5c90
fix recipe advancements
Faithcaio Jun 16, 2024
1d8a791
fix shapeless recipe matching
Faithcaio Jun 16, 2024
e6baede
fix attack NPE
Faithcaio Jun 16, 2024
4d90ce5
fix custom data
Faithcaio Jun 16, 2024
d9349c5
fix merchantoffer second item
Faithcaio Jun 16, 2024
8f577b7
massive performance improvements
Faithcaio Jun 19, 2024
5215e26
fix damage cancellation
Faithcaio Jun 21, 2024
d3b24c0
improve chunk-position stream performance by making one big read inst…
Faithcaio Jun 20, 2024
b62df09
fix Bogged
Faithcaio Jun 21, 2024
5dcbff9
Add Difficulties generator (#4034)
ImMorpheus Jun 22, 2024
efadd96
Add ItemTiers generator (#4037)
ImMorpheus Jun 22, 2024
4b669ef
Add PandaGenes generator (#4038)
ImMorpheus Jun 22, 2024
de6c171
Add SpellTypes generator (#4041)
ImMorpheus Jun 22, 2024
94b8a77
Add MooshroomTypes generator (#4035)
ImMorpheus Jun 22, 2024
5b05543
Readd StatisticCategories generator (#4036)
ImMorpheus Jun 22, 2024
156c3ab
Add EquipmentGroups generator (#4046)
ImMorpheus Jun 22, 2024
b516450
Add ParrotTypes generator (#4039)
ImMorpheus Jun 22, 2024
491b54e
Update blockstate property and blockstate propery keys generators (#4…
ImMorpheus Jun 22, 2024
7f4952f
Sort generated fields by name and guard against invalid field names (…
ImMorpheus Jun 22, 2024
5a8e348
Add SculkSensorStates generator (#4047)
ImMorpheus Jun 22, 2024
28a643e
Add MusicDics generator (#4044)
ImMorpheus Jun 22, 2024
6096b2a
Add MapDecorationType generator (#4043)
ImMorpheus Jun 22, 2024
fb9a737
Add RabbitTypes generator (#4040)
ImMorpheus Jun 22, 2024
c1cc31f
Fix windcharge and Armadillo mixins (#4042)
ImMorpheus Jun 22, 2024
fd74cc4
fix DataDeserializer for numbers
Faithcaio Jun 22, 2024
b9194b5
Keep old name for musicdics registry
ImMorpheus Jun 22, 2024
ad2f6ec
server scope MUSIC_DISC
Faithcaio Jun 22, 2024
81ab80a
Add registrytest testplugin (#4049)
ImMorpheus Jun 22, 2024
c075da9
Add DripstoneSegments generator (#4053)
ImMorpheus Jun 23, 2024
e1fd53b
Add Tilts generator (#4052)
ImMorpheus Jun 23, 2024
ff52718
Add TrialSpawnerStates generator (#4051)
ImMorpheus Jun 23, 2024
4cbf122
Add PushReactions generator (#4050)
ImMorpheus Jun 23, 2024
41b91d4
fix particles
MrHell228 Jun 13, 2024
10011f9
Implement PositionSource
MrHell228 Jun 13, 2024
f0d9a82
spotlessApply
MrHell228 Jun 17, 2024
ae6f6c9
fix written book
MrHell228 Jun 11, 2024
601a270
fix Viewer#sendWorldType()
MrHell228 Jun 11, 2024
adc357d
Implement Viewer#sendBlockProgress
MrHell228 Jun 2, 2024
7c1c033
Add DisplaySlots generator (#4055)
ImMorpheus Jun 23, 2024
14c61c0
Use serialized name if available (#4057)
ImMorpheus Jun 23, 2024
439013b
Log a warning if enum validator is not using serialized name when pos…
ImMorpheus Jun 23, 2024
d44a497
Log an error in registrytest if catalog class is not final (#4059)
ImMorpheus Jun 23, 2024
9fd5497
Log an error in registrytest if catalog class has non private constru…
ImMorpheus Jun 23, 2024
1a76feb
Add EquipmentTypes generator (#4056)
ImMorpheus Jun 24, 2024
8032431
Remove hardcoded fields from VanillaRegistryLoader (#4061)
ImMorpheus Jun 25, 2024
2e4303a
Bump SpongeAPI (#4063)
ImMorpheus Jun 25, 2024
310dfd4
Implement ForwardingViewer
MrHell228 Jun 23, 2024
1fb0554
Bump SpongeAPI
ImMorpheus Jun 27, 2024
3a7fdd7
Add VehicleEntityMixin_API
ImMorpheus Jun 27, 2024
4675270
Add missing GlowItemFrameMixin_API
ImMorpheus Jun 27, 2024
2184091
Add missing GlowSquidMixin_API
ImMorpheus Jun 27, 2024
1cfbd5c
Add missing GoatMixin_API
ImMorpheus Jun 27, 2024
f71d0ea
Add missing StriderMixin_API
ImMorpheus Jun 27, 2024
6d2debc
Add missing AxolotlMixin_API
ImMorpheus Jun 27, 2024
3e1d96b
Rename RegistryTest to ValidationTest and add checkentities command
ImMorpheus Jun 27, 2024
ec84c31
Fix: Resources incorrectly listed for plugin packs (#4069)
pandier Jun 28, 2024
fd3d111
Implement Keys.TELEPORT_DURATION
DrZoddiak May 31, 2024
83ce551
Add missing AbstractPiglinMixin_API
ImMorpheus Jun 28, 2024
4e0a38b
Implement ServerWorld#saveAndFlush
Lignium Jan 21, 2023
013ae88
Add missing api mixins and update keys references (#4074)
ImMorpheus Jun 29, 2024
f597bfa
actually prevent DestructEntityEventDeath
Faithcaio Jun 30, 2024
00b6255
fix HarvestEntityEvent for ArmorStand
Faithcaio Jun 30, 2024
ca79b30
fix attack mixin final damage
Faithcaio Jun 30, 2024
d2eb9d2
Bump SpongeAPI for entity changes (#4075)
ImMorpheus Jun 30, 2024
268c7f3
Fixes to channels
aromaa Jul 2, 2024
a80c323
fix EnderDragon#bossBar()
MrHell228 Jul 2, 2024
5367431
Add ServerWorld#dragonFightBossBar()
MrHell228 Jul 2, 2024
93437a7
fix ItemStackComparator
Faithcaio Jul 6, 2024
df5aa79
fix empty CONTAINER component breaking comparators
Faithcaio Jul 6, 2024
0c7dcdd
fix AdventureComponents breaking ItemStack equality
Faithcaio Jul 6, 2024
0740f11
fix build
Faithcaio Jul 6, 2024
37444ac
actually fix build
Faithcaio Jul 6, 2024
09d27d3
bump API
Faithcaio Jul 6, 2024
63acd58
Bump SpongeAPI and update mixins (#4081)
ImMorpheus Jul 6, 2024
17a8710
Bump SpongeAPI (#4082)
ImMorpheus Jul 6, 2024
59d7fd5
Implement Attribute#removeModifier(ResourceKey) (#4076)
avaruus1 Jul 7, 2024
7065851
Add missing EnemyMixin_API (#4083)
ImMorpheus Jul 7, 2024
95bccf4
Add missing FlyingAnimalMixin_API (#4084)
ImMorpheus Jul 7, 2024
971ae89
Implement BossBarViewer & BossBar#viewers()
MrHell228 Jul 5, 2024
13a444e
Remove manual update of bossbars locale
MrHell228 Jul 5, 2024
f2ca53f
Add missing ItemSupplierMixin_API (#4085)
ImMorpheus Jul 7, 2024
b3c4868
wrap null ContainerType
Faithcaio Jul 7, 2024
1cffbd1
Bump SpongeAPI and update mixins (#4086)
ImMorpheus Jul 7, 2024
6f5cc47
Update validationtest plugin (#4087)
ImMorpheus Jul 7, 2024
9f0b870
unwrap enchantment holder
Faithcaio Jul 10, 2024
2324080
DataFix entity nbt when spawning from DataContainer
Faithcaio Jul 12, 2024
90cca88
Fix Keys.ABSORPTION remove operation (#4089)
ImMorpheus Jul 12, 2024
c5bbe2d
Support Keys.LEASH_HOLDER for all Leashable entities and fix remove (…
ImMorpheus Jul 12, 2024
22d37d4
Fix Keys.FROZEN_TIME remove operation (#4094)
ImMorpheus Jul 12, 2024
911a12a
Fix Keys.PASSENGERS remove operation (#4093)
ImMorpheus Jul 12, 2024
8f7720b
Fix Keys.INVULNERABILITY_TICKS remove operation (#4091)
ImMorpheus Jul 12, 2024
1e8c4d4
fix build
Faithcaio Jul 12, 2024
6379fcc
Fix Keys.SCOREBOARD_TAGS remove operation (#4098)
ImMorpheus Jul 12, 2024
1b0d092
Fix Keys.VELOCITY remove operation (#4097)
ImMorpheus Jul 12, 2024
4030d70
Fix Keys.TRANSIENT remove operation (#4095)
ImMorpheus Jul 12, 2024
b702266
Fix Keys.STUCK_ARROWS remove operation (#4099)
ImMorpheus Jul 12, 2024
166b312
Fix Keys.POTION_EFFECTS remove operation (#4096)
ImMorpheus Jul 12, 2024
8cc9878
Fix Keys.INVULNERABLE remove operation (#4101)
ImMorpheus Jul 12, 2024
ea6b9a4
Implement Keys.AUTO_SPIN_ATTACK_TICKS for Living (#4088)
ImMorpheus Jul 12, 2024
dbde307
remove Raid#setBossBar()
MrHell228 Jul 2, 2024
695b934
Guard against null elements in cached valueconstructors (#4102)
ImMorpheus Jul 12, 2024
3368919
register updaters for ItemStack/ItemStackSnapshot, fix wrappedContent…
Faithcaio Jul 12, 2024
5edf409
Update PlayerListMixin.java
SawFowl Jul 12, 2024
093d90c
Fix block entity archetype querying
aromaa Jul 14, 2024
2339fa6
Clear block drop effect after capturing is done
aromaa Jul 18, 2024
723603e
Move onSend mixin to other overload
aromaa Jul 18, 2024
f25cc69
Fixes to damage injections
aromaa Jul 20, 2024
2901a2b
chore: merge api-11 fixes and updates
gabizou Jul 23, 2024
6411814
Update to MC 1.21.1 (#4118)
ImMorpheus Aug 12, 2024
8750428
viewer fix (#4112)
MrHell228 Aug 12, 2024
6627ee2
Fix client crash with portals (#4110)
MrHell228 Aug 12, 2024
c1a976f
Support MAX_STACK_SIZE for ItemStack (#4121)
avaruus1 Aug 23, 2024
b76fa66
Revert "disable SpongeForge during snapshots"
Faithcaio Jun 13, 2024
16e74e4
Update SpongeForge to MC 1.21
Yeregorix Jun 13, 2024
a093a2a
fix: update Forge implementation of Player.attack
gabizou Jun 17, 2024
6b09c69
chore: clean up unused hooks for vanilla attack implementation
gabizou Jun 17, 2024
d44f62d
chore(deps): update forge pointer
gabizou Jun 23, 2024
0bfd061
fix: re-merge attack implementation
gabizou Jun 24, 2024
44fb9ed
fix: forge altered a small injection point for attack implementation
gabizou Jun 24, 2024
b23af9f
fix: forge uses mojang named classes again
gabizou Jun 24, 2024
5e4edc4
chore: update Attack implementation mixin
gabizou Jul 15, 2024
4fddf8a
Fix wolf cast attack injection
Yeregorix Aug 11, 2024
b0430ad
Update Forge to 52.0.3
Yeregorix Aug 13, 2024
60bc74e
Fix broken injections due to LVT changes
Yeregorix Aug 23, 2024
777f7dc
Merge branch 'api-11' into api-12
Yeregorix Aug 24, 2024
2d52f70
Fix SOE with DamageEntityEvent
aromaa Aug 25, 2024
79abad4
Implement ItemStackLike
MrHell228 Aug 12, 2024
59c0dfc
replace: createStack() -> asMutable() & createSnapshot() -> asImmutab…
MrHell228 Aug 12, 2024
21e6301
Merge branch 'api-12' into api-12-itemstacklike
MrHell228 Sep 10, 2024
eff3d93
Update verification-metadata.xml
MrHell228 Sep 10, 2024
858d535
Don't fire damage event for invulnerability ticks
aromaa Sep 12, 2024
345aa1d
Bump API
MrHell228 Sep 13, 2024
108b6c4
Pin VanillaGradle versio
aromaa Sep 13, 2024
8bcb310
Move attack impl modifyDamageTaken after lastHurt
aromaa Sep 13, 2024
114d058
Migrate recipes to ItemStackLike
MrHell228 Sep 14, 2024
6e636e0
Migrate enchantments and trade offers
MrHell228 Sep 14, 2024
5694e1a
Migrate Equipable
MrHell228 Sep 15, 2024
bd919dd
Migrate item transactions
MrHell228 Sep 15, 2024
610ef28
Migrate slots
MrHell228 Sep 15, 2024
67f317f
Migrate inventory.type package
MrHell228 Sep 15, 2024
3fbcd80
finalize migrating item package
MrHell228 Sep 15, 2024
56369c2
Migrate different stuff
MrHell228 Sep 16, 2024
935ef9b
WIP Update ModLauncher on SpongeVanilla
Yeregorix Jun 13, 2024
b151dfc
Boot vanilla dev environment on modern ModLauncher
Yeregorix Aug 26, 2024
3ad082e
Transform listener classes in vanilla
Yeregorix Aug 27, 2024
ab66bf1
Move environment resource locator to plugin-spi
Yeregorix Aug 28, 2024
b7d95d0
Make TestEventManager compile
Yeregorix Aug 28, 2024
ffa8f6f
Use a proper setter to define blackboard keys
Yeregorix Aug 28, 2024
a390196
Update verification metadata
Yeregorix Aug 29, 2024
3dd7f98
Vanilla production jar on modern ModLauncher
Yeregorix Aug 31, 2024
7262cde
Exclude versioned module-info in shadow jars
Yeregorix Sep 1, 2024
d46e125
Workaround to support dash in plugin ids. Add a deprecation warning.
Yeregorix Sep 1, 2024
ba72fb7
Update verification metadata
Yeregorix Sep 1, 2024
a2bc234
Fix compatibility with SpongeGradle
Yeregorix Sep 1, 2024
08cd053
Remove most generics in services and candidates
Yeregorix Sep 2, 2024
a22f53a
Cleanup buildscripts
Yeregorix Sep 2, 2024
1e8c366
Update plugin-spi to 0.4.0
Yeregorix Sep 19, 2024
98392d9
Bump SpongeAPI
Yeregorix Sep 19, 2024
c233dac
Fix missing LWJGL natives in SV client
Yeregorix Sep 22, 2024
7ac46ab
fix stored enchantments applying only to enchanted book
MrHell228 Sep 22, 2024
9252b6f
Optimize ChangeBlockEvent.All transaction building
aromaa Sep 22, 2024
8b4cf4e
Optimize ChangeBlockEvent.Post transaction building
aromaa Sep 22, 2024
7fc0c47
Switch to volume stream application phase on forEach & applyUntil
aromaa Sep 22, 2024
a1bd4c4
Disable VolumeTransformationTest
aromaa Sep 23, 2024
1043e51
chore: re-add forge item enchantment check
gabizou Sep 23, 2024
9757058
feat: merge stored enchantment removing restrictions
gabizou Sep 23, 2024
34aba64
Fix launch when jar path contains spaces
Yeregorix Sep 23, 2024
cf68907
Bump SpongeAPI
Yeregorix Sep 26, 2024
02f45e8
Ignore PrepareBlockDropsTransaction when generating ChangeBlockEvent.All
aromaa Sep 27, 2024
4c9fda0
Merge remote-tracking branch 'origin/api-11' into api-12
aromaa Sep 28, 2024
49414fa
chore: merge ItemStackLike
gabizou Sep 28, 2024
47a830a
chore: merge earlier api additions
gabizou Sep 28, 2024
1923c3f
Merge remote-tracking branch 'origin/api-11' into api-12
aromaa Sep 29, 2024
ffa5ec1
!feat: Refactor Interactions to use Transactions
gabizou Apr 21, 2024
70e5d9a
feat: Add other interactions as pipeline transactions
gabizou May 6, 2024
49ac418
wip: update to the new event generator
gabizou Sep 30, 2024
2c2dcff
chore: update api dependency
gabizou Oct 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 5 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ insert_final_newline = false
max_line_length = 120
tab_width = 4

[*mixins*.json]
indent_size = 4
[{*.json,*.jsonc,*.png.mcmeta,mcmod.info,pack.mcmeta}]
indent_size = 2

[*mixins.*.json]
indent_size = 4
2 changes: 1 addition & 1 deletion SpongeAPI
Submodule SpongeAPI updated 328 files
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void copyModulesExcludingProvided(final Configuration source, final Confi

final String providedVersion = providedModuleVersions.get(module);
if (providedVersion == null) {
ModuleDependency dep = (ModuleDependency) deps.create(id.getDisplayName());
ModuleDependency dep = (ModuleDependency) deps.create(module.getGroup() + ":" + module.getName() + ":" + version);
dep.setTransitive(false);
target.getDependencies().add(dep);
} else if (!providedVersion.equals(version)) {
Expand Down
153 changes: 92 additions & 61 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ val apiVersion: String by project
val apiJavaTarget: String by project
val minecraftVersion: String by project
val recommendedVersion: String by project
val organization: String by project
val projectUrl: String by project

val commonManifest = java.manifest {
attributes(
Expand All @@ -34,48 +36,9 @@ val commonManifest = java.manifest {
System.getenv()["GIT_BRANCH"]?.apply { attributes("Git-Branch" to this) }
}

tasks {
jar {
manifest.from(commonManifest)
}
val mixinsJar by registering(Jar::class) {
archiveClassifier.set("mixins")
manifest.from(commonManifest)
from(mixins.map { it.output })
}
val accessorsJar by registering(Jar::class) {
archiveClassifier.set("accessors")
manifest.from(commonManifest)
from(accessors.map { it.output })
}
val launchJar by registering(Jar::class) {
archiveClassifier.set("launch")
manifest.from(commonManifest)
from(launch.map { it.output })
}
val applaunchJar by registering(Jar::class) {
archiveClassifier.set("applaunch")
manifest.from(commonManifest)
from(applaunch.map { it.output })
}

test {
useJUnitPlatform()
}

check {
dependsOn(gradle.includedBuild("SpongeAPI").task(":check"))
}

prepareWorkspace {
dependsOn(gradle.includedBuild("SpongeAPI").task(":genEventImpl"))
}

}

version = spongeImpl.generateImplementationVersionString(apiVersion, minecraftVersion, recommendedVersion)

// Configurations
// SpongeCommon configurations
val applaunchConfig by configurations.register("applaunch")

val launchConfig by configurations.register("launch") {
Expand All @@ -90,35 +53,28 @@ val mixinsConfig by configurations.register("mixins") {
extendsFrom(launchConfig)
}

// create the sourcesets
// SpongeCommon source sets
val main by sourceSets

val applaunch by sourceSets.registering {
spongeImpl.applyNamedDependencyOnOutput(project, this, main, project, main.implementationConfigurationName)
project.dependencies {
mixinsConfig(this@registering.output)
}

configurations.named(implementationConfigurationName) {
extendsFrom(applaunchConfig)
}
}
val launch by sourceSets.registering {
spongeImpl.applyNamedDependencyOnOutput(project, applaunch.get(), this, project, this.implementationConfigurationName)
project.dependencies {
mixinsConfig(this@registering.output)
}
project.dependencies {
implementation(this@registering.output)
}
spongeImpl.applyNamedDependencyOnOutput(project, this, main, project, main.implementationConfigurationName)

configurations.named(implementationConfigurationName) {
extendsFrom(launchConfig)
}
}

val accessors by sourceSets.registering {
spongeImpl.applyNamedDependencyOnOutput(project, launch.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, this, main, project, main.implementationConfigurationName)

configurations.named(implementationConfigurationName) {
extendsFrom(accessorsConfig)
}
Expand All @@ -128,6 +84,7 @@ val mixins by sourceSets.registering {
spongeImpl.applyNamedDependencyOnOutput(project, applaunch.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, accessors.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, main, this, project, this.implementationConfigurationName)

configurations.named(implementationConfigurationName) {
extendsFrom(mixinsConfig)
}
Expand Down Expand Up @@ -199,7 +156,6 @@ dependencies {
applaunchConfig(libs.log4j.core)
applaunchConfig(libs.log4j.jpl)

mixinsConfig(sourceSets.main.map { it.output })
add(mixins.get().implementationConfigurationName, "org.spongepowered:spongeapi:$apiVersion")

// Tests
Expand All @@ -215,8 +171,6 @@ dependencies {
}
}

val organization: String by project
val projectUrl: String by project
indraSpotlessLicenser {
licenseHeaderFile(rootProject.file("HEADER.txt"))

Expand All @@ -229,7 +183,6 @@ idea {
if (project != null) {
(project as ExtensionAware).extensions["settings"].run {
(this as ExtensionAware).extensions.getByType(org.jetbrains.gradle.ext.TaskTriggersConfig::class).run {
afterSync(":modlauncher-patcher:build")
afterSync(":modlauncher-transformers:build")
}
}
Expand Down Expand Up @@ -365,6 +318,38 @@ allprojects {
}
}

tasks.register("printConfigsHierarchy") {
group = "debug"
doLast {
configurations.forEach { conf: Configuration ->
val seen = mutableSetOf<Configuration>()
println("Parents of ${conf.name}:")
printParents(conf, "", seen)
}
}
}

tasks.register("printConfigsResolution") {
group = "debug"
doLast {
configurations.forEach { conf: Configuration ->
println()
println("Artifacts of ${conf.name}:")
if (conf.isCanBeResolved) {
try {
conf.forEach {
println(it)
}
} catch (e: Exception) {
println("error")
}
} else {
println("not resolved")
}
}
}
}

afterEvaluate {
publishing {
repositories {
Expand Down Expand Up @@ -395,34 +380,80 @@ allprojects {
}
}

fun printParents(conf: Configuration, indent: String, seen: MutableSet<Configuration>) {
for (parent in conf.extendsFrom) {
if (parent in seen) {
continue
}
seen.add(parent)
println("$indent - ${parent.name}")
printParents(parent, indent + " ", seen)
}
}

tasks {
jar {
manifest.from(commonManifest)
}
val mixinsJar by registering(Jar::class) {
archiveClassifier.set("mixins")
manifest.from(commonManifest)
from(mixins.map { it.output })
}
val accessorsJar by registering(Jar::class) {
archiveClassifier.set("accessors")
manifest.from(commonManifest)
from(accessors.map { it.output })
}
val launchJar by registering(Jar::class) {
archiveClassifier.set("launch")
manifest.from(commonManifest)
from(launch.map { it.output })
}
val applaunchJar by registering(Jar::class) {
archiveClassifier.set("applaunch")
manifest.from(commonManifest)
from(applaunch.map { it.output })
}

val jar by existing
val sourcesJar by existing
val mixinsJar by existing
val accessorsJar by existing
val launchJar by existing
val applaunchJar by existing

shadowJar {
mergeServiceFiles()
archiveClassifier.set("dev")

manifest {
attributes(mapOf(
"Access-Widener" to "common.accesswidener",
"Multi-Release" to true
"Access-Widener" to "common.accesswidener",
"Multi-Release" to true
))
from(commonManifest)
}

from(jar)
from(sourcesJar)
from(mixinsJar)
from(accessorsJar)
from(launchJar)
from(applaunchJar)

dependencies {
include(project(":"))
}
}

test {
useJUnitPlatform()
}

check {
dependsOn(gradle.includedBuild("SpongeAPI").task(":check"))
}

prepareWorkspace {
dependsOn(gradle.includedBuild("SpongeAPI").task(":genEventImpl"))
}
}

publishing {
Expand Down
Loading
Loading