├── .githooks ├── setupHooks.sh └── pre-commit ├── cardinal-components-base ├── build.gradle.kts ├── src │ ├── main │ │ ├── resources │ │ │ ├── assets │ │ │ │ └── cardinal-components-base │ │ │ │ │ └── icon.png │ │ │ ├── mixins.cardinal_components_base.json │ │ │ └── fabric.mod.json │ │ └── java │ │ │ └── org │ │ │ └── ladysnake │ │ │ └── cca │ │ │ ├── internal │ │ │ └── base │ │ │ │ ├── ComponentRegistrationInitializer.java │ │ │ │ ├── UnknownComponentException.java │ │ │ │ ├── package-info.java │ │ │ │ └── asm │ │ │ │ ├── package-info.java │ │ │ │ ├── CalledByAsm.java │ │ │ │ ├── StaticComponentLoadingException.java │ │ │ │ └── AsmGeneratedCallback.java │ │ │ ├── api │ │ │ └── v3 │ │ │ │ ├── util │ │ │ │ ├── package-info.java │ │ │ │ └── CheckEnvironment.java │ │ │ │ └── component │ │ │ │ ├── package-info.java │ │ │ │ ├── load │ │ │ │ └── package-info.java │ │ │ │ ├── sync │ │ │ │ ├── ComponentPacketWriter.java │ │ │ │ ├── C2SComponentPacketWriter.java │ │ │ │ └── PlayerSyncPredicate.java │ │ │ │ ├── ComponentV3.java │ │ │ │ ├── ComponentFactory.java │ │ │ │ ├── tick │ │ │ │ └── ServerTickingComponent.java │ │ │ │ └── TransientComponent.java │ │ │ └── mixin │ │ │ └── base │ │ │ └── NbtReadViewAccessor.java │ └── testmod │ │ ├── resources │ │ ├── mixins.cardinal_components_base_test.json │ │ └── fabric.mod.json │ │ └── java │ │ └── org │ │ └── ladysnake │ │ └── cca │ │ ├── test │ │ └── base │ │ │ ├── EmptyVita.java │ │ │ ├── SyncedVita.java │ │ │ └── Vita.java │ │ └── internal │ │ └── base │ │ └── CcaTesting.java └── changelog.md ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── src ├── testmod │ ├── resources │ │ ├── pack.mcmeta │ │ ├── assets │ │ │ └── componenttest │ │ │ │ ├── blockstates │ │ │ │ └── vita_condenser.json │ │ │ │ ├── models │ │ │ │ ├── block │ │ │ │ │ └── vita_condenser.json │ │ │ │ └── item │ │ │ │ │ └── vita_stick.json │ │ │ │ └── lang │ │ │ │ ├── en_us.json │ │ │ │ └── es_ar.json │ │ └── fabric.mod.json │ └── java │ │ └── org │ │ └── ladysnake │ │ └── componenttest │ │ └── content │ │ ├── package-info.java │ │ ├── vita │ │ └── package-info.java │ │ └── CCATestClient.java └── main │ └── resources │ ├── assets │ └── cardinal-components │ │ └── icon.png │ └── fabric.mod.json ├── cardinal-components-item ├── src │ └── main │ │ ├── resources │ │ ├── cardinal-components-item.accesswidener │ │ ├── assets │ │ │ └── cardinal-components-item │ │ │ │ └── icon.png │ │ ├── mixins.cardinal_components_item.json │ │ └── fabric.mod.json │ │ └── java │ │ └── org │ │ └── ladysnake │ │ └── cca │ │ ├── api │ │ └── v3 │ │ │ └── item │ │ │ └── package-info.java │ │ ├── internal │ │ └── item │ │ │ └── package-info.java │ │ └── mixin │ │ └── item │ │ └── common │ │ ├── package-info.java │ │ └── MixinItemStackComponentizationFix.java ├── changelog.md └── build.gradle.kts ├── cardinal-components-block ├── src │ ├── main │ │ ├── resources │ │ │ ├── assets │ │ │ │ └── cardinal-components-block │ │ │ │ │ └── icon.png │ │ │ ├── mixins.cardinal_components_block.json │ │ │ └── fabric.mod.json │ │ └── java │ │ │ └── org │ │ │ └── ladysnake │ │ │ └── cca │ │ │ ├── api │ │ │ └── v3 │ │ │ │ └── block │ │ │ │ ├── package-info.java │ │ │ │ ├── BlockEntitySyncAroundCallback.java │ │ │ │ └── BlockEntitySyncCallback.java │ │ │ ├── internal │ │ │ └── block │ │ │ │ └── package-info.java │ │ │ └── mixin │ │ │ └── block │ │ │ └── common │ │ │ ├── package-info.java │ │ │ └── MixinChunkHolder.java │ └── testmod │ │ ├── resources │ │ └── fabric.mod.json │ │ └── java │ │ └── org │ │ └── ladysnake │ │ └── cca │ │ └── test │ │ └── block │ │ └── package-info.java ├── changelog.md └── build.gradle ├── cardinal-components-chunk ├── src │ ├── main │ │ ├── resources │ │ │ ├── assets │ │ │ │ └── cardinal-components-chunk │ │ │ │ │ └── icon.png │ │ │ ├── mixins.cardinal_components_chunk.json │ │ │ └── fabric.mod.json │ │ └── java │ │ │ └── org │ │ │ └── ladysnake │ │ │ └── cca │ │ │ ├── api │ │ │ └── v3 │ │ │ │ └── chunk │ │ │ │ ├── package-info.java │ │ │ │ └── ChunkSyncCallback.java │ │ │ ├── internal │ │ │ └── chunk │ │ │ │ └── package-info.java │ │ │ └── mixin │ │ │ └── chunk │ │ │ └── common │ │ │ ├── package-info.java │ │ │ ├── MixinServerWorld.java │ │ │ ├── MixinWrapperProtoChunk.java │ │ │ └── MixinEmptyChunk.java │ └── testmod │ │ ├── resources │ │ └── fabric.mod.json │ │ └── java │ │ └── org │ │ └── ladysnake │ │ └── cca │ │ └── test │ │ └── chunk │ │ ├── ChunkVita.java │ │ └── CcaChunkTestMod.java ├── changelog.md └── build.gradle ├── cardinal-components-level ├── src │ ├── main │ │ ├── resources │ │ │ ├── assets │ │ │ │ └── cardinal-components-level │ │ │ │ │ └── icon.png │ │ │ ├── mixins.cardinal_components_level.json │ │ │ └── fabric.mod.json │ │ └── java │ │ │ └── org │ │ │ └── ladysnake │ │ │ └── cca │ │ │ ├── internal │ │ │ └── level │ │ │ │ ├── package-info.java │ │ │ │ └── CcaLevelClient.java │ │ │ ├── mixin │ │ │ └── level │ │ │ │ ├── client │ │ │ │ └── package-info.java │ │ │ │ └── common │ │ │ │ ├── package-info.java │ │ │ │ ├── MixinWorldProperties.java │ │ │ │ ├── MixinMinecraftServer.java │ │ │ │ └── MixinUnmodifiableLevelProperties.java │ │ │ └── api │ │ │ └── v3 │ │ │ └── level │ │ │ └── package-info.java │ └── testmod │ │ ├── resources │ │ └── fabric.mod.json │ │ └── java │ │ └── org │ │ └── ladysnake │ │ └── cca │ │ └── test │ │ └── level │ │ ├── LevelVita.java │ │ ├── CcaLevelTestMod.java │ │ └── CcaLevelTestSuite.java ├── changelog.md └── build.gradle ├── cardinal-components-world ├── src │ ├── main │ │ ├── resources │ │ │ ├── assets │ │ │ │ └── cardinal-components-world │ │ │ │ │ └── icon.png │ │ │ ├── mixins.cardinal_components_world.json │ │ │ └── fabric.mod.json │ │ └── java │ │ │ └── org │ │ │ └── ladysnake │ │ │ └── cca │ │ │ ├── api │ │ │ └── v3 │ │ │ │ └── world │ │ │ │ ├── package-info.java │ │ │ │ ├── WorldComponentInitializer.java │ │ │ │ └── WorldSyncCallback.java │ │ │ ├── internal │ │ │ └── world │ │ │ │ ├── package-info.java │ │ │ │ └── CcaWorldClient.java │ │ │ └── mixin │ │ │ └── world │ │ │ ├── common │ │ │ ├── package-info.java │ │ │ └── MixinPlayerManager.java │ │ │ └── client │ │ │ └── MixinClientWorld.java │ └── testmod │ │ ├── resources │ │ └── fabric.mod.json │ │ └── java │ │ └── org │ │ └── ladysnake │ │ └── cca │ │ └── test │ │ └── world │ │ └── NetherVita.java ├── changelog.md └── build.gradle.kts ├── cardinal-components-entity ├── src │ ├── main │ │ ├── resources │ │ │ ├── assets │ │ │ │ └── cardinal-components-entity │ │ │ │ │ └── icon.png │ │ │ ├── mixins.cardinal_components_entity.json │ │ │ └── fabric.mod.json │ │ └── java │ │ │ └── org │ │ │ └── ladysnake │ │ │ └── cca │ │ │ ├── api │ │ │ └── v3 │ │ │ │ └── entity │ │ │ │ ├── package-info.java │ │ │ │ ├── TrackingStartCallback.java │ │ │ │ └── PlayerSyncCallback.java │ │ │ ├── internal │ │ │ └── entity │ │ │ │ ├── SwitchablePlayerEntity.java │ │ │ │ └── package-info.java │ │ │ └── mixin │ │ │ └── entity │ │ │ └── common │ │ │ ├── package-info.java │ │ │ └── MixinServerPlayerEntity.java │ └── testmod │ │ ├── resources │ │ └── fabric.mod.json │ │ └── java │ │ └── org │ │ └── ladysnake │ │ └── cca │ │ └── test │ │ └── entity │ │ ├── package-info.java │ │ └── CcaEntityTestClient.java ├── changelog.md └── build.gradle.kts ├── cardinal-components-scoreboard ├── src │ ├── main │ │ ├── resources │ │ │ ├── assets │ │ │ │ └── cardinal-components-scoreboard │ │ │ │ │ └── icon.png │ │ │ ├── mixins.cardinal_components_scoreboard.json │ │ │ └── fabric.mod.json │ │ └── java │ │ │ └── org │ │ │ └── ladysnake │ │ │ └── cca │ │ │ ├── api │ │ │ └── v3 │ │ │ │ └── scoreboard │ │ │ │ ├── package-info.java │ │ │ │ ├── TeamAddCallback.java │ │ │ │ └── ScoreboardSyncCallback.java │ │ │ ├── internal │ │ │ └── scoreboard │ │ │ │ ├── CcaPackedState.java │ │ │ │ ├── package-info.java │ │ │ │ ├── ScoreboardComponentContainerFactory.java │ │ │ │ └── TeamComponentContainerFactory.java │ │ │ └── mixin │ │ │ └── scoreboard │ │ │ ├── package-info.java │ │ │ ├── TeamAccessor.java │ │ │ ├── ServerScoreboardAccessor.java │ │ │ ├── MixinPersistentState.java │ │ │ └── MixinPlayerManager.java │ └── testmod │ │ ├── resources │ │ └── fabric.mod.json │ │ └── java │ │ └── org │ │ └── ladysnake │ │ └── cca │ │ └── test │ │ └── scoreboard │ │ ├── CcaScoreboardTestMod.java │ │ └── ScoreboardVita.java ├── changelog.md └── build.gradle.kts ├── .gitattributes ├── .gitignore ├── .editorconfig ├── style.md ├── gradle.properties ├── code_quality ├── GPL3_HEADER.txt ├── LGPL3_HEADER.txt └── MIT_HEADER.txt ├── settings.gradle ├── .github └── workflows │ └── build.yml └── LICENSE.md /.githooks/setupHooks.sh: -------------------------------------------------------------------------------- 1 | repoRoot="$(git rev-parse --show-toplevel)" 2 | git config core.hooksPath "$repoRoot/.githooks" 3 | -------------------------------------------------------------------------------- /cardinal-components-base/build.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencies { 2 | testCompileOnly("com.google.code.findbugs:jsr305:3.0.2") 3 | } 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ladysnake/Cardinal-Components-API/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/testmod/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "Test assets", 4 | "pack_format": 4 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/cardinal-components/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ladysnake/Cardinal-Components-API/HEAD/src/main/resources/assets/cardinal-components/icon.png -------------------------------------------------------------------------------- /src/testmod/resources/assets/componenttest/blockstates/vita_condenser.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { "model": "componenttest:block/vita_condenser" } 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/testmod/resources/assets/componenttest/models/block/vita_condenser.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube_all", 3 | "textures": { 4 | "all": "block/furnace_side" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/testmod/resources/assets/componenttest/models/item/vita_stick.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "minecraft:item/stick" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /cardinal-components-item/src/main/resources/cardinal-components-item.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v2 named 2 | accessible class net/minecraft/datafixer/fix/ItemStackComponentizationFix$StackData 3 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/resources/assets/cardinal-components-base/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ladysnake/Cardinal-Components-API/HEAD/cardinal-components-base/src/main/resources/assets/cardinal-components-base/icon.png -------------------------------------------------------------------------------- /cardinal-components-item/src/main/resources/assets/cardinal-components-item/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ladysnake/Cardinal-Components-API/HEAD/cardinal-components-item/src/main/resources/assets/cardinal-components-item/icon.png -------------------------------------------------------------------------------- /cardinal-components-block/src/main/resources/assets/cardinal-components-block/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ladysnake/Cardinal-Components-API/HEAD/cardinal-components-block/src/main/resources/assets/cardinal-components-block/icon.png -------------------------------------------------------------------------------- /cardinal-components-chunk/src/main/resources/assets/cardinal-components-chunk/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ladysnake/Cardinal-Components-API/HEAD/cardinal-components-chunk/src/main/resources/assets/cardinal-components-chunk/icon.png -------------------------------------------------------------------------------- /cardinal-components-level/src/main/resources/assets/cardinal-components-level/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ladysnake/Cardinal-Components-API/HEAD/cardinal-components-level/src/main/resources/assets/cardinal-components-level/icon.png -------------------------------------------------------------------------------- /cardinal-components-world/src/main/resources/assets/cardinal-components-world/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ladysnake/Cardinal-Components-API/HEAD/cardinal-components-world/src/main/resources/assets/cardinal-components-world/icon.png -------------------------------------------------------------------------------- /cardinal-components-entity/src/main/resources/assets/cardinal-components-entity/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ladysnake/Cardinal-Components-API/HEAD/cardinal-components-entity/src/main/resources/assets/cardinal-components-entity/icon.png -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/resources/assets/cardinal-components-scoreboard/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ladysnake/Cardinal-Components-API/HEAD/cardinal-components-scoreboard/src/main/resources/assets/cardinal-components-scoreboard/icon.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # Linux start script should use lf 5 | /gradlew text eol=lf 6 | 7 | # These are Windows script files and should use crlf 8 | *.bat text eol=crlf 9 | 10 | -------------------------------------------------------------------------------- /cardinal-components-base/changelog.md: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------ 2 | Version 1.2.1-SNAPSHOT 3 | ------------------------------------------------------ 4 | Additions 5 | - None 6 | 7 | Changes 8 | - None 9 | 10 | Bug Fixes 11 | - None 12 | -------------------------------------------------------------------------------- /cardinal-components-block/changelog.md: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------ 2 | Version 1.2.1-SNAPSHOT 3 | ------------------------------------------------------ 4 | Additions 5 | - None 6 | 7 | Changes 8 | - None 9 | 10 | Bug Fixes 11 | - None 12 | -------------------------------------------------------------------------------- /cardinal-components-chunk/changelog.md: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------ 2 | Version unspecified 3 | ------------------------------------------------------ 4 | Additions 5 | - None 6 | 7 | Changes 8 | - None 9 | 10 | Bug Fixes 11 | - None 12 | -------------------------------------------------------------------------------- /cardinal-components-item/changelog.md: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------ 2 | Version 1.2.1-SNAPSHOT 3 | ------------------------------------------------------ 4 | Additions 5 | - None 6 | 7 | Changes 8 | - None 9 | 10 | Bug Fixes 11 | - None 12 | -------------------------------------------------------------------------------- /cardinal-components-level/changelog.md: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------ 2 | Version unspecified 3 | ------------------------------------------------------ 4 | Additions 5 | - None 6 | 7 | Changes 8 | - None 9 | 10 | Bug Fixes 11 | - None 12 | -------------------------------------------------------------------------------- /cardinal-components-world/changelog.md: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------ 2 | Version unspecified 3 | ------------------------------------------------------ 4 | Additions 5 | - None 6 | 7 | Changes 8 | - None 9 | 10 | Bug Fixes 11 | - None 12 | -------------------------------------------------------------------------------- /cardinal-components-entity/changelog.md: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------ 2 | Version 1.2.1-SNAPSHOT 3 | ------------------------------------------------------ 4 | Additions 5 | - None 6 | 7 | Changes 8 | - None 9 | 10 | Bug Fixes 11 | - None 12 | -------------------------------------------------------------------------------- /cardinal-components-item/build.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencies { 2 | api(project(path = ":cardinal-components-base", configuration = "namedElements")) 3 | } 4 | 5 | loom { 6 | accessWidenerPath = project.file("src/main/resources/cardinal-components-item.accesswidener") 7 | } 8 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/changelog.md: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------ 2 | Version unspecified 3 | ------------------------------------------------------ 4 | Additions 5 | - None 6 | 7 | Changes 8 | - None 9 | 10 | Bug Fixes 11 | - None 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # gradle 2 | 3 | .gradle/ 4 | build/ 5 | out/ 6 | 7 | # idea 8 | 9 | .idea/* 10 | !.idea/copyright 11 | *.iml 12 | *.ipr 13 | *.iws 14 | 15 | # vscode 16 | 17 | .settings/ 18 | .vscode/ 19 | bin/ 20 | .classpath 21 | .project 22 | 23 | # fabric 24 | 25 | run/ 26 | classes/ 27 | logs/ 28 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /cardinal-components-item/src/main/resources/mixins.cardinal_components_item.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "compatibilityLevel": "JAVA_8", 5 | "package": "org.ladysnake.cca.mixin.item", 6 | "mixins": [ 7 | "common.MixinItemStackComponentizationFix" 8 | ], 9 | "injectors": { 10 | "defaultRequire": 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/resources/mixins.cardinal_components_base.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "compatibilityLevel": "JAVA_8", 5 | "package": "org.ladysnake.cca.mixin.base", 6 | "mixins": [ 7 | "NbtReadViewAccessor" 8 | ], 9 | "client": [ 10 | ], 11 | "injectors": { 12 | "defaultRequire": 1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cardinal-components-base/src/testmod/resources/mixins.cardinal_components_base_test.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "compatibilityLevel": "JAVA_8", 5 | "package": "org.ladysnake.cca.test.base.mixin", 6 | "mixins": [ 7 | "TestAnnotationLocatorMixin", 8 | "TestMethodMixin" 9 | ], 10 | "client": [ 11 | ], 12 | "injectors": { 13 | "defaultRequire": 1 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cardinal-components-chunk/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | // Need to add the base module to the annotation classpath too, otherwise the mixin obf AP chokes on ComponentProvider 3 | // (which we add to various classes through interface injection) 4 | annotationProcessor api(project(path: ":cardinal-components-base", configuration: "namedElements")) 5 | testmodImplementation project(":cardinal-components-base").sourceSets.testmod.output 6 | } 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = crlf 8 | indent_size = 4 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | insert_final_newline = false 15 | trim_trailing_whitespace = false 16 | 17 | [*.json] 18 | indent_size = 2 19 | 20 | [*.java] 21 | ij_java_insert_override_annotation = true 22 | ij_java_method_annotation_wrap = normal 23 | -------------------------------------------------------------------------------- /cardinal-components-world/src/main/resources/mixins.cardinal_components_world.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "compatibilityLevel": "JAVA_8", 5 | "package": "org.ladysnake.cca.mixin.world", 6 | "mixins": [ 7 | "common.DataFixTypesMixin", 8 | "common.MixinPlayerManager", 9 | "common.MixinServerWorld", 10 | "common.MixinWorld" 11 | ], 12 | "client": [ 13 | "client.MixinClientWorld" 14 | ], 15 | "injectors": { 16 | "defaultRequire": 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cardinal-components-block/src/main/resources/mixins.cardinal_components_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "compatibilityLevel": "JAVA_8", 5 | "package": "org.ladysnake.cca.mixin.block", 6 | "mixins": [ 7 | "common.MixinBlockEntity", 8 | "common.MixinChunkDataSender", 9 | "common.MixinChunkHolder", 10 | "common.MixinServerPlayerEntity", 11 | "common.MixinWorldChunk" 12 | ], 13 | "client": [ 14 | ], 15 | "injectors": { 16 | "defaultRequire": 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/build.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencies { 2 | // Need to add the base module to the annotation classpath too, otherwise the mixin obf AP chokes on ComponentProvider 3 | // (which we add to various classes through interface injection) 4 | api(project(path = ":cardinal-components-base", configuration = "namedElements")) 5 | annotationProcessor(project(path = ":cardinal-components-base", configuration = "namedElements")) 6 | testmodImplementation(rootProject.project(":cardinal-components-base").sourceSets.testmod.get().output) 7 | } 8 | -------------------------------------------------------------------------------- /src/testmod/resources/assets/componenttest/lang/en_us.json: -------------------------------------------------------------------------------- 1 | { 2 | "componenttest:tooltip.vitality": "Vitality stored: %d", 3 | "componenttest:tooltip.vitality.native": "Inherent vitality: %d", 4 | "componenttest:tooltip.self_vitality": "Your vitality: %d", 5 | "componenttest:title.world_vitality": "Current vitality: %d + %d", 6 | "componenttest:action.chunk_vitality": "Chunk vitality: %d", 7 | "componenttest:action.block_vitality": "Block vitality: %d", 8 | "componenttest:item_group": "CCA Test", 9 | "item.componenttest.vita_stick": "Vita Stick" 10 | } 11 | -------------------------------------------------------------------------------- /cardinal-components-level/src/main/resources/mixins.cardinal_components_level.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "compatibilityLevel": "JAVA_8", 5 | "package": "org.ladysnake.cca.mixin.level", 6 | "client": [ 7 | "client.MixinClientWorldProperties" 8 | ], 9 | "mixins": [ 10 | "common.LevelStorageMixin", 11 | "common.MixinLevelProperties", 12 | "common.MixinMinecraftServer", 13 | "common.MixinUnmodifiableLevelProperties", 14 | "common.MixinWorldProperties" 15 | ], 16 | "injectors": { 17 | "defaultRequire": 1 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/testmod/resources/assets/componenttest/lang/es_ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "componenttest:tooltip.vitality": "Vitalidad almacenada: %d", 3 | "componenttest:tooltip.vitality.native": "Vitalidad inherente: %d", 4 | "componenttest:tooltip.self_vitality": "Tu vitalidad: %d", 5 | "componenttest:title.world_vitality": "Vitalidad actual: %d + %d", 6 | "componenttest:action.chunk_vitality": "Vitalidad del chunk: %d", 7 | "componenttest:action.block_vitality": "Vitalidad del bloque: %d", 8 | "componenttest:item_group": "Prueba de CCA", 9 | "item.componenttest.vita_stick": "Bastón de Vita" 10 | } 11 | -------------------------------------------------------------------------------- /cardinal-components-chunk/src/main/resources/mixins.cardinal_components_chunk.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "compatibilityLevel": "JAVA_8", 5 | "package": "org.ladysnake.cca.mixin.chunk", 6 | "mixins": [ 7 | "common.MixinChunk", 8 | "common.MixinChunkDataSender", 9 | "common.MixinChunkHolder", 10 | "common.MixinEmptyChunk", 11 | "common.MixinSerializedChunk", 12 | "common.MixinServerWorld", 13 | "common.MixinWorldChunk", 14 | "common.MixinWrapperProtoChunk" 15 | ], 16 | "injectors": { 17 | "defaultRequire": 1 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /cardinal-components-entity/src/main/resources/mixins.cardinal_components_entity.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "compatibilityLevel": "JAVA_8", 5 | "package": "org.ladysnake.cca.mixin.entity", 6 | "mixins": [ 7 | "common.BucketableMixin", 8 | "common.MixinEntity", 9 | "common.MixinEntityTrackerEntry", 10 | "common.MixinPlayerManager", 11 | "common.MixinServerPlayerEntity", 12 | "common.MixinServerWorld" 13 | ], 14 | "client": [ 15 | "client.MixinClientWorld" 16 | ], 17 | "injectors": { 18 | "defaultRequire": 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /style.md: -------------------------------------------------------------------------------- 1 | # Cardinal Components API Coding Style Guide 2 | 3 | These "style guidelines" are used to keep the Cardinal Components codebase clean and consistent. 4 | 5 | **Basics** 6 | 7 | - Indent uses 4 spaces 8 | - Files end with a newline (`\n`) 9 | - No trailing whitespace after a line 10 | - Markdown text may use trailing whitespace for line breaks 11 | 12 | **Naming conventions** 13 | - Modules and packages use singular names 14 | - Module names start with `cardinal-components` 15 | 16 | **Java code style** 17 | - Standard Java conventions apply 18 | - Redundant language modifiers are omitted -------------------------------------------------------------------------------- /cardinal-components-entity/build.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencies { 2 | api(project(path = ":cardinal-components-base", configuration = "namedElements")) 3 | annotationProcessor(project(path = ":cardinal-components-base", configuration = "namedElements")) 4 | testmodImplementation(rootProject.project(":cardinal-components-base").sourceSets.testmod.get().output) 5 | modLocalImplementation(fabricApi.module("fabric-object-builder-api-v1", project.properties["fabric_api_version"] as String)) 6 | modLocalImplementation(fabricApi.module("fabric-entity-events-v1", project.properties["fabric_api_version"] as String)) 7 | } 8 | -------------------------------------------------------------------------------- /cardinal-components-level/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | // Need to add the base module to the annotation classpath too, otherwise the mixin obf AP chokes on ComponentProvider 3 | // (which we add to various classes through interface injection) 4 | annotationProcessor api(project(path: ":cardinal-components-base", configuration: "namedElements")) 5 | api project(path: ":cardinal-components-world", configuration: "namedElements") 6 | testmodImplementation project(":cardinal-components-base").sourceSets.testmod.output 7 | testmodImplementation project(":cardinal-components-world").sourceSets.testmod.output 8 | } 9 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/resources/mixins.cardinal_components_scoreboard.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "compatibilityLevel": "JAVA_8", 5 | "package": "org.ladysnake.cca.mixin.scoreboard", 6 | "mixins": [ 7 | "MixinMinecraftServer", 8 | "MixinPackedScoreboardState", 9 | "MixinPackedTeam", 10 | "MixinPersistentState", 11 | "MixinPlayerManager", 12 | "MixinScoreboard", 13 | "MixinServerScoreboard", 14 | "MixinTeam", 15 | "ServerScoreboardAccessor", 16 | "TeamAccessor" 17 | ], 18 | "injectors": { 19 | "defaultRequire": 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cardinal-components-block/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | // Need to add the base module to the annotation classpath too, otherwise the mixin obf AP chokes on ComponentProvider 3 | // (which we add to various classes through interface injection) 4 | annotationProcessor api(project(path: ":cardinal-components-base", configuration: "namedElements")) 5 | modApi fabricApi.module("fabric-api-lookup-api-v1", rootProject.fabric_api_version) 6 | testmodImplementation project(":cardinal-components-base").sourceSets.testmod.output 7 | modCompileOnly "com.github.iPortalTeam:ImmersivePortalsMod:${rootProject.immersive_portals_version}" 8 | } 9 | -------------------------------------------------------------------------------- /cardinal-components-world/build.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencies { 2 | // Need to add the base module to the annotation classpath too, otherwise the mixin obf AP chokes on ComponentProvider 3 | // (which we add to various classes through interface injection) 4 | api(project(path = ":cardinal-components-base", configuration = "namedElements")) 5 | annotationProcessor(project(path = ":cardinal-components-base", configuration = "namedElements")) 6 | modLocalRuntime(fabricApi.module("fabric-gametest-api-v1", project.properties["fabric_api_version"].toString())) 7 | testmodImplementation(rootProject.project(":cardinal-components-base").sourceSets.testmod.get().output) 8 | } 9 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | #General 2 | org.gradle.jvmargs = -Xmx3G 3 | org.gradle.parallel=true 4 | fabric.loom.multiProjectOptimisation=true 5 | 6 | #see https://fabricmc.net/develop/ 7 | minecraft_version=1.21.11 8 | yarn_mappings=2 9 | loader_version=0.18.2 10 | #Fabric api 11 | fabric_api_version=0.139.4+1.21.11 12 | 13 | elmendorf_version=0.16.0 14 | 15 | immersive_portals_version=v6.0.3-mc1.21.1 16 | 17 | #Publishing 18 | mod_version = 7.3.0 19 | curseforge_id = 318449 20 | modrinth_id = K01OU20C 21 | curseforge_versions = 1.21.11 22 | modrinth_versions = 1.21.11 23 | release_type = release 24 | display_name = Cardinal-Components-API 25 | owners = Ladysnake 26 | 27 | # Licensing 28 | license_header = MIT 29 | -------------------------------------------------------------------------------- /cardinal-components-level/src/testmod/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cca-level-test", 5 | "name": "Cardinal Components API Test Mod", 6 | "description": "Test mod for Cardinal Components API", 7 | "version": "${version}", 8 | "entrypoints": { 9 | "cardinal-components": [ 10 | "org.ladysnake.cca.test.level.CcaLevelTestMod" 11 | ], 12 | "fabric-gametest": [ 13 | "org.ladysnake.cca.test.level.CcaLevelTestSuite" 14 | ] 15 | }, 16 | "depends": { 17 | "fabric-api-base": "*" 18 | }, 19 | "authors": [ 20 | "Pyrofab" 21 | ], 22 | "license": "MIT" 23 | } 24 | -------------------------------------------------------------------------------- /cardinal-components-world/src/testmod/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cca-world-test", 5 | "name": "Cardinal Components API Test Mod", 6 | "description": "Test mod for Cardinal Components API", 7 | "version": "${version}", 8 | "entrypoints": { 9 | "cardinal-components": [ 10 | "org.ladysnake.cca.test.world.CcaWorldTestMod" 11 | ], 12 | "fabric-gametest": [ 13 | "org.ladysnake.cca.test.world.CcaWorldTestSuite" 14 | ] 15 | }, 16 | "depends": { 17 | "fabric-api-base": "*" 18 | }, 19 | "authors": [ 20 | "Pyrofab" 21 | ], 22 | "license": "MIT" 23 | } 24 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/testmod/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cca-scoreboard-test", 5 | "name": "Cardinal Components API Test Mod", 6 | "description": "Test mod for Cardinal Components API", 7 | "version": "${version}", 8 | "entrypoints": { 9 | "cardinal-components": [ 10 | "org.ladysnake.cca.test.scoreboard.CcaScoreboardTestMod" 11 | ], 12 | "fabric-gametest": [ 13 | "org.ladysnake.cca.test.scoreboard.CcaScoreboardTestSuite" 14 | ] 15 | }, 16 | "depends": { 17 | "fabric-api-base": "*" 18 | }, 19 | "authors": [ 20 | "Pyrofab" 21 | ], 22 | "license": "MIT" 23 | } 24 | -------------------------------------------------------------------------------- /code_quality/GPL3_HEADER.txt: -------------------------------------------------------------------------------- 1 | ${projectDisplayName} 2 | Copyright (C) 2019-${year} Ladysnake 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | -------------------------------------------------------------------------------- /code_quality/LGPL3_HEADER.txt: -------------------------------------------------------------------------------- 1 | ${projectDisplayName} 2 | Copyright (C) 2019-${year} Ladysnake 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 3 of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; If not, see . 16 | -------------------------------------------------------------------------------- /.githooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # A hook script to verify what is about to be committed. 4 | # Called by "git commit" with no arguments. The hook should 5 | # exit with non-zero status after issuing an appropriate message if 6 | # it wants to stop the commit. 7 | # 8 | # This hook stops the commit if the added files are missing license headers. 9 | # 10 | addedFiles="$(git diff --name-only --diff-filter=A --cached)" 11 | if [ ! -z "${addedFiles// }" ]; 12 | then 13 | repoRoot="$(git rev-parse --show-toplevel)" 14 | "$repoRoot/gradlew" checkLicenses > /dev/null 15 | if [ $? -ne 0 ]; 16 | then 17 | cat <<\EOF 18 | 19 | Error: Attempt to push one or more files without a license header. Please run gradlew updateLicenses and commit. 20 | EOF 21 | exit 1 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /cardinal-components-chunk/src/testmod/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cca-chunk-test", 5 | "name": "Cardinal Components API Test Mod", 6 | "description": "Test mod for Cardinal Components API", 7 | "version": "${version}", 8 | "entrypoints": { 9 | "main": [ 10 | "org.ladysnake.cca.test.chunk.CcaChunkTestMod" 11 | ], 12 | "cardinal-components": [ 13 | "org.ladysnake.cca.test.chunk.CcaChunkTestMod" 14 | ], 15 | "fabric-gametest": [ 16 | "org.ladysnake.cca.test.chunk.CcaChunkTestSuite" 17 | ] 18 | }, 19 | "depends": { 20 | "fabric-api-base": "*" 21 | }, 22 | "authors": [ 23 | "Pyrofab" 24 | ], 25 | "license": "MIT" 26 | } 27 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | maven { 8 | name = 'Quilt' 9 | url = 'https://maven.quiltmc.org/repository/release/' 10 | } 11 | maven { 12 | name = 'Cotton' 13 | url = 'https://server.bbkr.space/artifactory/libs-release/' 14 | } 15 | gradlePluginPortal() 16 | mavenLocal() 17 | } 18 | } 19 | rootProject.name = 'cardinal-components-api' 20 | 21 | include 'cardinal-components-base' 22 | include 'cardinal-components-block' 23 | include 'cardinal-components-chunk' 24 | include 'cardinal-components-entity' 25 | include 'cardinal-components-item' 26 | include 'cardinal-components-level' 27 | include 'cardinal-components-scoreboard' 28 | include 'cardinal-components-world' 29 | -------------------------------------------------------------------------------- /cardinal-components-entity/src/testmod/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cca-entity-test", 5 | "name": "Cardinal Components API Test Mod", 6 | "description": "Test mod for Cardinal Components API", 7 | "version": "${version}", 8 | "entrypoints": { 9 | "main": [ 10 | "org.ladysnake.cca.test.entity.CcaEntityTestMod" 11 | ], 12 | "client": [ 13 | "org.ladysnake.cca.test.entity.CcaEntityTestClient" 14 | ], 15 | "cardinal-components": [ 16 | "org.ladysnake.cca.test.entity.CcaEntityTestMod" 17 | ], 18 | "fabric-gametest": [ 19 | "org.ladysnake.cca.test.entity.CcaEntityTestSuite" 20 | ] 21 | }, 22 | "depends": { 23 | "fabric-api-base": "*" 24 | }, 25 | "authors": [ 26 | "Pyrofab" 27 | ], 28 | "license": "MIT" 29 | } 30 | -------------------------------------------------------------------------------- /cardinal-components-block/src/testmod/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cca-block-test", 5 | "name": "Cardinal Components API Test Mod", 6 | "description": "Test mod for Cardinal Components API", 7 | "version": "${version}", 8 | "entrypoints": { 9 | "main": [ 10 | "org.ladysnake.cca.test.block.CcaBlockTestMod" 11 | ], 12 | "cardinal-components": [ 13 | "org.ladysnake.cca.test.block.CcaBlockTestMod" 14 | ], 15 | "fabric-gametest": [ 16 | "org.ladysnake.cca.test.block.CcaBlockTestSuite" 17 | ] 18 | }, 19 | "depends": { 20 | "fabric-api-base": "*" 21 | }, 22 | "authors": [ 23 | "Pyrofab" 24 | ], 25 | "license": "MIT", 26 | "custom": { 27 | "cardinal-components": [ 28 | "cca-block-test:vita_compound" 29 | ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cardinal-components", 5 | "name": "Cardinal Components API", 6 | "description": "Attaching more data to various game objects", 7 | "version": "${version}", 8 | "icon": "assets/cardinal-components/icon.png", 9 | "custom": { 10 | "modmenu": { 11 | "badges": ["library"] 12 | } 13 | }, 14 | "authors": [ 15 | { 16 | "name": "UpcraftLP", 17 | "contact": { 18 | "homepage": "https://twitter.com/UpcraftLP" 19 | } 20 | }, 21 | "Pyrofab" 22 | ], 23 | "contact": { 24 | "homepage": "https://www.curseforge.com/minecraft/mc-mods/cardinal-components", 25 | "issues": "https://github.com/Ladysnake/Cardinal-Components-API/issues", 26 | "sources": "https://github.com/Ladysnake/Cardinal-Components-API" 27 | }, 28 | "license": "MIT" 29 | } 30 | -------------------------------------------------------------------------------- /cardinal-components-base/src/testmod/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cca-base-test", 5 | "name": "Cardinal Components API Test Mod", 6 | "description": "Test mod for Cardinal Components API", 7 | "version": "${version}", 8 | "entrypoints": { 9 | "fabric-gametest": [ 10 | "org.ladysnake.cca.internal.base.ComponentRegistryImplTest", 11 | "org.ladysnake.cca.internal.base.QualifiedComponentFactoryTest" 12 | ] 13 | }, 14 | "custom": { 15 | "cardinal-components": [ 16 | "cca-base-test:vita", 17 | "cca-base-test:ticking", 18 | "cca-base-test:loading", 19 | "testmod:test", 20 | "testmod:test_2", 21 | "testmod:test_3" 22 | ] 23 | }, 24 | "depends": { 25 | "fabric-api-base": "*" 26 | }, 27 | "mixins": [ 28 | "mixins.cardinal_components_base_test.json" 29 | ], 30 | "authors": [ 31 | "Pyrofab" 32 | ], 33 | "license": "MIT" 34 | } 35 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # Automatically build the project and run any configured tests for every push 2 | # and submitted pull request. This can help catch issues that only occur on 3 | # certain platforms or Java versions, and provides a first line of defence 4 | # against bad commits. 5 | 6 | name: build 7 | on: [pull_request, push] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-24.04 12 | steps: 13 | - name: checkout repository 14 | uses: actions/checkout@v4 15 | with: 16 | fetch-depth: 0 17 | filter: 'blob:none' 18 | - name: validate gradle wrapper 19 | uses: gradle/actions/wrapper-validation@v4 20 | - name: setup jdk 21 | uses: actions/setup-java@v4 22 | with: 23 | java-version: '21' 24 | distribution: 'microsoft' 25 | - name: make gradle wrapper executable 26 | run: chmod +x ./gradlew 27 | - name: build 28 | run: ./gradlew build 29 | - name: capture build artifacts 30 | uses: actions/upload-artifact@v4 31 | with: 32 | name: Artifacts 33 | path: build/libs/ 34 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Ladysnake 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /code_quality/MIT_HEADER.txt: -------------------------------------------------------------------------------- 1 | ${projectDisplayName} 2 | Copyright (C) 2019-${year} Ladysnake 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 20 | OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /src/testmod/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "componenttest", 5 | "name": "Cardinal Components API Test Mod", 6 | "description": "Test mod for Cardinal Components API", 7 | "version": "${version}", 8 | "entrypoints": { 9 | "main": [ 10 | "org.ladysnake.componenttest.content.CardinalComponentsTest::init" 11 | ], 12 | "client": [ 13 | "org.ladysnake.componenttest.content.CCATestClient::clientInit" 14 | ], 15 | "cardinal-components:static-init": [ 16 | "org.ladysnake.componenttest.content.TestStaticComponentInitializer" 17 | ], 18 | "cardinal-components": [ 19 | "org.ladysnake.componenttest.content.TestComponents" 20 | ], 21 | "fabric-gametest": [ 22 | "org.ladysnake.componenttest.tests.CcaTestSuite" 23 | ] 24 | }, 25 | "custom": { 26 | "cardinal-components": [ 27 | "componenttest:vita", 28 | "testmod:test", 29 | "testmod:test_2", 30 | "testmod:test_3" 31 | ] 32 | }, 33 | "depends": { 34 | "fabric-api-base": "*" 35 | }, 36 | "authors": [ 37 | "Pyrofab" 38 | ], 39 | "license": "MIT" 40 | } 41 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/internal/base/ComponentRegistrationInitializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.internal.base; 24 | 25 | /** 26 | * Internal marker for {@code "cardinal-components"} entrypoints 27 | */ 28 | public interface ComponentRegistrationInitializer { 29 | } 30 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/api/v3/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /** 24 | * Utility classes for API consumers 25 | */ 26 | @MethodsReturnNonnullByDefault 27 | @ParametersAreNonnullByDefault 28 | package org.ladysnake.cca.api.v3.util; 29 | 30 | import javax.annotation.ParametersAreNonnullByDefault; 31 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/internal/base/UnknownComponentException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.internal.base; 24 | 25 | public class UnknownComponentException extends RuntimeException { 26 | public UnknownComponentException(String message) { 27 | super(message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/testmod/java/org/ladysnake/componenttest/content/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @MethodsReturnNonnullByDefault 24 | @ParametersAreNonnullByDefault 25 | package org.ladysnake.componenttest.content; 26 | 27 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 28 | 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /cardinal-components-block/src/main/java/org/ladysnake/cca/api/v3/block/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @MethodsReturnNonnullByDefault 24 | @ParametersAreNonnullByDefault 25 | package org.ladysnake.cca.api.v3.block; 26 | 27 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 28 | 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /cardinal-components-block/src/testmod/java/org/ladysnake/cca/test/block/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @MethodsReturnNonnullByDefault 24 | @ParametersAreNonnullByDefault 25 | package org.ladysnake.cca.test.block; 26 | 27 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 28 | 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /cardinal-components-chunk/src/main/java/org/ladysnake/cca/api/v3/chunk/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @MethodsReturnNonnullByDefault 24 | @ParametersAreNonnullByDefault 25 | package org.ladysnake.cca.api.v3.chunk; 26 | 27 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 28 | 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /cardinal-components-item/src/main/java/org/ladysnake/cca/api/v3/item/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @MethodsReturnNonnullByDefault 24 | @ParametersAreNonnullByDefault 25 | package org.ladysnake.cca.api.v3.item; 26 | 27 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 28 | 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /cardinal-components-item/src/main/java/org/ladysnake/cca/internal/item/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @MethodsReturnNonnullByDefault 24 | @ParametersAreNonnullByDefault 25 | package org.ladysnake.cca.internal.item; 26 | 27 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 28 | 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /cardinal-components-world/src/main/java/org/ladysnake/cca/api/v3/world/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @MethodsReturnNonnullByDefault 24 | @ParametersAreNonnullByDefault 25 | package org.ladysnake.cca.api.v3.world; 26 | 27 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 28 | 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /src/testmod/java/org/ladysnake/componenttest/content/vita/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @MethodsReturnNonnullByDefault 24 | @ParametersAreNonnullByDefault 25 | package org.ladysnake.componenttest.content.vita; 26 | 27 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 28 | 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /cardinal-components-entity/src/main/java/org/ladysnake/cca/api/v3/entity/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @MethodsReturnNonnullByDefault 24 | @ParametersAreNonnullByDefault 25 | package org.ladysnake.cca.api.v3.entity; 26 | 27 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 28 | 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /cardinal-components-entity/src/testmod/java/org/ladysnake/cca/test/entity/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @MethodsReturnNonnullByDefault 24 | @ParametersAreNonnullByDefault 25 | package org.ladysnake.cca.test.entity; 26 | 27 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 28 | 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/api/v3/component/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @MethodsReturnNonnullByDefault 24 | @ParametersAreNonnullByDefault 25 | package org.ladysnake.cca.api.v3.component; 26 | 27 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 28 | 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/api/v3/scoreboard/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @MethodsReturnNonnullByDefault 24 | @ParametersAreNonnullByDefault 25 | package org.ladysnake.cca.api.v3.scoreboard; 26 | 27 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 28 | 29 | import javax.annotation.ParametersAreNonnullByDefault; 30 | -------------------------------------------------------------------------------- /cardinal-components-item/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cardinal-components-item", 5 | "name": "Cardinal Components API (items)", 6 | "description": "deprecated module", 7 | "icon": "assets/cardinal-components-item/icon.png", 8 | "version": "${version}", 9 | "custom": { 10 | "modmenu": { 11 | "badges": [ "library" ], 12 | "parent": { 13 | "id": "cardinal-components", 14 | "name": "Cardinal Components API", 15 | "description": "Attaching more data to various game objects", 16 | "badges": [ "library" ] 17 | } 18 | } 19 | }, 20 | "depends": { 21 | "minecraft": ">=1.17-", 22 | "fabric-api-base": "*", 23 | "cardinal-components-base": "*" 24 | }, 25 | "entrypoints": { 26 | "main": [ 27 | "org.ladysnake.cca.internal.item.StaticItemComponentPlugin::INSTANCE" 28 | ] 29 | }, 30 | "authors": [ 31 | { 32 | "name": "UpcraftLP", 33 | "contact": { 34 | "homepage": "https://twitter.com/UpcraftLP" 35 | } 36 | } 37 | ], 38 | "contact": { 39 | "homepage": "https://minecraft.curseforge.com/projects/318449", 40 | "issues": "https://github.com/Ladysnake/Cardinal-Components-API/issues", 41 | "sources": "https://github.com/Ladysnake/Cardinal-Components-API" 42 | }, 43 | "license": "MIT", 44 | "mixins": [ 45 | { 46 | "environment": "*", 47 | "config": "mixins.cardinal_components_item.json" 48 | } 49 | ], 50 | "accessWidener": "cardinal-components-item.accesswidener" 51 | } 52 | -------------------------------------------------------------------------------- /cardinal-components-entity/src/main/java/org/ladysnake/cca/internal/entity/SwitchablePlayerEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.internal.entity; 24 | 25 | public interface SwitchablePlayerEntity { 26 | // Can be used by mods as an unofficial API for now 27 | @SuppressWarnings("unused") void cca$markAsSwitchingCharacter(); 28 | boolean cca$isSwitchingCharacter(); 29 | } 30 | -------------------------------------------------------------------------------- /cardinal-components-block/src/main/java/org/ladysnake/cca/internal/block/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.internal.block; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-chunk/src/main/java/org/ladysnake/cca/internal/chunk/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.internal.chunk; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-entity/src/main/java/org/ladysnake/cca/internal/entity/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.internal.entity; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-level/src/main/java/org/ladysnake/cca/internal/level/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.internal.level; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-world/src/main/java/org/ladysnake/cca/internal/world/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.internal.world; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-block/src/main/java/org/ladysnake/cca/mixin/block/common/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.mixin.block.common; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-chunk/src/main/java/org/ladysnake/cca/mixin/chunk/common/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.mixin.chunk.common; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-item/src/main/java/org/ladysnake/cca/mixin/item/common/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.mixin.item.common; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-level/src/main/java/org/ladysnake/cca/mixin/level/client/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.mixin.level.client; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-level/src/main/java/org/ladysnake/cca/mixin/level/common/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.mixin.level.common; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/internal/scoreboard/CcaPackedState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.internal.scoreboard; 24 | 25 | import net.minecraft.nbt.NbtCompound; 26 | import org.jetbrains.annotations.Nullable; 27 | 28 | public interface CcaPackedState { 29 | @Nullable NbtCompound cca$getSerializedComponents(); 30 | void cca$setSerializedComponents(@Nullable NbtCompound nbt); 31 | } 32 | -------------------------------------------------------------------------------- /cardinal-components-world/src/main/java/org/ladysnake/cca/mixin/world/common/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.mixin.world.common; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-entity/src/main/java/org/ladysnake/cca/mixin/entity/common/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.mixin.entity.common; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/mixin/scoreboard/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.mixin.scoreboard; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/api/v3/component/load/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Experimental 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.api.v3.component.load; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-level/src/main/java/org/ladysnake/cca/mixin/level/common/MixinWorldProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.level.common; 24 | 25 | import net.minecraft.world.WorldProperties; 26 | import org.ladysnake.cca.api.v3.component.ComponentProvider; 27 | import org.spongepowered.asm.mixin.Mixin; 28 | 29 | @Mixin(WorldProperties.class) 30 | public interface MixinWorldProperties extends ComponentProvider { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/internal/scoreboard/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | @ApiStatus.Internal 24 | @MethodsReturnNonnullByDefault 25 | @ParametersAreNonnullByDefault 26 | package org.ladysnake.cca.internal.scoreboard; 27 | 28 | import org.jetbrains.annotations.ApiStatus; 29 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 30 | 31 | import javax.annotation.ParametersAreNonnullByDefault; 32 | -------------------------------------------------------------------------------- /cardinal-components-world/src/testmod/java/org/ladysnake/cca/test/world/NetherVita.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.test.world; 24 | 25 | import org.ladysnake.cca.api.v3.component.tick.ServerTickingComponent; 26 | import org.ladysnake.cca.test.base.BaseVita; 27 | 28 | public class NetherVita extends BaseVita implements ServerTickingComponent { 29 | @Override 30 | public void serverTick() { 31 | this.setVitality(666); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/mixin/base/NbtReadViewAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.base; 24 | 25 | import net.minecraft.nbt.NbtCompound; 26 | import net.minecraft.storage.NbtReadView; 27 | import org.spongepowered.asm.mixin.Mixin; 28 | import org.spongepowered.asm.mixin.gen.Accessor; 29 | 30 | @Mixin(NbtReadView.class) 31 | public interface NbtReadViewAccessor { 32 | @Accessor 33 | NbtCompound getNbt(); 34 | } 35 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/mixin/scoreboard/TeamAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.scoreboard; 24 | 25 | import net.minecraft.scoreboard.Scoreboard; 26 | import net.minecraft.scoreboard.Team; 27 | import org.spongepowered.asm.mixin.Mixin; 28 | import org.spongepowered.asm.mixin.gen.Accessor; 29 | 30 | @Mixin(Team.class) 31 | public interface TeamAccessor { 32 | @Accessor 33 | Scoreboard getScoreboard(); 34 | } 35 | -------------------------------------------------------------------------------- /cardinal-components-level/src/main/java/org/ladysnake/cca/api/v3/level/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /** 24 | * Deprecated: level components are a legacy feature that has been superseded by scoreboard components 25 | */ 26 | @Deprecated(since = "6.0.0") 27 | @MethodsReturnNonnullByDefault 28 | @ParametersAreNonnullByDefault 29 | package org.ladysnake.cca.api.v3.level; 30 | 31 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 32 | 33 | import javax.annotation.ParametersAreNonnullByDefault; 34 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/internal/base/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /** 24 | * Internal classes. Should never be referenced from other projects. 25 | */ 26 | @ApiStatus.Internal 27 | @MethodsReturnNonnullByDefault 28 | @ParametersAreNonnullByDefault 29 | package org.ladysnake.cca.internal.base; 30 | 31 | import org.jetbrains.annotations.ApiStatus; 32 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 33 | 34 | import javax.annotation.ParametersAreNonnullByDefault; 35 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/internal/base/asm/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /** 24 | * Internal classes. Should never be referenced from other projects. 25 | */ 26 | @ApiStatus.Internal 27 | @MethodsReturnNonnullByDefault 28 | @ParametersAreNonnullByDefault 29 | package org.ladysnake.cca.internal.base.asm; 30 | 31 | import org.jetbrains.annotations.ApiStatus; 32 | import org.ladysnake.cca.api.v3.util.MethodsReturnNonnullByDefault; 33 | 34 | import javax.annotation.ParametersAreNonnullByDefault; 35 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/mixin/scoreboard/ServerScoreboardAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.scoreboard; 24 | 25 | import net.minecraft.scoreboard.ServerScoreboard; 26 | import net.minecraft.server.MinecraftServer; 27 | import org.spongepowered.asm.mixin.Mixin; 28 | import org.spongepowered.asm.mixin.gen.Accessor; 29 | 30 | @Mixin(ServerScoreboard.class) 31 | public interface ServerScoreboardAccessor { 32 | @Accessor 33 | MinecraftServer getServer(); 34 | } 35 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/api/v3/component/sync/ComponentPacketWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.component.sync; 24 | 25 | import net.minecraft.network.RegistryByteBuf; 26 | import net.minecraft.server.network.ServerPlayerEntity; 27 | import org.jetbrains.annotations.Contract; 28 | 29 | @FunctionalInterface 30 | public interface ComponentPacketWriter { 31 | @Contract(mutates = "param1") 32 | void writeSyncPacket(RegistryByteBuf buf, ServerPlayerEntity recipient); 33 | } 34 | -------------------------------------------------------------------------------- /cardinal-components-level/src/testmod/java/org/ladysnake/cca/test/level/LevelVita.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.test.level; 24 | 25 | import net.minecraft.server.MinecraftServer; 26 | import org.ladysnake.cca.api.v3.level.LevelComponents; 27 | import org.ladysnake.cca.test.base.Vita; 28 | import org.ladysnake.cca.test.world.AmbientVita; 29 | 30 | public class LevelVita extends AmbientVita { 31 | @Override 32 | public void syncWithAll(MinecraftServer server) { 33 | LevelComponents.sync(Vita.KEY, server); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/internal/base/asm/CalledByAsm.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.internal.base.asm; 24 | 25 | import java.lang.annotation.ElementType; 26 | import java.lang.annotation.Retention; 27 | import java.lang.annotation.RetentionPolicy; 28 | import java.lang.annotation.Target; 29 | 30 | /** 31 | * Signals that the annotated method is called by an {@link AsmGeneratedCallback} 32 | */ 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target(ElementType.METHOD) 35 | public @interface CalledByAsm { } 36 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/api/v3/component/ComponentV3.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.component; 24 | 25 | import net.minecraft.item.ItemStack; 26 | 27 | /** 28 | * The base interface for components. 29 | * 30 | *

