Changes

Jump to navigation Jump to search
→‎'Get player' changes: + Game1.player now internal
Line 234: Line 234:     
==Changes for C# mods==
 
==Changes for C# mods==
==='Get player' changes===
+
===Player changes===
 +
<ul>
 +
<li>
 
The <samp>Game1.getFarmer</samp> and <samp>Game1.getFarmerMaybeOffline</samp> methods are now obsolete and should no longer be used. They've been replaced by a unified <samp>Game1.GetPlayer</samp> method.
 
The <samp>Game1.getFarmer</samp> and <samp>Game1.getFarmerMaybeOffline</samp> methods are now obsolete and should no longer be used. They've been replaced by a unified <samp>Game1.GetPlayer</samp> method.
   Line 255: Line 257:  
<syntaxhighlight lang="c#">Farmer? player = Game1.GetPlayer(id);</syntaxhighlight>
 
<syntaxhighlight lang="c#">Farmer? player = Game1.GetPlayer(id);</syntaxhighlight>
 
|}
 
|}
 +
</li>
 +
<li>The <samp>Game1.player</samp> setter is now internal. Setting it causes side-effects that are typically unexpected by mod authors, which led to frequent errors and crashes. These are explained in its new code docs. Mods can still set it via reflection if they really want to.</li>
 +
</ul>
    
===Screen reader changes===
 
===Screen reader changes===
manager
8,549

edits

Navigation menu