repo for my hex addons :3
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

we interrupt this broadcast to bring you new changes

+299 -140
+26 -2
build.gradle.kts
··· 6 6 import kotlin.io.path.exists 7 7 import kotlin.io.path.readText 8 8 import groovy.json.JsonOutput 9 + import `java.nio`.file.Files; 10 + import kotlin.io.path.deleteIfExists 9 11 10 12 plugins { 11 13 id("fabric-loom") version "1.13-SNAPSHOT" ··· 73 75 plugins.withId("fabric-loom") { 74 76 loom { 75 77 splitEnvironmentSourceSets() 76 - runs["client"].programArgs += listOf("--username", "Player", "--uuid", "bd346dd5-ac1c-427d-87e8-73bdd4bf3e13") 78 + runs["client"].programArgs += listOf("--username", "Player", "--uuid", "9e1b34e3-8031-4623-8918-eb7914ab564b") 77 79 78 80 mods { 79 81 register(modid) { ··· 85 87 mixin.useLegacyMixinAp = false 86 88 } 87 89 90 + fabricApi { 91 + configureTests { 92 + modId = modid 93 + eula = true 94 + } 95 + } 96 + 97 + dependencies { 98 + modLocalRuntime("maven.modrinth:ears:1.4.7+fabric-1.20") 99 + } 100 + 101 + if (project != rootProject) { 102 + tasks.named("runClient") { 103 + doFirst { 104 + val rootOptions = rootProject.file("run/options.txt").toPath() 105 + val options = file("run/options.txt").toPath() 106 + options.deleteIfExists() 107 + Files.createSymbolicLink(options, rootOptions) 108 + } 109 + } 110 + } 111 + 88 112 tasks.processResources { 89 113 val bookRoot = destinationDir.resolve("assets/hexcasting/patchouli_books/thehexbook") 90 114 val langRoot = destinationDir.resolve("assets/$modid/lang") 91 115 92 116 doLast { 93 - for (lang in bookRoot.list()) { 117 + bookRoot.list()?.forEach { lang -> 94 118 val langFile = langRoot.resolve("$lang.json") 95 119 if (langFile.exists()) { 96 120 val entries = JsonSlurper().parseText(langFile.readText()) as MutableMap<String, String>
+60
project/hexxytounge/build.gradle.kts
··· 1 + plugins { 2 + id("fabric-loom") version "1.13-SNAPSHOT" 3 + id("scala") 4 + kotlin("jvm") version "2.2.0" 5 + id("maven-publish") 6 + id("de.undercouch.download") version "5.6.0" 7 + id("org.eu.net.pool.mc-plugin") version "0.1.1" 8 + } 9 + 10 + dependencies { 11 + minecraft("com.mojang:minecraft:${project.property("minecraft_version")}") 12 + mappings("net.fabricmc:yarn:${project.property("yarn_mappings")}:v2") 13 + modImplementation("net.fabricmc:fabric-loader:${project.property("loader_version")}") 14 + modImplementation("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_version")}") 15 + api("org.scala-lang:scala3-library_3:3.7.1") 16 + api("org.scala-lang:scala-library:2.13.6") 17 + api(project(":util", "namedElements")) 18 + include(modImplementation("maven.modrinth:jsonpatcher:1.0.0-beta.4+mc.1.20.1")!!) 19 + implementation("com.github.mattidragon:JsonPatcherLang:v1.0.0-beta.3") // trans maven.modrinth:jsonpatcher 20 + modImplementation("com.github.mattidragon:ConfigToolkit:v1.0.0") // trans maven.modrinth:jsonpatcher 21 + modImplementation("at.petra-k.hexcasting:hexcasting-fabric-$minecraft_version:0.11.3") 22 + modImplementation("at.petra-k.paucal:paucal-fabric-$minecraft_version:0.6.0-pre-118") 23 + modImplementation("com.samsthenerd.inline:inline-fabric:$minecraft_version-1.0.1") 24 + modImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.2.3") 25 + modImplementation("ram.talia.moreiotas:moreiotas-fabric-$minecraft_version:0.1.1") { exclude(module = "serialization-hooks") } 26 + } 27 + 28 + tasks.processResources { 29 + preprocessor { 30 + fabricMod("hexxytounge" /* typo'd but too late to change */, version as String) { 31 + name = "Tongued Hexxy" 32 + description = "Adds chat manipulation to Hex Casting because that's certainly a great idea." 33 + license = "LGPL-3.0" 34 + icon = "hexxytounge.icon.png" 35 + 36 + author("pool") { 37 + put("discord", "https://discord.com/users/758407438251720795") 38 + } 39 + 40 + depends("mod-tools", "^1.1.5+1.20.1") 41 + depends("phlib", "0.1.1") 42 + depends("hexcasting", ">=0.11.2") 43 + depends("moreiotas", ">=0.1.1") 44 + depends("cardinal-components-entity", "^5.2.3") 45 + depends("jsonpatcher", "^1.0.0-beta") 46 + recommends("hexpose", "*") 47 + breaks("hexic", "<2.0.0") 48 + 49 + entrypoint("org.eu.net.pool.hexxytounge.main\$package::init") 50 + entrypoint("cardinal-components", "org.eu.net.pool.hexxytounge.Components") 51 + mixins("hexxytongge.mixins.json") 52 + custom { 53 + array("cardinal-components") { 54 + put("hexxytounge:murmur") 55 + put("hexxytounge:reveal") 56 + } 57 + } 58 + } 59 + } 60 + }
+9
project/hexxytounge/gradle.properties
··· 1 + minecraft_version=1.20.1 2 + yarn_mappings=1.20.1+build.10 3 + loader_version=0.16.14 4 + scala_loader_version=0.3.1.11 5 + mod_version=0.1.0 6 + maven_group=org.eu.net.pool 7 + modid=hexxytognue 8 + archives_base_name=hexxytognue 9 + fabric_version=0.92.6+1.20.1
+69
project/hexxytounge/src/client/scala/org/eu/net/pool/hexxytounge/client.scala
··· 1 + package org.eu.net.pool.hexxytounge 2 + 3 + import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking 4 + import net.fabricmc.fabric.api.networking.v1.PacketByteBufs 5 + import net.minecraft.client.MinecraftClient 6 + import net.minecraft.client.gui.screen.ChatScreen 7 + 8 + import scala.annotation.experimental 9 + 10 + given Conversion[ChatScreen, mixin.ChatScreenAccess] = _.asInstanceOf 11 + 12 + var lastMurmur = None: Option[String] 13 + def tick() = 14 + val currentMurmur = MinecraftClient.getInstance.currentScreen match 15 + case null => None 16 + case c: ChatScreen => Some(c.chatField.getText) 17 + case _ => None 18 + if currentMurmur != lastMurmur then 19 + lastMurmur = currentMurmur 20 + val buf = PacketByteBufs.create() 21 + buf.writeBoolean(currentMurmur.isDefined) 22 + currentMurmur.foreach(buf.writeString) 23 + try 24 + ClientPlayNetworking.send("murmur", buf) 25 + catch 26 + case _: IllegalStateException => 27 + 28 + package mixin: 29 + import com.llamalad7.mixinextras.injector.ModifyExpressionValue 30 + import com.llamalad7.mixinextras.sugar.Local 31 + import net.minecraft.client.MinecraftClient 32 + import net.minecraft.client.gui.hud.{ChatHud, ChatHudLine, MessageIndicator} 33 + import net.minecraft.client.gui.screen.ChatScreen 34 + import net.minecraft.client.gui.widget.TextFieldWidget 35 + import org.eu.net.pool.hexxytounge 36 + import org.eu.net.pool.phlib.given 37 + import org.spongepowered.asm.mixin.{Mixin, Unique} 38 + import org.spongepowered.asm.mixin.gen.Accessor 39 + import org.spongepowered.asm.mixin.injection.{At, Inject} 40 + import org.spongepowered.asm.mixin.injection.callback.CallbackInfo 41 + 42 + @Mixin(Array(classOf[MinecraftClient])) 43 + private[mixin] class MinecraftClientMixin: 44 + @Inject(at = Array(new At(value = "HEAD")), method = Array("tick")) 45 + def tick(using CallbackInfo) = 46 + hexxytounge.tick() 47 + @Mixin(Array(classOf[ChatScreen])) 48 + trait ChatScreenAccess: 49 + @Accessor("chatField") val chatField: TextFieldWidget 50 + @Mixin(Array(classOf[ChatHud])) 51 + @experimental 52 + private[mixin] class ChatHudMixin: 53 + @Unique private def patch(original: java.util.List[ChatHudLine.Visible], currentTick: Int): java.util.List[ChatHudLine.Visible] = { 54 + val p = MinecraftClient.getInstance.player 55 + if p != null then 56 + val lines = p.component[RevealComponent].lines.map(line => new ChatHudLine.Visible(currentTick, line.asOrderedText, MessageIndicator.system, true)) 57 + println(lines) 58 + if lines.nonEmpty then 59 + lines.reverse ++ original 60 + else 61 + original 62 + else 63 + original 64 + } 65 + 66 + @ModifyExpressionValue(method = Array("render"), at = Array(new At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/ChatHud;visibleMessages:Ljava/util/List;"))) 67 + def modifyDrawnMessages(original: java.util.List[ChatHudLine.Visible], @Local(ordinal = 0, argsOnly = true) currentTick: Int) = patch(original, currentTick) 68 + @ModifyExpressionValue(method = Array("getTextStyleAt", "getIndicatorAt"), at = Array(new At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/ChatHud;visibleMessages:Ljava/util/List;"))) 69 + def modifyLookedUpMessages(original: java.util.List[ChatHudLine.Visible]) = patch(original, 0)
+4
project/hexxytounge/src/main/resources/assets/hexxytounge/lang/en_us.json
··· 1 + { 2 + "hexcasting.action.hexxytounge:murmur": "Murmur Reflection", 3 + "book.hexxytounge.page.murmur": "Finds the region of my mind known as the 'chat box' and adds its contents to the stack. If it cannot be found, adds Null instead." 4 + }
+12
project/hexxytounge/src/main/resources/hexxytongge.mixins.json
··· 1 + { 2 + "required": true, 3 + "minVersion": "0.8", 4 + "package": "org.eu.net.pool.hexxytounge.mixin", 5 + "compatibilityLevel": "JAVA_17", 6 + "mixins": [], 7 + "client": [ 8 + "ChatHudMixin", 9 + "ChatScreenAccess", 10 + "MinecraftClientMixin" 11 + ] 12 + }
+85
project/hexxytounge/src/main/scala/org/eu/net/pool/hexxytounge/main.scala
··· 1 + package org.eu.net.pool.hexxytounge 2 + 3 + import at.petrak.hexcasting.api.casting.eval.CastingEnvironment 4 + import at.petrak.hexcasting.api.casting.iota.{Iota, IotaType, ListIota, NullIota} 5 + import at.petrak.hexcasting.api.casting.mishaps.MishapBadCaster 6 + import com.google.gson.JsonElement 7 + import com.mojang.serialization.JsonOps 8 + import dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent 9 + import dev.onyxstudios.cca.api.v3.component.{Component, ComponentAccess, ComponentKey, ComponentRegistry} 10 + import dev.onyxstudios.cca.api.v3.entity.{EntityComponentFactoryRegistry, EntityComponentInitializer, RespawnCopyStrategy} 11 + import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking 12 + import net.minecraft.nbt.{NbtCompound, NbtElement} 13 + import net.minecraft.server.network.ServerPlayerEntity 14 + import net.minecraft.text.Text 15 + import net.minecraft.util.Identifier 16 + import org.eu.net.pool.phlib.{Events as PhEvents, *, given} 17 + import org.slf4j.{Logger, LoggerFactory} 18 + import ram.talia.moreiotas.api.casting.iota.StringIota 19 + 20 + import scala.collection.immutable.* 21 + import scala.language.implicitConversions 22 + 23 + private[hexxytounge] given Logger = LoggerFactory.getLogger("hexxytounge") 24 + private[hexxytounge] given Conversion[String, Identifier] = Identifier.of("hexxytounge", _) 25 + 26 + private[hexxytounge] case class MurmurCache(var value: Option[String]) extends Component: 27 + override def readFromNbt(tag: NbtCompound): Unit = 28 + if tag.getBoolean("active") then 29 + value = Some(tag.getString("value")) 30 + else 31 + value = None 32 + override def writeToNbt(tag: NbtCompound): Unit = 33 + tag.putBoolean("active", false) 34 + for value <- value do 35 + tag.putBoolean("active", true) 36 + tag.putString("value", value) 37 + private[hexxytounge] object MurmurCache: 38 + given ComponentKey[MurmurCache] = ComponentRegistry.getOrCreate("murmur", classOf[MurmurCache]) 39 + 40 + private[hexxytounge] case class RevealComponent(var lines: Seq[Text]) extends AutoSyncedComponent: 41 + override def readFromNbt(tag: NbtCompound): Unit = 42 + lines = for n <- 0 until tag.getInt("lineCount") yield Text.Serializer.fromJson(tag(s"line$n")) // nbt is json apparently? 43 + override def writeToNbt(tag: NbtCompound): Unit = 44 + tag.putInt("lineCount", lines.size) 45 + for (line, n) <- lines.zipWithIndex do tag(s"line$n") = Text.Serializer.toJsonTree(line) 46 + private[hexxytounge] object RevealComponent: 47 + given ComponentKey[RevealComponent] = ComponentRegistry.getOrCreate("reveal", classOf[RevealComponent]) 48 + 49 + class Components extends EntityComponentInitializer: 50 + override def registerEntityComponentFactories(registry: EntityComponentFactoryRegistry): Unit = 51 + registry.registerForPlayers(summon[ComponentKey[MurmurCache]], _ => MurmurCache(None), RespawnCopyStrategy.ALWAYS_COPY) 52 + registry.registerForPlayers(summon[ComponentKey[RevealComponent]], _ => RevealComponent(Seq.empty), RespawnCopyStrategy.LOSSLESS_ONLY) 53 + 54 + def keyOf[C <: Component: ComponentKey as key] = key 55 + 56 + extension (c: ComponentAccess) 57 + def component[C <: Component: ComponentKey as key]: C = c.getComponent(key) 58 + def syncComponent[C <: Component: ComponentKey as key](): Unit = c.syncComponent(key) 59 + 60 + object hasComponent: 61 + def unapply[C <: Component: ComponentKey](ctx: ComponentAccess): Option[C] = 62 + try 63 + Some(ctx.component[C]) 64 + catch case _: NoSuchElementException => 65 + None 66 + 67 + def init() = 68 + Patterns.register("reveal", ne"deqed" ): 69 + Patterns.mkConstAction(1, 0): 70 + case Seq(iota: Iota) => 71 + locally(summon[CastingEnvironment]).getCastingEntity match 72 + case null => throw MishapBadCaster() 73 + case p: ServerPlayerEntity => 74 + p.component[RevealComponent].lines = iota match 75 + case s: ListIota => s.getList.map(_.display).toSeq 76 + //case m: MapIota => m.map.toSeq.map(p => IotaType.getDisplay(p._1) -> IotaType.getDisplay(p._2)).sortBy(_._1.getString) 77 + case _: NullIota => Seq() 78 + case _ => Seq(iota.display) 79 + p.syncComponent[RevealComponent]() 80 + Seq() 81 + case _ => throw MishapBadCaster() 82 + Patterns.register("murmur", e"wwaqwa"): 83 + Patterns.mkLiteral: (env, _) ?=> 84 + hasComponent.unapply[MurmurCache](env.getCastingEntity).fold(throw MishapBadCaster())(_.value.fold(NullIota())(StringIota.make)) 85 + ServerPlayNetworking.registerGlobalReceiver("murmur", { case (_, hasComponent[MurmurCache](c), _, buf, _) => c.value = Option.when(buf.readBoolean())(buf.readString()) }: ServerPlayNetworking.PlayChannelHandler)
+2
project/iotaworks/build.gradle.kts
··· 18 18 modImplementation("at.petra-k.hexcasting:hexcasting-fabric-$minecraft_version:0.11.3") 19 19 modImplementation("at.petra-k.paucal:paucal-fabric-$minecraft_version:0.6.0-pre-118") 20 20 modImplementation("com.samsthenerd.inline:inline-fabric:$minecraft_version-1.0.1") 21 + modImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-block:5.2.3") 22 + modImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-item:5.2.3") 21 23 modApi("miyucomics.hexcellular:hexcellular:1.1.0") 22 24 } 23 25
+1 -1
project/iotaworks/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/zh_cn/entries/addon/iotaworks/metatables.json
··· 28 28 { 29 29 "type": "patchouli:text", 30 30 "flag": "mod:hexdoc", 31 - "text": "这些$(thing)重载映射/$和我之前见过的一种技巧很像:在基础层面上重新定义图案。那些月之邪教徒(没位置解释)用到的$(l:https://www.lua.org/pil/13.html)元表/$——关联两张表来重新定义运算符——也跟它很类似。每当唤起我这边的“元方法”时,即会将自定义数据压栈。修补 iota 的其他信息则都遗失了;如果要返回同种 iota,就需要从头再构建一遍。也许可以用个“构造”宏?" 31 + "text": "这些$(thing)重载映射/$和我之前听过的一种技巧很像:在基础层面上重新定义图案。那些月之邪教徒(没位置解释)用到的$(l:https://www.lua.org/pil/13.html)元表/$——关联两张表来重新定义运算符——也跟它很类似。每当唤起我这边的“元方法”时,即会将自定义数据压栈。修补 iota 的其他信息则都遗失了;如果要返回同种 iota,就需要从头再构建一遍。也许可以用个“构造”宏?" 32 32 }, 33 33 { 34 34 "type": "patchouli:text",
+2
project/iotaworks/src/main/resources/assets/iotaworks/lang/zh_cn.json
··· 1 1 { 2 + "modmenu.nameTranslation.iotaworks": "Iota工程", 3 + "modmenu.descriptionTranslation.iotaworks": "能操纵iota本身的咒法学附属。", 2 4 "hexcasting.action.iotaworks:metatable": "修补之提整" 3 5 }
+3 -1
settings.gradle.kts
··· 20 20 21 21 include("util") 22 22 include("iotaworks") 23 - project(":iotaworks").projectDir = file("project/iotaworks") 23 + project(":iotaworks").projectDir = file("project/iotaworks") 24 + include("hexxytounge") 25 + project(":hexxytounge").projectDir = file("project/hexxytounge")
+2 -3
src/client/resources/hexic.client.mixins.json
··· 4 4 "package": "org.eu.net.pool.hexic.mixin.client", 5 5 "compatibilityLevel": "JAVA_17", 6 6 "client": [ 7 - "ChatHudMixin", 7 + "org.eu.net.pool.hexxytounge.mixin.ChatHudMixin", 8 8 "ChatInputSuggestorMixin", 9 9 "ChatScreenAccess", 10 10 "ChatScreenMixin", 11 - "InventoryScreenMixin", 12 - "MinecraftClientMixin" 11 + "InventoryScreenMixin" 13 12 ], 14 13 "injectors": { 15 14 "defaultRequire": 1
-17
src/client/scala/org/eu/net/pool/hexic/client/main.scala
··· 63 63 var lastMurmur: Option[String] = None 64 64 65 65 object Hooks: 66 - def clientTick(): Unit = 67 - val currentMurmur = client.currentScreen match 68 - case null => None 69 - case c: ChatScreenAccess => Some(c.getChatField.getText) 70 - case _ => None 71 - if currentMurmur != lastMurmur then 72 - if isDev then println(s"Sending murmur: ${currentMurmur}") 73 - lastMurmur = currentMurmur 74 - val buf = PacketByteBufs.create() 75 - buf.writeBoolean(currentMurmur.isDefined) 76 - currentMurmur.foreach(buf.writeString) 77 - try 78 - ClientPlayNetworking.send("murmur", buf) 79 - catch 80 - case _: IllegalStateException => 81 66 def provideRenderText(string: String, firstCharacterIndex: Int, field: TextFieldWidget, original: OrderedText): OrderedText = 82 67 foldLocalPlayer(original): p => 83 68 val c = p.getComponent(PlayerInfoComponent.key) ··· 342 327 "makeworld" -> "Conjure Demiplane", 343 328 "malloc" -> "Allocator's Purification", 344 329 "modulo" -> "Modulus Distillation II", 345 - "murmur" -> "Murmur Reflection", 346 330 "nbt/deserialize" -> "Importer's Purification", 347 331 "nbt/lift1" -> "Secretary's Purification: Byte", 348 332 "nbt/lift2" -> "Secretary's Purification: Short", ··· 404 388 gen.add("book.hexic.page.erase", "Erases the _Hex or iota contained within a dropped item or block. Costs one dust per item.") 405 389 gen.add("book.hexic.page.get_other_caster", "Adds the closest sentient being, excluding me, to the stack.") 406 390 gen.add("book.hexic.page.modulo", "Similar to Modulus, but differs for negative numbers: -8 %%₁ 3 = -2, but -8 %%₂ 3 = 1.") 407 - gen.add("book.hexic.page.murmur", "Adds the phrase on the $(o)tip of my tongue/$ to the stack, regardless of whether I intend to say it.") 408 391 gen.add("hexdoc.hexic.description", "Miscellaneous neat features and QoL patterns for Hex Casting") 409 392 gen.add("hexdoc.hexic.title", "Hexic") 410 393 gen.add("hexic.media.external", "Media")
-42
src/client/scala/org/eu/net/pool/hexic/mixin/client/ChatHudMixin.java
··· 1 - package org.eu.net.pool.hexic.mixin.client; 2 - 3 - import com.llamalad7.mixinextras.injector.ModifyExpressionValue; 4 - import com.llamalad7.mixinextras.sugar.Local; 5 - import net.minecraft.client.MinecraftClient; 6 - import net.minecraft.client.gui.hud.ChatHud; 7 - import net.minecraft.client.gui.hud.ChatHudLine; 8 - import net.minecraft.client.gui.hud.MessageIndicator; 9 - import net.minecraft.client.network.ClientPlayerEntity; 10 - import net.minecraft.text.Text; 11 - import org.eu.net.pool.hexic.PlayerInfoComponent; 12 - import org.spongepowered.asm.mixin.Mixin; 13 - import org.spongepowered.asm.mixin.Unique; 14 - import org.spongepowered.asm.mixin.injection.At; 15 - import scala.reflect.ClassTag; 16 - 17 - import java.util.ArrayList; 18 - import java.util.List; 19 - 20 - import static scala.jdk.javaapi.CollectionConverters.*; 21 - 22 - @Mixin(ChatHud.class) 23 - public class ChatHudMixin { 24 - @Unique 25 - private List<ChatHudLine.Visible> patch(List<ChatHudLine.Visible> original, int currentTick) { 26 - ArrayList ls = new ArrayList(); 27 - ClientPlayerEntity p = MinecraftClient.getInstance().player; 28 - if (p != null) 29 - for (Text t: asJava(p.getComponent(PlayerInfoComponent.key()).chatLines())) 30 - ls.add(0, new ChatHudLine.Visible(currentTick, t.asOrderedText(), MessageIndicator.system(), true)); 31 - ls.addAll(original); 32 - return ls; 33 - } 34 - @ModifyExpressionValue(method = "render", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/ChatHud;visibleMessages:Ljava/util/List;")) 35 - List<ChatHudLine.Visible> modifyDrawnMessages(List<ChatHudLine.Visible> original, @Local(ordinal = 0, argsOnly = true) int currentTick) { 36 - return patch(original, currentTick); 37 - } 38 - @ModifyExpressionValue(method = {"getTextStyleAt", "getIndicatorAt"}, at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/ChatHud;visibleMessages:Ljava/util/List;")) 39 - List<ChatHudLine.Visible> modifyLookedUpMessages(List<ChatHudLine.Visible> original) { 40 - return patch(original, 0); 41 - } 42 - }
-12
src/client/scala/org/eu/net/pool/hexic/mixin/client/ChatScreenAccess.java
··· 1 - package org.eu.net.pool.hexic.mixin.client; 2 - 3 - import net.minecraft.client.gui.screen.ChatScreen; 4 - import net.minecraft.client.gui.widget.TextFieldWidget; 5 - import org.spongepowered.asm.mixin.Mixin; 6 - import org.spongepowered.asm.mixin.gen.Accessor; 7 - 8 - @Mixin(ChatScreen.class) 9 - public interface ChatScreenAccess { 10 - @Accessor 11 - public TextFieldWidget getChatField(); 12 - }
-22
src/client/scala/org/eu/net/pool/hexic/mixin/client/MinecraftClientMixin.java
··· 1 - package org.eu.net.pool.hexic.mixin.client; 2 - 3 - import net.minecraft.client.MinecraftClient; 4 - import net.minecraft.client.gui.screen.ChatScreen; 5 - import net.minecraft.client.gui.screen.Screen; 6 - import org.eu.net.pool.hexic.client.Hooks$; 7 - import org.jetbrains.annotations.Nullable; 8 - import org.spongepowered.asm.mixin.Mixin; 9 - import org.spongepowered.asm.mixin.Shadow; 10 - import org.spongepowered.asm.mixin.injection.At; 11 - import org.spongepowered.asm.mixin.injection.Inject; 12 - import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 - 14 - @Mixin(MinecraftClient.class) 15 - public class MinecraftClientMixin { 16 - @Shadow @Nullable public Screen currentScreen; 17 - 18 - @Inject(at = @At("HEAD"), method = "tick") 19 - void tick(CallbackInfo ci) { 20 - Hooks$.MODULE$.clientTick(); 21 - } 22 - }
+3 -3
src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/addon/hexic/greater_reveal.json project/hexxytounge/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/addon/hexxytongue/greater_reveal.json
··· 7 7 "Thus, I've devised a new pattern of my own. It's similar to $(l:hexcasting:patterns/basics#hexcasting:print)$(action)Reveal/$, but the message is lodged well within my mind, and I forget it instantly if I replace it with something else. It can also take a list of messages, for convenience.", 8 8 { 9 9 "type": "hexcasting:pattern", 10 - "anchor": "hexic:reveal", 11 - "op_id": "hexic:reveal", 10 + "anchor": "hexxytounge:reveal", 11 + "op_id": "hexxytounge:reveal", 12 12 "input": "[iota] | iota", 13 13 "output": "", 14 - "text": "Takes a list of iotas (or a single non-iota, which is treated as a list with one element) and displays them permanently to the caster. Displayed iotas survive all methods that would clear a normal Reveal, and can only be cleared by another casting of Greater Reveal." 14 + "text": "Takes a list of iotas (or a single non-iota, which is treated as a list with one element) and embeds them in my mind persistently. Displayed iotas survive all methods that would clear a normal Reveal, and can only be cleared by another casting of Greater Reveal or my untimely demise." 15 15 }, 16 16 "$(o)To be a Hexcaster is to glimpse a truth that might best be hidden./$" 17 17 ]
+2 -2
src/main/resources/assets/hexcasting/patchouli_books/thehexbook/zh_cn/entries/addon/hexic/greater_reveal.json project/hexxytounge/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/zh_cn/entries/addon/hexxytongue/greater_reveal.json
··· 7 7 "因此,我自己设计了一个图案。它的功能和$(l:hexcasting:patterns/basics#hexcasting:print)$(action)揭示/$类似,但发来的消息会牢牢嵌在我的意识里,而且一经替换就会立刻遗忘。为方便起见,它还能接受一个消息列表。", 8 8 { 9 9 "type": "hexcasting:pattern", 10 - "anchor": "hexic:reveal", 11 - "op_id": "hexic:reveal", 10 + "anchor": "hexxytounge:reveal", 11 + "op_id": "hexxytounge:reveal", 12 12 "input": "[iota] | iota", 13 13 "output": "", 14 14 "text": "接受 iota 列表(或单个非 iota,此时视作单元素列表)并永久性将其展示给施法者。清除普通揭示的方法无法清除此操作展示的 iota,而是只能通过再次施放卓越揭示清除。"
+4 -2
src/main/resources/assets/hexcasting/patchouli_books/thehexbook/zh_cn/entries/addon/hexic/lists2.json
··· 63 63 }, 64 64 { 65 65 "type": "hexcasting:pattern", 66 + "header": "外积之馏化", 66 67 "op_id": "hexcasting:mul", 67 68 "anchor": "hexcasting:mul", 68 69 "input": "[a], [b]", ··· 71 72 }, 72 73 { 73 74 "type": "hexcasting:pattern", 74 - "op_id": "hexcasting:mul", 75 - "anchor": "hexcasting:mul", 75 + "header": "内积之馏化", 76 + "op_id": "hexcasting:div", 77 + "anchor": "hexcasting:div", 76 78 "input": "[a], [b]", 77 79 "output": "[[a, b]]", 78 80 "text": "计算两列表的内积。即纵向排布两列表的元素,而后相邻排列两列表,将每行的元素对组为列表返回(跳过未配对的元素)。"
+3 -3
src/main/resources/assets/hexic/jsonpatch/strings.jsonpatch project/hexxytounge/src/main/resources/assets/hexxytounge/jsonpatch/strings.jsonpatch
··· 3 3 4 4 $pages = arrays.insert($pages, 11, { 5 5 type: "hexcasting:pattern", 6 - op_id: "hexic:murmur", 7 - anchor: "hexic:murmur", 6 + op_id: "hexxytounge:murmur", 7 + anchor: "hexxytounge:murmur", 8 8 input: "", 9 9 output: "str", 10 - text: "book.hexic.page.murmur" 10 + text: "book.hexxytounge.page.murmur" 11 11 });
+4
src/main/resources/assets/hexic/lang/zh_cn.json
··· 4 4 "book.hexic.page.get_other_caster": "将离我最近的有智慧存在压入栈,我自己不计入统计范围。", 5 5 "book.hexic.page.modulo": "与余数之馏化类似,但两者在负数上的表现不同:-8 %%₁ 3 = -2,而 -8 %%₂ 3 = 1。", 6 6 "book.hexic.page.murmur": "将$(o)在我嘴边/$的话语压入栈中,后续是否要说出不影响结果。", 7 + "hexcasting.action.hexic:deleteworld": "击碎半位面", 7 8 "hexcasting.action.hexic:drop": "拒斥之馏化", 8 9 "hexcasting.action.hexic:dye_offhand": "应用染色剂", 9 10 "hexcasting.action.hexic:erase": "清除方块", ··· 16 17 "hexcasting.action.hexic:jvm/class_of_payload": "判类器之纯化,第一型", 17 18 "hexcasting.action.hexic:jvm/newinstance_boxed": "构造器之纯化,第一型", 18 19 "hexcasting.action.hexic:jvm/newinstance_unboxed": "构造器之纯化,第二型", 20 + "hexcasting.action.hexic:make_cme": "托特之伪策略", 21 + "hexcasting.action.hexic:makeworld": "构筑半位面", 19 22 "hexcasting.action.hexic:malloc": "分配器之纯化", 20 23 "hexcasting.action.hexic:modulo": "余数之馏化,第二型", 21 24 "hexcasting.action.hexic:murmur": "私语之精思", ··· 34 37 "hexcasting.action.hexic:nbt/serialize": "导出器之纯化", 35 38 "hexcasting.action.hexic:reveal": "卓越揭示", 36 39 "hexcasting.action.hexic:rotate": "摩天轮之馏化", 40 + "hexcasting.action.hexic:snow": "召雪", 37 41 "hexcasting.action.hexic:staffcast_factory": "Lani之卓越策略", 38 42 "hexcasting.action.hexic:staffcast_factory/lazy": "Lani之初等策略", 39 43 "hexcasting.action.hexic:take": "维持之馏化",
-22
src/main/scala/org/eu/net/pool/hexic/main.scala
··· 1849 1849 Seq(ListIota(ls take n), ListIota(ls drop (n+1)), ls(n)) 1850 1850 case Seq(ary: ListIota, nr) => throw MishapInvalidIota.ofType(nr, 0, "int") 1851 1851 case Seq(ary, _) => throw MishapInvalidIota.ofType(ary, 1, "list") 1852 - Patterns.register("murmur", e"wwaqwa"): 1853 - Patterns.mkLiteral: 1854 - locally(summon[CastingEnvironment]).getCastingEntity match 1855 - case null => throw MishapBadCaster() 1856 - case p: ServerPlayerEntity => p.getComponent(PlayerInfoComponent.key).murmur.fold(NullIota())(StringIota.make) 1857 - case _ => throw MishapBadCaster() 1858 1852 Patterns.register("make_cme", ne"dqqd"): 1859 1853 Patterns.mkAction: (img, cont) => 1860 1854 img.getStack.toSeq.reverse match ··· 1909 1903 case Seq(i, _: ListIota, _*) => throw MishapInvalidIota.ofType(i, 0, "list") 1910 1904 case Seq(_, i, _*) => throw MishapInvalidIota.ofType(i, 1, "list") 1911 1905 case s => throw MishapNotEnoughArgs(2, s.size) 1912 - Patterns.register("reveal", ne"deqed"): 1913 - Patterns.mkConstAction(1, 0): 1914 - case Seq(iota: Iota) => 1915 - locally(summon[CastingEnvironment]).getCastingEntity match 1916 - case null => throw MishapBadCaster() 1917 - case p: ServerPlayerEntity => 1918 - p.getComponent(PlayerInfoComponent.key).chatLines = iota match 1919 - case s: ListIota => s.getList.map(_.display).toSeq 1920 - case _ => Seq(iota.display) 1921 - p.syncComponent(PlayerInfoComponent.key) 1922 - Seq() 1923 - case _ => throw MishapBadCaster() 1924 - ServerPlayNetworking.registerGlobalReceiver("murmur", (_, player, _, buf, _) => 1925 - val in = Option.when(buf.readBoolean())(buf.readString()) 1926 - if isDev then println(s"${player.getName.getString} murmurs: $in") 1927 - player.getComponent(PlayerInfoComponent.key).murmur = in) 1928 1906 lazy val messageFrameType: ContinuationFrame.Type[MessageFrame] = (c: NbtCompound, world: ServerWorld) => 1929 1907 val id = Uuids.toUuid(c.getIntArray("id")) 1930 1908 MessageFrame(id, Text.Serializer.fromJson(NbtOps.INSTANCE.convertTo(JsonOps.INSTANCE, c.getCompound("t"))), world.getServer.getPlayerManager.getPlayer(id))
+6 -6
util/build.gradle.kts
··· 21 21 modImplementation("com.samsthenerd.inline:inline-fabric:$minecraft_version-1.0.1") 22 22 modApi("io.github.tropheusj:serialization-hooks:0.4.99999") 23 23 val cardinal_version = "5.2.3" 24 - modApi("dev.onyxstudios.cardinal-components-api:cardinal-components-base:$cardinal_version") 25 - modApi("dev.onyxstudios.cardinal-components-api:cardinal-components-block:$cardinal_version") 26 - modApi("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:$cardinal_version") 27 - modApi("dev.onyxstudios.cardinal-components-api:cardinal-components-item:$cardinal_version") 28 - modApi("dev.onyxstudios.cardinal-components-api:cardinal-components-level:$cardinal_version") 29 - modApi("dev.onyxstudios.cardinal-components-api:cardinal-components-world:$cardinal_version") 24 + modImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-base:$cardinal_version") 25 + modImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-block:$cardinal_version") 26 + modImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:$cardinal_version") 27 + modImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-item:$cardinal_version") 28 + modImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-level:$cardinal_version") 29 + modImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-world:$cardinal_version") 30 30 modRuntimeOnly("dev.onyxstudios.cardinal-components-api:cardinal-components-api:$cardinal_version") 31 31 } 32 32
+2 -2
util/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/zh_cn/entries/addon/phlib/maps.json
··· 7 7 "映射是能存储 iota 对的高效结构。虽然这种功能只靠列表操作也能做到,但专门设计的映射 iota 用到了某种奥秘物件,称作“$(thing)哈希/$”。这种区别并不会减少访问映射所需$(o)运算符/$的数量,却能大幅降低自然的负载,大多数访问下接近于 O(1)。", 8 8 { 9 9 "type": "hexcasting:pattern", 10 - "op_id": "hexic:empty_map", 11 - "anchor": "hexic:empty_map", 10 + "op_id": "phlib:empty_map", 11 + "anchor": "phlib:empty_map", 12 12 "input": "", 13 13 "output": "map<⊥, ⊥>", 14 14 "text": "创建一个空映射以供使用。"
util/src/main/scala/org/eu/net/pool/phlib/util.scala