Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: DataComponents #75

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ subprojects {
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
maven("https://erethon.de/repo/")
mavenLocal()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.spaceio.xyz/repository/maven-snapshots/")
maven("https://jitpack.io")
maven("https://mvn.lumine.io/repository/maven-public/") { metadataSources { artifact() } }// MythicMobs
maven("https://repo.unnamed.team/repository/unnamed-public/")
maven("https://repo.oraxen.com/releases")
maven("https://repo.oraxen.com/snapshots")
maven("https://repo.nexomc.com/releases")
maven("https://repo.nexomc.com/snapshots")
}

tasks {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=com.mineinabyss
version=0.25
version=0.26
25 changes: 13 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[versions]
anvilgui = "1.10.3-SNAPSHOT"
compose = "1.6.11"
coroutines = "1.9.0-RC"
compose = "1.7.1"
coroutines = "1.9.0"
creative = "1.7.3"
dependencyversions = "0.51.0"
dokka = "1.9.20"
exposed = "0.55.0"
exposed = "0.56.0"
fastutil = "8.5.14"
fawe = "2.8.4"
fawe = "2.12.2"
itemsadder = "3.6.1"
junit = "5.11.0"
jvm = "21"
Expand All @@ -22,19 +22,19 @@ ktor = "2.3.11"
logback = "1.5.9"
mccoroutine = "2.20.0"
# @pin
minecraft = "1.21.1-R0.1-SNAPSHOT"
mockbukkit = "3.133.0"
minecraft = "1.21.3-R0.1-SNAPSHOT"
mockbukkit = "3.133.2"
mockk = "1.13.13"
modelengine = "R4.0.7"
mythic-dist = "5.7.2"
mythiccrucible = "2.0.0"
oraxen = "1.182.0"
mythic-dist = "5.8.0-SNAPSHOT"
mythiccrucible = "2.2.0-SNAPSHOT"
nexo = "0.1.0-dev.52"
protocollib = "5.3.0-SNAPSHOT"
reflections = "0.10.2"
serialization = "1.7.3"
shadowjar = "8.3.0"
shadowjar = "8.3.5"
sqlite-jdbc = "3.46.0.0"
userdev = "1.7.3"
userdev = "1.7.5"
vault = "1.7"
version-catalog-update = "0.8.4"
worldguard = "7.1.0-SNAPSHOT"
Expand Down Expand Up @@ -78,13 +78,14 @@ minecraft-mccoroutine = { module = "com.github.shynixn.mccoroutine:mccoroutine-b
minecraft-mccoroutine-core = { module = "com.github.shynixn.mccoroutine:mccoroutine-bukkit-core", version.ref = "mccoroutine" }
minecraft-mockbukkit = { module = "com.github.seeseemelk:MockBukkit-v1.21", version.ref = "mockbukkit" }
minecraft-papermc = { module = "io.papermc.paper:paper-api", version.ref = "minecraft" }
#minecraft-cartridge = { module = "com.mineinabyss.cartridge:cartridge-api", version.ref = "minecraft" }
minecraft-plugin-fawe-bukkit = { module = "com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit", version.ref = "fawe" }
minecraft-plugin-fawe-core = { module = "com.fastasyncworldedit:FastAsyncWorldEdit-Core", version.ref = "fawe" }
minecraft-plugin-itemsadder = { module = "com.github.LoneDev6:api-itemsadder", version.ref = "itemsadder" }
minecraft-plugin-modelengine = { module = "com.ticxo.modelengine:ModelEngine", version.ref = "modelengine" }
minecraft-plugin-mythic-crucible = { module = "io.lumine:MythicCrucible", version.ref = "mythiccrucible" }
minecraft-plugin-mythic-dist = { module = "io.lumine:Mythic-Dist", version.ref = "mythic-dist" }
minecraft-plugin-oraxen = { module = "io.th0rgal:oraxen", version.ref = "oraxen" }
minecraft-plugin-nexo = { module = "com.nexomc:nexo", version.ref = "nexo" }
minecraft-plugin-protocollib = { module = "com.comphenix.protocol:ProtocolLib", version.ref = "protocollib" }
minecraft-plugin-vault = { module = "com.github.MilkBowl:VaultAPI", version.ref = "vault" }
minecraft-plugin-worldguard = { module = "com.sk89q.worldguard:worldguard-bukkit", version.ref = "worldguard" }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
plugins {
java
}

val libs = idofrontLibsRef

repositories {
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
mavenLocal()
}

dependencies {
compileOnly(libs.findLibrary("minecraft-papermc").get())
}

tasks {
processResources {
filesMatching(setOf("plugin.yml", "paper-plugin.yml")) {
expand(mutableMapOf("plugin_version" to version))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
val libs = idofrontLibsRef

repositories {
mavenLocal()
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.papermc.io/repository/maven-public/")
}
Expand Down
2 changes: 1 addition & 1 deletion idofront-serializers/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {
compileOnly(libs.kotlinx.serialization.kaml)
compileOnly(libs.minecraft.plugin.mythic.dist)
compileOnly(libs.minecraft.plugin.mythic.crucible)
compileOnly(libs.minecraft.plugin.oraxen)
compileOnly(libs.minecraft.plugin.nexo)
compileOnly(libs.minecraft.plugin.itemsadder)
compileOnly(libs.creative.api)
implementation(project(":idofront-util"))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mineinabyss.idofront.serialization

import io.papermc.paper.datacomponent.item.ItemAttributeModifiers
import kotlinx.serialization.EncodeDefault
import kotlinx.serialization.EncodeDefault.Mode.NEVER
import kotlinx.serialization.KSerializer
Expand All @@ -8,22 +9,27 @@ import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import net.kyori.adventure.key.Key
import org.bukkit.NamespacedKey
import org.bukkit.attribute.Attribute
import org.bukkit.attribute.AttributeModifier
import org.bukkit.inventory.EquipmentSlotGroup
import java.util.*

@Serializable
@SerialName("SerializableAttribute")
class SerializableAttribute (
class SerializableAttribute(
val attribute: Attribute,
val modifier: @Serializable(with = AttributeModifierSerializer::class) AttributeModifier,
) {

constructor(itemAttributeModifier: ItemAttributeModifiers.Entry) : this(
itemAttributeModifier.attribute(),
itemAttributeModifier.modifier()
)

operator fun component1(): Attribute {
return attribute
}

operator fun component2(): AttributeModifier {
return modifier
}
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading