Skip to content

Ongoing development#3

Open
Pathoschild wants to merge 17 commits into
silentoak:masterfrom
Pathoschild:update-code
Open

Ongoing development#3
Pathoschild wants to merge 17 commits into
silentoak:masterfrom
Pathoschild:update-code

Conversation

@Pathoschild

@Pathoschild Pathoschild commented Jul 21, 2019

Copy link
Copy Markdown

This PR has ongoing development to maintain compatibility with the latest versions, update for new SMAPI features, and make minor improvements. Once this is merged, I can provide compiled zips to release if you'd like.

Changes

Rewrite

The mod replaces in-game machines with temporary processor instances, but that's error-prone and breaks compatibility with some mods (particularly custom-location mods). This PR rewrites the mod to intercept machine methods using Harmony instead, and calls singleton processors to run the mod logic. That means it doesn't need to add/remove any custom instances to the world, automatically works for all machines, and works fine even if other mods add/remove machines/locations.

Fixes

  • Fixed errors when a recipe matches an item, but there's not enough to satisfy the recipe.
  • Fixed error when used with certain mods that add custom honey types.
  • Fixed save crashes in some cases (especially when used with custom-location mods).
  • Fixed config.json not auto-generated correctly. It can now be left out of the release, to avoid overwriting player's configuration.
  • Fixed Automate-patch errors not marked as AutoQualityPatch errors.

Internal refactoring

  • Added the assets folder from the release (so they're included in the build automatically).
  • Added a .gitattributes to keep line endings consistent between Linux/Mac/Windows.
  • Updated the mod build package and migrated to the new simpler .csproj format.
  • Simplified and standardised Harmony patching.
  • Removed unused files.
  • Fixed a compile error on Windows.
  • Fixed implicit net field conversion warnings.
  • Automate is now loaded from the Mods folder directly (no longer need to copy it into a Lib folder).

Testing

These changes are part of unofficial updates which a number of players have been using. See download counts for the most recent releases: unofficial.4, unofficial.3, unofficial.2, unofficial.1.

Let me know if you want me to change anything!

The new package version...
- adds support for SMAPI 3.0 and Stardew Valley 1.4;
- deploys 'assets' folders automatically;
- adds a Harmony reference automatically using <EnableHarmony>.
This commit rewrites the logic for applying processor logic to machines. Instead of replacing the in-world machine instances, the mod now uses Harmony to intercept machine methods and invoke singleton processors with the machine instance. This is much less error-prone, fixes save errors when machines are in some custom locations due to race conditions, fixes other mod compatibility issues, and fixes a machine duplication bug.
@Pathoschild Pathoschild changed the title Various fixes, internal refactoring Ongoing development Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant