mirror of
https://github.com/neoforged/NeoForge
synced 2026-08-20 08:23:13 -04:00
Skip logoFile warning if bannerFile or iconFile is present (#3413)
This commit is contained in:
parent
880646025f
commit
62ac9fd4d2
1 changed files with 11 additions and 1 deletions
|
|
@ -25,7 +25,17 @@ public class LogoFileWarningsHandler {
|
|||
var logoFile = info.getLogoFile()
|
||||
.or(() -> info.getOwningFile().getConfig().getConfigElement("logoFile"));
|
||||
|
||||
if (logoFile.isPresent()) {
|
||||
// If logoFile is not set, there is nothing to warn about
|
||||
if (logoFile.isEmpty()) return;
|
||||
|
||||
var bannerFile = info.getConfig().getConfigElement("bannerFile")
|
||||
.or(() -> info.getOwningFile().getConfig().getConfigElement("bannerFile"));
|
||||
// See DefaultModDisplayInfo#icon()
|
||||
var iconFile = info.getConfig().getConfigElement("iconFile")
|
||||
.or(() -> info.getOwningFile().getConfig().getConfigElement("iconFile"));
|
||||
|
||||
// Skip warning if bannerFile or iconFile is present, since it means the developer consciously kept the old property (for multi-version compat)
|
||||
if (bannerFile.isEmpty() && iconFile.isEmpty()) {
|
||||
// This shouldn't need to be translated, as it will only ever show for developers
|
||||
//noinspection UnstableApiUsage
|
||||
ModLoader.addLoadingIssue(ModLoadingIssue.warning("Mod %s uses the deprecated `logoFile` property; change to `bannerFile` and/or (for square icons) `iconFile`", info.getModId()).withAffectedMod(info));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue