11package dev .isxander .controlify .bindings ;
22
33import dev .isxander .controlify .api .bind .RadialIcon ;
4- import dev .isxander .controlify .utils .render .Blit ;
54import dev .isxander .controlify .utils .CUtil ;
5+ import dev .isxander .controlify .utils .render .Blit ;
66import dev .isxander .controlify .utils .render .CGuiPose ;
77import it .unimi .dsi .fastutil .objects .Object2ObjectOpenHashMap ;
88import net .minecraft .client .Minecraft ;
99import net .minecraft .client .gui .Gui ;
10- import net .minecraft .client .renderer .texture .TextureAtlasSprite ;
1110import net .minecraft .core .Holder ;
1211import net .minecraft .core .registries .BuiltInRegistries ;
1312import net .minecraft .resources .ResourceKey ;
1413import net .minecraft .resources .ResourceLocation ;
1514import net .minecraft .world .effect .MobEffect ;
1615import net .minecraft .world .item .Item ;
1716import net .minecraft .world .item .ItemStack ;
17+ import org .jetbrains .annotations .NotNull ;
1818
1919import java .util .ArrayDeque ;
2020import java .util .Map ;
@@ -24,7 +24,13 @@ public final class RadialIcons {
2424 private static final Minecraft minecraft = Minecraft .getInstance ();
2525
2626 public static final ResourceLocation EMPTY = CUtil .rl ("empty" );
27- public static final ResourceLocation FABRIC_ICON = ResourceLocation .fromNamespaceAndPath ("fabric-resource-loader-v0" , "icon.png" );
27+ private static final ResourceLocation _FABRIC_ICON = ResourceLocation .fromNamespaceAndPath ("fabric-resource-loader-v0" , "icon.png" );
28+ /**
29+ * @deprecated This icon is not available on NeoForge.
30+ * Use {@link RadialIcons#getModLoaderIcon()} instead.
31+ */
32+ @ Deprecated (forRemoval = true )
33+ public static final ResourceLocation FABRIC_ICON = _FABRIC_ICON ;
2834
2935 private static Map <ResourceLocation , RadialIcon > icons = null ;
3036 private static Queue <Runnable > deferredRegistrations = new ArrayDeque <>();
@@ -101,18 +107,27 @@ private static void addPotionEffects(Map<ResourceLocation, RadialIcon> map) {
101107
102108 private static Map <ResourceLocation , RadialIcon > registerIcons () {
103109 Map <ResourceLocation , RadialIcon > map = new Object2ObjectOpenHashMap <>();
110+ final ResourceLocation modLoaderIcon = getModLoaderIcon ();
104111
105112 map .put (EMPTY , (graphics , x , y , tickDelta ) -> {});
106- map .put (FABRIC_ICON , (graphics , x , y , tickDelta ) -> {
113+ map .put (modLoaderIcon , (graphics , x , y , tickDelta ) -> {
107114 var pose = CGuiPose .ofPush (graphics );
108115 pose .translate (x , y );
109116 pose .scale (0.5f , 0.5f );
110- Blit .tex (graphics , FABRIC_ICON , 0 , 0 , 0 , 0 , 32 , 32 , 32 , 32 );
117+ Blit .tex (graphics , modLoaderIcon , 0 , 0 , 0 , 0 , 32 , 32 , 32 , 32 );
111118 pose .pop ();
112119 });
113120 addItems (map );
114121 addPotionEffects (map );
115122
116123 return map ;
117124 }
125+
126+ public static @ NotNull ResourceLocation getModLoaderIcon () {
127+ //? if fabric {
128+ return _FABRIC_ICON ;
129+ //?} else {
130+ /*return getItem(net.minecraft.world.item.Items.BOOK);
131+ */ //?}
132+ }
118133}
0 commit comments