repo for my hex addons :3
0
fork

Configure Feed

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

fix map iota flock disint

+56 -24
+1 -2
project/hexic/src/main/scala/org/eu/net/pool/hexic/main.scala
··· 847 847 possible(Random.nextInt(possible.size)) 848 848 Interop.thoughtWorld = RegistryKey.of(RegistryKeys.WORLD, "thought") 849 849 iotaTypeRegistry("access") = PropertyAccessIota.Type 850 - for (color, item) <- Mediaweave.colors do 851 - Registries.ITEM(s"${color.asString}_mediaweave") = item 850 + for color -> item <- Mediaweave.colors do Registries.ITEM(s"${color.asString}_mediaweave") = item 852 851 for item <- MediaBundle.items do 853 852 Registries.ITEM(item.size match 854 853 case 6 => s"small_${item.color.asString}_bundle"
+1
util/src/main/resources/phlib.mixins.json
··· 6 6 "mixins": [ 7 7 "ActuallySimpleRegistryMixin", 8 8 "AllocationTrackerMixin", 9 + "OpSplatMixin", 9 10 "PatternIotaMixin", 10 11 "SimpleRegistryMixin" 11 12 ]
+21 -21
util/src/main/scala/org/eu/net/pool/phlib/maps.scala
··· 84 84 output 85 85 def fromJavaMap(map: java.util.Map[Iota, Iota])(using ServerWorld) = MapIota((map: collection.Map[Iota, Iota]).map(e => IotaType.serialize(e._1) -> IotaType.serialize(e._2)).toMap) 86 86 val mapArithmetic = 87 - import at.petrak.hexcasting.api.casting.arithmetic.Arithmetic.* 88 - arith("map", 89 - ADD -> ((a: MapIota, b: MapIota) => a ++ b), 90 - SUB -> ((a: MapIota, b: MapIota) => a -- b), 91 - ABS -> ((a: MapIota) => DoubleIota(a.map.size)), 92 - INDEX -> ((a: MapIota, k: Iota) => a(k)), 93 - UNAPPEND -> ((a: MapIota) => a.lastOption.map(p => Seq(p._1, p._2)).getOrElse(Seq(NullIota(), NullIota())) prepended a.init), 94 - INDEX_OF -> ((a: MapIota, v: Iota) => 95 - val c = IotaType.serialize(v) 96 - a.update(_.filter(_._2 == c))), 97 - REMOVE -> ((a: MapIota, k: Iota) => a - k), 98 - REPLACE -> ((a: MapIota, k: Iota, v: Iota) => a + (k -> v)), 99 - UNCONS -> ((a: MapIota) => a.headOption.map(p => Seq(p._1, p._2)).getOrElse(Seq(NullIota(), NullIota())) prepended a.tail), 100 - AND -> ((a: MapIota, b: MapIota) => a & b), 101 - OR -> ((a: MapIota, b: MapIota) => b ++ a), 102 - XOR -> ((a: MapIota, b: MapIota) => a ^ b), 103 - GREATER -> ((a: MapIota, b: MapIota) => a.map.containsAll(b.map) && a.map != b.map), 104 - LESS -> ((a: MapIota, b: MapIota) => b.map.containsAll(a.map) && a.map != b.map), 105 - GREATER_EQ -> ((a: MapIota, b: MapIota) => a.map containsAll b.map), 106 - LESS_EQ -> ((a: MapIota, b: MapIota) => b.map containsAll a.map), 107 - ) 87 + import at.petrak.hexcasting.api.casting.arithmetic.Arithmetic.* 88 + arith("map", 89 + ADD -> ((a: MapIota, b: MapIota) => a ++ b), 90 + SUB -> ((a: MapIota, b: MapIota) => a -- b), 91 + ABS -> ((a: MapIota) => DoubleIota(a.map.size)), 92 + INDEX -> ((a: MapIota, k: Iota) => a(k)), 93 + UNAPPEND -> ((a: MapIota) => a.lastOption.map(p => Seq(p._1, p._2)).getOrElse(Seq(NullIota(), NullIota())) prepended a.init), 94 + INDEX_OF -> ((a: MapIota, v: Iota) => 95 + val c = IotaType.serialize(v) 96 + a.update(_.filter(_._2 == c))), 97 + REMOVE -> ((a: MapIota, k: Iota) => a - k), 98 + REPLACE -> ((a: MapIota, k: Iota, v: Iota) => a + (k -> v)), 99 + UNCONS -> ((a: MapIota) => a.headOption.map(p => Seq(p._1, p._2)).getOrElse(Seq(NullIota(), NullIota())) prepended a.tail), 100 + AND -> ((a: MapIota, b: MapIota) => a & b), 101 + OR -> ((a: MapIota, b: MapIota) => b ++ a), 102 + XOR -> ((a: MapIota, b: MapIota) => a ^ b), 103 + GREATER -> ((a: MapIota, b: MapIota) => a.map.containsAll(b.map) && a.map != b.map), 104 + LESS -> ((a: MapIota, b: MapIota) => b.map.containsAll(a.map) && a.map != b.map), 105 + GREATER_EQ -> ((a: MapIota, b: MapIota) => a.map containsAll b.map), 106 + LESS_EQ -> ((a: MapIota, b: MapIota) => b.map containsAll a.map), 107 + )
+33
util/src/main/scala/org/eu/net/pool/phlib/mixin/OpSplatMixin.java
··· 1 + package org.eu.net.pool.phlib.mixin; 2 + 3 + import at.petrak.hexcasting.api.casting.SpellList; 4 + import at.petrak.hexcasting.api.casting.iota.Iota; 5 + import at.petrak.hexcasting.api.casting.iota.ListIota; 6 + import at.petrak.hexcasting.common.casting.actions.lists.OpSplat; 7 + import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 8 + import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 9 + import org.eu.net.pool.phlib.MapIota; 10 + import org.spongepowered.asm.mixin.Mixin; 11 + import org.spongepowered.asm.mixin.injection.At; 12 + 13 + import java.util.ArrayList; 14 + import java.util.List; 15 + 16 + // 2026-03-20 01:29 pool: this is *very* out-of-scope for phlib 17 + // but what are you, a fed? 18 + @Mixin(OpSplat.class) 19 + public class OpSplatMixin { 20 + @WrapOperation(at = @At(value = "INVOKE", target = "Lat/petrak/hexcasting/api/casting/OperatorUtils;getList(Ljava/util/List;II)Lat/petrak/hexcasting/api/casting/SpellList;"), method = "execute") 21 + SpellList redirectList(List<? extends Iota> stack, int it, int x, Operation<SpellList> original) { 22 + if (stack.get(it) instanceof MapIota map) { 23 + final var retList = new ArrayList(map.size() * 2); 24 + for (var pair: map.asJavaMap().entrySet()) { 25 + retList.add(pair.getKey()); 26 + retList.add(pair.getValue()); 27 + } 28 + return new ListIota(retList).getList(); 29 + } else { 30 + return original.call(stack, it, x); 31 + } 32 + } 33 + }
-1
util/src/main/scala/org/eu/net/pool/phlib/util.scala
··· 96 96 override def operate(env: CastingEnvironment, img: CastingImage, cont: SpellContinuation): OperationResult = 97 97 val stack = img.getStack.asScala.toSeq 98 98 val args = stack.takeRight(${Expr(a.size)}) 99 - // I'm fairly certain the remainder of this method is considered a war crime 100 99 ${ 101 100 Block(a.zipWithIndex.map { p => 102 101 val (v@ValDef(n, ty, _), i) = p