Skip to content

Commit ae4c426

Browse files
committed
Merge branch 'develop' into stable
2 parents f665caf + f3e97a0 commit ae4c426

File tree

10 files changed

+138
-13
lines changed

10 files changed

+138
-13
lines changed

build/common.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repo. It imports the other MSBuild files as needed.
77
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
88
<PropertyGroup>
99
<!--set general build properties -->
10-
<Version>4.1.6</Version>
10+
<Version>4.1.7</Version>
1111
<Product>SMAPI</Product>
1212
<LangVersion>latest</LangVersion>
1313
<AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>

docs/release-notes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
[README](README.md)
22

33
# Release notes
4+
## 4.1.7
5+
Released 12 November 2024 for Stardew Valley 1.6.14 or later.
6+
7+
* For players:
8+
* Updated for Stardew Valley 1.6.14.
9+
* Updated mod compatibility list.
10+
* Fixed crash if a mod has a missing or invalid DLL.
11+
412
## 4.1.6
513
Released 07 November 2024 for Stardew Valley 1.6.10 or later.
614

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"Name": "Console Commands",
33
"Author": "SMAPI",
4-
"Version": "4.1.6",
4+
"Version": "4.1.7",
55
"Description": "Adds SMAPI console commands that let you manipulate the game.",
66
"UniqueID": "SMAPI.ConsoleCommands",
77
"EntryDll": "ConsoleCommands.dll",
8-
"MinimumApiVersion": "4.1.6"
8+
"MinimumApiVersion": "4.1.7"
99
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"Name": "Save Backup",
33
"Author": "SMAPI",
4-
"Version": "4.1.6",
4+
"Version": "4.1.7",
55
"Description": "Automatically backs up all your saves once per day into its folder.",
66
"UniqueID": "SMAPI.SaveBackup",
77
"EntryDll": "SaveBackup.dll",
8-
"MinimumApiVersion": "4.1.6"
8+
"MinimumApiVersion": "4.1.7"
99
}

src/SMAPI.Web/wwwroot/SMAPI.metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@
148148
"~1.0.0 | Status": "AssumeBroken",
149149
"~1.0.0 | StatusReasonDetails": "ItemStockInformation references crash at runtime"
150150
},
151+
"Happy Home Designer": {
152+
"ID": "tlitookilakin.HappyHomeDesigner",
153+
"~2.1.2 | Status": "AssumeBroken",
154+
"~2.1.2 | StatusReasonDetails": "ItemStockInformation references crash at runtime"
155+
},
151156
"Heart Event Helper": {
152157
"ID": "bungus.HeartEventHelper",
153158
"~1.0.6 | Status": "AssumeBroken",
@@ -160,6 +165,16 @@
160165

161166
"Default | UpdateKey": "Nexus:1720"
162167
},
168+
"Lunar Disturbances": {
169+
"ID": "KoihimeNakamura.LunarDisturbances",
170+
"~1.5.3 | Status": "AssumeBroken",
171+
"~1.5.3 | StatusReasonDetails": "ItemStockInformation references crash at runtime"
172+
},
173+
"Searchable Chests": {
174+
"ID": "ThisIsCad.SearchableChests",
175+
"~1.2.0 | Status": "AssumeBroken",
176+
"~1.2.0 | StatusReasonDetails": "ItemStockInformation references crash at runtime"
177+
},
163178
"Shop Tile Framework": {
164179
"ID": "Cherry.ShopTileFramework",
165180
"~1.0.10-alpha-20240227 | Status": "AssumeBroken",

src/SMAPI/Constants.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ internal static class EarlyConstants
4949
internal static int? LogScreenId { get; set; }
5050

5151
/// <summary>SMAPI's current raw semantic version.</summary>
52-
internal static string RawApiVersion = "4.1.6";
52+
internal static string RawApiVersion = "4.1.7";
5353
}
5454

5555
/// <summary>Contains SMAPI's constants and assumptions.</summary>
@@ -65,7 +65,7 @@ public static class Constants
6565
public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion(EarlyConstants.RawApiVersion);
6666

6767
/// <summary>The minimum supported version of Stardew Valley.</summary>
68-
public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.6.10");
68+
public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.6.14");
6969

