mirror of
https://github.com/Pathoschild/SMAPI.git
synced 2026-10-12 02:08:51 +00:00
update rewriters for Stardew Valley 1.6.16
This commit is contained in:
@@ -65,10 +65,10 @@ public static class Constants
|
||||
public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion(EarlyConstants.RawApiVersion);
|
||||
|
||||
/// <summary>The minimum supported version of Stardew Valley.</summary>
|
||||
public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.6.14");
|
||||
public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.6.16");
|
||||
|
||||
/// <summary>The minimum supported Stardew Valley build number, or <c>null</c> for any build of <see cref="MinimumGameVersion"/>.</summary>
|
||||
public static int? MinimumGameBuild { get; } = null;
|
||||
public static int? MinimumGameBuild { get; } = 25256;
|
||||
|
||||
/// <summary>The maximum supported version of Stardew Valley, if any.</summary>
|
||||
public static ISemanticVersion? MaximumGameVersion { get; } = null;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.5.6's <see cref="ArgUtility"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class ArgUtilityFacade : IRewriteFacade
|
||||
public class ArgUtilityFacade_1_6 : IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Fields
|
||||
@@ -19,108 +19,108 @@ public class ArgUtilityFacade : IRewriteFacade
|
||||
** Public methods
|
||||
*********/
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGet(string[] array, int index, out string value, out string error, bool allowBlank = true)
|
||||
public static bool TryGet(string[] array, int index, out string? value, out string? error, bool allowBlank = true)
|
||||
{
|
||||
return ArgUtility.TryGet(array, index, out value, out error, allowBlank, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGet(array, index, out value, out error, allowBlank, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetOptional(string[] array, int index, out string value, out string error, string? defaultValue = null, bool allowBlank = true)
|
||||
public static bool TryGetOptional(string[] array, int index, out string? value, out string? error, string? defaultValue = null, bool allowBlank = true)
|
||||
{
|
||||
return ArgUtility.TryGetOptional(array, index, out value, out error, defaultValue, allowBlank, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetOptional(array, index, out value, out error, defaultValue, allowBlank, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetBool(string[] array, int index, out bool value, out string error)
|
||||
public static bool TryGetBool(string[] array, int index, out bool value, out string? error)
|
||||
{
|
||||
return ArgUtility.TryGetBool(array, index, out value, out error, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetBool(array, index, out value, out error, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetOptionalBool(string[] array, int index, out bool value, out string error, bool defaultValue = false)
|
||||
public static bool TryGetOptionalBool(string[] array, int index, out bool value, out string? error, bool defaultValue = false)
|
||||
{
|
||||
return ArgUtility.TryGetOptionalBool(array, index, out value, out error, defaultValue, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetOptionalBool(array, index, out value, out error, defaultValue, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetDirection(string[] array, int index, out int value, out string error)
|
||||
public static bool TryGetDirection(string[] array, int index, out int value, out string? error)
|
||||
{
|
||||
return ArgUtility.TryGetDirection(array, index, out value, out error, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetDirection(array, index, out value, out error, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetOptionalDirection(string[] array, int index, out int value, out string error, int defaultValue = Game1.up)
|
||||
public static bool TryGetOptionalDirection(string[] array, int index, out int value, out string? error, int defaultValue = Game1.up)
|
||||
{
|
||||
return ArgUtility.TryGetOptionalDirection(array, index, out value, out error, defaultValue, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetOptionalDirection(array, index, out value, out error, defaultValue, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetEnum<TEnum>(string[] array, int index, out TEnum value, out string error)
|
||||
public static bool TryGetEnum<TEnum>(string[] array, int index, out TEnum value, out string? error)
|
||||
where TEnum : struct
|
||||
{
|
||||
return ArgUtility.TryGetEnum<TEnum>(array, index, out value, out error, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetEnum<TEnum>(array, index, out value, out error, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetOptionalEnum<TEnum>(string[] array, int index, out TEnum value, out string error, TEnum defaultValue = default)
|
||||
public static bool TryGetOptionalEnum<TEnum>(string[] array, int index, out TEnum value, out string? error, TEnum defaultValue = default)
|
||||
where TEnum : struct
|
||||
{
|
||||
return ArgUtility.TryGetOptionalEnum<TEnum>(array, index, out value, out error, defaultValue, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetOptionalEnum<TEnum>(array, index, out value, out error, defaultValue, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetFloat(string[] array, int index, out float value, out string error)
|
||||
public static bool TryGetFloat(string[] array, int index, out float value, out string? error)
|
||||
{
|
||||
return ArgUtility.TryGetFloat(array, index, out value, out error, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetFloat(array, index, out value, out error, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetOptionalFloat(string[] array, int index, out float value, out string error, float defaultValue = 0)
|
||||
public static bool TryGetOptionalFloat(string[] array, int index, out float value, out string? error, float defaultValue = 0)
|
||||
{
|
||||
return ArgUtility.TryGetOptionalFloat(array, index, out value, out error, defaultValue, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetOptionalFloat(array, index, out value, out error, defaultValue, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetInt(string[] array, int index, out int value, out string error)
|
||||
public static bool TryGetInt(string[] array, int index, out int value, out string? error)
|
||||
{
|
||||
return ArgUtility.TryGetInt(array, index, out value, out error, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetInt(array, index, out value, out error, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetOptionalInt(string[] array, int index, out int value, out string error, int defaultValue = 0)
|
||||
public static bool TryGetOptionalInt(string[] array, int index, out int value, out string? error, int defaultValue = 0)
|
||||
{
|
||||
return ArgUtility.TryGetOptionalInt(array, index, out value, out error, defaultValue, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetOptionalInt(array, index, out value, out error, defaultValue, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetPoint(string[] array, int index, out Point value, out string error)
|
||||
public static bool TryGetPoint(string[] array, int index, out Point value, out string? error)
|
||||
{
|
||||
return ArgUtility.TryGetPoint(array, index, out value, out error, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetPoint(array, index, out value, out error, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetRectangle(string[] array, int index, out Rectangle value, out string error)
|
||||
public static bool TryGetRectangle(string[] array, int index, out Rectangle value, out string? error)
|
||||
{
|
||||
return ArgUtility.TryGetRectangle(array, index, out value, out error, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetRectangle(array, index, out value, out error, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetVector2(string[] array, int index, out Vector2 value, out string error, bool integerOnly = false)
|
||||
public static bool TryGetVector2(string[] array, int index, out Vector2 value, out string? error, bool integerOnly = false)
|
||||
{
|
||||
return ArgUtility.TryGetVector2(array, index, out value, out error, integerOnly, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetVector2(array, index, out value, out error, integerOnly, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public static bool TryGetRemainder(string[] array, int index, out string value, out string error, char delimiter = ' ')
|
||||
public static bool TryGetRemainder(string[] array, int index, out string? value, out string? error, char delimiter = ' ')
|
||||
{
|
||||
return ArgUtility.TryGetRemainder(array, index, out value, out error, delimiter, ArgUtilityFacade.DefaultName);
|
||||
return ArgUtility.TryGetRemainder(array, index, out value, out error, delimiter, ArgUtilityFacade_1_6.DefaultName);
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private ArgUtilityFacade()
|
||||
private ArgUtilityFacade_1_6()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class BuffFacade : Buff, IRewriteFacade
|
||||
|
||||
public void addBuff()
|
||||
{
|
||||
Game1.player.buffs.Apply(this);
|
||||
Game1.player.buffs.ApplyLocal(this);
|
||||
}
|
||||
|
||||
public void removeBuff()
|
||||
|
||||
@@ -7,14 +7,17 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.5.6's <see cref="Bush"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class BushFacade : Bush, IRewriteFacade
|
||||
public class BushFacade_1_6 : Bush, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public void draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Vector2 tileLocation, float yDrawOffset)
|
||||
{
|
||||
base.draw(spriteBatch, yDrawOffset);
|
||||
if (this.drawOffset.Y != yDrawOffset)
|
||||
this.drawOffset = new Point(this.drawOffset.X, this.drawOffset.Y);
|
||||
|
||||
base.draw(spriteBatch);
|
||||
}
|
||||
|
||||
public void draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Vector2 tileLocation)
|
||||
@@ -59,7 +62,7 @@ public class BushFacade : Bush, IRewriteFacade
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private BushFacade()
|
||||
private BushFacade_1_6()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.5.6's <see cref="Dialogue"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class DialogueFacade : Dialogue, IRewriteFacade
|
||||
public class DialogueFacade_1_6 : Dialogue, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
@@ -19,7 +19,7 @@ public class DialogueFacade : Dialogue, IRewriteFacade
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private DialogueFacade()
|
||||
private DialogueFacade_1_6()
|
||||
: base(null, null)
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.5.6's <see cref="Farmer"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class FarmerFacade : Farmer, IRewriteFacade
|
||||
public class FarmerFacade_1_6 : Farmer, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Accessors
|
||||
@@ -285,11 +285,10 @@ public class FarmerFacade : Farmer, IRewriteFacade
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private FarmerFacade()
|
||||
private FarmerFacade_1_6()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.5.6's <see cref="Forest"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class ForestFacade : Forest, IRewriteFacade
|
||||
public class ForestFacade_1_6 : Forest, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Accessors
|
||||
@@ -40,7 +40,7 @@ public class ForestFacade : Forest, IRewriteFacade
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private ForestFacade()
|
||||
private ForestFacade_1_6()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.5.6's <see cref="Game1"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class Game1Facade : Game1, IRewriteFacade
|
||||
public class Game1Facade_1_6 : Game1, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Accessors
|
||||
@@ -179,7 +179,7 @@ public class Game1Facade : Game1, IRewriteFacade
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private Game1Facade()
|
||||
private Game1Facade_1_6()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class GameLocationFacade : GameLocation, IRewriteFacade
|
||||
}
|
||||
|
||||
/// <remarks>Changed in Stardew Valley 1.6.9.</remarks>
|
||||
public LightSource getLightSource(int identifier)
|
||||
public LightSource? getLightSource(int identifier)
|
||||
{
|
||||
return base.getLightSource(identifier.ToString());
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ internal static class NetRefWrapperCache<T>
|
||||
*********/
|
||||
/// <summary>Get a wrapper for a given value.</summary>
|
||||
/// <param name="value">The value to wrap.</param>
|
||||
public static NetRef<T> GetCachedWrapperFor(T value)
|
||||
public static NetRef<T> GetCachedWrapperFor(T? value)
|
||||
{
|
||||
if (value is null)
|
||||
throw new InvalidOperationException($"{nameof(NetRefWrapperCache<T>)} doesn't support wrapping null values.");
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.5.6's <see cref="LocalizedContentManager"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class LocalizedContentManagerFacade : LocalizedContentManager, IRewriteFacade
|
||||
public class LocalizedContentManagerFacade_1_6 : LocalizedContentManager, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
@@ -19,7 +19,7 @@ public class LocalizedContentManagerFacade : LocalizedContentManager, IRewriteFa
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private LocalizedContentManagerFacade()
|
||||
private LocalizedContentManagerFacade_1_6()
|
||||
: base(null, null)
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.5.6's <see cref="NPC"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public abstract class NpcFacade : NPC, IRewriteFacade
|
||||
public abstract class NpcFacade_1_6 : NPC, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Accessors
|
||||
@@ -33,7 +33,7 @@ public abstract class NpcFacade : NPC, IRewriteFacade
|
||||
*********/
|
||||
public static NPC Constructor(AnimatedSprite sprite, Vector2 position, string defaultMap, int facingDirection, string name, bool datable, Dictionary<int, int[]> schedule, Texture2D portrait)
|
||||
{
|
||||
return new NPC(sprite, position, defaultMap, facingDirection, name, datable, portrait);
|
||||
return new NPC(sprite, position, defaultMap, facingDirection, name, portrait);
|
||||
}
|
||||
|
||||
public static NPC Constructor(AnimatedSprite sprite, Vector2 position, string defaultMap, int facingDir, string name, Dictionary<int, int[]> schedule, Texture2D portrait, bool eventActor, string? syncedPortraitPath = null)
|
||||
@@ -58,7 +58,8 @@ public abstract class NpcFacade : NPC, IRewriteFacade
|
||||
// else replicate old behavior
|
||||
return
|
||||
base.Birthday_Season != null
|
||||
&& base.Birthday_Season == season
|
||||
&& Utility.TryParseEnum(season, out Season parsedSeason)
|
||||
&& base.Birthday_Season.Value == parsedSeason
|
||||
&& base.Birthday_Day == day;
|
||||
}
|
||||
|
||||
@@ -67,7 +68,7 @@ public abstract class NpcFacade : NPC, IRewriteFacade
|
||||
WarpPathfindingCache.PopulateCache();
|
||||
}
|
||||
|
||||
public void showTextAboveHead(string Text, int spriteTextColor = -1, int style = NPC.textStyle_none, int duration = 3000, int preTimer = 0)
|
||||
public void showTextAboveHead(string Text, int spriteTextColor = -1, int style = SpeechBubble.textStyle_none, int duration = 3000, int preTimer = 0)
|
||||
{
|
||||
Color? color = spriteTextColor != -1 ? SpriteText.getColorFromIndex(spriteTextColor) : null;
|
||||
base.showTextAboveHead(Text, color, style, duration, preTimer);
|
||||
@@ -77,7 +78,7 @@ public abstract class NpcFacade : NPC, IRewriteFacade
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private NpcFacade()
|
||||
private NpcFacade_1_6()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Stats_160_Facade : Stats, IRewriteFacade
|
||||
public uint averageBedtime
|
||||
{
|
||||
get => base.AverageBedtime;
|
||||
set => base.AverageBedtime = value;
|
||||
set => base.OnWentToBed((int)value);
|
||||
}
|
||||
|
||||
public uint beveragesMade
|
||||
@@ -40,12 +40,6 @@ public class Stats_160_Facade : Stats, IRewriteFacade
|
||||
set => base.BeveragesMade = value;
|
||||
}
|
||||
|
||||
public uint caveCarrotsFound
|
||||
{
|
||||
get => base.CaveCarrotsFound;
|
||||
set => base.CaveCarrotsFound = value;
|
||||
}
|
||||
|
||||
public uint cheeseMade
|
||||
{
|
||||
get => base.CheeseMade;
|
||||
@@ -256,12 +250,6 @@ public class Stats_160_Facade : Stats, IRewriteFacade
|
||||
set => base.SheepWoolProduced = value;
|
||||
}
|
||||
|
||||
public uint slimesKilled
|
||||
{
|
||||
get => base.SlimesKilled;
|
||||
set => base.SlimesKilled = value;
|
||||
}
|
||||
|
||||
public uint stepsTaken
|
||||
{
|
||||
get => base.StepsTaken;
|
||||
|
||||
@@ -72,7 +72,7 @@ public class UtilityFacade : Utility, IRewriteFacade
|
||||
yield return 3;
|
||||
}
|
||||
|
||||
public static T GetRandom<T>(List<T> list, Random? random = null)
|
||||
public static T? GetRandom<T>(List<T> list, Random? random = null)
|
||||
{
|
||||
return (random ?? Game1.random).ChooseFrom(list);
|
||||
}
|
||||
@@ -85,13 +85,17 @@ public class UtilityFacade : Utility, IRewriteFacade
|
||||
|
||||
// else replicate old behavior
|
||||
NPC? found = null;
|
||||
Utility.ForEachCharacter(npc =>
|
||||
if (Utility.TryParseEnum(season, out Season parsedSeason))
|
||||
{
|
||||
if (npc.birthday_Season.Value == season && npc.birthday_Day.Value == day)
|
||||
found = npc;
|
||||
Utility.ForEachCharacter(npc =>
|
||||
{
|
||||
if (npc.Birthday_Season == parsedSeason && npc.Birthday_Day == day)
|
||||
found = npc;
|
||||
|
||||
return found is null;
|
||||
});
|
||||
}
|
||||
|
||||
return found is null;
|
||||
});
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Netcode;
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
using StardewValley.GameData;
|
||||
using StardewValley.Objects;
|
||||
|
||||
@@ -18,9 +19,9 @@ public class WallpaperFacade : Wallpaper, IRewriteFacade
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public virtual ModWallpaperOrFlooring GetModData()
|
||||
public virtual ModWallpaperOrFlooring? GetModData()
|
||||
{
|
||||
return base.GetSetData();
|
||||
return ItemRegistry.GetData(base.QualifiedItemId)?.RawData as ModWallpaperOrFlooring;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="AnimatedSprite"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class AnimatedSpriteFacade : AnimatedSprite, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public new void LoadTexture(string textureName, bool syncTextureName = true)
|
||||
{
|
||||
base.LoadTexture(textureName, syncTextureName);
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private AnimatedSpriteFacade()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using StardewValley;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="ArgUtility"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class ArgUtilityFacade_1_6_16 : IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public static bool TryGetOptionalRemainder(string[]? array, int index, out string? value, string? defaultValue = null, char delimiter = ' ')
|
||||
{
|
||||
value = ArgUtility.GetRemainder(array, index, defaultValue, delimiter);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
using StardewValley.Buffs;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="BuffManager"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class BuffManagerFacade : BuffManager, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public void Apply(Buff buff)
|
||||
{
|
||||
base.ApplyLocal(buff);
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private BuffManagerFacade()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley.TerrainFeatures;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="Bush"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class BushFacade_1_6_16 : Bush, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public void draw(SpriteBatch spriteBatch, float yDrawOffset)
|
||||
{
|
||||
if (this.drawOffset.Y != yDrawOffset)
|
||||
this.drawOffset = new Point(this.drawOffset.X, this.drawOffset.Y);
|
||||
|
||||
base.draw(spriteBatch);
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private BushFacade_1_6_16()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,488 @@
|
||||
using System.Collections.Generic;
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
using StardewValley.ContentManagement;
|
||||
using StardewValley.GameData;
|
||||
using StardewValley.GameData.BigCraftables;
|
||||
using StardewValley.GameData.Buffs;
|
||||
using StardewValley.GameData.Buildings;
|
||||
using StardewValley.GameData.Bundles;
|
||||
using StardewValley.GameData.Characters;
|
||||
using StardewValley.GameData.Crafting;
|
||||
using StardewValley.GameData.Crops;
|
||||
using StardewValley.GameData.FarmAnimals;
|
||||
using StardewValley.GameData.Fences;
|
||||
using StardewValley.GameData.FishPonds;
|
||||
using StardewValley.GameData.FloorsAndPaths;
|
||||
using StardewValley.GameData.FruitTrees;
|
||||
using StardewValley.GameData.GarbageCans;
|
||||
using StardewValley.GameData.GiantCrops;
|
||||
using StardewValley.GameData.HomeRenovations;
|
||||
using StardewValley.GameData.LocationContexts;
|
||||
using StardewValley.GameData.Locations;
|
||||
using StardewValley.GameData.Machines;
|
||||
using StardewValley.GameData.MakeoverOutfits;
|
||||
using StardewValley.GameData.Minecarts;
|
||||
using StardewValley.GameData.Movies;
|
||||
using StardewValley.GameData.Museum;
|
||||
using StardewValley.GameData.Objects;
|
||||
using StardewValley.GameData.Pants;
|
||||
using StardewValley.GameData.Pets;
|
||||
using StardewValley.GameData.Powers;
|
||||
using StardewValley.GameData.Shirts;
|
||||
using StardewValley.GameData.Shops;
|
||||
using StardewValley.GameData.SpecialOrders;
|
||||
using StardewValley.GameData.Tools;
|
||||
using StardewValley.GameData.Weapons;
|
||||
using StardewValley.GameData.Weddings;
|
||||
using StardewValley.GameData.WildTrees;
|
||||
using StardewValley.GameData.WorldMaps;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="DataLoader"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class DataLoaderFacade : IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
// return type changed too, which is a breaking change we can't easily rewrite
|
||||
///// <inheritdoc cref="DataLoader.Achievements" />
|
||||
//public static Dictionary<int, string> Achievements(LocalizedContentManager content)
|
||||
//{
|
||||
// return DataLoader.Achievements(content);
|
||||
//}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.AdditionalFarms" />
|
||||
public static List<ModFarmType> AdditionalFarms(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.AdditionalFarms(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.AdditionalLanguages" />
|
||||
public static List<ModLanguage> AdditionalLanguages(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.AdditionalLanguages(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.AdditionalWallpaperFlooring" />
|
||||
public static List<ModWallpaperOrFlooring> AdditionalWallpaperFlooring(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.AdditionalWallpaperFlooring(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.AnimationDescriptions" />
|
||||
public static Dictionary<string, string> AnimationDescriptions(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.AnimationDescriptions(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.AquariumFish" />
|
||||
public static Dictionary<string, string> AquariumFish(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.AquariumFish(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.AudioChanges" />
|
||||
public static Dictionary<string, AudioCueData> AudioChanges(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.AudioChanges(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.BigCraftables" />
|
||||
public static Dictionary<string, BigCraftableData> BigCraftables(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.BigCraftables(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Boots" />
|
||||
public static Dictionary<string, string> Boots(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Boots(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Buffs" />
|
||||
public static Dictionary<string, BuffData> Buffs(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Buffs(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Buildings" />
|
||||
public static Dictionary<string, BuildingData> Buildings(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Buildings(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Bundles" />
|
||||
public static Dictionary<string, string> Bundles(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Bundles(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.ChairTiles" />
|
||||
public static Dictionary<string, string> ChairTiles(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.ChairTiles(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Characters" />
|
||||
public static Dictionary<string, CharacterData> Characters(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Characters(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Concessions" />
|
||||
public static List<ConcessionItemData> Concessions(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Concessions(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.ConcessionTastes" />
|
||||
public static List<ConcessionTaste> ConcessionTastes(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.ConcessionTastes(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.CookingRecipes" />
|
||||
public static Dictionary<string, string> CookingRecipes(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.CookingRecipes(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.CraftingRecipes" />
|
||||
public static Dictionary<string, string> CraftingRecipes(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.CraftingRecipes(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Crops" />
|
||||
public static Dictionary<string, CropData> Crops(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Crops(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.LostItemsShop" />
|
||||
public static List<LostItem> LostItemsShop(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.LostItemsShop(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.EngagementDialogue" />
|
||||
public static Dictionary<string, string> EngagementDialogue(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.EngagementDialogue(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.FarmAnimals" />
|
||||
public static Dictionary<string, FarmAnimalData> FarmAnimals(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.FarmAnimals(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Fences" />
|
||||
public static Dictionary<string, FenceData> Fences(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Fences(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Festivals_FestivalDates" />
|
||||
public static Dictionary<string, string> Festivals_FestivalDates(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Festivals_FestivalDates(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Fish" />
|
||||
public static Dictionary<string, string> Fish(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Fish(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.FishPondData" />
|
||||
public static List<FishPondData> FishPondData(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.FishPondData(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.FloorsAndPaths" />
|
||||
public static Dictionary<string, FloorPathData> FloorsAndPaths(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.FloorsAndPaths(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.FruitTrees" />
|
||||
public static Dictionary<string, FruitTreeData> FruitTrees(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.FruitTrees(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Furniture" />
|
||||
public static Dictionary<string, string> Furniture(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Furniture(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.GarbageCans" />
|
||||
public static GarbageCanData GarbageCans(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.GarbageCans(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.GiantCrops" />
|
||||
public static Dictionary<string, GiantCropData> GiantCrops(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.GiantCrops(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.HairData" />
|
||||
public static Dictionary<int, string> HairData(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.HairData(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Hats" />
|
||||
public static Dictionary<string, string> Hats(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Hats(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.HomeRenovations" />
|
||||
public static Dictionary<string, HomeRenovation> HomeRenovations(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.HomeRenovations(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.IncomingPhoneCalls" />
|
||||
public static Dictionary<string, IncomingPhoneCallData> IncomingPhoneCalls(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.IncomingPhoneCalls(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.JukeboxTracks" />
|
||||
public static Dictionary<string, JukeboxTrackData> JukeboxTracks(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.JukeboxTracks(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.LocationContexts" />
|
||||
public static Dictionary<string, LocationContextData> LocationContexts(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.LocationContexts(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Locations" />
|
||||
public static Dictionary<string, LocationData> Locations(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Locations(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Machines" />
|
||||
public static Dictionary<string, MachineData> Machines(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Machines(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Mail" />
|
||||
public static Dictionary<string, string> Mail(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Mail(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.MakeoverOutfits" />
|
||||
public static List<MakeoverOutfit> MakeoverOutfits(LocalizedContentManager content)
|
||||
{
|
||||
return content.Load<List<MakeoverOutfit>>("Data/MakeoverOutfits");
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Mannequins" />
|
||||
public static Dictionary<string, MannequinData> Mannequins(LocalizedContentManager content)
|
||||
{
|
||||
return content.Load<Dictionary<string, MannequinData>>("Data/Mannequins");
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Minecarts" />
|
||||
public static Dictionary<string, MinecartNetworkData> Minecarts(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Minecarts(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Monsters" />
|
||||
public static Dictionary<string, string> Monsters(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Monsters(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.MonsterSlayerQuests" />
|
||||
public static Dictionary<string, MonsterSlayerQuestData> MonsterSlayerQuests(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.MonsterSlayerQuests(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Movies" />
|
||||
public static List<MovieData> Movies(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Movies(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.MoviesReactions" />
|
||||
public static List<MovieCharacterReaction> MoviesReactions(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.MoviesReactions(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.MuseumRewards" />
|
||||
public static Dictionary<string, MuseumRewards> MuseumRewards(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.MuseumRewards(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.NpcGiftTastes" />
|
||||
public static Dictionary<string, string> NpcGiftTastes(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.NpcGiftTastes(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Objects" />
|
||||
public static Dictionary<string, ObjectData> Objects(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Objects(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.PaintData" />
|
||||
public static Dictionary<string, string> PaintData(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.PaintData(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Pants" />
|
||||
public static Dictionary<string, PantsData> Pants(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Pants(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.PassiveFestivals" />
|
||||
public static Dictionary<string, PassiveFestivalData> PassiveFestivals(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.PassiveFestivals(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Pets" />
|
||||
public static Dictionary<string, PetData> Pets(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Pets(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Powers" />
|
||||
public static Dictionary<string, PowersData> Powers(LocalizedContentManager content)
|
||||
{
|
||||
return content.Load<Dictionary<string, PowersData>>("Data/Powers");
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Quests" />
|
||||
public static Dictionary<string, string> Quests(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Quests(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.RandomBundles" />
|
||||
public static List<RandomBundleData> RandomBundles(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.RandomBundles(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.SecretNotes" />
|
||||
public static Dictionary<int, string> SecretNotes(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.SecretNotes(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Shirts" />
|
||||
public static Dictionary<string, ShirtData> Shirts(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Shirts(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Shops" />
|
||||
public static Dictionary<string, ShopData> Shops(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Shops(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.SpecialOrders" />
|
||||
public static Dictionary<string, SpecialOrderData> SpecialOrders(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.SpecialOrders(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.TailoringRecipes" />
|
||||
public static List<TailorItemRecipe> TailoringRecipes(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.TailoringRecipes(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Tools" />
|
||||
public static Dictionary<string, ToolData> Tools(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Tools(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.TriggerActions" />
|
||||
public static List<TriggerActionData> TriggerActions(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.TriggerActions(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Trinkets" />
|
||||
public static Dictionary<string, TrinketData> Trinkets(LocalizedContentManager content)
|
||||
{
|
||||
return content.Load<Dictionary<string, TrinketData>>("Data/Trinkets");
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Weapons" />
|
||||
public static Dictionary<string, WeaponData> Weapons(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Weapons(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Weddings" />
|
||||
public static WeddingData Weddings(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Weddings(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.WildTrees" />
|
||||
public static Dictionary<string, WildTreeData> WildTrees(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.WildTrees(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.WorldMap" />
|
||||
public static Dictionary<string, WorldMapRegionData> WorldMap(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.WorldMap(content);
|
||||
}
|
||||
|
||||
/****
|
||||
** TV assets
|
||||
****/
|
||||
/// <inheritdoc cref="DataLoader.Tv_CookingChannel" />
|
||||
public static Dictionary<string, string> Tv_CookingChannel(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Tv_CookingChannel(content);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DataLoader.Tv_TipChannel" />
|
||||
public static Dictionary<string, string> Tv_TipChannel(LocalizedContentManager content)
|
||||
{
|
||||
return DataLoader.Tv_TipChannel(content);
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private DataLoaderFacade()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
using StardewValley.Inventories;
|
||||
using StardewValley.Objects;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="Farmer"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class FarmerFacade_1_6_16 : Farmer, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public bool addItemToInventoryBool(Item? item, bool makeActiveObject = false)
|
||||
{
|
||||
if (item is null || !this.IsLocalPlayer)
|
||||
return false;
|
||||
|
||||
AddToInventoryResult result = base.TryAddToInventory(item);
|
||||
|
||||
if (makeActiveObject && result.AnyAdded && item is not SpecialItem && result.Remainder != null && item.Stack <= 1)
|
||||
{
|
||||
int newItemPosition = this.getIndexOfInventoryItem(item);
|
||||
if (newItemPosition > -1)
|
||||
(this.Items[this.CurrentToolIndex], this.Items[newItemPosition]) = (this.Items[newItemPosition], this.Items[this.CurrentToolIndex]); // swap into active position
|
||||
}
|
||||
|
||||
return result.AnyAdded;
|
||||
}
|
||||
|
||||
public void applyBuff(Buff buff)
|
||||
{
|
||||
base.applyLocalBuff(buff);
|
||||
}
|
||||
|
||||
public void dropItem(Item? i)
|
||||
{
|
||||
if (i is null || !i.canBeDropped())
|
||||
return;
|
||||
|
||||
|
||||
this.DropItemAtFeet(i, direction: this.FacingDirection);
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private FarmerFacade_1_6_16()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
using StardewValley.Locations;
|
||||
using StardewValley.TerrainFeatures;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="Forest"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class ForestFacade_1_6_16 : Forest, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public bool ShouldTravelingMerchantVisitToday()
|
||||
{
|
||||
return Forest.ShouldTravelingMerchantVisit(Game1.Date);
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private ForestFacade_1_6_16()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
using StardewValley.ContentManagement;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="Game1"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class Game1Facade_1_6_16 : Game1, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Accessors
|
||||
*********/
|
||||
public new static LocalizedContentManager content => (LocalizedContentManager)Game1.content;
|
||||
public new static LocalizedContentManager temporaryContent => (LocalizedContentManager)Game1.temporaryContent;
|
||||
public new LocalizedContentManager? xTileContent => (LocalizedContentManager?)base.xTileContent;
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private Game1Facade_1_6_16()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using StardewValley;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="ItemRegistry"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class ItemRegistryFacade : IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public static Item? Create(string itemId, int amount = 1, int quality = 0, bool allowNull = false)
|
||||
{
|
||||
return allowNull
|
||||
? ItemRegistry.CreateOrNull(itemId, amount, quality)
|
||||
: ItemRegistry.Create(itemId, amount, quality);
|
||||
}
|
||||
|
||||
public static TItem? Create<TItem>(string itemId, int amount = 1, int quality = 0, bool allowNull = false)
|
||||
where TItem : Item
|
||||
{
|
||||
return CreateGeneric<TItem>(itemId, amount, quality, allowNull);
|
||||
}
|
||||
|
||||
// referenced from InstructionMetadata
|
||||
public static TItem? CreateGeneric<TItem>(string itemId, int amount = 1, int quality = 0, bool allowNull = false)
|
||||
where TItem : Item
|
||||
{
|
||||
return allowNull
|
||||
? ItemRegistry.CreateOrNull<TItem>(itemId, amount, quality)
|
||||
: ItemRegistry.Create<TItem>(itemId, amount, quality);
|
||||
}
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using StardewModdingAPI.Framework.ContentManagers;
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
using StardewValley.ContentManagement;
|
||||
using StardewValley.GameData;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="LocalizedContentManager"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class LocalizedContentManagerFacade_1_6_16 : LocalizedContentManager, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Accessors
|
||||
*********/
|
||||
public static string CurrentLanguageString => Game1.content.LanguageString;
|
||||
public static bool CurrentLanguageLatin => Game1.content.LanguageUsesLatinFont;
|
||||
public static ModLanguage CurrentModLanguage => Game1.content.LanguageModData;
|
||||
|
||||
public static LanguageCode CurrentLanguageCode
|
||||
{
|
||||
get => Game1.content.LanguageCode;
|
||||
set => Game1.content.LanguageCode = value;
|
||||
}
|
||||
|
||||
public static event LanguageChangedHandler OnLanguageChange
|
||||
{
|
||||
add => Game1.content.OnGlobalLanguageChanged += value;
|
||||
remove => Game1.content.OnGlobalLanguageChanged -= value;
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public LanguageCode GetCurrentLanguage()
|
||||
{
|
||||
return this.LanguageCode;
|
||||
}
|
||||
|
||||
public new static LanguageCode GetDefaultLanguageCode()
|
||||
{
|
||||
return Game1.content.GetDefaultLanguageCode();
|
||||
}
|
||||
|
||||
public new static void SetModLanguage(ModLanguage new_mod_language)
|
||||
{
|
||||
Game1.content.SetModLanguage(new_mod_language);
|
||||
}
|
||||
|
||||
public new LocalizedContentManager CreateTemporary()
|
||||
{
|
||||
//
|
||||
// Note: since method calls are redirected to this implementation, the context doesn't work as you'd expect.
|
||||
// In particular:
|
||||
// - `base.CreateTemporary()` calls the vanilla base class (*not* the subclass we're rewriting).
|
||||
// - `this is GameContentManager` is false even if `this.GetType() == typeof(GameContentManager)`.
|
||||
// - Private fields (e.g. to cache the reflection) are shared between multiple instances, resulting in access
|
||||
// violation exceptions.
|
||||
//
|
||||
|
||||
Type type = this.GetType();
|
||||
|
||||
if (type == typeof(GameContentManager))
|
||||
return (LocalizedContentManager)Game1.content.CreateTemporary(); // skip reflection if we can avoid it
|
||||
|
||||
MethodInfo method = this.GetType().GetMethod(nameof(base.CreateTemporary))!;
|
||||
return (LocalizedContentManager)method.Invoke(this, [])!;
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private LocalizedContentManagerFacade_1_6_16()
|
||||
: base(null, null)
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
using StardewValley.ContentManagement;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="NPC"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public abstract class NpcFacade_1_6_16 : NPC, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Accessors
|
||||
*********/
|
||||
public string? Birthday_Season =>
|
||||
base.Birthday_Season != null
|
||||
? Utility.getSeasonNameFromNumber((int)base.Birthday_Season.Value)
|
||||
: null;
|
||||
|
||||
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public static NPC Constructor(AnimatedSprite sprite, Vector2 position, int facingDir, string name, LocalizedContentManager? content = null)
|
||||
{
|
||||
return new NPC(sprite, position, facingDir, name, content);
|
||||
}
|
||||
|
||||
public bool TryLoadPortraits(string assetName, out string error, LocalizedContentManager? content = null)
|
||||
{
|
||||
return this.TryLoadPortraits(assetName, out error, (IContentManager?)content);
|
||||
}
|
||||
|
||||
public bool TryLoadSprites(string assetName, out string error, LocalizedContentManager? content = null)
|
||||
{
|
||||
return this.TryLoadSprites(assetName, out error, (IContentManager?)content);
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private NpcFacade_1_6_16()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Linq;
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley.GameData.Pets;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="PetData"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public abstract class PetDataFacade : PetData, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public PetBreed? GetBreedById(string breedId, bool allowNull = false)
|
||||
{
|
||||
return allowNull
|
||||
? base.Breeds?.FirstOrDefault(p => p.Id == breedId)
|
||||
: base.GetPreferredBreed(breedId);
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private PetDataFacade()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="Response"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class ResponseFacade : Response, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public Response SetHotKey(Keys key)
|
||||
{
|
||||
// note: the original code mutated the instance *and* returned it. Changing the current instance is no longer
|
||||
// possible since it's immutable, so this only really works for mods which used the return value correctly.
|
||||
|
||||
return new Response(this.responseKey, this.responseText, key);
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private ResponseFacade()
|
||||
: base(null, null)
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="TemporaryAnimatedSpriteList"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public abstract class TemporaryAnimatedSpriteListFacade : TemporaryAnimatedSpriteList, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public new IEnumerator<TemporaryAnimatedSprite> GetEnumerator()
|
||||
{
|
||||
return base.GetEnumerator();
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private TemporaryAnimatedSpriteListFacade()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
using StardewValley.Menus;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="TextBox"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public abstract class TextBoxFacade : TextBox, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public void RecieveCommandInput(char command)
|
||||
{
|
||||
base.RecieveCommandInput(command, KeyboardModifier.None);
|
||||
}
|
||||
|
||||
public void RecieveSpecialInput(Keys key)
|
||||
{
|
||||
base.RecieveSpecialInput(key, KeyboardModifier.None);
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private TextBoxFacade()
|
||||
: base(null, null, null, Color.Transparent)
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System.Collections.Generic;
|
||||
using StardewModdingAPI.Framework.ModLoading.Framework;
|
||||
using StardewValley;
|
||||
|
||||
namespace StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
|
||||
/// <summary>Maps Stardew Valley 1.6.15's <see cref="Utility"/> methods to their newer form to avoid breaking older mods.</summary>
|
||||
/// <remarks>This is public to support SMAPI rewriting and should never be referenced directly by mods. See remarks on <see cref="ReplaceReferencesRewriter"/> for more info.</remarks>
|
||||
public class UtilityFacade_1_6_16 : Utility, IRewriteFacade
|
||||
{
|
||||
/*********
|
||||
** Public methods
|
||||
*********/
|
||||
public static bool CollectOrDrop(Item item, int direction)
|
||||
{
|
||||
return Game1.player.CollectOrDrop(item, direction);
|
||||
}
|
||||
|
||||
public static bool CollectOrDrop(Item item)
|
||||
{
|
||||
return Game1.player.CollectOrDrop(item);
|
||||
}
|
||||
|
||||
public static List<int> getDaysOfBooksellerThisSeason()
|
||||
{
|
||||
return Utility.getDaysOfBooksellerThisSeason(Game1.season, Game1.year);
|
||||
}
|
||||
|
||||
|
||||
/*********
|
||||
** Private methods
|
||||
*********/
|
||||
private UtilityFacade_1_6_16()
|
||||
{
|
||||
RewriteHelper.ThrowFakeConstructorCalled();
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,11 @@ using StardewModdingAPI.Framework.ModLoading.Finders;
|
||||
using StardewModdingAPI.Framework.ModLoading.Rewriters;
|
||||
using StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_5;
|
||||
using StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6;
|
||||
using StardewModdingAPI.Framework.ModLoading.Rewriters.StardewValley_1_6_16;
|
||||
using StardewValley;
|
||||
using StardewValley.Audio;
|
||||
using StardewValley.BellsAndWhistles;
|
||||
using StardewValley.Buffs;
|
||||
using StardewValley.Buildings;
|
||||
using StardewValley.ContentManagement;
|
||||
using StardewValley.Enchantments;
|
||||
@@ -20,6 +22,7 @@ using StardewValley.GameData;
|
||||
using StardewValley.GameData.FishPonds;
|
||||
using StardewValley.GameData.FloorsAndPaths;
|
||||
using StardewValley.GameData.Movies;
|
||||
using StardewValley.GameData.Pets;
|
||||
using StardewValley.GameData.SpecialOrders;
|
||||
using StardewValley.Internal;
|
||||
using StardewValley.Locations;
|
||||
@@ -28,6 +31,7 @@ using StardewValley.Minigames;
|
||||
using StardewValley.Mods;
|
||||
using StardewValley.Network;
|
||||
using StardewValley.Objects;
|
||||
using StardewValley.Objects.Trinkets;
|
||||
using StardewValley.Pathfinding;
|
||||
using StardewValley.Projectiles;
|
||||
using StardewValley.Quests;
|
||||
@@ -182,7 +186,7 @@ internal class InstructionMetadata
|
||||
// note: types are mapped before members, regardless of the order listed here
|
||||
.MapFacade<AbigailGame, AbigailGameFacade>()
|
||||
.MapFacade<AnimalHouse, AnimalHouseFacade>()
|
||||
.MapFacade(typeof(ArgUtility).FullName!, typeof(ArgUtilityFacade))
|
||||
.MapFacade(typeof(ArgUtility).FullName!, typeof(ArgUtilityFacade_1_6))
|
||||
.MapFacade<BasicProjectile, BasicProjectileFacade>()
|
||||
.MapFacade<BedFurniture, BedFurnitureFacade>()
|
||||
.MapFacade<BoatTunnel, BoatTunnelFacade>()
|
||||
@@ -190,7 +194,7 @@ internal class InstructionMetadata
|
||||
.MapFacade<BreakableContainer, BreakableContainerFacade>()
|
||||
.MapFacade<Buff, BuffFacade>()
|
||||
.MapFacade<BuffsDisplay, BuffsDisplayFacade>()
|
||||
.MapFacade<Bush, BushFacade>()
|
||||
.MapFacade<Bush, BushFacade_1_6>()
|
||||
.MapFacade<Butterfly, ButterflyFacade>()
|
||||
.MapFacade<Building, BuildingFacade>()
|
||||
.MapFacade<CarpenterMenu, CarpenterMenuFacade>()
|
||||
@@ -204,23 +208,23 @@ internal class InstructionMetadata
|
||||
.MapFacade<Crop, CropFacade>()
|
||||
.MapFacade<DebuffingProjectile, DebuffingProjectileFacade>()
|
||||
.MapFacade<DelayedAction, DelayedActionFacade>()
|
||||
.MapFacade<Dialogue, DialogueFacade>()
|
||||
.MapFacade<Dialogue, DialogueFacade_1_6>()
|
||||
.MapFacade<DialogueBox, DialogueBoxFacade>()
|
||||
.MapFacade<DiscreteColorPicker, DiscreteColorPickerFacade>()
|
||||
.MapFacade<Event, EventFacade>()
|
||||
.MapFacade<Farm, FarmFacade>()
|
||||
.MapFacade<FarmAnimal, FarmAnimalFacade>()
|
||||
.MapFacade<Farmer, FarmerFacade>()
|
||||
.MapFacade<Farmer, FarmerFacade_1_6>()
|
||||
.MapFacade<FarmerTeam, FarmerTeamFacade>()
|
||||
.MapFacade<FarmerRenderer, FarmerRendererFacade>()
|
||||
.MapFacade<Fence, FenceFacade>()
|
||||
.MapFacade<FishingRod, FishingRodFacade>()
|
||||
.MapFacade<FishPondReward, FishPondRewardFacade>()
|
||||
.MapFacade<FishTankFurniture, FishTankFurnitureFacade>()
|
||||
.MapFacade<Forest, ForestFacade>()
|
||||
.MapFacade<Forest, ForestFacade_1_6>()
|
||||
.MapFacade<Furniture, FurnitureFacade>()
|
||||
.MapFacade<FruitTree, FruitTreeFacade>()
|
||||
.MapFacade<Game1, Game1Facade>()
|
||||
.MapFacade<Game1, Game1Facade_1_6>()
|
||||
.MapFacade<GameLocation, GameLocationFacade>()
|
||||
.MapFacade<GiantCrop, GiantCropFacade>()
|
||||
.MapFacade<Hat, HatFacade>()
|
||||
@@ -235,14 +239,14 @@ internal class InstructionMetadata
|
||||
.MapFacade<Layer, LayerFacade>()
|
||||
.MapFacade<LibraryMuseum, LibraryMuseumFacade>()
|
||||
.MapFacade<LightSource, LightSourceFacade>()
|
||||
.MapFacade<LocalizedContentManager, LocalizedContentManagerFacade>()
|
||||
.MapFacade<LocalizedContentManager, LocalizedContentManagerFacade_1_6>()
|
||||
.MapType("StardewValley.Buildings.Mill", typeof(Building))
|
||||
.MapFacade<MineShaft, MineShaftFacade>()
|
||||
.MapFacade<Multiplayer, MultiplayerFacade>()
|
||||
.MapFacade<MeleeWeapon, MeleeWeaponFacade>()
|
||||
.MapFacade<NetFields, NetFieldsFacade>()
|
||||
.MapFacade<NetWorldState, NetWorldStateFacade>()
|
||||
.MapFacade<NPC, NpcFacade>()
|
||||
.MapFacade<NPC, NpcFacade_1_6>()
|
||||
.MapFacade<PathFindController, PathFindControllerFacade>()
|
||||
.MapFacade<Projectile, ProjectileFacade>()
|
||||
.MapFacade<ProfileMenu, ProfileMenuFacade>()
|
||||
@@ -294,7 +298,53 @@ internal class InstructionMetadata
|
||||
.MapMethod("System.Int32 Netcode.NetInt::op_Implicit(Netcode.NetInt)", typeof(ImplicitConversionOperatorsFacade), nameof(ImplicitConversionOperatorsFacade.NetInt_ToInt))
|
||||
.MapMethod("System.String Netcode.NetString::op_Implicit(Netcode.NetString)", typeof(ImplicitConversionOperatorsFacade), nameof(ImplicitConversionOperatorsFacade.NetString_ToString))
|
||||
.MapMethod("System.Int32 StardewValley.Network.NetDirection::op_Implicit(StardewValley.Network.NetDirection)", typeof(ImplicitConversionOperatorsFacade), nameof(ImplicitConversionOperatorsFacade.NetDirection_ToInt))
|
||||
.MapMethod("!0 StardewValley.Network.NetPausableField`3<Microsoft.Xna.Framework.Vector2,Netcode.NetVector2,Netcode.NetVector2>::op_Implicit(StardewValley.Network.NetPausableField`3<!0,!1,!2>)", typeof(NetPausableFieldFacade<Vector2, NetVector2, NetVector2>), nameof(NetPausableFieldFacade<Vector2, NetVector2, NetVector2>.op_Implicit));
|
||||
.MapMethod("!0 StardewValley.Network.NetPausableField`3<Microsoft.Xna.Framework.Vector2,Netcode.NetVector2,Netcode.NetVector2>::op_Implicit(StardewValley.Network.NetPausableField`3<!0,!1,!2>)", typeof(NetPausableFieldFacade<Vector2, NetVector2, NetVector2>), nameof(NetPausableFieldFacade<Vector2, NetVector2, NetVector2>.op_Implicit))
|
||||
|
||||
/****
|
||||
** Stardew Valley 1.6.16
|
||||
****/
|
||||
// moved types (FishTankFurniture)
|
||||
.MapType("StardewValley.Objects.FishTankFurniture/FishTankCategories", typeof(StardewValley.Objects.FishTanks.FishTankCategories))
|
||||
.MapType("StardewValley.Objects.TankFish", typeof(StardewValley.Objects.FishTanks.TankFish))
|
||||
.MapType("StardewValley.Objects.TankFish/FishType", typeof(StardewValley.Objects.FishTanks.FishType))
|
||||
|
||||
// moved types (LocalizedContentManager)
|
||||
.MapType("StardewValley.LocalizedContentManager", typeof(LocalizedContentManager))
|
||||
.MapType("StardewValley.LocalizedContentManager/LanguageChangedHandler", typeof(LanguageChangedHandler))
|
||||
.MapType("StardewValley.LocalizedContentManager/LanguageCode", typeof(LanguageCode))
|
||||
|
||||
// generic ItemRegistry.Create<T> changes
|
||||
// For some reason, these aren't handled by the ItemRegistryFacade. We can't list every possible item,
|
||||
// but we can cover the main ones and add others as needed.
|
||||
.MapMethod($"!!0 StardewValley.ItemRegistry::Create<{typeof(Axe).FullName}>(System.String,System.Int32,System.Int32,System.Boolean)", typeof(ItemRegistryFacade), nameof(ItemRegistryFacade.CreateGeneric))
|
||||
.MapMethod($"!!0 StardewValley.ItemRegistry::Create<{typeof(Boots).FullName}>(System.String,System.Int32,System.Int32,System.Boolean)", typeof(ItemRegistryFacade), nameof(ItemRegistryFacade.CreateGeneric))
|
||||
.MapMethod($"!!0 StardewValley.ItemRegistry::Create<{typeof(Chest).FullName}>(System.String,System.Int32,System.Int32,System.Boolean)", typeof(ItemRegistryFacade), nameof(ItemRegistryFacade.CreateGeneric))
|
||||
.MapMethod($"!!0 StardewValley.ItemRegistry::Create<{typeof(Clothing).FullName}>(System.String,System.Int32,System.Int32,System.Boolean)", typeof(ItemRegistryFacade), nameof(ItemRegistryFacade.CreateGeneric))
|
||||
.MapMethod($"!!0 StardewValley.ItemRegistry::Create<{typeof(Furniture).FullName}>(System.String,System.Int32,System.Int32,System.Boolean)", typeof(ItemRegistryFacade), nameof(ItemRegistryFacade.CreateGeneric))
|
||||
.MapMethod($"!!0 StardewValley.ItemRegistry::Create<{typeof(Hat).FullName}>(System.String,System.Int32,System.Int32,System.Boolean)", typeof(ItemRegistryFacade), nameof(ItemRegistryFacade.CreateGeneric))
|
||||
.MapMethod($"!!0 StardewValley.ItemRegistry::Create<{typeof(Ring).FullName}>(System.String,System.Int32,System.Int32,System.Boolean)", typeof(ItemRegistryFacade), nameof(ItemRegistryFacade.CreateGeneric))
|
||||
.MapMethod($"!!0 StardewValley.ItemRegistry::Create<{typeof(SObject).FullName}>(System.String,System.Int32,System.Int32,System.Boolean)", typeof(ItemRegistryFacade), nameof(ItemRegistryFacade.CreateGeneric))
|
||||
.MapMethod($"!!0 StardewValley.ItemRegistry::Create<{typeof(Tool).FullName}>(System.String,System.Int32,System.Int32,System.Boolean)", typeof(ItemRegistryFacade), nameof(ItemRegistryFacade.CreateGeneric))
|
||||
.MapMethod($"!!0 StardewValley.ItemRegistry::Create<{typeof(Trinket).FullName}>(System.String,System.Int32,System.Int32,System.Boolean)", typeof(ItemRegistryFacade), nameof(ItemRegistryFacade.CreateGeneric))
|
||||
|
||||
// general API changes
|
||||
// note: types are mapped before members, regardless of the order listed here
|
||||
.MapFacade("StardewValley.DataLoader", typeof(DataLoaderFacade))
|
||||
.MapFacade<AnimatedSprite, AnimatedSpriteFacade>()
|
||||
.MapFacade(typeof(ArgUtility).FullName!, typeof(ArgUtilityFacade_1_6_16))
|
||||
.MapFacade<BuffManager, BuffManagerFacade>()
|
||||
.MapFacade<Bush, BushFacade_1_6_16>()
|
||||
.MapFacade<Farmer, FarmerFacade_1_6_16>()
|
||||
.MapFacade<Forest, ForestFacade_1_6_16>()
|
||||
.MapFacade<Game1, Game1Facade_1_6_16>()
|
||||
.MapFacade(typeof(ItemRegistry).FullName!, typeof(ItemRegistryFacade))
|
||||
.MapFacade<LocalizedContentManager, LocalizedContentManagerFacade_1_6_16>()
|
||||
.MapFacade<NPC, NpcFacade_1_6_16>()
|
||||
.MapFacade<PetData, PetDataFacade>()
|
||||
.MapFacade<Response, ResponseFacade>()
|
||||
.MapFacade<TemporaryAnimatedSpriteList, TemporaryAnimatedSpriteListFacade>()
|
||||
.MapFacade<TextBox, TextBoxFacade>()
|
||||
.MapFacade<Utility, UtilityFacade_1_6_16>();
|
||||
|
||||
// heuristic rewrites
|
||||
yield return new HeuristicFieldRewriter(this.ValidateReferencesToAssemblies);
|
||||
|
||||
Reference in New Issue
Block a user