repo for my hex addons :3
0
fork

Configure Feed

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

view setup

+19 -9
+19 -9
src/main/scala/org/eu/net/pool/hexic/Hexic.scala
··· 46 46 import miyucomics.hexical.features.pigments.{PigmentIota, PigmentIotaKt} 47 47 import net.fabricmc.fabric.api.`object`.builder.v1.block.FabricBlockSettings 48 48 import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback 49 + import net.fabricmc.fabric.api.event.{Event, EventFactory} 49 50 import net.fabricmc.fabric.api.item.v1.FabricItemSettings 50 51 import net.fabricmc.fabric.api.transfer.v1.fluid.{FluidConstants, FluidVariant} 51 52 import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant ··· 848 849 val wizard = Item(Item.Settings().rarity(Rarity.EPIC).maxCount(1)) 849 850 850 851 val aLotOfMedia = (200000 /* max phial size */ * 6 /* phials per small pouch */ * 4 /* small pouches per large pouch */ * (36 /* inventory slots */ + 4 /* armor slots */ + 2 /* offhands */) + 20 /* healthcasting */) * MediaConstants.DUST_UNIT 851 - 852 - class Event[T, R](default: T => R) extends (T => R): 853 - private var current = default 854 - def apply(x: T): R = current(x) 855 - def apply(fn: PartialFunction[T, R]): Unit = 856 - val old = current 857 - current = fn.applyOrElse(_, old) 858 - 859 - val useItemEvent = Event[(Item, ItemUsageContext, ItemUsageContext => ActionResult), ActionResult](p => p._3(p._2)) 860 852 861 853 trait HasCodec: 862 854 def getCodec: Codec[? <: this.type] ··· 2174 2166 if x < min then min 2175 2167 else if x > max then max 2176 2168 else x 2169 + 2170 + trait InventoryView: 2171 + def apply(idx: Int)(using CastingEnvironment): Option[SlotReference] = None 2172 + @throws[Mishap] 2173 + def tryWithdraw(variant: TransferVariant[?], amount: Long)(using TransactionContext, CastingEnvironment): Long = 0 2174 + def entities(using TransactionContext): Iterable[Entity] = Iterable() 2175 + @throws[Mishap] 2176 + def teleportEntity(ent: Entity)(using TransactionContext, CastingEnvironment): Unit = ??? // TODO: make a mishap for this 2177 + 2178 + object InventoryView extends Registrar[InventoryView.Type[?]]("inventory"): 2179 + trait Type[T <: InventoryView]: 2180 + def serialize(view: T): NbtCompound 2181 + def deserialize(data: NbtCompound)(using ServerWorld): T 2182 + object Events: 2183 + val forEntity: Event[Entity => ServerWorld ?=> Seq[InventoryView]] = EventFactory.createArrayBacked[Entity => ServerWorld ?=> Seq[InventoryView]](classOf, _ => Seq(), fns => e => fns.flatMap(_(e))) 2184 + val forBlock: Event[(BlockPos, BlockState) => ServerWorld ?=> Seq[InventoryView]] = EventFactory.createArrayBacked[(BlockPos, BlockState) => ServerWorld ?=> Seq[InventoryView]](classOf, (_, _) => Seq(), fns => (pos, state) => fns.flatMap(_(pos, state))) 2185 + object SlotReference extends Registrar[SlotReference.Type[?]]("slot"): 2186 + class Type[T <: SlotReference: Codec] 2177 2187 2178 2188 object isIota: 2179 2189 def unapply[T <: Iota: IotaType as ty: ClassTag, I <: Int: Const as i](iota: Iota): Some[T] =