7070
/// <summary>The minimum supported Stardew Valley build number, or <c>null</c> for any build of <see cref="MinimumGameVersion"/>.</summary>
7171
public static int? MinimumGameBuild { get; } = null;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
using StardewModdingAPI.Framework.ModLoading.Framework;
3+
using StardewValley;
4+
using StardewValley.Internal;
5+
6+
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6;
7+
8+
/// <summary>Maps Stardew Valley 1.6's <see cref="ItemQueryContext"/> methods to their newer form in 1.6.14 to avoid breaking older mods.</summary>
9+
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
10+
public class ItemQueryContextFacade : ItemQueryContext, IRewriteFacade
11+
{
12+
/*********
13+
** Public methods
14+
*********/
15+
public static ItemQueryContext Constructor(ItemQueryContext parentContext)
16+
{
17+
return new ItemQueryContext(parentContext, null);
18+
}
19+
20+
public static ItemQueryContext Constructor(GameLocation location, Farmer player, Random random)
21+
{
22+
return new ItemQueryContext(location, player, random, null);
23+
}
24+
25+
26+
/*********
27+
** Private methods
28+
*********/
29+
private ItemQueryContextFacade()
30+
{
31+
RewriteHelper.ThrowFakeConstructorCalled();
32+
}
33+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using Microsoft.Xna.Framework;
2+
using StardewModdingAPI.Framework.ModLoading.Framework;
3+
using StardewValley;
4+
using StardewValley.Internal;
5+
using StardewValley.WorldMaps;
6+
7+
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6;
8+
9+
/// <summary>Maps Stardew Valley 1.'s <see cref="WorldMapManager"/> methods to their newer form in 1.6.14 to avoid breaking older mods.</summary>
10+
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
11+
public class WorldMapManagerFacade : IRewriteFacade
12+
{
13+
/*********
14+
** Public methods
15+
*********/
16+
/// <summary>Get the map position which contains a given location and tile coordinate, if any.</summary>
17+
/// <param name="location">The in-game location.</param>
18+
/// <param name="tile">The tile coordinate within the location.</param>
19+
public static MapAreaPosition? GetPositionData(GameLocation location, Point tile)
20+
{
21+
return WorldMapManager.GetPositionData(location, tile, null)?.Data;
22+
}
23+
24+
/// <summary>Get the map position which contains a given location and tile coordinate, if any.</summary>
25+
/// <param name="location">The in-game location.</param>
26+
/// <param name="tile">The tile coordinate within the location.</param>
27+
/// <param name="log">The detailed log to update with the steps used to match the position, if set.</param>
28+
internal static MapAreaPosition? GetPositionData(GameLocation location, Point tile, LogBuilder log)
29+
{
30+
return WorldMapManager.GetPositionData(location, tile, log)?.Data;
31+
}
32+
33+
34+
/*********
35+
** Private methods
36+
*********/
37+
private WorldMapManagerFacade()
38+
{
39+
RewriteHelper.ThrowFakeConstructorCalled();
40+
}
41+
}

src/SMAPI/Framework/SCore.cs

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,11 +1929,8 @@ private bool TryLoadMod(IModMetadata mod, IModMetadata[] mods, AssemblyLoader as
19291929
this.Monitor.Log($" {mod.DisplayName} (from {relativePath}, ID: {manifest?.UniqueID}) [content pack]...");
19301930
else if (manifest?.EntryDll != null)
19311931
{
1932-
FileVersionInfo version = FileVersionInfo.GetVersionInfo(assemblyFile!.FullName);
1933-
string versionStr = version.FilePrivatePart == 0
1934-
? $"{version.FileMajorPart}.{version.FileMinorPart}.{version.FileBuildPart}"
1935-
: $"{version.FileMajorPart}.{version.FileMinorPart}.{version.FileBuildPart}.{version.FilePrivatePart}";
1936-
this.Monitor.Log($" {mod.DisplayName} (from {relativePath}{Path.DirectorySeparatorChar}{manifest.EntryDll}, ID: {manifest.UniqueID}, assembly version: {versionStr})..."); // don't use Path.Combine here, since EntryDLL might not be valid
1932+
this.TryGetAssemblyVersion(assemblyFile?.FullName, out string? assemblyVersion);
1933+
this.Monitor.Log($" {mod.DisplayName} (from {relativePath}{Path.DirectorySeparatorChar}{manifest.EntryDll}, ID: {manifest.UniqueID}, assembly version: {assemblyVersion ?? "<unknown>"})..."); // don't use Path.Combine here, since EntryDLL might not be valid
19371934
}
19381935
else
19391936
this.Monitor.Log($" {mod.DisplayName} (from {relativePath}, ID: {manifest?.UniqueID ?? "<unknown>"})...");
@@ -2088,6 +2085,34 @@ IContentPack[] GetContentPacks()
20882085
}
20892086
}
20902087

