Open main menu
Home
Random
Log in
Settings
About Stardew Valley Wiki
Disclaimers
Stardew Valley Wiki
Search
Changes
← Older edit
Newer edit →
Modding:Modder Guide/APIs
(view source)
Revision as of 04:38, 28 May 2018
370 bytes removed
,
04:38, 28 May 2018
→Multiplayer
:
moved to
Modding:Modder Guide/APIs/Multiplayer
Line 80:
Line 80:
FieldInfo field = this.Helper.Reflection.GetField<string>(…).FieldInfo;
FieldInfo field = this.Helper.Reflection.GetField<string>(…).FieldInfo;
MethodInfo method = this.Helper.Reflection.GetMethod(…).MethodInfo;
MethodInfo method = this.Helper.Reflection.GetMethod(…).MethodInfo;
−
</source>
−
−
===Multiplayer===
−
The multiplayer API provides methods to support modding in a multiplayer context:
−
<source lang="c#">
−
// get a unique multiplayer ID (e.g. for animal IDs)
−
int uniqueID = this.Helper.Multiplayer.GetNewID();
−
−
// get the locations being sync'd from the main player
−
foreach (GameLocation location in this.Helper.Multiplayer.GetActiveLocations())
</source>
</source>
Pathoschild
translators
8,445
edits