repo for my hex addons :3
0
fork

Configure Feed

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

this should prob be pluggable

authored by

PoolloverNathan and committed by
poolcritter
257cd0fd 4ab115af

+12 -4
+12 -4
src/main/scala/org/eu/net/pool/hexic/Hexic.scala
··· 1778 1778 ), cont, HexEvalSounds.HERMES, Seq()) 1779 1779 case _ => throw MishapBadCaster() 1780 1780 Patterns.register("findview", e"addaadewewedaaddqwawqddaadewewedaaddqwawdeeweee"): 1781 + inline def lookup = InventoryView.Events.forIota.invoker()(using compiletime.summonInline) 1781 1782 Patterns.mkConstAction(1): 1782 - case Seq(block: Vec3Iota) => 1783 - val pos = BlockPos.ofFloored(block.getVec3) 1784 - summon[CastingEnvironment].assertPosInRangeForEditing(pos) 1785 - Seq(BoxedView.Instance(InventoryView.OfBlock(pos))) 1783 + case Seq(lookup(view)) => Seq(BoxedView.Instance(view)) 1784 + case Seq(iota) => throw MishapInvalidIota.ofType(iota, 0, "hexic:view") 1785 + InventoryView.Events.forIota.register: 1786 + case block: Vec3Iota => 1787 + val pos = BlockPos.ofFloored(block.getVec3) 1788 + summon[CastingEnvironment].assertPosInRangeForEditing(pos) 1789 + InventoryView.OfBlock(pos) 1786 1790 hexXplat.getArithmeticRegistry("view") = arith("view", 1787 1791 Arithmetic.ADD -> { 1788 1792 (view1: BoxedView.Instance, view2: BoxedView.Instance) => Seq(BoxedView.Instance(InventoryView.OfSum(view1.view, view2.view))) ··· 2249 2253 object Events: 2250 2254 val forEntity: Event[Entity => ServerWorld ?=> Seq[Handler]] = EventFactory.createArrayBacked(classOf, _ => Seq(), fns => e => fns.flatMap(_(e))) 2251 2255 val forBlock: Event[(BlockPos, BlockState) => ServerWorld ?=> Seq[Handler]] = EventFactory.createArrayBacked(classOf, (_, _) => Seq(), fns => (pos, state) => fns.flatMap(_(pos, state))) 2256 + // 'implementation restriction' my ass 2257 + val forIota: Event[CastingEnvironment ?=> PartialFunction[Iota, InventoryView]] = EventFactory.createArrayBacked(classOf, PartialFunction.empty, new util.function.Function[Array[CastingEnvironment ?=> PartialFunction[Iota, InventoryView]], CastingEnvironment ?=> PartialFunction[Iota, InventoryView]]: 2258 + def apply(fns: Array[CastingEnvironment ?=> PartialFunction[Iota, InventoryView]]): CastingEnvironment ?=> PartialFunction[Iota, InventoryView] = (((_: CastingEnvironment) ?=> PartialFunction.empty[Iota, InventoryView]) /: fns) { _ orElse _ } 2259 + ) 2252 2260 abstract class OfMerged(viewType: InventoryView.Type[?], views: => Seq[Handler]) extends InventoryView(viewType): 2253 2261 def getViews = views 2254 2262 override def apply(idx: Int)(using CastingEnvironment): Option[SlotReference] = views.collectFirst(hexicVisibilityHack.unlifted(_(idx)))