25
25
import net .minecraft .client .gui .GuiGraphics ;
26
26
import net .minecraft .client .gui .components .Button ;
27
27
import net .minecraft .client .gui .components .EditBox ;
28
+ import net .minecraft .client .gui .components .LogoRenderer ;
28
29
import net .minecraft .client .gui .components .ObjectSelectionList ;
29
30
import net .minecraft .client .gui .narration .NarrationElementOutput ;
30
31
import net .minecraft .client .gui .screens .Screen ;
@@ -374,30 +375,36 @@ private void updateCache() {
374
375
VersionChecker .CheckResult vercheck = VersionChecker .getResult (selectedMod );
375
376
376
377
@ SuppressWarnings ("resource" )
377
- Pair <ResourceLocation , Size2i > logoData = selectedMod .getLogoFile ().map (logoFile -> {
378
- TextureManager tm = this .minecraft .getTextureManager ();
379
- final Pack .ResourcesSupplier resourcePack = ResourcePackLoader .getPackFor (selectedMod .getModId ())
380
- .orElse (ResourcePackLoader .getPackFor ("neoforge" ).orElseThrow (() -> new RuntimeException ("Can't find neoforge, WHAT!" )));
381
- try (PackResources packResources = resourcePack .openPrimary (new PackLocationInfo ("mod/" + selectedMod .getModId (), Component .empty (), PackSource .BUILT_IN , Optional .empty ()))) {
382
- NativeImage logo = null ;
383
- IoSupplier <InputStream > logoResource = packResources .getRootResource (logoFile .split ("[/\\ \\ ]" ));
384
- if (logoResource != null )
385
- logo = NativeImage .read (logoResource .get ());
386
- if (logo != null ) {
387
-
388
- return Pair .of (tm .register ("modlogo" , new DynamicTexture (logo ) {
389
- @ Override
390
- public void upload () {
391
- this .bind ();
392
- NativeImage td = this .getPixels ();
393
- // Use custom "blur" value which controls texture filtering (nearest-neighbor vs linear)
394
- this .getPixels ().upload (0 , 0 , 0 , 0 , 0 , td .getWidth (), td .getHeight (), selectedMod .getLogoBlur (), false , false , false );
395
- }
396
- }), new Size2i (logo .getWidth (), logo .getHeight ()));
397
- }
398
- } catch (IOException | IllegalArgumentException e ) {}
399
- return Pair .<ResourceLocation , Size2i >of (null , new Size2i (0 , 0 ));
400
- }).orElse (Pair .of (null , new Size2i (0 , 0 )));
378
+ Pair <ResourceLocation , Size2i > logoData ;
379
+
380
+ if (selectedMod .getModId ().equals (ResourceLocation .DEFAULT_NAMESPACE )) {
381
+ logoData = Pair .of (LogoRenderer .MINECRAFT_LOGO , new Size2i (LogoRenderer .LOGO_TEXTURE_WIDTH , LogoRenderer .LOGO_TEXTURE_HEIGHT ));
382
+ } else {
383
+ logoData = selectedMod .getLogoFile ().map (logoFile -> {
384
+ TextureManager tm = this .minecraft .getTextureManager ();
385
+ final Pack .ResourcesSupplier resourcePack = ResourcePackLoader .getPackFor (selectedMod .getModId ())
386
+ .orElse (ResourcePackLoader .getPackFor ("neoforge" ).orElseThrow (() -> new RuntimeException ("Can't find neoforge, WHAT!" )));
387
+ try (PackResources packResources = resourcePack .openPrimary (new PackLocationInfo ("mod/" + selectedMod .getModId (), Component .empty (), PackSource .BUILT_IN , Optional .empty ()))) {
388
+ NativeImage logo = null ;
389
+ IoSupplier <InputStream > logoResource = packResources .getRootResource (logoFile .split ("[/\\ \\ ]" ));
390
+ if (logoResource != null )
391
+ logo = NativeImage .read (logoResource .get ());
392
+ if (logo != null ) {
393
+
394
+ return Pair .of (tm .register ("modlogo" , new DynamicTexture (logo ) {
395
+ @ Override
396
+ public void upload () {
397
+ this .bind ();
398
+ NativeImage td = this .getPixels ();
399
+ // Use custom "blur" value which controls texture filtering (nearest-neighbor vs linear)
400
+ this .getPixels ().upload (0 , 0 , 0 , 0 , 0 , td .getWidth (), td .getHeight (), selectedMod .getLogoBlur (), false , false , false );
401
+ }
402
+ }), new Size2i (logo .getWidth (), logo .getHeight ()));
403
+ }
404
+ } catch (IOException | IllegalArgumentException e ) {}
405
+ return Pair .<ResourceLocation , Size2i >of (null , new Size2i (0 , 0 ));
406
+ }).orElse (Pair .of (null , new Size2i (0 , 0 )));
407
+ }
401
408
402
409
lines .add (selectedMod .getDisplayName ());
403
410
lines .add (FMLTranslations .parseMessage ("fml.menu.mods.info.version" , MavenVersionTranslator .artifactVersionToString (selectedMod .getVersion ())));
@@ -416,7 +423,7 @@ public void upload() {
416
423
lines .add (FMLTranslations .parseMessage ("fml.menu.mods.info.updateavailable" , vercheck .url () == null ? "" : vercheck .url ()).replace ("\r \n " , "\n " ));
417
424
lines .add (FMLTranslations .parseMessage ("fml.menu.mods.info.license" , selectedMod .getOwningFile ().getLicense ()).replace ("\r \n " , "\n " ));
418
425
lines .add (null );
419
- lines .add (FMLTranslations .parseMessageWithFallback ("fml.menu.mods.info.description." + selectedMod .getModId (), selectedMod ::getDescription ));
426
+ lines .add (FMLTranslations .getPattern ("fml.menu.mods.info.description." + selectedMod .getModId (), selectedMod ::getDescription ));
420
427
421
428
/* Removed because people bitched that this information was misleading.
422
429
lines.add(null);
0 commit comments