repo for my hex addons :3
0
fork

Configure Feed

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

item transfer presumably

+22
+22
src/main/scala/org/eu/net/pool/hexic/Hexic.scala
··· 751 751 def toRoman(value: Int): String = 752 752 "M" * (value / 1000) + ("", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM").productElement(value % 1000 / 100) + ("", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC").productElement(value % 100 / 10) + ("", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX").productElement(value % 10) 753 753 754 + private [hexic] val conceptScale = mutable.Map[ClassTag[? <: TransferVariant[?]], Double]().withDefaultValue(1.0) 755 + def setConceptScale[T <: TransferVariant[?]: ClassTag as ct](scale: Int) = 756 + if conceptScale.isDefinedAt(ct) && conceptScale(ct) != scale then 757 + throw IllegalStateException(s"Conflicting scales ${conceptScale(ct)} and $scale defined for class $ct") 758 + else 759 + conceptScale(ct) = scale 760 + 754 761 private [hexic] object Extern: 755 762 private [hexic] val worlds = mutable.Set[WeakReference[World]]() 756 763 private [hexic] def getWorld(biome: Biome): World = ··· 1769 1776 null // kotlin bullshit 1770 1777 ), cont, HexEvalSounds.HERMES, Seq()) 1771 1778 case _ => throw MishapBadCaster() 1779 + Patterns.register("moveconcept", se"wawdwawqdewewedqwawdwaw"): 1780 + Patterns.mkConstAction(4): 1781 + case Seq(isIota[BoxedView.Instance, 3](from), isIota[BoxedView.Instance, 2](into), typ: VariantIota[?], isIota[DoubleIota, 0](count)) => 1782 + Using.resource(Transaction.openOuter()): 1783 + case given TransactionContext => 1784 + val scale = conceptScale(ClassTag(typ.getClass)) 1785 + val toExtract = (scale * count.getDouble).toLong 1786 + val extract = from.view.tryExtract(typ.data, toExtract) 1787 + if extract < toExtract then 1788 + ??? // TODO: mishap 1789 + val insert = into.view.tryInsert(typ.data, extract) 1790 + if insert < extract then 1791 + ??? // TODO: mishap 1792 + Seq(DoubleIota(insert / scale)) 1772 1793 Patterns.register("moveentity", e"edeeewawdweaaddaqwqwqaddaaewdwawewdqd"): 1773 1794 Patterns.mkConstAction(3): 1774 1795 case Seq(isIota[BoxedView.Instance, 2](from), isIota[BoxedView.Instance, 1](into), isIota[DoubleIota, 0](count)) => ··· 2839 2860 data.toNbt tap(_.putString("type", key.getValue.toString)) 2840 2861 //noinspection UnstableApiUsage 2841 2862 object VariantIota extends IotaType[VariantIota[?]], Registrar[VariantIota.Reader]("transfer_variants"): 2863 + given IotaType[VariantIota[?]] = this 2842 2864 type Reader = NbtCompound => Option[VariantIota.TaggedVariant] 2843 2865 trait TaggedVariant: 2844 2866 type T: ClassTag