2088+
/// <summary>Get the display version for an assembly file, if it's valid.</summary>
2089+
/// <param name="filePath">The absolute path to the assembly file.</param>
2090+
/// <param name="versionString">The extracted display version, if valid.</param>
2091+
/// <returns>Returns whether the assembly version was successfully extracted.</returns>
2092+
private bool TryGetAssemblyVersion(string? filePath, [NotNullWhen(true)] out string? versionString)
2093+
{
2094+
if (filePath is null || !File.Exists(filePath))
2095+
{
2096+
versionString = null;
2097+
return false;
2098+
}
2099+
2100+
try
2101+
{
2102+
FileVersionInfo version = FileVersionInfo.GetVersionInfo(filePath);
2103+
versionString = version.FilePrivatePart == 0
2104+
? $"{version.FileMajorPart}.{version.FileMinorPart}.{version.FileBuildPart}"
2105+
: $"{version.FileMajorPart}.{version.FileMinorPart}.{version.FileBuildPart}.{version.FilePrivatePart}";
2106+
return true;
2107+
}
2108+
catch (Exception ex)
2109+
{
2110+
this.Monitor.Log($"Error extracting assembly version from '{filePath}': {ex.GetLogSummary()}");
2111+
versionString = null;
2112+
return false;
2113+
}
2114+
}
2115+
20912116
/// <summary>Create a fake content pack instance for a parent mod.</summary>
20922117
/// <param name="packDirPath">The absolute path to the fake content pack's directory.</param>
20932118
/// <param name="packManifest">The fake content pack's manifest.</param>

src/SMAPI/Metadata/InstructionMetadata.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using StardewValley.GameData.FloorsAndPaths;
2121
using StardewValley.GameData.Movies;
2222
using StardewValley.GameData.SpecialOrders;
23+
using StardewValley.Internal;
2324
using StardewValley.Locations;
2425
using StardewValley.Menus;
2526
using StardewValley.Minigames;
@@ -34,8 +35,8 @@
3435
using StardewValley.SpecialOrders.Rewards;
3536
using StardewValley.TerrainFeatures;
3637
using StardewValley.Tools;
38+
using StardewValley.WorldMaps;
3739
using xTile.Layers;
38-
using static StardewValley.Projectiles.BasicProjectile;
3940
using SObject = StardewValley.Object;
4041

4142
namespace StardewModdingAPI.Metadata;
@@ -227,6 +228,7 @@ public IEnumerable<IInstructionHandler> GetHandlers(bool paranoidMode, bool rewr
227228
.MapFacade<IClickableMenu, IClickableMenuFacade>()
228229
.MapFacade<IslandWest, IslandWestFacade>()
229230
.MapFacade<Item, ItemFacade>()
231+
.MapFacade<ItemQueryContext, ItemQueryContextFacade>()
230232
.MapFacade<JunimoHut, JunimoHutFacade>()
231233
.MapFacade<LargeTerrainFeature, LargeTerrainFeatureFacade>()
232234
.MapFacade<Layer, LayerFacade>()
@@ -265,6 +267,7 @@ public IEnumerable<IInstructionHandler> GetHandlers(bool paranoidMode, bool rewr
265267
.MapFacade<Wallpaper, WallpaperFacade>()
266268
.MapFacade<WateringCan, WateringCanFacade>()
267269
.MapFacade<WorldDate, WorldDateFacade>()
270+
.MapFacade(typeof(WorldMapManager).FullName!, typeof(WorldMapManagerFacade))
268271

269272
// BuildableGameLocation merged into GameLocation
270273
.MapFacade("StardewValley.Locations.BuildableGameLocation", typeof(BuildableGameLocationFacade))

0 commit comments

Comments
 (0)