1919import dev .terminalmc .exportstats .mixin .accessor .*;
2020import dev .terminalmc .exportstats .platform .Services ;
2121import dev .terminalmc .exportstats .util .ModLogger ;
22- import net .minecraft .Util ;
2322import net .minecraft .client .Minecraft ;
2423import net .minecraft .client .gui .components .WidgetSprites ;
2524import net .minecraft .client .gui .components .tabs .Tab ;
3029import net .minecraft .client .gui .screens .achievement .StatsScreen .MobsStatisticsList ;
3130import net .minecraft .client .gui .screens .achievement .StatsScreen .MobsStatisticsList .MobRow ;
3231import net .minecraft .network .chat .Component ;
33- import net .minecraft .resources .ResourceLocation ;
32+ import net .minecraft .resources .Identifier ;
3433import net .minecraft .stats .Stat ;
3534import net .minecraft .stats .StatType ;
3635import net .minecraft .stats .StatsCounter ;
36+ import net .minecraft .util .Util ;
3737import net .minecraft .world .item .BlockItem ;
3838import net .minecraft .world .item .Item ;
3939import net .minecraft .world .level .block .Block ;
40+ import org .jetbrains .annotations .NotNull ;
4041import org .jetbrains .annotations .Nullable ;
4142
4243import java .io .FileOutputStream ;
@@ -55,9 +56,9 @@ public class ExportStats {
5556 public static final String MOD_NAME = "ExportStats" ;
5657 public static final ModLogger LOG = new ModLogger (MOD_NAME );
5758 public static final WidgetSprites EXPORT_SPRITES = new WidgetSprites (
58- ResourceLocation .fromNamespaceAndPath (MOD_ID , "widget/export_button" ),
59- ResourceLocation .fromNamespaceAndPath (MOD_ID , "widget/export_button_disabled" ),
60- ResourceLocation .fromNamespaceAndPath (MOD_ID , "widget/export_button_highlighted" )
59+ Identifier .fromNamespaceAndPath (MOD_ID , "widget/export_button" ),
60+ Identifier .fromNamespaceAndPath (MOD_ID , "widget/export_button_disabled" ),
61+ Identifier .fromNamespaceAndPath (MOD_ID , "widget/export_button_highlighted" )
6162 );
6263
6364 public static final Path ROOT_PATH = Services .PLATFORM .getConfigDir ().resolve (MOD_ID );
@@ -107,7 +108,7 @@ public static Path saveStats(StatsCounter counter, GeneralStatisticsList stats,
107108 StringBuilder builder = new StringBuilder ();
108109
109110 for (Entry row : stats .children ()) {
110- Stat <ResourceLocation > stat =
111+ Stat <@ NotNull Identifier > stat =
111112 ((GeneralStatisticsListEntryAccessor ) row ).exportstats$getStat ();
112113 String key = "stat." + stat .getValue ().toString ().replace (':' , '.' );
113114 String name = Component .translatable (key ).getString ();
@@ -133,10 +134,10 @@ public static Path saveStats(StatsCounter counter, ItemStatisticsList stats, boo
133134 String name = item .getDefaultInstance ().getHoverName ().getString ();
134135 builder .append ("%s\n " .formatted (name ));
135136
136- List <StatType <Block >> blockColumns =
137+ List <StatType <@ NotNull Block >> blockColumns =
137138 ((ItemStatisticsListAccessor ) stats ).exportstats$getBlockColumns ();
138- for (StatType <Block > blockColumn : blockColumns ) {
139- Stat <Block > blockStat = item instanceof BlockItem blockItem
139+ for (StatType <@ NotNull Block > blockColumn : blockColumns ) {
140+ Stat <@ NotNull Block > blockStat = item instanceof BlockItem blockItem
140141 ? blockColumn .get (blockItem .getBlock ())
141142 : null ;
142143
@@ -150,10 +151,10 @@ public static Path saveStats(StatsCounter counter, ItemStatisticsList stats, boo
150151 ));
151152 }
152153
153- List <StatType <Item >> itemColumns =
154+ List <StatType <@ NotNull Item >> itemColumns =
154155 ((ItemStatisticsListAccessor ) stats ).exportstats$getItemColumns ();
155- for (StatType <Item > itemColumn : itemColumns ) {
156- Stat <Item > itemStat = itemColumn .get (item );
156+ for (StatType <@ NotNull Item > itemColumn : itemColumns ) {
157+ Stat <@ NotNull Item > itemStat = itemColumn .get (item );
157158
158159 Component component =
159160 Component .literal (itemStat .format (counter .getValue (itemStat )));
0 commit comments