repo for my hex addons :3
0
fork

Configure Feed

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

hexic-style inline patterns

+19
+19
project/hexic/src/client/scala/org/eu/net/pool/hexic/client.scala
··· 1 1 package org.eu.net.pool 2 2 package hexic 3 3 4 + import at.petrak.hexcasting.api.casting.math.{HexDir, HexPattern} 4 5 import at.petrak.hexcasting.api.item.PigmentItem 5 6 import at.petrak.hexcasting.api.mod.HexTags 6 7 import at.petrak.hexcasting.api.pigment.FrozenPigment 8 + import at.petrak.hexcasting.interop.inline.InlinePatternData 7 9 import com.google.gson.reflect.TypeToken 8 10 import com.google.gson.{Gson, JsonArray, JsonObject} 9 11 import com.llamalad7.mixinextras.injector.wrapoperation.Operation 12 + import com.samsthenerd.inline.api.client.InlineClientAPI 13 + import com.samsthenerd.inline.api.matching.{InlineMatch, InlineMatcher, MatcherInfo, RegexMatcher} 10 14 import dev.emi.trinkets.api.{TrinketComponent, TrinketsApi} 11 15 import kotlin.jvm.JvmField 12 16 import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking ··· 105 109 val k = s"layer$i" 106 110 if !json.ItemModelGenerator.LAYERS.contains(k) then 107 111 json.ItemModelGenerator.LAYERS.add(k) 112 + InlineClientAPI.INSTANCE.addMatcher: 113 + RegexMatcher.Simple(regex = "([ns]?[ew])\"([qweasd]*)\"", 114 + id = "scala_pattern", 115 + matcher = 116 + m => InlineMatch.DataMatch(InlinePatternData(HexPattern.fromAnglesUnchecked( 117 + m.group(2), 118 + m.group(1) match 119 + case "ne" => HexDir.NORTH_EAST 120 + case "e" => HexDir.EAST 121 + case "se" => HexDir.SOUTH_EAST 122 + case "sw" => HexDir.SOUTH_WEST 123 + case "w" => HexDir.WEST 124 + case "nw" => HexDir.NORTH_WEST 125 + ))), 126 + info = MatcherInfo.fromId("scala_pattern")) 108 127 phlib.Events.registryLookup.register: 109 128 val preferredColor = DyeColor.values()(client.getSession.getUuidOrNull.getLeastSignificantBits.abs.%(16).toInt) 110 129 val preferredStringworm = stringworms(Stringworm.flavors(client.getSession.getUuidOrNull.getLeastSignificantBits.abs.%(48).*(7).%(4).toInt))