diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bd52384..9f2669a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,7 +75,7 @@ jobs: fabric-api: 0.85.0 # NOTE: these must be quoted and formatted exactly like this, since they'll be used as a bash array dependencies: >- - 'https://cdn.modrinth.com/data/Ha28R6CL/versions/ADg3gvlr/fabric-language-kotlin-1.9.5%2Bkotlin.1.8.22.jar' + 'https://cdn.modrinth.com/data/Ha28R6CL/versions/vlhvI5Li/fabric-language-kotlin-1.10.18%2Bkotlin.1.9.22.jar' 'https://cdn.modrinth.com/data/K01OU20C/versions/qW85eawp/cardinal-components-api-5.2.2.jar' 'https://cdn.modrinth.com/data/nU0bVIaL/versions/PKvFvHeb/Patchouli-1.20.1-80-FABRIC.jar' 'https://cdn.modrinth.com/data/9s6osm5g/versions/s7VTKfLA/cloth-config-11.1.106-fabric.jar' diff --git a/CHANGELOG.md b/CHANGELOG.md index f61a9779..b4c9a4f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [UNRELEASED] + +### Added + +- Added support for debugging cyclic wisps with [HexDebug](https://modrinth.com/mod/hexdebug)! + +### Changed + +- Increased minimum dependency versions: + - Fabric Loader: `0.16` + - Fabric Language Kotlin: `1.10.18+kotlin.1.9.22` + ## `0.3.1` - 2025-10-30 ### Changed diff --git a/Common/build.gradle b/Common/build.gradle index 9d330493..3fed956e 100644 --- a/Common/build.gradle +++ b/Common/build.gradle @@ -37,6 +37,8 @@ dependencies { compileOnly "ram.talia.moreiotas:moreiotas-common-$minecraftVersion:$moreIotasVersion" compileOnly "vazkii.patchouli:Patchouli-xplat:$minecraftVersion-$patchouliVersion-SNAPSHOT" compileOnly "software.bernie.geckolib:geckolib-forge-$minecraftVersion:$geckolibVersion" + compileOnly "gay.object.hexdebug:hexdebug-core-common-mojmap:$hexdebugVersion+$minecraftVersion" + compileOnly "gay.object.hexdebug:hexdebug-common-mojmap:$hexdebugVersion+$minecraftVersion" testImplementation "at.petra-k.paucal:paucal-common-$minecraftVersion:$paucalVersion" testImplementation "at.petra-k.hexcasting:hexcasting-common-$minecraftVersion:$hexcastingVersion" diff --git a/Common/src/main/java/ram/talia/hexal/api/casting/wisp/WispCastingManager.kt b/Common/src/main/java/ram/talia/hexal/api/casting/wisp/WispCastingManager.kt index 4fff3bc7..1d3ce80e 100644 --- a/Common/src/main/java/ram/talia/hexal/api/casting/wisp/WispCastingManager.kt +++ b/Common/src/main/java/ram/talia/hexal/api/casting/wisp/WispCastingManager.kt @@ -7,6 +7,8 @@ import at.petrak.hexcasting.api.casting.iota.Iota import at.petrak.hexcasting.api.casting.iota.IotaType.isTooLargeToSerialize import at.petrak.hexcasting.api.utils.asCompound import at.petrak.hexcasting.api.utils.putCompound +import gay.`object`.hexdebug.core.api.HexDebugCoreAPI +import gay.`object`.hexdebug.core.api.exceptions.DebugException import net.minecraft.nbt.CompoundTag import net.minecraft.nbt.ListTag import net.minecraft.server.MinecraftServer @@ -16,6 +18,7 @@ import ram.talia.hexal.api.HexalAPI import ram.talia.hexal.api.casting.eval.env.WispCastEnv import ram.talia.hexal.api.nbt.SerialisedIotaList import ram.talia.hexal.common.entities.BaseCastingWisp +import ram.talia.hexal.common.entities.TickingWisp import java.util.* class WispCastingManager(private val casterUUID: UUID, private var cachedServer: MinecraftServer?) { @@ -130,22 +133,28 @@ class WispCastingManager(private val casterUUID: UUID, private var cachedServer: userData = userData ) - val harness = CastingVM(image, ctx) + val hex = cast.hex.getIotas(ctx.world) - val info = harness.queueExecuteAndWrapIotas(cast.hex.getIotas(ctx.world), wisp.level() as ServerLevel) + // if we're debugging this wisp, delegate to the debugger + if (wisp is TickingWisp && wisp.isDebugging) { + wisp.getDebugEnv()?.let { debugEnv -> + debugEnv.isPaused = true + try { + HexDebugCoreAPI.INSTANCE.startDebuggingIotas(debugEnv, ctx, hex, image) + } catch (e: DebugException) { + HexalAPI.LOGGER.warn("Failed to start debugging wisp hex", e) + } + } + return WispCastResult(wisp, succeeded = true, image = image, cancelled = true) + } - // TODO: Make this a mishap - // Clear stack if it gets too large - var endStack = harness.image.stack - if (isTooLargeToSerialize(endStack)) { - endStack = mutableListOf() - } + val harness = CastingVM(image, ctx) - val endRavenmind = harness.image.userData.getCompound(HexAPI.RAVENMIND_USERDATA) + val info = harness.queueExecuteAndWrapIotas(hex, wisp.level() as ServerLevel) // the wisp will have things it wants to do once the cast is successful, so a callback on it is called to let it know that happened, and what the end state of the // stack and ravenmind is. This is returned and added to a list that [executeCasts] will loop over to hopefully prevent concurrent modification problems. - return WispCastResult(wisp, info.resolutionType.success, endStack, endRavenmind) + return WispCastResult(wisp, info.resolutionType.success, harness.image) } fun readFromNbt(tag: CompoundTag?, level: ServerLevel) { @@ -248,6 +257,21 @@ class WispCastingManager(private val casterUUID: UUID, private var cachedServer: * the result passed back to the Wisp after its cast is successfully executed. */ data class WispCastResult(val wisp: BaseCastingWisp, val succeeded: Boolean, val endStack: List, val endRavenmind: CompoundTag, val cancelled: Boolean = false) { + constructor( + wisp: BaseCastingWisp, + succeeded: Boolean, + image: CastingImage, + cancelled: Boolean = false, + ) : this( + wisp = wisp, + succeeded = succeeded, + // TODO: Make this a mishap + // Clear stack if it gets too large + endStack = if (isTooLargeToSerialize(image.stack)) mutableListOf() else image.stack, + endRavenmind = image.userData.getCompound(HexAPI.RAVENMIND_USERDATA), + cancelled = cancelled, + ) + fun callback() { wisp.castCallback(this) } } @@ -266,4 +290,4 @@ class WispCastingManager(private val casterUUID: UUID, private var cachedServer: specialHandlers.add { _, cast -> cast.wisp?.seon == true } } } -} \ No newline at end of file +} diff --git a/Common/src/main/java/ram/talia/hexal/common/casting/actions/spells/wisp/OpSummonWisp.kt b/Common/src/main/java/ram/talia/hexal/common/casting/actions/spells/wisp/OpSummonWisp.kt index a3438ece..705b899c 100644 --- a/Common/src/main/java/ram/talia/hexal/common/casting/actions/spells/wisp/OpSummonWisp.kt +++ b/Common/src/main/java/ram/talia/hexal/common/casting/actions/spells/wisp/OpSummonWisp.kt @@ -2,22 +2,26 @@ package ram.talia.hexal.common.casting.actions.spells.wisp import at.petrak.hexcasting.api.HexAPI -import at.petrak.hexcasting.api.misc.MediaConstants import at.petrak.hexcasting.api.casting.* import at.petrak.hexcasting.api.casting.castables.SpellAction import at.petrak.hexcasting.api.casting.eval.CastingEnvironment import at.petrak.hexcasting.api.casting.iota.Iota import at.petrak.hexcasting.api.casting.iota.IotaType import at.petrak.hexcasting.api.casting.iota.NullIota +import at.petrak.hexcasting.api.misc.MediaConstants +import gay.`object`.hexdebug.core.api.HexDebugCoreAPI +import gay.`object`.hexdebug.core.api.exceptions.DebugException import net.minecraft.nbt.CompoundTag -import net.minecraft.world.entity.player.Player +import net.minecraft.server.level.ServerPlayer import net.minecraft.world.phys.Vec3 +import ram.talia.hexal.api.HexalAPI import ram.talia.hexal.api.addBounded import ram.talia.hexal.api.casting.eval.env.WispCastEnv -import ram.talia.hexal.api.config.HexalConfig import ram.talia.hexal.api.casting.mishaps.MishapExcessiveReproduction +import ram.talia.hexal.api.config.HexalConfig import ram.talia.hexal.common.entities.ProjectileWisp import ram.talia.hexal.common.entities.TickingWisp +import ram.talia.hexal.interop.hexdebug.WispDebugEnv import kotlin.math.max class OpSummonWisp(val ticking: Boolean) : SpellAction { @@ -72,15 +76,30 @@ class OpSummonWisp(val ticking: Boolean) : SpellAction { if (env is WispCastEnv) env.wisp.summonedChildThisCast = true + val player = env.castingEntity as? ServerPlayer + val pigment = env.pigment val wisp = when (ticking) { - true -> TickingWisp(env.world, pos, env.castingEntity as? Player, media) - false -> ProjectileWisp(env.world, pos, vel, env.castingEntity as? Player, media) + true -> TickingWisp(env.world, pos, player, media) + false -> ProjectileWisp(env.world, pos, vel, player, media) } wisp.setPigment(pigment) wisp.setHex(hex.toMutableList()) wisp.setRavenmind(ravenmind) env.world.addFreshEntity(wisp) + + // if the current cast is being debugged, try to spawn the wisp in debug mode too + if (HexDebugCoreAPI.INSTANCE.getDebugEnv(env) != null && player != null && wisp is TickingWisp) { + val debugEnv = WispDebugEnv(player, wisp.uuid, ravenmind) + try { + HexDebugCoreAPI.INSTANCE.createDebugThread(debugEnv, null) + } catch (e: DebugException) { + // if there are no threads available, just spawn the wisp in normal mode + HexalAPI.LOGGER.debug("Not starting wisp in debug mode", e) + return + } + wisp.setDebugEnv(debugEnv) + } } } -} \ No newline at end of file +} diff --git a/Common/src/main/java/ram/talia/hexal/common/entities/BaseCastingWisp.kt b/Common/src/main/java/ram/talia/hexal/common/entities/BaseCastingWisp.kt index 247285ec..1ea73363 100644 --- a/Common/src/main/java/ram/talia/hexal/common/entities/BaseCastingWisp.kt +++ b/Common/src/main/java/ram/talia/hexal/common/entities/BaseCastingWisp.kt @@ -316,7 +316,7 @@ abstract class BaseCastingWisp(entityType: EntityType, worl /** * Returns true if there are no triggers limiting when the wisp can cast, false otherwise */ - fun canScheduleCast(): Boolean { + open fun canScheduleCast(): Boolean { // HexalAPI.LOGGER.info("active trigger is $activeTrigger, shouldRemove: ${activeTrigger?.shouldRemoveTrigger(this)}, shouldTrigger: ${activeTrigger?.shouldTrigger(this)}") if (activeTrigger?.shouldRemoveTrigger(this) == true) activeTrigger = null diff --git a/Common/src/main/java/ram/talia/hexal/common/entities/TickingWisp.kt b/Common/src/main/java/ram/talia/hexal/common/entities/TickingWisp.kt index 971c1092..59aba31b 100644 --- a/Common/src/main/java/ram/talia/hexal/common/entities/TickingWisp.kt +++ b/Common/src/main/java/ram/talia/hexal/common/entities/TickingWisp.kt @@ -5,6 +5,7 @@ import at.petrak.hexcasting.api.casting.iota.EntityIota import at.petrak.hexcasting.api.casting.iota.Iota import at.petrak.hexcasting.api.utils.hasByte import at.petrak.hexcasting.api.utils.hasFloat +import gay.`object`.hexdebug.core.api.HexDebugCoreAPI import net.minecraft.nbt.CompoundTag import net.minecraft.nbt.ListTag import net.minecraft.network.chat.Component @@ -12,6 +13,7 @@ import net.minecraft.network.syncher.EntityDataAccessor import net.minecraft.network.syncher.EntityDataSerializers import net.minecraft.network.syncher.SynchedEntityData import net.minecraft.server.level.ServerLevel +import net.minecraft.server.level.ServerPlayer import net.minecraft.world.entity.EntityType import net.minecraft.world.entity.player.Player import net.minecraft.world.level.Level @@ -23,7 +25,9 @@ import ram.talia.hexal.api.nbt.SerialisedIotaList import ram.talia.hexal.api.plus import ram.talia.hexal.api.times import ram.talia.hexal.common.lib.HexalEntities +import ram.talia.hexal.interop.hexdebug.WispDebugEnv import java.lang.Double.min +import java.util.UUID class TickingWisp : BaseCastingWisp { override val shouldComplainNotEnoughMedia = false @@ -73,6 +77,24 @@ class TickingWisp : BaseCastingWisp { val maximumMoveMultiplier: Float get() = entityData.get(MAXIMUM_MOVE_MULTIPLIER) + private var debugSessionId: UUID? = null + + val isDebugging: Boolean + get() = debugSessionId != null + + private val isDebuggingAndPaused: Boolean + get() = isDebugging && getDebugEnv()?.isPaused != false + + fun getDebugEnv(): WispDebugEnv? { + val debugSessionId = debugSessionId ?: return null + val caster = caster as? ServerPlayer ?: return null + return HexDebugCoreAPI.INSTANCE.getDebugEnv(caster, debugSessionId) as? WispDebugEnv + } + + fun setDebugEnv(debugEnv: WispDebugEnv) { + debugSessionId = debugEnv.sessionId + } + constructor(entityType: EntityType, world: Level) : super(entityType, world) constructor( entityType: EntityType, @@ -121,6 +143,12 @@ class TickingWisp : BaseCastingWisp { } } + // if the debug session has ended, destroy the wisp + // TODO: this can result in a zombie session when the player dies (https://github.com/object-Object/HexDebug/issues/64) + if (isDebugging && caster != null && getDebugEnv() == null) { + discard() + } + super.tick() } @@ -143,7 +171,7 @@ class TickingWisp : BaseCastingWisp { } override fun move() { - if (reachedTargetPos()) // also checks if within close enough distance of target. + if (reachedTargetPos() || isDebuggingAndPaused) // also checks if within close enough distance of target. return val currentTarget = getTargetMovePosRaw() @@ -163,10 +191,16 @@ class TickingWisp : BaseCastingWisp { // Seon wisps have the same max range as the caster. override fun maxSqrCastingDistance() = if (seon) { PlayerBasedCastEnv.AMBIT_RADIUS * PlayerBasedCastEnv.AMBIT_RADIUS } else { CASTING_RADIUS * CASTING_RADIUS } + override fun canScheduleCast(): Boolean { + return super.canScheduleCast() && !isDebuggingAndPaused + } + override fun castCallback(result: WispCastingManager.WispCastResult) { // HexalAPI.LOGGER.info("ticking wisp $uuid had a cast successfully completed!") - setStack(result.endStack) - setRavenmind(result.endRavenmind) + if (!result.cancelled) { + setStack(result.endStack) + setRavenmind(result.endRavenmind) + } super.castCallback(result) } @@ -184,18 +218,29 @@ class TickingWisp : BaseCastingWisp { entityData.set(TARGET_MOVE_POS_Z, pos.z.toFloat()) } + fun clearTargetMovePos() { + entityData.set(HAS_TARGET_MOVE_POS, false) + } + fun reachedTargetPos(): Boolean { return if (!entityData.get(HAS_TARGET_MOVE_POS)) { true } else if ((getTargetMovePosRaw() - position()).lengthSqr() < 0.01) { setPos(getTargetMovePosRaw()) - entityData.set(HAS_TARGET_MOVE_POS, false) + clearTargetMovePos() true } else { false } } + override fun remove(reason: RemovalReason) { + if (reason.shouldDestroy()) { + getDebugEnv()?.let { HexDebugCoreAPI.INSTANCE.removeDebugThread(it) } + } + super.remove(reason) + } + override fun readAdditionalSaveData(compound: CompoundTag) { super.readAdditionalSaveData(compound) @@ -203,6 +248,10 @@ class TickingWisp : BaseCastingWisp { null -> serStack.set(mutableListOf()) else -> serStack.set(stackTag as ListTag) } + debugSessionId = when (compound.hasUUID(TAG_DEBUG_SESSION_ID)) { + true -> compound.getUUID(TAG_DEBUG_SESSION_ID) + false -> null + } entityData.set(HAS_TARGET_MOVE_POS, when(compound.hasByte(TAG_HAS_TARGET_MOVE_POS)) { true -> compound.getBoolean(TAG_HAS_TARGET_MOVE_POS) false -> false @@ -233,6 +282,7 @@ class TickingWisp : BaseCastingWisp { super.addAdditionalSaveData(compound) compound.put(TAG_STACK, serStack.getTag()) + debugSessionId?.let { compound.putUUID(TAG_DEBUG_SESSION_ID, it) } compound.putBoolean(TAG_HAS_TARGET_MOVE_POS, entityData.get(HAS_TARGET_MOVE_POS)) compound.putFloat(TAG_TARGET_MOVE_POS_X, entityData.get(TARGET_MOVE_POS_X)) compound.putFloat(TAG_TARGET_MOVE_POS_Y, entityData.get(TARGET_MOVE_POS_Y)) @@ -261,6 +311,7 @@ class TickingWisp : BaseCastingWisp { val MAXIMUM_MOVE_MULTIPLIER: EntityDataAccessor = SynchedEntityData.defineId(TickingWisp::class.java, EntityDataSerializers.FLOAT) const val TAG_STACK = "stack" + const val TAG_DEBUG_SESSION_ID = "debug_session_id" const val TAG_HAS_TARGET_MOVE_POS = "has_target_move_pos" const val TAG_TARGET_MOVE_POS_X = "target_move_pos_x" const val TAG_TARGET_MOVE_POS_Y = "target_move_pos_y" @@ -274,4 +325,4 @@ class TickingWisp : BaseCastingWisp { const val BASE_MAX_SPEED_PER_TICK = 6.0 / 20 const val SCALE = 0.2 } -} \ No newline at end of file +} diff --git a/Common/src/main/java/ram/talia/hexal/interop/hexdebug/WispDebugEnv.kt b/Common/src/main/java/ram/talia/hexal/interop/hexdebug/WispDebugEnv.kt new file mode 100644 index 00000000..3816e205 --- /dev/null +++ b/Common/src/main/java/ram/talia/hexal/interop/hexdebug/WispDebugEnv.kt @@ -0,0 +1,74 @@ +package ram.talia.hexal.interop.hexdebug + +import at.petrak.hexcasting.api.HexAPI +import at.petrak.hexcasting.api.casting.eval.CastingEnvironment +import at.petrak.hexcasting.api.casting.eval.ResolvedPatternType +import at.petrak.hexcasting.api.casting.eval.env.PlayerBasedCastEnv.AMBIT_RADIUS +import at.petrak.hexcasting.api.casting.eval.vm.CastingImage +import at.petrak.hexcasting.api.casting.iota.EntityIota +import at.petrak.hexcasting.api.casting.iota.Iota +import at.petrak.hexcasting.api.utils.asTranslatedComponent +import gay.`object`.hexdebug.core.api.HexDebugCoreAPI +import gay.`object`.hexdebug.core.api.debugging.StopReason +import gay.`object`.hexdebug.core.api.debugging.env.DebugEnvironment +import net.minecraft.network.chat.Component +import net.minecraft.server.level.ServerPlayer +import ram.talia.hexal.api.casting.wisp.WispCastingManager +import ram.talia.hexal.common.entities.TickingWisp +import java.util.* + +class WispDebugEnv( + caster: ServerPlayer, + private val wispUUID: UUID, + private val ravenmind: Iota? +) : DebugEnvironment(caster) { + var isPaused = false + + private val wisp: TickingWisp? get() = caster.serverLevel().getEntity(wispUUID) as? TickingWisp + + override fun resume(env: CastingEnvironment, image: CastingImage, resolutionType: ResolvedPatternType): Boolean { + val wisp = wisp ?: return false + + WispCastingManager.WispCastResult(wisp, resolutionType.success, image).callback() + if (!resolutionType.success) return false + + isPaused = false + return true + } + + override fun restart(threadId: Int) { + val wisp = wisp ?: return + + // TODO: should we also reset other things here? + wisp.setStack(listOf(EntityIota(wisp))) + wisp.setRavenmind(ravenmind) + wisp.currentMoveMultiplier = 1f + wisp.clearTargetMovePos() + isPaused = false + + HexDebugCoreAPI.INSTANCE.createDebugThread(this, threadId) + } + + override fun terminate() { + wisp?.discard() + } + + override fun isCasterInRange(): Boolean { + return wisp?.let { caster.distanceToSqr(it) <= AMBIT_RADIUS * AMBIT_RADIUS } ?: false + } + + override fun getName(): Component { + return "entity.hexal.wisp.ticking".asTranslatedComponent + } + + override fun postStep(env: CastingEnvironment, image: CastingImage, reason: StopReason?) { + // don't bother updating the stack/ravenmind if we just resumed (because we also do it in resume) or if the wisp is being terminated + if (reason == null || reason == StopReason.TERMINATED) return + + val wisp = wisp ?: return + + // update these in postStep so that the increased cost for storing a truename applies immediately + wisp.setStack(image.stack) + wisp.setRavenmind(image.userData.getCompound(HexAPI.RAVENMIND_USERDATA)) + } +} diff --git a/Fabric/build.gradle b/Fabric/build.gradle index b5cd9133..e176e434 100644 --- a/Fabric/build.gradle +++ b/Fabric/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version "$loomVersion" + id 'fabric-loom' id 'hexal.platform' } @@ -103,7 +103,7 @@ dependencies { modLocalRuntime "io.github.tropheusj:serialization-hooks:$serializationHooksVersion" - implementation(include("com.github.LlamaLad7:MixinExtras:0.1.1")) + include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:$mixinExtrasVersion"))) modImplementation "software.bernie.geckolib:geckolib-fabric-$minecraftVersion:$geckolibVersion" @@ -128,6 +128,11 @@ dependencies { implementation 'org.jetbrains:annotations:23.0.0' + // include hexdebug-core in production so we can use the classes directly in code without loaded mod checks + // and put full hexdebug in the dev env so we can test the interop + modImplementation(include("gay.object.hexdebug:hexdebug-core-fabric:$hexdebugVersion+$minecraftVersion")) + modLocalRuntime("gay.object.hexdebug:hexdebug-fabric:$hexdebugVersion+$minecraftVersion") + testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion" } diff --git a/Fabric/gradle.properties b/Fabric/gradle.properties index f9022152..fb7e5586 100644 --- a/Fabric/gradle.properties +++ b/Fabric/gradle.properties @@ -1,13 +1,13 @@ platform=fabric -loomVersion=1.1-SNAPSHOT fabricVersion=0.85.0+1.20.1 -fabricLoaderVersion=0.14.21 -fabricLanguageKotlinVersion=1.9.5+kotlin.1.8.22 +fabricLoaderVersion=0.16.7 +fabricLanguageKotlinVersion=1.10.18+kotlin.1.9.22 fiberVersion=0.23.0-2 cardinalComponentsVersion=5.2.3 serializationHooksVersion=0.4.99999 +mixinExtrasVersion=0.5.0 reiVersion=12.0.626 emiVersion=1.0.4+1.20.1 diff --git a/Fabric/src/main/resources/fabric.mod.json b/Fabric/src/main/resources/fabric.mod.json index 0427ddcd..fdee1ac1 100644 --- a/Fabric/src/main/resources/fabric.mod.json +++ b/Fabric/src/main/resources/fabric.mod.json @@ -49,9 +49,9 @@ "depends": { "minecraft": "=1.20.1", "java": ">=17", - "fabricloader": ">=0.14", + "fabricloader": ">=0.16", "fabric": ">=0.84", - "fabric-language-kotlin": ">=1.9.5+kotlin.1.8.22", + "fabric-language-kotlin": ">=1.10.18+kotlin.1.9.22", "cardinal-components": "~5.2.1", "patchouli": ">=1.20.1-80", "cloth-config": "11.1.x", diff --git a/Forge/build.gradle b/Forge/build.gradle index f1740662..8c2bdebc 100644 --- a/Forge/build.gradle +++ b/Forge/build.gradle @@ -22,6 +22,8 @@ apply plugin: 'org.spongepowered.mixin' archivesBaseName = getArtifactID("forge") +jarJar.enable() + minecraft { mappings channel: 'official', version: minecraftVersion accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') @@ -193,6 +195,15 @@ dependencies { compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:$curiosVersion+$minecraftVersion:api") runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:$curiosVersion+$minecraftVersion") + implementation fg.deobf("gay.object.hexdebug:hexdebug-core-forge:$hexdebugVersion+$minecraftVersion") + jarJar("gay.object.hexdebug:hexdebug-core-forge:$hexdebugVersion+$minecraftVersion") { + transitive = false // otherwise it tries to JiJ Hex Casting, for some reason + jarJar.ranged(it, "[$hexdebugVersion,)") + } + runtimeOnly fg.deobf("gay.object.hexdebug:hexdebug-forge:$hexdebugVersion+$minecraftVersion") + runtimeOnly fg.deobf("gay.object.ioticblocks:ioticblocks-forge:$ioticBlocksVersion") + runtimeOnly fg.deobf("dev.architectury:architectury-forge:$architecturyVersion") + // Testing dependencies: testCompileOnly project(":Common") @@ -246,8 +257,16 @@ task printSourceSetInformation(){ } } +tasks.jarJar { + archiveClassifier = "" +} + +jar { + archiveClassifier = "slim" +} + tasks.register("ciArtifacts", Copy) { - from jar + from tasks.jarJar into rootProject.file("build/ciArtifacts") } @@ -304,7 +323,7 @@ hexalModDependencies { } publishMods { - file = jar.archiveFile + file = tasks.jarJar.archiveFile } jar.finalizedBy('reobfJar') @@ -313,6 +332,7 @@ setupJar(this) publishing { publications { mavenJava(MavenPublication) { + artifact tasks.jarJar // ForgeGradle exports (broken) remapped dependencies, so just remove all of them // https://github.com/VazkiiMods/Botania/blob/87ef25381381f06a1f0f106b896b420956d52bca/Forge/build.gradle#L179 pom.withXml { diff --git a/Forge/gradle.properties b/Forge/gradle.properties index 2d29fd76..473ed9ff 100644 --- a/Forge/gradle.properties +++ b/Forge/gradle.properties @@ -2,7 +2,10 @@ platform=forge forgeVersion=47.2.0 -kotlinForForgeVersion=4.3.0 +kotlinForForgeVersion=4.10.0 curiosVersion=5.2.0-beta.3 -caelusVersion=3.1.0+1.20 \ No newline at end of file +caelusVersion=3.1.0+1.20 + +ioticBlocksVersion=1.0.2+1.20.1 +architecturyVersion=9.2.14 diff --git a/build.gradle b/build.gradle index b8a9538c..76b81b4b 100644 --- a/build.gradle +++ b/build.gradle @@ -16,6 +16,7 @@ plugins { id "org.jetbrains.kotlin.jvm" id 'idea' id 'hexal.publish' + id 'fabric-loom' version "$loomVersion" apply false } String getArtifactID(String platform) { diff --git a/gradle.properties b/gradle.properties index 03ff1f03..f8621059 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,6 +6,7 @@ org.gradle.java.installations.fromEnv=JAVA_17_HOME modID=hexal modName=Hexal +modVersion=0.3.1 curseforgeId=824725 modrinthId=aBVJ6Q36 @@ -13,8 +14,9 @@ modrinthId=aBVJ6Q36 jetbrainsAnnotationsVersion=23.0.0 minecraftVersion=1.20.1 -kotlinVersion=1.7.20 -modVersion=0.3.1 +kotlinVersion=1.9.22 + +loomVersion=1.8-SNAPSHOT paucalVersion=0.6.0-pre-118 # 0.11.2-pre-701 corresponds to the build of 0.11.2 on CurseForge/Modrinth @@ -24,6 +26,7 @@ patchouliVersion=83 geckolibVersion=4.2.1 inlineVersion=1.0.1 clothConfigVersion=11.1.106 +hexdebugVersion=0.8.0 jeiVersion=15.0.0.12 pehkuiVersion=3.7.7