Changes

Jump to navigation Jump to search
→‎Major changes: + SMAPI event changes
Line 77: Line 77:  
* They're not synced to other players, so each player has their own overlay objects. (That's used for special quest items, so other players can't take your item.)
 
* They're not synced to other players, so each player has their own overlay objects. (That's used for special quest items, so other players can't take your item.)
 
* They're positioned on top of the normal object layer. (If there was already an object where the item is placed, the previous object will be hidden until you pick up the overlay object instead of being deleted.)
 
* They're positioned on top of the normal object layer. (If there was already an object where the item is placed, the previous object will be hidden until you pick up the overlay object instead of being deleted.)
 +
 +
===SMAPI event changes===
 +
{{SMAPI upcoming|2.6-beta.7}}
 +
Some SMAPI events were rewritten so they make sense in multiplayer. These also use a new architecture under the hood, so they provide much more useful event data (e.g. added/removed instead of just current values). The following events have breaking changes:
 +
 +
{| class="wikitable"
 +
|-
 +
! old event
 +
!
 +
! new event
 +
! migration notes
 +
|-
 +
| <tt>LocationEvents.CurrentLocationChanged</tt>
 +
| &rarr;
 +
| <tt>PlayerEvents.Warped</tt>
 +
| &#32;
 +
* Change <tt>EventArgsCurrentLocationChanged</tt> to <tt>EventArgsPlayerWarped</tt>.
 +
|-
 +
| <tt>LocationEvents.LocationsChanged</tt>
 +
|
 +
| ''(same name)''
 +
| &#32;
 +
* Change <tt>EventArgsGameLocationsChanged</tt> to <tt>EventArgsLocationsChanged</tt>.
 +
* The event is now raised when ''any'' location is added/removed (including building interiors), not just the main world locations in <tt>Game1.locations</tt>. If you need to handle only main world locations, you can check <code>if (Game1.locations.Contains(e.NewLocation))</code>.
 +
* The event data previously contained the current list of locations; it now contains the locations added or removed since the last tick. If you previously used <tt>e.NewLocations</tt>, you can replace it with <tt>Game1.locations</tt>.
 +
|-
 +
| <tt>LocationEvents.LocationObjectsChanged</tt>
 +
| →
 +
| <tt>LocationEvents.ObjectsChanged</tt>
 +
| &#32;
 +
* The event is now raised when objects are added/removed to ''any'' location (including building interiors), not just the current player's location. If you need to handle only the current player's location, you can check <code>if (e.Location == Game1.player.currentLocation)</code>.
 +
* The event data previously contained the current location's list of objects; it now contains the location, and the objects added/removed in it since the last tick. If you previously used <tt>e.NewObjects</tt>, you can use <tt>e.Location.netObjects.FieldDict</tt> instead.
 +
|}
    
==Fix common build warnings==
 
==Fix common build warnings==
translators
8,403

edits

Navigation menu