This interface exposes basic methods for serializing components. 31 | * The {@link Object#equals(Object)} must additionally be overridden when attached to some providers 32 | * like {@link ItemStack}s. 33 | * 34 | * @since 2.5.0 35 | */ 36 | public interface ComponentV3 extends Component { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /cardinal-components-base/src/testmod/java/org/ladysnake/cca/test/base/EmptyVita.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.test.base; 24 | 25 | import org.ladysnake.cca.api.v3.component.TransientComponent; 26 | 27 | public class EmptyVita implements Vita, TransientComponent { 28 | public static final EmptyVita INSTANCE = new EmptyVita(); 29 | 30 | @Override 31 | public int getVitality() { 32 | return 0; 33 | } 34 | 35 | @Override 36 | public void setVitality(int value) { 37 | throw new UnsupportedOperationException(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/internal/base/asm/StaticComponentLoadingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.internal.base.asm; 24 | 25 | public class StaticComponentLoadingException extends RuntimeException { 26 | public StaticComponentLoadingException() { 27 | super(); 28 | } 29 | 30 | public StaticComponentLoadingException(String message) { 31 | super(message); 32 | } 33 | 34 | public StaticComponentLoadingException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /cardinal-components-base/src/testmod/java/org/ladysnake/cca/test/base/SyncedVita.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.test.base; 24 | 25 | import org.ladysnake.cca.api.v3.component.sync.AutoSyncedComponent; 26 | 27 | public class SyncedVita extends BaseVita implements AutoSyncedComponent { 28 | private final Object owner; 29 | 30 | public SyncedVita(Object owner) { 31 | this.owner = owner; 32 | } 33 | 34 | @Override 35 | public void setVitality(int value) { 36 | super.setVitality(value); 37 | Vita.KEY.sync(this.owner); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/internal/scoreboard/ScoreboardComponentContainerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.internal.scoreboard; 24 | 25 | import net.minecraft.scoreboard.Scoreboard; 26 | import net.minecraft.server.MinecraftServer; 27 | import org.jetbrains.annotations.Nullable; 28 | import org.ladysnake.cca.api.v3.component.ComponentContainer; 29 | 30 | @FunctionalInterface 31 | public interface ScoreboardComponentContainerFactory { 32 | ComponentContainer create(Scoreboard scoreboard, @Nullable MinecraftServer server); 33 | } 34 | -------------------------------------------------------------------------------- /cardinal-components-base/src/testmod/java/org/ladysnake/cca/internal/base/CcaTesting.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.internal.base; 24 | 25 | import net.minecraft.util.Identifier; 26 | 27 | import java.util.List; 28 | 29 | public class CcaTesting { 30 | public static final Identifier TEST_ID_1 = Identifier.of("testmod:test"); 31 | public static final Identifier TEST_ID_2 = Identifier.of("testmod:test_2"); 32 | public static final Identifier TEST_ID_3 = Identifier.of("testmod:test_3"); 33 | public static final List ALL_TEST_IDS = List.of(TEST_ID_1, TEST_ID_2, TEST_ID_3); 34 | } 35 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/internal/scoreboard/TeamComponentContainerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.internal.scoreboard; 24 | 25 | import net.minecraft.scoreboard.Scoreboard; 26 | import net.minecraft.scoreboard.Team; 27 | import net.minecraft.server.MinecraftServer; 28 | import org.jetbrains.annotations.Nullable; 29 | import org.ladysnake.cca.api.v3.component.ComponentContainer; 30 | 31 | @FunctionalInterface 32 | public interface TeamComponentContainerFactory { 33 | ComponentContainer create(Team team, Scoreboard scoreboard, @Nullable MinecraftServer server); 34 | } 35 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cardinal-components-scoreboard", 5 | "name": "Cardinal Components API (scoreboard)", 6 | "description": "dynamically exposing components", 7 | "version": "${version}", 8 | "icon": "assets/cardinal-components-scoreboard/icon.png", 9 | "entrypoints": { 10 | "main": [ 11 | "org.ladysnake.cca.internal.scoreboard.CardinalComponentsScoreboard::init" 12 | ], 13 | "client": [ 14 | "org.ladysnake.cca.internal.scoreboard.CcaScoreboardClient::initClient" 15 | ] 16 | }, 17 | "custom": { 18 | "modmenu": { 19 | "badges": [ "library" ], 20 | "parent": { 21 | "id": "cardinal-components", 22 | "name": "Cardinal Components API", 23 | "description": "Attaching more data to various game objects", 24 | "badges": [ "library" ] 25 | } 26 | }, 27 | "loom:injected_interfaces": { 28 | "net/minecraft/class_269": [ 29 | "org/ladysnake/cca/api/v3/component/ComponentAccess" 30 | ], 31 | "net/minecraft/class_268": [ 32 | "org/ladysnake/cca/api/v3/component/ComponentAccess" 33 | ] 34 | } 35 | }, 36 | "depends": { 37 | "minecraft": ">=1.17-", 38 | "fabric-api-base": "*", 39 | "cardinal-components-base": ">=6.0.0-beta.2" 40 | }, 41 | "authors": [ 42 | "Pyrofab" 43 | ], 44 | "contact": { 45 | "homepage": "https://minecraft.curseforge.com/projects/318449", 46 | "issues": "https://github.com/Ladysnake/Cardinal-Components-API/issues", 47 | "sources": "https://github.com/Ladysnake/Cardinal-Components-API" 48 | }, 49 | "license": "MIT", 50 | "mixins": [ 51 | { 52 | "environment": "*", 53 | "config": "mixins.cardinal_components_scoreboard.json" 54 | } 55 | ] 56 | } 57 | -------------------------------------------------------------------------------- /cardinal-components-chunk/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cardinal-components-chunk", 5 | "name": "Cardinal Components API (chunks)", 6 | "description": "dynamically exposing components", 7 | "version": "${version}", 8 | "icon": "assets/cardinal-components-chunk/icon.png", 9 | "entrypoints": { 10 | "main": [ 11 | "org.ladysnake.cca.internal.chunk.CardinalComponentsChunk::init" 12 | ], 13 | "client": [ 14 | "org.ladysnake.cca.internal.chunk.CcaChunkClient::initClient" 15 | ] 16 | }, 17 | "custom": { 18 | "modmenu": { 19 | "badges": [ "library" ], 20 | "parent": { 21 | "id": "cardinal-components", 22 | "name": "Cardinal Components API", 23 | "description": "Attaching more data to various game objects", 24 | "badges": [ "library" ] 25 | } 26 | }, 27 | "loom:injected_interfaces": { 28 | "net/minecraft/class_2791": [ 29 | "org/ladysnake/cca/api/v3/component/ComponentAccess" 30 | ] 31 | } 32 | }, 33 | "depends": { 34 | "minecraft": ">=1.17-", 35 | "fabric-api-base": "*", 36 | "cardinal-components-base": ">=6.0.0-beta.2", 37 | "fabric-networking-api-v1": "*" 38 | }, 39 | "authors": [ 40 | { 41 | "name": "UpcraftLP", 42 | "contact": { 43 | "homepage": "https://twitter.com/UpcraftLP" 44 | } 45 | } 46 | ], 47 | "contact": { 48 | "homepage": "https://minecraft.curseforge.com/projects/318449", 49 | "issues": "https://github.com/NerdHubMC/Cardinal-Components-API/issues", 50 | "sources": "https://github.com/NerdHubMC/Cardinal-Components-API" 51 | }, 52 | "license": "MIT", 53 | "mixins": [ 54 | { 55 | "environment": "*", 56 | "config": "mixins.cardinal_components_chunk.json" 57 | } 58 | ] 59 | } 60 | -------------------------------------------------------------------------------- /cardinal-components-world/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cardinal-components-world", 5 | "name": "Cardinal Components API (worlds)", 6 | "description": "dynamically exposing components", 7 | "version": "${version}", 8 | "icon": "assets/cardinal-components-world/icon.png", 9 | "entrypoints": { 10 | "main": [ 11 | "org.ladysnake.cca.internal.world.CardinalComponentsWorld::init" 12 | ], 13 | "client": [ 14 | "org.ladysnake.cca.internal.world.CcaWorldClient::initClient" 15 | ] 16 | }, 17 | "custom": { 18 | "modmenu": { 19 | "badges": [ "library" ], 20 | "parent": { 21 | "id": "cardinal-components", 22 | "name": "Cardinal Components API", 23 | "description": "Attaching more data to various game objects", 24 | "badges": [ "library" ] 25 | } 26 | }, 27 | "loom:injected_interfaces": { 28 | "net/minecraft/class_1937": [ 29 | "org/ladysnake/cca/api/v3/component/ComponentAccess" 30 | ] 31 | } 32 | }, 33 | "depends": { 34 | "minecraft": ">=1.17-", 35 | "fabric-api-base": "*", 36 | "cardinal-components-base": ">=6.0.0-beta.2", 37 | "fabric-networking-api-v1": "*" 38 | }, 39 | "authors": [ 40 | { 41 | "name": "UpcraftLP", 42 | "contact": { 43 | "homepage": "https://twitter.com/UpcraftLP" 44 | } 45 | } 46 | ], 47 | "contact": { 48 | "homepage": "https://minecraft.curseforge.com/projects/318449", 49 | "issues": "https://github.com/Ladysnake/Cardinal-Components-API/issues", 50 | "sources": "https://github.com/Ladysnake/Cardinal-Components-API" 51 | }, 52 | "license": "MIT", 53 | "mixins": [ 54 | { 55 | "environment": "*", 56 | "config": "mixins.cardinal_components_world.json" 57 | } 58 | ] 59 | } 60 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cardinal-components-base", 5 | "name": "Cardinal Components API (base)", 6 | "description": "dynamically exposing components", 7 | "version": "${version}", 8 | "icon": "assets/cardinal-components-base/icon.png", 9 | "entrypoints": { 10 | "main": [ 11 | "org.ladysnake.cca.internal.base.ComponentsInternals::init" 12 | ] 13 | }, 14 | "custom": { 15 | "modmenu": { 16 | "badges": [ "library" ], 17 | "parent": { 18 | "id": "cardinal-components", 19 | "name": "Cardinal Components API", 20 | "description": "Attaching more data to various game objects", 21 | "badges": [ "library" ] 22 | } 23 | } 24 | }, 25 | "depends": { 26 | "minecraft": ">=1.17-", 27 | "fabric-api-base": ">=0.1.2" 28 | }, 29 | "breaks": { 30 | "cardinal-components-block": "<6.0.0-beta.2", 31 | "cardinal-components-chunk": "<6.0.0-beta.2", 32 | "cardinal-components-entity": "<6.0.0-beta.2", 33 | "cardinal-components-level": "<6.0.0-beta.2", 34 | "cardinal-components-scoreboard": "<6.0.0-beta.2", 35 | "cardinal-components-world": "<6.0.0-beta.2" 36 | }, 37 | "authors": [ 38 | { 39 | "name": "UpcraftLP", 40 | "contact": { 41 | "homepage": "https://twitter.com/UpcraftLP" 42 | } 43 | }, 44 | "Pyrofab" 45 | ], 46 | "contact": { 47 | "homepage": "https://minecraft.curseforge.com/projects/318449", 48 | "issues": "https://github.com/Ladysnake/Cardinal-Components-API/issues", 49 | "sources": "https://github.com/Ladysnake/Cardinal-Components-API" 50 | }, 51 | "license": "MIT", 52 | "mixins": [ 53 | { 54 | "environment": "*", 55 | "config": "mixins.cardinal_components_base.json" 56 | } 57 | ] 58 | } 59 | -------------------------------------------------------------------------------- /cardinal-components-entity/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cardinal-components-entity", 5 | "name": "Cardinal Components API (entities)", 6 | "description": "dynamically exposing components", 7 | "version": "${version}", 8 | "icon": "assets/cardinal-components-entity/icon.png", 9 | "entrypoints": { 10 | "main": [ 11 | "org.ladysnake.cca.internal.entity.CardinalComponentsEntity::init" 12 | ], 13 | "client": [ 14 | "org.ladysnake.cca.internal.entity.CcaEntityClient::initClient" 15 | ] 16 | }, 17 | "custom": { 18 | "modmenu": { 19 | "badges": [ "library" ], 20 | "parent": { 21 | "id": "cardinal-components", 22 | "name": "Cardinal Components API", 23 | "description": "Attaching more data to various game objects", 24 | "badges": [ "library" ] 25 | } 26 | }, 27 | "loom:injected_interfaces": { 28 | "net/minecraft/class_1297": [ 29 | "org/ladysnake/cca/api/v3/component/ComponentAccess" 30 | ] 31 | } 32 | }, 33 | "depends": { 34 | "minecraft": ">=1.17-", 35 | "fabric-api-base": "*", 36 | "cardinal-components-base": ">=6.0.0-beta.2" 37 | }, 38 | "recommends": { 39 | "fabric-networking-api-v1": "*" 40 | }, 41 | "authors": [ 42 | { 43 | "name": "UpcraftLP", 44 | "contact": { 45 | "homepage": "https://twitter.com/UpcraftLP" 46 | } 47 | } 48 | ], 49 | "contact": { 50 | "homepage": "https://minecraft.curseforge.com/projects/318449", 51 | "issues": "https://github.com/Ladysnake/Cardinal-Components-API/issues", 52 | "sources": "https://github.com/Ladysnake/Cardinal-Components-API" 53 | }, 54 | "license": "MIT", 55 | "mixins": [ 56 | { 57 | "environment": "*", 58 | "config": "mixins.cardinal_components_entity.json" 59 | } 60 | ] 61 | } 62 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/api/v3/component/sync/C2SComponentPacketWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.component.sync; 24 | 25 | import net.minecraft.network.RegistryByteBuf; 26 | import org.jetbrains.annotations.ApiStatus; 27 | import org.jetbrains.annotations.Contract; 28 | 29 | /** 30 | * @since 6.0.0 31 | */ 32 | @ApiStatus.Experimental 33 | @FunctionalInterface 34 | public interface C2SComponentPacketWriter { 35 | /** 36 | * A no-op writer, for when simply sending an empty message is enough 37 | */ 38 | C2SComponentPacketWriter EMPTY = buf -> {}; 39 | 40 | @Contract(mutates = "param") 41 | void writeC2SPacket(RegistryByteBuf buf); 42 | } 43 | -------------------------------------------------------------------------------- /cardinal-components-chunk/src/testmod/java/org/ladysnake/cca/test/chunk/ChunkVita.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.test.chunk; 24 | 25 | import net.minecraft.world.chunk.Chunk; 26 | import org.ladysnake.cca.api.v3.component.sync.AutoSyncedComponent; 27 | import org.ladysnake.cca.test.base.BaseVita; 28 | 29 | public class ChunkVita extends BaseVita implements AutoSyncedComponent { 30 | private final Chunk owner; 31 | 32 | public ChunkVita(Chunk owner) { 33 | this.owner = owner; 34 | } 35 | 36 | @Override 37 | public void setVitality(int value) { 38 | super.setVitality(value); 39 | this.owner.syncComponent(KEY); 40 | this.owner.markNeedsSaving(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /cardinal-components-block/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cardinal-components-block", 5 | "name": "Cardinal Components API (blocks)", 6 | "description": "dynamically exposing components", 7 | "version": "${version}", 8 | "icon": "assets/cardinal-components-block/icon.png", 9 | "entrypoints": { 10 | "main": [ 11 | "org.ladysnake.cca.internal.CardinalComponentsBlock::init" 12 | ], 13 | "client": [ 14 | "org.ladysnake.cca.internal.CcaBlockClient::initClient" 15 | ] 16 | }, 17 | "custom": { 18 | "modmenu": { 19 | "badges": [ "library" ], 20 | "parent": { 21 | "id": "cardinal-components", 22 | "name": "Cardinal Components API", 23 | "description": "Attaching more data to various game objects", 24 | "badges": [ "library" ] 25 | } 26 | }, 27 | "loom:injected_interfaces": { 28 | "net/minecraft/class_2586": [ 29 | "org/ladysnake/cca/api/v3/component/ComponentAccess" 30 | ] 31 | } 32 | }, 33 | "depends": { 34 | "minecraft": ">=1.17-", 35 | "fabric-api-base": "*", 36 | "fabric-api-lookup-api-v1": "*", 37 | "fabric-networking-api-v1": "*", 38 | "cardinal-components-base": ">=6.0.0-beta.2" 39 | }, 40 | "authors": [ 41 | { 42 | "name": "UpcraftLP", 43 | "contact": { 44 | "homepage": "https://twitter.com/UpcraftLP" 45 | } 46 | }, 47 | "Pyrofab", 48 | "B0undaryBreaker" 49 | ], 50 | "contact": { 51 | "homepage": "https://minecraft.curseforge.com/projects/318449", 52 | "issues": "https://github.com/Ladysnake/Cardinal-Components-API/issues", 53 | "sources": "https://github.com/Ladysnake/Cardinal-Components-API" 54 | }, 55 | "license": "MIT", 56 | "mixins": [ 57 | { 58 | "environment": "*", 59 | "config": "mixins.cardinal_components_block.json" 60 | } 61 | ] 62 | } 63 | -------------------------------------------------------------------------------- /cardinal-components-level/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "environment": "*", 4 | "id": "cardinal-components-level", 5 | "name": "Cardinal Components API (world saves)", 6 | "description": "dynamically exposing components", 7 | "version": "${version}", 8 | "icon": "assets/cardinal-components-level/icon.png", 9 | "entrypoints": { 10 | "main": [ 11 | "org.ladysnake.cca.internal.level.CardinalComponentsLevel::init" 12 | ], 13 | "client": [ 14 | "org.ladysnake.cca.internal.level.CcaLevelClient::initClient" 15 | ] 16 | }, 17 | "custom": { 18 | "modmenu": { 19 | "badges": [ "library" ], 20 | "parent": { 21 | "id": "cardinal-components", 22 | "name": "Cardinal Components API", 23 | "description": "Attaching more data to various game objects", 24 | "badges": [ "library" ] 25 | } 26 | }, 27 | "loom:injected_interfaces": { 28 | "net/minecraft/class_5217": [ 29 | "org/ladysnake/cca/api/v3/component/ComponentAccess" 30 | ] 31 | } 32 | }, 33 | "depends": { 34 | "minecraft": ">=1.17-", 35 | "fabric-api-base": "*", 36 | "cardinal-components-base": ">=6.0.0-beta.2", 37 | "fabric-networking-api-v1": "*" 38 | }, 39 | "recommends": { 40 | "cardinal-components-world": "*" 41 | }, 42 | "authors": [ 43 | { 44 | "name": "UpcraftLP", 45 | "contact": { 46 | "homepage": "https://twitter.com/UpcraftLP" 47 | } 48 | } 49 | ], 50 | "contact": { 51 | "homepage": "https://minecraft.curseforge.com/projects/318449", 52 | "issues": "https://github.com/Ladysnake/Cardinal-Components-API/issues", 53 | "sources": "https://github.com/Ladysnake/Cardinal-Components-API" 54 | }, 55 | "license": "MIT", 56 | "mixins": [ 57 | { 58 | "environment": "*", 59 | "config": "mixins.cardinal_components_level.json" 60 | } 61 | ] 62 | } 63 | -------------------------------------------------------------------------------- /cardinal-components-world/src/main/java/org/ladysnake/cca/internal/world/CcaWorldClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.internal.world; 24 | 25 | import net.fabricmc.loader.api.FabricLoader; 26 | import org.ladysnake.cca.internal.base.CcaClientInternals; 27 | 28 | public final class CcaWorldClient { 29 | public static void initClient() { 30 | if (FabricLoader.getInstance().isModLoaded("fabric-networking-api-v1")) { 31 | CcaClientInternals.registerComponentSync( 32 | CardinalComponentsWorld.PACKET_ID, 33 | (payload, ctx) -> payload.componentKey().flatMap( 34 | key -> key.maybeGet(ctx.client().world) 35 | ) 36 | ); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cardinal-components-level/src/testmod/java/org/ladysnake/cca/test/level/CcaLevelTestMod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.test.level; 24 | 25 | import org.ladysnake.cca.api.v3.level.LevelComponentFactoryRegistry; 26 | import org.ladysnake.cca.api.v3.level.LevelComponentInitializer; 27 | import org.ladysnake.cca.test.base.TickingTestComponent; 28 | import org.ladysnake.cca.test.base.Vita; 29 | 30 | public class CcaLevelTestMod implements LevelComponentInitializer { 31 | @Override 32 | public void registerLevelComponentFactories(LevelComponentFactoryRegistry registry) { 33 | registry.register(TickingTestComponent.KEY, props -> new TickingTestComponent()); 34 | registry.register(Vita.KEY, props -> new LevelVita()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /cardinal-components-chunk/src/main/java/org/ladysnake/cca/mixin/chunk/common/MixinServerWorld.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.chunk.common; 24 | 25 | import net.minecraft.server.world.ServerWorld; 26 | import net.minecraft.world.chunk.WorldChunk; 27 | import org.spongepowered.asm.mixin.Mixin; 28 | import org.spongepowered.asm.mixin.injection.At; 29 | import org.spongepowered.asm.mixin.injection.Inject; 30 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 31 | 32 | @Mixin(ServerWorld.class) 33 | public abstract class MixinServerWorld { 34 | @Inject(method = "tickChunk", at = @At("RETURN")) 35 | private void tick(WorldChunk chunk, int randomTickSpeed, CallbackInfo ci) { 36 | chunk.asComponentProvider().getComponentContainer().tickServerComponents(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /cardinal-components-entity/src/main/java/org/ladysnake/cca/api/v3/entity/TrackingStartCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.entity; 24 | 25 | import net.fabricmc.fabric.api.event.Event; 26 | import net.fabricmc.fabric.api.event.EventFactory; 27 | import net.minecraft.entity.Entity; 28 | import net.minecraft.server.network.ServerPlayerEntity; 29 | 30 | @FunctionalInterface 31 | public interface TrackingStartCallback { 32 | Event EVENT = EventFactory.createArrayBacked(TrackingStartCallback.class, (p, e) -> {}, listeners -> (player, entity) -> { 33 | for (TrackingStartCallback callback : listeners) { 34 | callback.onPlayerStartTracking(player, entity); 35 | } 36 | }); 37 | 38 | void onPlayerStartTracking(ServerPlayerEntity player, Entity entity); 39 | } 40 | -------------------------------------------------------------------------------- /cardinal-components-level/src/main/java/org/ladysnake/cca/internal/level/CcaLevelClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.internal.level; 24 | 25 | import net.fabricmc.loader.api.FabricLoader; 26 | import org.ladysnake.cca.internal.base.CcaClientInternals; 27 | 28 | import java.util.Objects; 29 | 30 | public final class CcaLevelClient { 31 | public static void initClient() { 32 | if (FabricLoader.getInstance().isModLoaded("fabric-networking-api-v1")) { 33 | CcaClientInternals.registerComponentSync( 34 | CardinalComponentsLevel.PACKET_ID, 35 | (payload, ctx) -> payload.componentKey().flatMap( 36 | key -> key.maybeGet(Objects.requireNonNull(ctx.client().world).getLevelProperties()) 37 | ) 38 | ); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /cardinal-components-entity/src/main/java/org/ladysnake/cca/mixin/entity/common/MixinServerPlayerEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.entity.common; 24 | 25 | import net.minecraft.server.network.ServerPlayerEntity; 26 | import org.ladysnake.cca.internal.entity.SwitchablePlayerEntity; 27 | import org.spongepowered.asm.mixin.Mixin; 28 | import org.spongepowered.asm.mixin.Unique; 29 | 30 | @Mixin(ServerPlayerEntity.class) 31 | public abstract class MixinServerPlayerEntity implements SwitchablePlayerEntity { 32 | @Unique 33 | private boolean switchingCharacter = false; 34 | 35 | @Override 36 | public void cca$markAsSwitchingCharacter() { 37 | this.switchingCharacter = true; 38 | } 39 | 40 | @Override 41 | public boolean cca$isSwitchingCharacter() { 42 | return this.switchingCharacter; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/api/v3/scoreboard/TeamAddCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.scoreboard; 24 | 25 | import net.fabricmc.fabric.api.event.Event; 26 | import net.fabricmc.fabric.api.event.EventFactory; 27 | import net.minecraft.scoreboard.Team; 28 | 29 | /** 30 | * The callback interface for receiving global team synchronization events. 31 | */ 32 | @FunctionalInterface 33 | public interface TeamAddCallback { 34 | Event EVENT = EventFactory.createArrayBacked(TeamAddCallback.class, (t) -> {}, listeners -> (team) -> { 35 | for (TeamAddCallback callback : listeners) { 36 | callback.onTeamAdded(team); 37 | } 38 | }); 39 | 40 | /** 41 | * Called when a team's data is sent to all players 42 | */ 43 | void onTeamAdded(Team team); 44 | } 45 | -------------------------------------------------------------------------------- /cardinal-components-world/src/main/java/org/ladysnake/cca/mixin/world/client/MixinClientWorld.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.world.client; 24 | 25 | import net.minecraft.client.world.ClientWorld; 26 | import org.ladysnake.cca.api.v3.component.ComponentProvider; 27 | import org.spongepowered.asm.mixin.Mixin; 28 | import org.spongepowered.asm.mixin.injection.At; 29 | import org.spongepowered.asm.mixin.injection.Inject; 30 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 31 | 32 | import java.util.function.BooleanSupplier; 33 | 34 | @Mixin(ClientWorld.class) 35 | public abstract class MixinClientWorld { 36 | @Inject(method = "tick", at = @At("RETURN")) 37 | private void tick(BooleanSupplier shouldKeepTicking, CallbackInfo ci) { 38 | ((ComponentProvider) this).getComponentContainer().tickClientComponents(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/testmod/java/org/ladysnake/componenttest/content/CCATestClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.componenttest.content; 24 | 25 | import net.fabricmc.fabric.api.client.item.v1.ItemTooltipCallback; 26 | import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; 27 | import net.minecraft.client.render.entity.ZombieEntityRenderer; 28 | import net.minecraft.text.Text; 29 | 30 | public final class CCATestClient { 31 | public static void clientInit() { 32 | EntityRendererRegistry.register(CardinalComponentsTest.VITALITY_ZOMBIE, ZombieEntityRenderer::new); 33 | ItemTooltipCallback.EVENT.register((stack, tooltipContext, tooltipType, lines) -> 34 | TestComponents.ALT_VITA.maybeGet(stack).ifPresent(vita -> lines.add(Text.translatable("componenttest:tooltip.vitality.native", vita.getVitality()))) 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/api/v3/util/CheckEnvironment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.util; 24 | 25 | import net.fabricmc.api.EnvType; 26 | import net.fabricmc.api.Environment; 27 | 28 | import java.lang.annotation.ElementType; 29 | import java.lang.annotation.Retention; 30 | import java.lang.annotation.RetentionPolicy; 31 | import java.lang.annotation.Target; 32 | 33 | /** 34 | * Indicates that the annotated method must only be called in a specific environment. 35 | * 36 | *

Unlike {@link Environment}, this annotation is purely informational and does not strip bytecode. 37 | */ 38 | @Target(ElementType.METHOD) 39 | @Retention(RetentionPolicy.SOURCE) 40 | public @interface CheckEnvironment { 41 | /** 42 | * Returns the environment type that the annotated element requires. 43 | */ 44 | EnvType value(); 45 | } 46 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/internal/base/asm/AsmGeneratedCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.internal.base.asm; 24 | 25 | import org.ladysnake.cca.api.v3.component.Component; 26 | 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Retention; 29 | import java.lang.annotation.RetentionPolicy; 30 | import java.lang.annotation.Target; 31 | 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target(ElementType.METHOD) 34 | public @interface AsmGeneratedCallback { 35 | /** 36 | * The type of component that should be called by the ASM implementation. 37 | * 38 | *

The returned type should declare exactly one method annotated with {@link CalledByAsm}. 39 | * 40 | * @return the specific type of component targeted by this callback 41 | */ 42 | Class value(); 43 | } 44 | -------------------------------------------------------------------------------- /cardinal-components-entity/src/testmod/java/org/ladysnake/cca/test/entity/CcaEntityTestClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.test.entity; 24 | 25 | import net.fabricmc.api.ClientModInitializer; 26 | import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; 27 | import net.minecraft.entity.mob.ShulkerEntity; 28 | import org.ladysnake.cca.api.v3.component.sync.C2SComponentPacketWriter; 29 | import org.ladysnake.cca.test.base.Vita; 30 | 31 | public class CcaEntityTestClient implements ClientModInitializer { 32 | @Override 33 | public void onInitializeClient() { 34 | ClientTickEvents.END_CLIENT_TICK.register(client -> { 35 | if (client.targetedEntity instanceof ShulkerEntity) { 36 | ((PlayerVita) Vita.get(client.player)).sendC2SMessage(C2SComponentPacketWriter.EMPTY); 37 | } 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/testmod/java/org/ladysnake/cca/test/scoreboard/CcaScoreboardTestMod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.test.scoreboard; 24 | 25 | import org.ladysnake.cca.api.v3.scoreboard.ScoreboardComponentFactoryRegistry; 26 | import org.ladysnake.cca.api.v3.scoreboard.ScoreboardComponentInitializer; 27 | import org.ladysnake.cca.test.base.LoadAwareTestComponent; 28 | import org.ladysnake.cca.test.base.Vita; 29 | 30 | public class CcaScoreboardTestMod implements ScoreboardComponentInitializer { 31 | @Override 32 | public void registerScoreboardComponentFactories(ScoreboardComponentFactoryRegistry registry) { 33 | registry.registerScoreboardComponent(LoadAwareTestComponent.KEY, (sb, server) -> new LoadAwareTestComponent()); 34 | registry.registerScoreboardComponent(Vita.KEY, (sb, server) -> new ScoreboardVita(sb)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /cardinal-components-chunk/src/main/java/org/ladysnake/cca/mixin/chunk/common/MixinWrapperProtoChunk.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.chunk.common; 24 | 25 | import net.minecraft.world.chunk.WorldChunk; 26 | import net.minecraft.world.chunk.WrapperProtoChunk; 27 | import org.ladysnake.cca.api.v3.component.ComponentContainer; 28 | import org.ladysnake.cca.api.v3.component.ComponentProvider; 29 | import org.spongepowered.asm.mixin.Final; 30 | import org.spongepowered.asm.mixin.Mixin; 31 | import org.spongepowered.asm.mixin.Shadow; 32 | 33 | @Mixin(WrapperProtoChunk.class) 34 | public abstract class MixinWrapperProtoChunk implements ComponentProvider { 35 | @Shadow 36 | @Final 37 | private WorldChunk wrapped; 38 | 39 | @Override 40 | public ComponentContainer getComponentContainer() { 41 | return this.wrapped.asComponentProvider().getComponentContainer(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /cardinal-components-level/src/testmod/java/org/ladysnake/cca/test/level/CcaLevelTestSuite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.test.level; 24 | 25 | import net.fabricmc.fabric.api.gametest.v1.GameTest; 26 | import net.minecraft.test.TestContext; 27 | import net.minecraft.text.Text; 28 | import org.ladysnake.cca.test.base.TickingTestComponent; 29 | 30 | public class CcaLevelTestSuite { 31 | @GameTest 32 | public void levelComponentsTick(TestContext ctx) { 33 | int baseTicks = ctx.getWorld().getLevelProperties().getComponent(TickingTestComponent.KEY).serverTicks(); 34 | ctx.waitAndRun(5, () -> { 35 | int ticks = ctx.getWorld().getLevelProperties().getComponent(TickingTestComponent.KEY).serverTicks(); 36 | ctx.assertEquals(5, ticks - baseTicks, Text.literal("Component should tick 5 times -")); 37 | ctx.complete(); 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/api/v3/component/ComponentFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.component; 24 | 25 | import org.jetbrains.annotations.Contract; 26 | 27 | /** 28 | * A single-arg component factory. 29 | * 30 | *

When invoked, the factory must return a {@link Component} of the right type. 31 | * 32 | * @since 3.0.0 33 | */ 34 | @FunctionalInterface 35 | public interface ComponentFactory { 36 | /** 37 | * Instantiates a {@link Component} for the given provider. 38 | * 39 | *

The component returned by this method will be available 40 | * on the provider as soon as all component factories have been invoked. 41 | * 42 | * @param t the factory argument 43 | * @return a new {@link Component} 44 | */ 45 | @Contract(value = "_ -> new", pure = true) 46 | C createComponent(T t); 47 | } 48 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/mixin/scoreboard/MixinPersistentState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.scoreboard; 24 | 25 | import net.minecraft.scoreboard.ScoreboardState; 26 | import net.minecraft.world.PersistentState; 27 | import org.spongepowered.asm.mixin.Mixin; 28 | import org.spongepowered.asm.mixin.injection.At; 29 | import org.spongepowered.asm.mixin.injection.Inject; 30 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 31 | 32 | @Mixin(PersistentState.class) 33 | public abstract class MixinPersistentState { 34 | @Inject(method = "isDirty", at = @At("RETURN"), cancellable = true) 35 | private void forceDirty(CallbackInfoReturnable cir) { 36 | //noinspection ConstantConditions 37 | if (!cir.getReturnValueZ() && (Object) this instanceof ScoreboardState) { 38 | cir.setReturnValue(true); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /cardinal-components-chunk/src/main/java/org/ladysnake/cca/mixin/chunk/common/MixinEmptyChunk.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.chunk.common; 24 | 25 | import net.minecraft.util.math.ChunkPos; 26 | import net.minecraft.world.World; 27 | import net.minecraft.world.chunk.EmptyChunk; 28 | import net.minecraft.world.chunk.WorldChunk; 29 | import org.jetbrains.annotations.NotNull; 30 | import org.ladysnake.cca.api.v3.component.ComponentContainer; 31 | import org.ladysnake.cca.api.v3.component.ComponentProvider; 32 | import org.spongepowered.asm.mixin.Mixin; 33 | 34 | @Mixin(EmptyChunk.class) 35 | public abstract class MixinEmptyChunk extends WorldChunk implements ComponentProvider { 36 | public MixinEmptyChunk(World world, ChunkPos pos) { 37 | super(world, pos); 38 | } 39 | 40 | @Override 41 | public @NotNull ComponentContainer getComponentContainer() { 42 | return ComponentContainer.EMPTY; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /cardinal-components-item/src/main/java/org/ladysnake/cca/mixin/item/common/MixinItemStackComponentizationFix.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.item.common; 24 | 25 | import com.mojang.serialization.Dynamic; 26 | import net.minecraft.datafixer.fix.ItemStackComponentizationFix; 27 | import org.ladysnake.cca.internal.item.StaticItemComponentPlugin; 28 | import org.spongepowered.asm.mixin.Mixin; 29 | import org.spongepowered.asm.mixin.injection.At; 30 | import org.spongepowered.asm.mixin.injection.Inject; 31 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 32 | 33 | @Mixin(ItemStackComponentizationFix.class) 34 | public abstract class MixinItemStackComponentizationFix { 35 | @Inject(method = "fixStack", at = @At("RETURN")) 36 | private static void fixStack(ItemStackComponentizationFix.StackData data, Dynamic dynamic, CallbackInfo ci) { 37 | StaticItemComponentPlugin.INSTANCE.migrate(data); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cardinal-components-world/src/main/java/org/ladysnake/cca/mixin/world/common/MixinPlayerManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.world.common; 24 | 25 | import net.minecraft.server.PlayerManager; 26 | import net.minecraft.server.network.ServerPlayerEntity; 27 | import net.minecraft.server.world.ServerWorld; 28 | import org.ladysnake.cca.api.v3.world.WorldSyncCallback; 29 | import org.spongepowered.asm.mixin.Mixin; 30 | import org.spongepowered.asm.mixin.injection.At; 31 | import org.spongepowered.asm.mixin.injection.Inject; 32 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 33 | 34 | @Mixin(PlayerManager.class) 35 | public abstract class MixinPlayerManager { 36 | @Inject(method = "sendWorldInfo", at = @At("RETURN")) 37 | private void sendWorldInfo(ServerPlayerEntity player, ServerWorld world, CallbackInfo ci) { 38 | WorldSyncCallback.EVENT.invoker().onPlayerStartTracking(player, world); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/api/v3/component/sync/PlayerSyncPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.component.sync; 24 | 25 | import net.minecraft.entity.player.PlayerEntity; 26 | import net.minecraft.server.network.ServerPlayerEntity; 27 | import org.jetbrains.annotations.Contract; 28 | 29 | public interface PlayerSyncPredicate { 30 | @Contract(pure = true) 31 | boolean shouldSyncWith(ServerPlayerEntity player); 32 | 33 | /** 34 | * If this method returns {@code true} and a client cannot handle a sync packet, they will be disconnected. 35 | * Otherwise, the sync will be skipped. 36 | */ 37 | default boolean isRequiredOnClient() { 38 | return true; 39 | } 40 | 41 | static PlayerSyncPredicate all() { 42 | return p -> true; 43 | } 44 | 45 | static PlayerSyncPredicate only(PlayerEntity player) { 46 | return p -> p == player; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /cardinal-components-world/src/main/java/org/ladysnake/cca/api/v3/world/WorldComponentInitializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.world; 24 | 25 | import net.fabricmc.api.ModInitializer; 26 | import net.minecraft.world.World; 27 | import org.ladysnake.cca.internal.base.ComponentRegistrationInitializer; 28 | 29 | /** 30 | * Entrypoint getting invoked to register static world component factories. 31 | * 32 | *

The entrypoint is exposed as either {@code "cardinal-components"} or {@code "cardinal-components-world"} in the mod json and runs for any environment. 33 | * It usually executes during {@linkplain ModInitializer mod init}, or right before the first {@link World} instance is created, whichever comes first. 34 | * 35 | * @since 2.4.0 36 | */ 37 | public interface WorldComponentInitializer extends ComponentRegistrationInitializer { 38 | void registerWorldComponentFactories(WorldComponentFactoryRegistry registry); 39 | } 40 | -------------------------------------------------------------------------------- /cardinal-components-block/src/main/java/org/ladysnake/cca/mixin/block/common/MixinChunkHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.block.common; 24 | 25 | import net.minecraft.block.entity.BlockEntity; 26 | import net.minecraft.server.world.ChunkHolder; 27 | import org.ladysnake.cca.api.v3.block.BlockEntitySyncAroundCallback; 28 | import org.spongepowered.asm.mixin.Mixin; 29 | import org.spongepowered.asm.mixin.injection.At; 30 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 31 | 32 | @Mixin(ChunkHolder.class) 33 | public abstract class MixinChunkHolder { 34 | @ModifyVariable(method = "sendBlockEntityUpdatePacket", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/entity/BlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/Packet;")) 35 | private BlockEntity sendBlockEntityUpdate(BlockEntity be) { 36 | BlockEntitySyncAroundCallback.EVENT.invoker().onBlockEntitySync(be); 37 | return be; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cardinal-components-entity/src/main/java/org/ladysnake/cca/api/v3/entity/PlayerSyncCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.entity; 24 | 25 | import net.fabricmc.fabric.api.event.Event; 26 | import net.fabricmc.fabric.api.event.EventFactory; 27 | import net.minecraft.server.network.ServerPlayerEntity; 28 | 29 | /** 30 | * The callback interface for receiving player synchronization events. 31 | */ 32 | @FunctionalInterface 33 | public interface PlayerSyncCallback { 34 | Event EVENT = EventFactory.createArrayBacked(PlayerSyncCallback.class, (p) -> {}, listeners -> (player) -> { 35 | for (PlayerSyncCallback callback : listeners) { 36 | callback.onPlayerSync(player); 37 | } 38 | }); 39 | 40 | /** 41 | * Called when a player eg. joins the server or changes dimension, can be used to synchronize the player's own data 42 | */ 43 | void onPlayerSync(ServerPlayerEntity player); 44 | } 45 | -------------------------------------------------------------------------------- /cardinal-components-block/src/main/java/org/ladysnake/cca/api/v3/block/BlockEntitySyncAroundCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.block; 24 | 25 | import net.fabricmc.fabric.api.event.Event; 26 | import net.fabricmc.fabric.api.event.EventFactory; 27 | import net.minecraft.block.entity.BlockEntity; 28 | 29 | /** 30 | * The callback interface for receiving {@link BlockEntity} synchronization events. 31 | */ 32 | @FunctionalInterface 33 | public interface BlockEntitySyncAroundCallback { 34 | Event EVENT = EventFactory.createArrayBacked(BlockEntitySyncAroundCallback.class, (be) -> {}, listeners -> (be) -> { 35 | for (BlockEntitySyncAroundCallback callback : listeners) { 36 | callback.onBlockEntitySync(be); 37 | } 38 | }); 39 | 40 | /** 41 | * Called when a {@link BlockEntity}'s data is sent to watching players 42 | */ 43 | void onBlockEntitySync(BlockEntity blockEntity); 44 | } 45 | -------------------------------------------------------------------------------- /cardinal-components-chunk/src/main/java/org/ladysnake/cca/api/v3/chunk/ChunkSyncCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.chunk; 24 | 25 | import net.fabricmc.fabric.api.event.Event; 26 | import net.fabricmc.fabric.api.event.EventFactory; 27 | import net.minecraft.server.network.ServerPlayerEntity; 28 | import net.minecraft.world.chunk.WorldChunk; 29 | 30 | /** 31 | * The callback interface for receiving chunk synchronization events. 32 | */ 33 | @FunctionalInterface 34 | public interface ChunkSyncCallback { 35 | Event EVENT = EventFactory.createArrayBacked(ChunkSyncCallback.class, (p, chunk) -> {}, listeners -> (player, chunk) -> { 36 | for (ChunkSyncCallback callback : listeners) { 37 | callback.onChunkSync(player, chunk); 38 | } 39 | }); 40 | 41 | /** 42 | * Called when a chunk's data is sent to a player 43 | */ 44 | void onChunkSync(ServerPlayerEntity player, WorldChunk chunk); 45 | } 46 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/api/v3/component/tick/ServerTickingComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.component.tick; 24 | 25 | import org.ladysnake.cca.api.v3.component.Component; 26 | import org.ladysnake.cca.api.v3.component.ComponentRegistryV3; 27 | import org.ladysnake.cca.internal.base.asm.CalledByAsm; 28 | import net.minecraft.util.Identifier; 29 | 30 | /** 31 | * A component that gets ticked alongside the provider it is attached to. 32 | * 33 | *

This interface must be visible at factory registration time - which means the class implementing it 34 | * must either be the parameter to {@link ComponentRegistryV3#getOrCreate(Identifier, Class)} or declared explicitly 35 | * using a dedicated method on the factory registry. 36 | * 37 | * @see ClientTickingComponent 38 | * @see CommonTickingComponent 39 | */ 40 | public interface ServerTickingComponent extends Component { 41 | @CalledByAsm 42 | void serverTick(); 43 | } 44 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/mixin/scoreboard/MixinPlayerManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.scoreboard; 24 | 25 | import net.minecraft.scoreboard.ServerScoreboard; 26 | import net.minecraft.server.PlayerManager; 27 | import net.minecraft.server.network.ServerPlayerEntity; 28 | import org.ladysnake.cca.api.v3.scoreboard.ScoreboardSyncCallback; 29 | import org.spongepowered.asm.mixin.Mixin; 30 | import org.spongepowered.asm.mixin.injection.At; 31 | import org.spongepowered.asm.mixin.injection.Inject; 32 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 33 | 34 | @Mixin(PlayerManager.class) 35 | public abstract class MixinPlayerManager { 36 | @Inject(method = "sendScoreboard", at = @At("RETURN")) 37 | private void syncTeamComponents(ServerScoreboard scoreboard, ServerPlayerEntity player, CallbackInfo ci) { 38 | ScoreboardSyncCallback.EVENT.invoker().onScoreboardSync(player, scoreboard); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /cardinal-components-world/src/main/java/org/ladysnake/cca/api/v3/world/WorldSyncCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.world; 24 | 25 | import net.fabricmc.fabric.api.event.Event; 26 | import net.fabricmc.fabric.api.event.EventFactory; 27 | import net.minecraft.server.network.ServerPlayerEntity; 28 | import net.minecraft.server.world.ServerWorld; 29 | 30 | /** 31 | * Callback interface to receive world synchronization events. 32 | */ 33 | @FunctionalInterface 34 | public interface WorldSyncCallback { 35 | Event EVENT = EventFactory.createArrayBacked(WorldSyncCallback.class, (p, e) -> {}, listeners -> (player, world) -> { 36 | for (WorldSyncCallback callback : listeners) { 37 | callback.onPlayerStartTracking(player, world); 38 | } 39 | }); 40 | 41 | /** 42 | * Called when a player starts tracking a world (eg. by joining it). 43 | */ 44 | void onPlayerStartTracking(ServerPlayerEntity player, ServerWorld world); 45 | } 46 | -------------------------------------------------------------------------------- /cardinal-components-base/src/testmod/java/org/ladysnake/cca/test/base/Vita.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.test.base; 24 | 25 | import net.minecraft.util.Identifier; 26 | import org.ladysnake.cca.api.v3.component.ComponentKey; 27 | import org.ladysnake.cca.api.v3.component.ComponentRegistryV3; 28 | import org.ladysnake.cca.api.v3.component.ComponentV3; 29 | 30 | public interface Vita extends ComponentV3 { 31 | ComponentKey KEY = ComponentRegistryV3.INSTANCE.getOrCreate(Identifier.of("cca-base-test", "vita"), Vita.class); 32 | 33 | static Vita get(Object provider) { 34 | return KEY.get(provider); 35 | } 36 | 37 | int getVitality(); 38 | void setVitality(int value); 39 | default void transferTo(Vita dest, int amount) { 40 | int sourceVitality = this.getVitality(); 41 | int actualAmount = Math.min(sourceVitality, amount); 42 | this.setVitality(sourceVitality - actualAmount); 43 | dest.setVitality(dest.getVitality() + actualAmount); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /cardinal-components-level/src/main/java/org/ladysnake/cca/mixin/level/common/MixinMinecraftServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.level.common; 24 | 25 | import net.minecraft.server.MinecraftServer; 26 | import net.minecraft.world.SaveProperties; 27 | import org.spongepowered.asm.mixin.Mixin; 28 | import org.spongepowered.asm.mixin.Shadow; 29 | import org.spongepowered.asm.mixin.injection.At; 30 | import org.spongepowered.asm.mixin.injection.Inject; 31 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 32 | 33 | import java.util.function.BooleanSupplier; 34 | 35 | @Mixin(MinecraftServer.class) 36 | public abstract class MixinMinecraftServer { 37 | @Shadow public abstract SaveProperties getSaveProperties(); 38 | 39 | @Inject(at = @At("TAIL"), method = "tick") 40 | private void onEndTick(BooleanSupplier shouldKeepTicking, CallbackInfo info) { 41 | this.getSaveProperties().getMainWorldProperties().asComponentProvider().getComponentContainer().tickServerComponents(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /cardinal-components-level/src/main/java/org/ladysnake/cca/mixin/level/common/MixinUnmodifiableLevelProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.mixin.level.common; 24 | 25 | import net.minecraft.world.level.ServerWorldProperties; 26 | import net.minecraft.world.level.UnmodifiableLevelProperties; 27 | import org.ladysnake.cca.api.v3.component.ComponentContainer; 28 | import org.ladysnake.cca.api.v3.component.ComponentProvider; 29 | import org.spongepowered.asm.mixin.Final; 30 | import org.spongepowered.asm.mixin.Mixin; 31 | import org.spongepowered.asm.mixin.Shadow; 32 | 33 | import javax.annotation.Nonnull; 34 | 35 | @Mixin(UnmodifiableLevelProperties.class) 36 | public abstract class MixinUnmodifiableLevelProperties implements ComponentProvider { 37 | 38 | @Shadow @Final private ServerWorldProperties worldProperties; 39 | 40 | @Nonnull 41 | @Override 42 | public ComponentContainer getComponentContainer() { 43 | return this.worldProperties.asComponentProvider().getComponentContainer(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/testmod/java/org/ladysnake/cca/test/scoreboard/ScoreboardVita.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.test.scoreboard; 24 | 25 | import net.minecraft.network.RegistryByteBuf; 26 | import net.minecraft.scoreboard.Scoreboard; 27 | import net.minecraft.server.network.ServerPlayerEntity; 28 | import net.minecraft.storage.ReadView; 29 | import net.minecraft.storage.WriteView; 30 | import org.ladysnake.cca.test.base.SyncedVita; 31 | 32 | public class ScoreboardVita extends SyncedVita { 33 | public ScoreboardVita(Scoreboard owner) { 34 | super(owner); 35 | } 36 | 37 | @Override 38 | public void writeSyncPacket(RegistryByteBuf buf, ServerPlayerEntity recipient) { 39 | super.writeSyncPacket(buf, recipient); 40 | } 41 | 42 | @Override 43 | public void writeData(WriteView writeView) { 44 | super.writeData(writeView); 45 | } 46 | 47 | @Override 48 | public void readData(ReadView readView) { 49 | super.readData(readView); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /cardinal-components-base/src/main/java/org/ladysnake/cca/api/v3/component/TransientComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.component; 24 | 25 | import net.minecraft.storage.ReadView; 26 | import net.minecraft.storage.WriteView; 27 | import org.jetbrains.annotations.Nullable; 28 | 29 | /** 30 | * Utility interface for components that do not hold any data 31 | */ 32 | public interface TransientComponent extends Component { 33 | @Override 34 | default void readData(ReadView readView) { 35 | // Nothing to read 36 | } 37 | 38 | @Override 39 | default void writeData(WriteView writeView) { 40 | // Nothing to write 41 | } 42 | 43 | abstract class SimpleImpl implements TransientComponent { 44 | @Override 45 | public int hashCode() { 46 | return 1337; 47 | } 48 | 49 | @Override 50 | public boolean equals(@Nullable Object obj) { 51 | return obj != null && obj.getClass() == this.getClass(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/api/v3/scoreboard/ScoreboardSyncCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.scoreboard; 24 | 25 | import net.fabricmc.fabric.api.event.Event; 26 | import net.fabricmc.fabric.api.event.EventFactory; 27 | import net.minecraft.scoreboard.Scoreboard; 28 | import net.minecraft.server.network.ServerPlayerEntity; 29 | 30 | /** 31 | * The callback interface for receiving scoreboard synchronization events. 32 | */ 33 | @FunctionalInterface 34 | public interface ScoreboardSyncCallback { 35 | Event EVENT = EventFactory.createArrayBacked(ScoreboardSyncCallback.class, (p, t) -> {}, listeners -> (player, scoreboard) -> { 36 | for (ScoreboardSyncCallback callback : listeners) { 37 | callback.onScoreboardSync(player, scoreboard); 38 | } 39 | }); 40 | 41 | /** 42 | * Called when a team's data is sent to a player 43 | */ 44 | void onScoreboardSync(ServerPlayerEntity player, Scoreboard scoreboard); 45 | } 46 | -------------------------------------------------------------------------------- /cardinal-components-block/src/main/java/org/ladysnake/cca/api/v3/block/BlockEntitySyncCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.api.v3.block; 24 | 25 | import net.fabricmc.fabric.api.event.Event; 26 | import net.fabricmc.fabric.api.event.EventFactory; 27 | import net.minecraft.block.entity.BlockEntity; 28 | import net.minecraft.server.network.ServerPlayerEntity; 29 | 30 | /** 31 | * The callback interface for receiving {@link BlockEntity} synchronization events. 32 | */ 33 | @FunctionalInterface 34 | public interface BlockEntitySyncCallback { 35 | Event EVENT = EventFactory.createArrayBacked(BlockEntitySyncCallback.class, (p, be) -> {}, listeners -> (player, be) -> { 36 | for (BlockEntitySyncCallback callback : listeners) { 37 | callback.onBlockEntitySync(player, be); 38 | } 39 | }); 40 | 41 | /** 42 | * Called when a {@link BlockEntity}'s data is sent to a player 43 | */ 44 | void onBlockEntitySync(ServerPlayerEntity player, BlockEntity blockEntity); 45 | } 46 | -------------------------------------------------------------------------------- /cardinal-components-chunk/src/testmod/java/org/ladysnake/cca/test/chunk/CcaChunkTestMod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Cardinal-Components-API 3 | * Copyright (C) 2019-2025 Ladysnake 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy 6 | * of this software and associated documentation files (the "Software"), to deal 7 | * in the Software without restriction, including without limitation the rights 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | * copies of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | * OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | package org.ladysnake.cca.test.chunk; 24 | 25 | import net.fabricmc.api.ModInitializer; 26 | import org.ladysnake.cca.api.v3.chunk.ChunkComponentFactoryRegistry; 27 | import org.ladysnake.cca.api.v3.chunk.ChunkComponentInitializer; 28 | import org.ladysnake.cca.test.base.LoadAwareTestComponent; 29 | import org.ladysnake.cca.test.base.TickingTestComponent; 30 | import org.ladysnake.cca.test.base.Vita; 31 | 32 | public class CcaChunkTestMod implements ModInitializer, ChunkComponentInitializer { 33 | @Override 34 | public void registerChunkComponentFactories(ChunkComponentFactoryRegistry registry) { 35 | registry.register(TickingTestComponent.KEY, chunk -> new TickingTestComponent()); 36 | registry.register(Vita.KEY, ChunkVita::new); 37 | registry.register(LoadAwareTestComponent.KEY, chunk -> new LoadAwareTestComponent()); 38 | } 39 | 40 | @Override 41 | public void onInitialize() { 42 | 43 | } 44 | } 45 | --------------------------------------------------------------------------------