repo for my hex addons :3
0
fork

Configure Feed

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

merge

+5 -315
+1 -1
build.gradle.kts
··· 60 60 } 61 61 val modid: String by project.properties 62 62 ext["release"] = release 63 - val isProject = project.projectDir.path.contains("/project/") 63 + val isProject = project.projectDir.path.contains("/project/") || project == project(":util") 64 64 65 65 plugins.withId("java") { 66 66 java {
+1
project/hexic/changelog
··· 1 1 2.0.0 engulfed hexxychests 2 2 2.0.0 load config from config/*.properties instead of config/jvm.properties 3 3 2.0.0 murmur and reveal now use separate components 4 + 2.0.0 !removed NBT iotas 4 5 2.0.0 !removed tripwires
+2 -19
project/hexic/src/client/scala/org/eu/net/pool/hexic/client.scala
··· 329 329 "free" -> "Deallocator's Gambit", 330 330 "get_other_caster" -> "Dual's Reflection", 331 331 "grep" -> "Refinement Distillation", 332 - "jvm/class_of_iota" -> "Classifier Purification II", 333 - "jvm/class_of_payload" -> "Classifier Purification I", 334 - "jvm/newinstance_boxed" -> "Constructor Purification I", 335 - "jvm/newinstance_unboxed" -> "Constructor Purification II", 336 332 "make_cme" -> "Thoth's Pseudogambit", 337 333 "makeworld" -> "Conjure Demiplane", 338 334 "malloc" -> "Allocator's Purification", ··· 340 336 "moveconcept" -> "Transfer Substance", 341 337 "moveentity" -> "Transfer Creature", 342 338 "murmur" -> "Murmur Reflection", 343 - "nbt/deserialize" -> "Importer's Purification", 344 - "nbt/lift1" -> "Secretary's Purification: Byte", 345 - "nbt/lift2" -> "Secretary's Purification: Short", 346 - "nbt/lift4" -> "Secretary's Purification: Integer", 347 - "nbt/lift8" -> "Secretary's Purification: Long", 348 - "nbt/liftd" -> "Secretary's Purification: Double", 349 - "nbt/liftf" -> "Secretary's Purification: Float", 350 - "nbt/literal/array1" -> "Secretary's Reflection: Vacant Byte Array", 351 - "nbt/literal/array2" -> "Secretary's Reflection: Vacant Integer Array", 352 - "nbt/literal/array4" -> "Secretary's Reflection: Vacant Long Array", 353 - "nbt/literal/collection" -> "Secretary's Reflection: Collection", 354 - "nbt/literal/list" -> "Secretary's Reflection: Vacant List", 355 - "nbt/serialize" -> "Exporter's Purification", 356 339 "reveal" -> "Greater Reveal", 357 340 "rotate" -> "Ferris Distillation", 358 341 "staffcast_factory" -> "Lani's Greater Gambit", ··· 386 369 gen.add(item, s"Stringworm") 387 370 for item <- MediaBundle.items do 388 371 gen.add(item, item.size match 389 - case 6 => s"${item.color.humanName} Media Pouch" 390 - case 12 => s"Large ${item.color.humanName} Media Pouch" 372 + case 6 => s"${item.color.humanName} Casting Pouch" 373 + case 12 => s"Large ${item.color.humanName} Casting Pouch" 391 374 case s => throw IllegalStateException(s"Unhandled bundle size $s")) 392 375 gen.add(wizard, "Wizard") 393 376 val hexLang = Seq("hexcasting", "oneironaut").flatMap(mod => Gson().fromJson(InputStreamReader(getClass.getResourceAsStream(s"/assets/$mod/lang/en_us.json")), new TypeToken[java.util.Map[String, String]]() {}).asScala).toMap
+1 -2
project/hexic/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/addon/hexic/media_bundle.json
··· 1 - 2 1 { 3 - "name": "Media Pouches", 2 + "name": "Casting Pouches", 4 3 "category": "hexcasting:items", 5 4 "icon": "hexic:small_preferred_bundle", 6 5 "sortnum": 1,
-58
project/hexic/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/addon/hexic/nbt.json
··· 1 - { 2 - "name": "Nature's Records", 3 - "category": "hexcasting:patterns", 4 - "icon": "minecraft:glow_ink_sac", 5 - "advancement": "hexcasting:enlightenment", 6 - "pages": [ 7 - "My studies have led me to understand the fabric undermining every facet of this world. Nature's memory manifests itself as a recursive structure of 'tags' of several types. I've documented these over the next few pages. Though many types of tag appear to be redundant with each other, I must keep in mind that they are not freely interchangeable — and since I am dealing directly with Nature's memories, such a mistake could be worse than fatal.", 8 - "If everything in the world is merely reduced to a tag... what am I? Is my entire existence reducible to a pile of bytes? At least this gives me some comfort, knowing that the villagers I've sacrificed in my journey truly had no life of their own... what about mine? What am I? Were the words I am writing in this very book, just a manifestation of random ones and zeroes?$(2br)I best not ponder too much. Though I may pry into everything I wish in detail, doing so would suck the joy from this illusion.", 9 - { 10 - "type": "hexcasting:pattern", 11 - "anchor": "hexic:nbt/lift1", 12 - "op_id": "hexic:nbt/lift1", 13 - "input": "number", 14 - "output": "nbt", 15 - "text": "Converts a number into a Byte tag: an integer between -128 and 127, inclusive." 16 - }, 17 - { 18 - "type": "hexcasting:pattern", 19 - "anchor": "hexic:nbt/lift2", 20 - "op_id": "hexic:nbt/lift2", 21 - "input": "number", 22 - "output": "nbt", 23 - "text": "Converts a number into a Short tag, between -65536 and 65535." 24 - }, 25 - { 26 - "type": "hexcasting:pattern", 27 - "anchor": "hexic:nbt/lift4", 28 - "op_id": "hexic:nbt/lift4", 29 - "input": "number", 30 - "output": "nbt", 31 - "text": "Converts a number into an Int tag, between roughly negative 2 billion and positive 2 billion." 32 - }, 33 - { 34 - "type": "hexcasting:pattern", 35 - "anchor": "hexic:nbt/lift8", 36 - "op_id": "hexic:nbt/lift8", 37 - "input": "number", 38 - "output": "nbt", 39 - "text": "Converts a number into a Long tag: bounded to 9 quintillion, which I will likely never reach." 40 - }, 41 - { 42 - "type": "hexcasting:pattern", 43 - "anchor": "hexic:nbt/liftd", 44 - "op_id": "hexic:nbt/liftd", 45 - "input": "number", 46 - "output": "nbt", 47 - "text": "Converts a number into a Double tag. Oddly, doubles seem to perfectly correspond to my knowledge of numbers, plus the ability to represent infinities and non-numbers." 48 - }, 49 - { 50 - "type": "hexcasting:pattern", 51 - "anchor": "hexic:nbt/liftf", 52 - "op_id": "hexic:nbt/liftf", 53 - "input": "number", 54 - "output": "nbt", 55 - "text": "Converts a number into a Float tag. These seem similar to Doubles, albeit with less precision." 56 - } 57 - ] 58 - }
-235
project/hexic/src/main/scala/org/eu/net/pool/hexic/main.scala
··· 848 848 ) 849 849 possible(Random.nextInt(possible.size)) 850 850 Interop.thoughtWorld = RegistryKey.of(RegistryKeys.WORLD, "thought") 851 - iotaTypeRegistry("nbt") = NbtIota 852 851 iotaTypeRegistry("access") = PropertyAccessIota.Type 853 852 for (color, item) <- Mediaweave.colors do 854 853 Registries.ITEM(s"${color.asString}_mediaweave") = item ··· 987 986 , true, true 988 987 )) 989 988 case i => throw MishapInvalidIota.ofType(i, 0, "pigment") 990 - def mkNbtLiftAction[T: FromIota](lift: T => NbtElement, expected: Identifier) = 991 - Patterns.mkConstAction(1): 992 - case Seq(iotaLike[T](x)) => Seq(NbtIota(lift(x))) 993 - case Seq(x) => throw MishapInvalidIota.of(x, 0, expected.toString) 994 - def mkNbtLiftArrayAction[T: FromIota](lift: T => NbtElement, liftArray: Array[T] => NbtElement, expected: Identifier)(using FromIota[Array[T]]) = 995 - Patterns.mkConstAction(1): 996 - case Seq(iotaLike[T](x)) => Seq(NbtIota(lift(x))) 997 - case Seq(iotaLike[Array[T]](x)) => Seq(NbtIota(liftArray(x))) 998 - case Seq(x) => throw MishapInvalidIota.of(x, 0, expected.toString) 999 - Patterns.register("nbt/lift1", (HexDir.NORTH_WEST, "edwaqw")): 1000 - mkNbtLiftArrayAction[Byte](NbtByte.of, (b => NbtByteArray(b)): Array[Byte] => NbtElement, "byte") 1001 - Patterns.register("nbt/lift2", (HexDir.NORTH_WEST, "edwaqww")): 1002 - mkNbtLiftAction[Short](NbtShort.of, "short") 1003 - Patterns.register("nbt/lift4", (HexDir.NORTH_WEST, "edwaqwww")): 1004 - mkNbtLiftArrayAction[Int](NbtInt.of, (b: Array[Int]) => NbtIntArray(b), "int") 1005 - Patterns.register("nbt/lift8", (HexDir.NORTH_WEST, "edwaqwwww")): 1006 - mkNbtLiftArrayAction[Long](NbtLong.of, (b: Array[Long]) => NbtLongArray(b), "long") 1007 - Patterns.register("nbt/liftf", (HexDir.NORTH_WEST, "edwaqwaa")): 1008 - mkNbtLiftAction[Float](NbtFloat.of, "float") 1009 - Patterns.register("nbt/liftd", (HexDir.NORTH_WEST, "edwaqwaawaa")): 1010 - mkNbtLiftAction[Double](NbtDouble.of, "double") 1011 - Patterns.register("nbt/literal/collection", (HexDir.EAST, "qqddqdewqaeaaee")): 1012 - Patterns.mkLiteral(NbtIota(NbtCompound())) 1013 - Patterns.register("nbt/literal/list", (HexDir.EAST, "eedwaqq")): 1014 - Patterns.mkLiteral(NbtIota(NbtList())) 1015 - Patterns.register("nbt/literal/array1", (HexDir.EAST, "eedwaqqe")): 1016 - Patterns.mkLiteral(NbtIota(NbtByteArray(Array[Byte]()))) 1017 - Patterns.register("nbt/literal/array2", (HexDir.EAST, "eedwaqqew")): 1018 - Patterns.mkLiteral(NbtIota(NbtIntArray(Array[Int]()))) 1019 - Patterns.register("nbt/literal/array4", (HexDir.EAST, "eedwaqqewww")): 1020 - Patterns.mkLiteral(NbtIota(NbtLongArray(Array[Long]()))) 1021 989 Patterns.register("prop_fi", sw"aawqe"): 1022 990 Patterns.mkConstAction(1): 1023 991 case Seq(x: PropertyIota) => Seq(PropertyAccessIota.Writer(x.getName, "head")) ··· 1034 1002 Patterns.mkConstAction(1): 1035 1003 case Seq(x: PropertyIota) => Seq(PropertyAccessIota.Stream(x.getName, "tail")) 1036 1004 case Seq(x) => throw MishapInvalidIota(x, 0, "property") 1037 - Patterns.register("nbt/serialize", nw"edwaq"): 1038 - Patterns.mkConstAction(1): 1039 - case Seq(x: Iota) => Seq(IotaType.serialize(x)) 1040 1005 Patterns.register("where", nw"qaeaqwdd"): 1041 1006 Patterns.mkConstAction(1): i => 1042 1007 val Seq(x) = i ··· 1068 1033 ??? 1069 1034 Patterns.register("whatthefuck", ne"daadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaadaadaddaddaadaddaadaadaddaddaadaddaddaadaddaadaadadda"): 1070 1035 Patterns.mkLiteral(PatternIota(e"wedqawqeewdeaqeewdeaqqedqawqqedqawqeedqawqqewdeaqeedqawqeewdeaqqewdeaqeewdeaqeedqawqqedqawqqewdeaqeedqawqeewdeaqqewdeaqeewdeaqeedqawqqedqawqqewdeaqqedqawqeewdeaqeewdeaqqedqawqqedqawqeedqawqqewdeaqqedqawqeewdeaqeewdeaqqedqawqqedqawqeedqawqqewdeaqeedqawqeewdeaqeewdeaqqedqawqqedqawqeedqawqqewdeaqqedqawqeewdeaqqewdeaqeewdeaqeedqawqqedqawqqewdeaqe")) 1071 - Patterns.register("nbt/deserialize", (HexDir.NORTH_WEST, "edwaqa")): 1072 - Patterns.mkConstAction(1): 1073 - case Seq(data: NbtIota) => 1074 - val env = summon[CastingEnvironment] 1075 - given ServerWorld = env.getWorld 1076 - val iota = data.data.asInstanceOf[NbtCompound].iota 1077 - iota match 1078 - case p: EntityIota => p.getEntity match 1079 - case t: PlayerEntity if t != env.getCastingEntity => 1080 - throw MishapOthersName(t) 1081 - case _ => 1082 - case _ => 1083 - Seq(iota) 1084 - case Seq(x) => 1085 - throw MishapInvalidIota(x, 0, Text.literal("an ").append(Text.literal("NBT compound").styled(_.withColor(NbtIota.color)))) 1086 - Registry.register(hexXplat.getArithmeticRegistry, "nbt": Identifier, { 1087 - import Arithmetic.* 1088 - given Conversion[NbtIota, NbtElement] = _.data 1089 - given Conversion[NbtElement, NbtIota] = NbtIota(_) 1090 - arith("nbt", 1091 - ADD -> ((a: NbtIota, b: Iota) => 1092 - Seq[NbtIota]: 1093 - (a.data, b) match 1094 - case (a: NbtDouble, iotaLike[Double](b)) => NbtDouble.of(a.doubleValue + b) 1095 - case (a: NbtFloat, iotaLike[Float](b)) => NbtFloat.of(a.floatValue + b) 1096 - case (a: NbtLong, iotaLike[Long](b)) => NbtLong.of(a.longValue + b) 1097 - case (a: NbtInt, iotaLike[Int](b)) => NbtInt.of(a.intValue + b) 1098 - case (a: NbtShort, iotaLike[Short](b)) => NbtShort.of((a.shortValue + b).toShort) 1099 - case (a: NbtByte, iotaLike[Byte](b)) => NbtByte.of((a.byteValue + b).toByte) 1100 - case (a: NbtByteArray, iotaLike[Seq[Byte]](b)) => NbtByteArray(a.getByteArray ++ b) 1101 - case (a: NbtIntArray, iotaLike[Seq[Int]](b)) => NbtIntArray(a.getIntArray ++ b) 1102 - case (a: NbtLongArray, iotaLike[Seq[Long]](b)) => NbtLongArray(a.getLongArray ++ b) 1103 - case (a: NbtList, iotaLike[Seq[NbtElement]](b)) => NbtList().tap: l => 1104 - l.addAll(a) 1105 - l.addAll(b) 1106 - case (a: NbtCompound, iotaLike[NbtCompound](b)) => NbtCompound().tap: c => 1107 - c.copyFrom(a) 1108 - c.copyFrom(b) 1109 - ), 1110 - SUB -> ((a: NbtIota, b: Iota) => 1111 - Seq[NbtIota]: 1112 - (a.data, b) match 1113 - case (a: NbtDouble, iotaLike[Double](b)) => NbtDouble.of(a.doubleValue - b) 1114 - case (a: NbtFloat, iotaLike[Float](b)) => NbtFloat.of(a.floatValue - b) 1115 - case (a: NbtLong, iotaLike[Long](b)) => NbtLong.of(a.longValue - b) 1116 - case (a: NbtInt, iotaLike[Int](b)) => NbtInt.of(a.intValue - b) 1117 - case (a: NbtShort, iotaLike[Short](b)) => NbtShort.of((a.shortValue - b).toShort) 1118 - case (a: NbtByte, iotaLike[Byte](b)) => NbtByte.of((a.byteValue - b).toByte) 1119 - ), 1120 - MUL -> ((a: NbtIota, b: Iota) => 1121 - Seq[NbtIota]: 1122 - (a.data, b) match 1123 - case (a: NbtDouble, iotaLike[Double](b)) => NbtDouble.of(a.doubleValue * b) 1124 - case (a: NbtFloat, iotaLike[Float](b)) => NbtFloat.of(a.floatValue * b) 1125 - case (a: NbtLong, iotaLike[Long](b)) => NbtLong.of(a.longValue * b) 1126 - case (a: NbtInt, iotaLike[Int](b)) => NbtInt.of(a.intValue * b) 1127 - case (a: NbtShort, iotaLike[Short](b)) => NbtShort.of((a.shortValue * b).toShort) 1128 - case (a: NbtByte, iotaLike[Byte](b)) => NbtByte.of((a.byteValue * b).toByte) 1129 - ), 1130 - DIV -> ((a: NbtIota, b: Iota) => 1131 - Seq[NbtIota]: 1132 - (a.data, b) match 1133 - case (a: NbtDouble, iotaLike[Double](b)) => NbtDouble.of(a.doubleValue / b) 1134 - case (a: NbtFloat, iotaLike[Float](b)) => NbtFloat.of(a.floatValue / b) 1135 - case (a: NbtLong, iotaLike[Long](b)) => NbtLong.of(a.longValue / b) 1136 - case (a: NbtInt, iotaLike[Int](b)) => NbtInt.of(a.intValue / b) 1137 - case (a: NbtShort, iotaLike[Short](b)) => NbtShort.of((a.shortValue / b).toShort) 1138 - case (a: NbtByte, iotaLike[Byte](b)) => NbtByte.of((a.byteValue / b).toByte) 1139 - ), 1140 - INDEX -> ((a: NbtIota, b: DoubleIota | StringIota) => 1141 - Seq[NbtIota]: 1142 - (a.data, b) match 1143 - case (a: AbstractNbtList[? <: NbtElement], b: DoubleIota) => a.get(b.asIntOrThrow(0)) 1144 - case (a: NbtCompound, iotaLike[String](b)) => a.get(b) 1145 - ), 1146 - SLICE -> ((a: NbtIota, f: DoubleIota | StringIota, t: DoubleIota) => 1147 - Seq[NbtIota]: 1148 - (a.data, f, t) match 1149 - case (a: NbtByteArray, b: DoubleIota, c: DoubleIota) => (a: Array[Byte]).slice(b `asIntOrThrow` 1, c `asIntOrThrow` 2): NbtByteArray 1150 - case (a: NbtIntArray, b: DoubleIota, c: DoubleIota) => (a: Array[Int]).slice(b `asIntOrThrow` 1, c `asIntOrThrow` 2): NbtIntArray 1151 - case (a: NbtLongArray, b: DoubleIota, c: DoubleIota) => (a: Array[Long]).slice(b `asIntOrThrow` 1, c `asIntOrThrow` 2): NbtLongArray 1152 - case (a: NbtList, b: DoubleIota, c: DoubleIota) => 1153 - val l = NbtList() 1154 - a.slice(b `asIntOrThrow` 1, c `asIntOrThrow` 2).foreach(l.add) 1155 - l 1156 - case (a: NbtCompound, b: StringIota, c: StringIota) => 1157 - NbtCompound().tap: r => 1158 - a.getKeys.collect: 1159 - case k if k <= b.getString && k > c.getString => r(k) = a(k) 1160 - ), 1161 - INDEX_OF -> ((a: NbtIota, b: NbtIota) => 1162 - Seq[NbtIota]: 1163 - (a.data, b.data) match 1164 - case (a: AbstractNbtList[? <: NbtElement], b: NbtElement) => NbtInt.of(a.indexOf(b)) 1165 - case (a: NbtCompound, b: NbtElement) => 1166 - val list = NbtList() 1167 - a.getKeys.foreach: k => 1168 - if a.get(k) == b then 1169 - list.add(NbtString.of(k)) 1170 - NbtIota(list) 1171 - ), 1172 - APPEND -> ((a: NbtIota, b: NbtIota) => 1173 - Seq[NbtIota]: 1174 - (a.data, b.data) match 1175 - case (a: AbstractNbtList[t], b) if b.isInstanceOf[t] => 1176 - a.copy().tap: 1177 - case c: AbstractNbtList[t] => 1178 - c.add(b.asInstanceOf[t]) 1179 - ), 1180 - UNAPPEND -> ((a: NbtIota) => 1181 - a.data match 1182 - case a: AbstractNbtList[?] => 1183 - val s = a.asScala 1184 - Seq[NbtIota](NbtList().tap(_.addAll(s.init)), s.last) 1185 - case c: NbtCompound => 1186 - val k = c.getKeys.asScala.toBuffer 1187 - Seq[NbtIota]( 1188 - NbtCompound().tap: d => 1189 - k.init.foreach: k => 1190 - d(k) = c(k), 1191 - NbtString.of(k.last), 1192 - c(k.last), 1193 - ) 1194 - ), 1195 - CONS -> ((a: NbtIota, b: Iota) => 1196 - Seq[NbtIota]: 1197 - (a.data, b) match 1198 - case (nbtList(Tagged(a: AbstractNbtList[t], given _)), b) => 1199 - b match 1200 - case iotaLike[t](b) => a.copy.asInstanceOf[AbstractNbtList[t]].tap(_.add(0, b)) 1201 - ), 1202 - UNCONS -> ((a: NbtIota) => 1203 - a.data match 1204 - case a: AbstractNbtList[?] => 1205 - val s = a.asScala 1206 - Seq[NbtIota](NbtList().tap(_.addAll(s.tail)), s.head) 1207 - case c: NbtCompound => 1208 - val k = c.getKeys.asScala.toBuffer 1209 - Seq[NbtIota]( 1210 - NbtCompound().tap: d => 1211 - k.tail.foreach: k => 1212 - d(k) = c(k), 1213 - NbtString.of(k.head), 1214 - c(k.head), 1215 - ) 1216 - ), 1217 - REMOVE -> ((a: NbtIota, key: Iota) => 1218 - a match 1219 - case nbtList(Tagged(l: AbstractNbtList[t], given _)) => 1220 - key match 1221 - case iotaLike[Int](i) => 1222 - val c: l.type = l.copy.asInstanceOf 1223 - c.remove(i) 1224 - Seq(NbtIota(c)) 1225 - case _ => throw MishapInvalidIota.of(key, 0, "int") 1226 - ), 1227 - REPLACE -> ((t: NbtIota, k: Iota, v: NbtIota) => 1228 - Seq: 1229 - NbtIota: 1230 - t.data.copy.tap: 1231 - case c: NbtCompound => 1232 - c(k.asValue[String](1, StringIota.TYPE.typeName)) = v.data 1233 - case l: AbstractNbtList[t] => 1234 - given ClassTag[t] = elementTag(l) 1235 - l(k.asValue[Int](1, Text.translatable("hexcasting.iota.int"))) = ??? 1236 - ), 1237 - ) 1238 - }) 1239 1036 def fox(tr: PlayerEntity ?=> PartialFunction[Option[FoxEntity.Type], Option[FoxEntity.Type]]): Action = 1240 1037 Patterns.mkAction: (img, cont) => 1241 1038 img.getStack.lastOption match ··· 2074 1871 given FromIota[Iota] = Some(_) 2075 1872 given FromIota[String] = FromIota.lift: 2076 1873 case s: StringIota => s.getString 2077 - case NbtIota(s: NbtString) => s.asString 2078 1874 given FromIota[Boolean] = FromIota.lift: 2079 1875 case b: BooleanIota => b.getBool 2080 - case NbtIota(n: AbstractNbtNumber) => n.longValue != 0 2081 1876 given [T: ClassTag](using elems: FromIota[T]): FromIota[Seq[T]] = FromIota.liftFlat: 2082 1877 case l: ListIota => 2083 1878 boundary: ··· 2086 1881 case Some(p) => b.add(p) 2087 1882 case None => boundary.break(None) 2088 1883 Some(b.toSeq) 2089 - given arrayByteFromIota: FromIota[Array[Byte]] = FromIota.lift: 2090 - case NbtIota(t: NbtByteArray) => t.getByteArray 2091 - given arrayIntFromIota: FromIota[Array[Int]] = FromIota.lift: 2092 - case NbtIota(t: NbtIntArray) => t.getIntArray 2093 - given arrayLongFromIota: FromIota[Array[Long]] = FromIota.lift: 2094 - case NbtIota(t: NbtLongArray) => t.getLongArray 2095 - given [T <: NbtElement: ClassTag]: FromIota[T] = FromIota.lift: 2096 - case NbtIota(data: T) => data 2097 1884 given FromIota[Double] = FromIota.lift: 2098 1885 case d: DoubleIota => d.getDouble 2099 1886 given FromIota[Float] = FromIota.lift: 2100 1887 case d: DoubleIota if (d.getDouble.round.toFloat - d.getDouble) < DoubleIota.TOLERANCE => d.getDouble.round.toFloat 2101 - case NbtIota(n: NbtFloat) => n.floatValue 2102 1888 given FromIota[Byte] = FromIota.lift: 2103 1889 case d: DoubleIota if d.getDouble < Byte.MaxValue && d.getDouble > Byte.MinValue && (d.getDouble.round.toByte - d.getDouble) < DoubleIota.TOLERANCE => d.getDouble.round.toByte 2104 - case NbtIota(n: AbstractNbtNumber) => n.byteValue 2105 1890 given FromIota[Short] = FromIota.lift: 2106 1891 case d: DoubleIota if d.getDouble < Short.MaxValue && d.getDouble > Short.MinValue && (d.getDouble.round.toShort - d.getDouble) < DoubleIota.TOLERANCE => d.getDouble.round.toShort 2107 - case NbtIota(n: AbstractNbtNumber) => n.shortValue 2108 1892 given FromIota[Int] = FromIota.lift: 2109 1893 case d: DoubleIota if d.getDouble < Int.MaxValue && d.getDouble > Int.MinValue && (d.getDouble.round.toInt - d.getDouble) < DoubleIota.TOLERANCE => d.getDouble.round.toInt 2110 - case NbtIota(n: AbstractNbtNumber) => n.intValue 2111 1894 given FromIota[Long] = FromIota.lift: 2112 1895 case d: DoubleIota if d.getDouble < Long.MaxValue && d.getDouble > Long.MinValue && (d.getDouble.round - d.getDouble) < DoubleIota.TOLERANCE => d.getDouble.round 2113 - case NbtIota(n: AbstractNbtNumber) => n.longValue 2114 1896 2115 1897 object nbtList: 2116 1898 def unapply(l: NbtElement): Option[Tagged[AbstractNbtList, NbtElement]] = ··· 2248 2030 @targetName("hexic$MediaContainerProvider$getMediaContainer") 2249 2031 def getMediaContainer(c: Context): Option[MediaContainer] 2250 2032 2251 - case class NbtIota(data: NbtElement) extends Iota(NbtIota, data): 2252 - override def isTruthy: Boolean = data match 2253 - case d: AbstractNbtNumber => d.numberValue != 0 2254 - case a: AbstractNbtList[?] => a.size != 0 2255 - case s: NbtString => s.asString != "" 2256 - case c: NbtCompound => c.getSize != 0 2257 - case _ => true 2258 - override def toleratesOther(that: Iota): Boolean = that match 2259 - case that: NbtIota => this.data == that.data 2260 - case _ => this.data == that 2261 - override def serialize: NbtElement = data 2262 - 2263 2033 object registerHopperEndpoint extends (() => Unit): 2264 2034 def apply(): Unit = 2265 2035 HopperEndpointRegistry.INSTANCE.register: (iota: Iota, env: CastingEnvironment, slot: Integer) => ··· 2294 2064 def downcast[R: ClassTag](t: Any): Option[R] = t match 2295 2065 case r: R => Some(r) 2296 2066 case _ => None 2297 - object NbtIota extends IotaType[NbtIota]: 2298 - def name: Text = ("NBT": MutableText).styled(_.withColor(color)) 2299 - def color: Int = Formatting.DARK_AQUA.getColorValue 2300 - def deserialize(using NbtElement, ServerWorld): NbtIota = NbtIota(summon) 2301 - def display(e: NbtElement): Text = Text.literal(StringNbtWriter()(e)).styled(_.withColor(color))