Changes

Jump to navigation Jump to search
Line 43: Line 43:  
* With the latest mod build package installed, rebuild your project. The package will detect net field references you need to update, and show an appropriate warning. See [[#Fix common warnings|''fix common warnings'']] below.
 
* With the latest mod build package installed, rebuild your project. The package will detect net field references you need to update, and show an appropriate warning. See [[#Fix common warnings|''fix common warnings'']] below.
   −
===<tt>Game1.player.friendships</tt>===
+
===WorldDate===
This field is always null in Stardew Valley 1.3. Use the new <tt>Game1.player.friendshipData</tt> field instead, which wraps the raw data with a model.
+
<tt>Game1.WorldDate</tt> is a new field which provides a more useful way to check the date. This combines the day, season, and year with useful logic like day-of-week and date comparisons. This incorporates many of the features from SMAPI's <tt>SDate</tt> class.
 +
 
 +
===Farmer.friendships===
 +
The <tt>Game1.player.friendships</tt> field is always null in Stardew Valley 1.3. Use the new <tt>Game1.player.friendshipData</tt> field instead, which wraps the raw data with a more useful model and more data.
    
===Texture constructor arguments===
 
===Texture constructor arguments===
 
Many constructors which previously accepted <tt>Texture2D texture</tt> arguments now take a <tt>string textureName</tt> argument instead. It's usually better to use SMAPI's content API to override textures instead. You can change the cached texture after the object is constructed (may need [[Modding:SMAPI APIs#Reflection|reflection]]), but don't change the texture name to avoid multiplayer sync issues.
 
Many constructors which previously accepted <tt>Texture2D texture</tt> arguments now take a <tt>string textureName</tt> argument instead. It's usually better to use SMAPI's content API to override textures instead. You can change the cached texture after the object is constructed (may need [[Modding:SMAPI APIs#Reflection|reflection]]), but don't change the texture name to avoid multiplayer sync issues.
 +
 +
===Changes to help modders===
 +
Stardew Valley 1.3 includes several changes intended to benefit modders. Some of the most relevant are...
 +
* Many more methods and properties are now virtual.
 +
* Many type checks now allow subclasses (like <code>item.GetType() == typeof(Axe)</code> &rarr; <code>item is Axe</code>).
 +
* Any <tt>GameLocation</tt> can now set <tt>IsGreenhouse = true</tt>, and crops will grow there all year.
 +
* Any <tt>NPC</tt> can now set <tt>IsSocial</tt> to determine whether they appear in the social menu.
 +
* Bee houses now find nearby flowers in any location, not only when placed on the farm.
 +
* Custom map tilesheets no longer need hacks to avoid the game's seasonal logic. Tilesheets which don't start with a season name and underscore won't be seasonalised.
 +
* Several changes to support upcoming SMAPI features and fixes.
    
==Fix common compiler warnings==
 
==Fix common compiler warnings==
translators
8,403

edits

Navigation menu