Skip to content

Commit

Permalink
It has come
Browse files Browse the repository at this point in the history
  • Loading branch information
StellarWitch7 committed Sep 21, 2024
1 parent 9db5771 commit 039e97a
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 69 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
- Updated to Trickster 2.0.0-alpha.36 and marked as compatible with all versions above as stability is less of a concern now
- Updated to Trickster 2.0.0-alpha.37
- Added a way to store values globally in the world
- Added a handful of patterns for meta-programming
20 changes: 1 addition & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,10 @@ repositories {
url "https://maven.enjarai.dev/mirrors"
}

maven {
url 'https://maven.wispforest.io'
}

maven {
name = "Ladysnake Mods"
url = 'https://maven.ladysnake.org/releases'
}

maven {
name "Terraformers Maven"
url 'https://maven.terraformersmc.com'
}

maven {
url 'https://maven.shedaniel.me/'
}
}

loom {
Expand All @@ -77,12 +64,7 @@ dependencies {
modImplementation "net.fabricmc:fabric-language-kotlin:${property('deps.kotlin')}"

modImplementation "stellarwitch7:libstellar:${property('deps.libstellar')}"

modImplementation "io.wispforest:lavender:${property('deps.lavender')}"
include modLocalRuntime("io.wispforest.lavender-md:owo-ui:0.1.2+1.21")

modImplementation "dev.enjarai:trickster:${property('deps.trickster')}"
modImplementation "io.wispforest:accessories-fabric:${property('deps.accessories')}"

modImplementation "com.terraformersmc:modmenu:${property('deps.modmenu')}"
}
Expand Down Expand Up @@ -155,7 +137,7 @@ publishMods {
displayName = "Random Access Mind ${property('mod_version')} for Trickster ${property('deps.trickster')}"
version = project.version
changelog = getRootProject().file("CHANGELOG.md").text
type = STABLE
type = ALPHA
modLoaders.add("fabric")

def min = property('publish_target_min')
Expand Down
14 changes: 3 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Mod Properties
mod_version=1.0.13-todo-dont-forget-to-update-the-thing-so-cells-dont-write-ephemerals
mod_version=2.0.0-alpha.1
maven_group=stellarwitch7
archives_base_name=ram

Expand All @@ -24,13 +24,5 @@ deps.kotlin=1.11.0+kotlin.2.0.0
# Dependencies
deps.fabric-api=0.100.1+1.21
deps.libstellar=1.2.1
deps.owo-lib=0.12.10+1.21
deps.lavender=0.1.11+1.21
deps.cardinal-components-api=6.1.1
deps.cicada=0.8.3+1.21-and-above
deps.trickster=2.0.0-alpha.36
deps.accessories=1.0.0-beta.11+1.21
deps.modmenu=11.0.1

# Optional
deps.sodium=mc1.21-0.5.11
deps.trickster=2.0.0-alpha.37
deps.modmenu=11.0.1
17 changes: 14 additions & 3 deletions src/main/kotlin/stellarwitch7/ram/cca/world/CellsComponent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ import dev.enjarai.trickster.spell.Fragment
import dev.enjarai.trickster.spell.fragment.VoidFragment
import dev.enjarai.trickster.spell.trick.Trick
import io.wispforest.endec.Endec
import io.wispforest.endec.StructEndec
import io.wispforest.endec.impl.KeyedEndec
import io.wispforest.endec.impl.StructEndecBuilder
import net.minecraft.nbt.NbtCompound
import net.minecraft.registry.RegistryWrapper
import net.minecraft.world.World
import org.ladysnake.cca.api.v3.component.Component
import stellarwitch7.ram.spell.cell.Cell
import stellarwitch7.ram.spell.fragment.CellFragment
import stellarwitch7.ram.spell.trick.blunder.CellNotWithinWorldBlunder
import stellarwitch7.ram.spell.trick.blunder.ImmutableCellBlunder
import stellarwitch7.ram.spell.blunder.CellNotWithinWorldBlunder
import stellarwitch7.ram.spell.blunder.ImmutableCellBlunder
import java.util.*
import kotlin.collections.HashMap

Expand Down Expand Up @@ -54,4 +55,14 @@ class CellsComponent(private val world: World) : Component {
companion object {
val endec: KeyedEndec<MutableMap<UUID, Cell>> = KeyedEndec("cells", Endec.map(EndecTomfoolery.UUID, Cell.endec), HashMap())
}

data class Cell(var locked: Boolean, var value: Fragment) {
companion object {
val endec: StructEndec<Cell> = StructEndecBuilder.of(
Endec.BOOLEAN.fieldOf("locked", Cell::locked),
Fragment.ENDEC.fieldOf("value", Cell::value),
::Cell
)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package stellarwitch7.ram.spell.trick.blunder
package stellarwitch7.ram.spell.blunder

import dev.enjarai.trickster.spell.trick.Trick
import dev.enjarai.trickster.spell.trick.blunder.TrickBlunderException
import dev.enjarai.trickster.spell.blunder.TrickBlunderException
import net.minecraft.text.MutableText

class CellNotWithinWorldBlunder(source: Trick) : TrickBlunderException(source) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package stellarwitch7.ram.spell.trick.blunder
package stellarwitch7.ram.spell.blunder

import dev.enjarai.trickster.spell.trick.Trick
import dev.enjarai.trickster.spell.trick.blunder.TrickBlunderException
import dev.enjarai.trickster.spell.blunder.TrickBlunderException
import net.minecraft.text.MutableText

class ImmutableCellBlunder(source: Trick) : TrickBlunderException(source) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package stellarwitch7.ram.spell.trick.blunder
package stellarwitch7.ram.spell.blunder

import dev.enjarai.trickster.spell.trick.Trick
import dev.enjarai.trickster.spell.trick.blunder.TrickBlunderException
import dev.enjarai.trickster.spell.blunder.TrickBlunderException
import net.minecraft.text.MutableText

class NotWithinRAMBoundsBlunder(source: Trick, private val size: UInt, private val given: Int) : TrickBlunderException(source) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package stellarwitch7.ram.spell.trick.blunder
package stellarwitch7.ram.spell.blunder

import dev.enjarai.trickster.spell.trick.Trick
import dev.enjarai.trickster.spell.trick.blunder.TrickBlunderException
import dev.enjarai.trickster.spell.blunder.TrickBlunderException
import net.minecraft.text.MutableText

class OutOfRAMBlunder(source: Trick) : TrickBlunderException(source) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package stellarwitch7.ram.spell.trick.blunder
package stellarwitch7.ram.spell.blunder

import dev.enjarai.trickster.spell.trick.Trick
import dev.enjarai.trickster.spell.trick.blunder.TrickBlunderException
import dev.enjarai.trickster.spell.blunder.TrickBlunderException
import net.minecraft.text.MutableText

class RAMNotSupportedBlunder(source: Trick) : TrickBlunderException(source) {
override fun createMessage(): MutableText {
return super.createMessage().append("Caster does not support RAM")
}
}
}
16 changes: 0 additions & 16 deletions src/main/kotlin/stellarwitch7/ram/spell/cell/Cell.kt

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/kotlin/stellarwitch7/ram/spell/mind/DefaultRAM.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import dev.enjarai.trickster.spell.fragment.VoidFragment
import dev.enjarai.trickster.spell.trick.Trick
import stellarwitch7.libstellar.registry.codec.CodecType
import stellarwitch7.libstellar.utils.KCodecUtils
import stellarwitch7.ram.spell.trick.blunder.NotWithinRAMBoundsBlunder
import stellarwitch7.ram.spell.trick.blunder.OutOfRAMBlunder
import stellarwitch7.ram.spell.blunder.NotWithinRAMBoundsBlunder
import stellarwitch7.ram.spell.blunder.OutOfRAMBlunder

open class DefaultRAM(val size: UInt) : RAM {
override val type: CodecType<RAM> = RAM.default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class WriteCellTrick : Trick(Pattern.of(4, 6, 0, 4, 8)) {
override fun activate(ctx: SpellContext, fragments: List<Fragment>): Fragment {
val cell = expectInput(fragments, ModFragmentTypes.cell, 0)
val value = expectInput(fragments, 1)
cell.set(this, ctx.source.world, value/*TODO: make this kill ephemerals*/)
cell.set(this, ctx.source.world, value.applyEphemeral())
return cell
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import dev.enjarai.trickster.spell.SpellContext
import dev.enjarai.trickster.spell.fragment.NumberFragment
import dev.enjarai.trickster.spell.trick.Trick
import stellarwitch7.ram.cca.entity.ModEntityComponents
import stellarwitch7.ram.spell.trick.blunder.RAMNotSupportedBlunder
import stellarwitch7.ram.spell.blunder.RAMNotSupportedBlunder

class RAMAllocTrick : Trick(Pattern.of(1, 4, 0, 6, 4, 8, 2, 4)) {
override fun activate(ctx: SpellContext, fragments: List<Fragment>): Fragment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import dev.enjarai.trickster.spell.fragment.FragmentType
import dev.enjarai.trickster.spell.fragment.VoidFragment
import dev.enjarai.trickster.spell.trick.Trick
import stellarwitch7.ram.cca.entity.ModEntityComponents
import stellarwitch7.ram.spell.trick.blunder.RAMNotSupportedBlunder
import stellarwitch7.ram.spell.blunder.RAMNotSupportedBlunder

class RAMFreeTrick : Trick(Pattern.of(1, 4, 6, 8, 4)) {
override fun activate(ctx: SpellContext, fragments: List<Fragment>): Fragment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import dev.enjarai.trickster.spell.SpellContext
import dev.enjarai.trickster.spell.fragment.FragmentType
import dev.enjarai.trickster.spell.trick.Trick
import stellarwitch7.ram.cca.entity.ModEntityComponents
import stellarwitch7.ram.spell.trick.blunder.RAMNotSupportedBlunder
import stellarwitch7.ram.spell.blunder.RAMNotSupportedBlunder

class RAMReadTrick : Trick(Pattern.of(1, 4, 3, 6, 8, 5)) {
override fun activate(ctx: SpellContext, fragments: List<Fragment>): Fragment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import dev.enjarai.trickster.spell.fragment.FragmentType
import dev.enjarai.trickster.spell.fragment.VoidFragment
import dev.enjarai.trickster.spell.trick.Trick
import stellarwitch7.ram.cca.entity.ModEntityComponents
import stellarwitch7.ram.spell.trick.blunder.RAMNotSupportedBlunder
import stellarwitch7.ram.spell.blunder.RAMNotSupportedBlunder

class RAMWriteTrick : Trick(Pattern.of(1, 4, 5, 8, 6, 3)) {
override fun activate(ctx: SpellContext, fragments: List<Fragment>): Fragment {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"fabric-api": "*",
"fabric-language-kotlin": "*",
"libstellar": ">=1.1.8",
"trickster": ">=2.0.0-alpha.36"
"trickster": ">=2.0.0-alpha.37"
},
"suggests": {
}
Expand Down

0 comments on commit 039e97a

Please sign in to comment.