summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI/Context.cs8
-rw-r--r--src/SMAPI/StardewModdingAPI.config.json2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/SMAPI/Context.cs b/src/SMAPI/Context.cs
index 119e14c8..7ed9b052 100644
--- a/src/SMAPI/Context.cs
+++ b/src/SMAPI/Context.cs
@@ -1,4 +1,4 @@
-using StardewModdingAPI.Events;
+using StardewModdingAPI.Events;
using StardewValley;
using StardewValley.Menus;
@@ -25,6 +25,12 @@ namespace StardewModdingAPI
/// <summary>Whether the game is currently running the draw loop. This isn't relevant to most mods, since you should use <see cref="GraphicsEvents.OnPostRenderEvent"/> to draw to the screen.</summary>
public static bool IsInDrawLoop { get; internal set; }
+ /// <summary>Whether <see cref="IsWorldReady"/> and the player loaded the save in multiplayer mode (regardless of whether any other players are connected).</summary>
+ public static bool IsMultiplayer => Context.IsWorldReady && Game1.multiplayerMode != Game1.singlePlayer;
+
+ /// <summary>Whether <see cref="IsWorldReady"/> and the current player is the main player. This is always true in single-player, and true when hosting in multiplayer.</summary>
+ public static bool IsMainPlayer => Context.IsWorldReady && Game1.IsMasterGame;
+
/****
** Internal
****/
diff --git a/src/SMAPI/StardewModdingAPI.config.json b/src/SMAPI/StardewModdingAPI.config.json
index 5b6bae12..f7082e96 100644
--- a/src/SMAPI/StardewModdingAPI.config.json
+++ b/src/SMAPI/StardewModdingAPI.config.json
@@ -59,7 +59,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha
* - A JSON structure containing any of four manifest fields (ID, Name, Author, and
* EntryDll) to match.
*
- * - MapLocalVersions and MapRemoteVersions crrect local manifest versions and remote versions
+ * - MapLocalVersions and MapRemoteVersions correct local manifest versions and remote versions
* during update checks. For example, if the API returns version '1.1-1078' where '1078' is
* intended to be a build number, MapRemoteVersions can map it to '1.1' when comparing to the
* mod's current version. This is only meant to support legacy mods with injected update keys.