1818import net .minecraft .util .Mth ;
1919import net .minecraft .world .level .Level ;
2020
21+ import java .util .ArrayList ;
2122import java .util .List ;
2223
2324import static at .petrak .hexcasting .api .mod .HexConfig .anyMatchResLoc ;
@@ -199,7 +200,12 @@ public static final class Server implements HexConfig.ServerConfigAccess, Config
199200
200201 // TODO: hook this up to the config, change Jankery, test, also test scroll injects on fabric
201202 @ ConfigEntry .Gui .Tooltip
202- private List <ResourceLocation > loreInjections = HexLootHandler .DEFAULT_LORE_INJECTS ;
203+ private List <String > loreInjectionsRaw = HexLootHandler .DEFAULT_LORE_INJECTS
204+ .stream ()
205+ .map (ResourceLocation ::toString )
206+ .toList ();
207+ @ ConfigEntry .Gui .Excluded
208+ private transient List <ResourceLocation > loreInjections ;
203209 @ ConfigEntry .Gui .Tooltip
204210 private double loreChance = HexLootHandler .DEFAULT_LORE_CHANCE ;
205211
@@ -222,6 +228,16 @@ public void validatePostLoad() throws ValidationException {
222228 throw new ValidationException ("Bad parsing of scroll injects" , e );
223229 }
224230
231+ this .loreInjections = new ArrayList <>();
232+ try {
233+ for (var table : this .loreInjectionsRaw ) {
234+ ResourceLocation loc = new ResourceLocation (table );
235+ this .loreInjections .add (loc );
236+ }
237+ } catch (Exception e ) {
238+ throw new ValidationException ("Bad parsing of lore injects" , e );
239+ }
240+
225241 this .loreChance = Mth .clamp (this .loreChance , 0.0 , 1.0 );
226242 }
227243
0 commit comments