From 681be6469e7a6c94ca02b476602a7bfb3ecd1f00 Mon Sep 17 00:00:00 2001 From: jneb802 <73610029+jneb802@users.noreply.github.com> Date: Fri, 16 Oct 2026 23:00:56 -0700 Subject: [PATCH 1/3] Allow public basic pickables inside Protective Wards --- CHANGELOG.md | 4 ++ README.md | 4 ++ Source/Compatibility/PublicBasicPickables.cs | 43 ++++++++++++++++++++ Source/Core/Plugin.cs | 4 +- docs/public-basic-pickables-validation.md | 28 +++++++++++++ manifest.json | 2 +- thunderstore.toml | 2 +- 7 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 Source/Compatibility/PublicBasicPickables.cs create mode 100644 docs/public-basic-pickables-validation.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 594f7a0..36b95e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.101 + +- Allow everyone to gather loose flint, branches, and stones inside Protective Wards. Other pickables and ward protections are unchanged. + ## 0.1.100 - Append active alternate biome names to the biome label beside the small minimap. The local `[Minimap] ShowAlternateBiomeName` setting defaults to true. diff --git a/README.md b/README.md index 2b455c4..fbdf306 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ PraetorisClient is the shared client-and-server mod for Praetoris-specific gamep ### Player features +#### Public basic pickups + +With Protective Wards installed, everyone can interact with `Pickable_Flint`, `Pickable_Branch`, and `Pickable_Stone` inside a ward. This exception is always enabled and applies only to those three world pickables. Other pickables, dropped items, containers, and ward permissions retain their existing protection. Normal pickup checks still apply. Collecting the resulting items follows Protective Wards' existing item pickup mode; Praetoris uses `AllowNonPlayerDropped`. + #### Discord account linking - Enter `!link CODE` in game chat to link a Valheim character to Discord. diff --git a/Source/Compatibility/PublicBasicPickables.cs b/Source/Compatibility/PublicBasicPickables.cs new file mode 100644 index 0000000..72beada --- /dev/null +++ b/Source/Compatibility/PublicBasicPickables.cs @@ -0,0 +1,43 @@ +using System; +using System.Reflection; +using BepInEx.Bootstrap; +using HarmonyLib; +using UnityEngine; + +namespace PraetorisClient +{ + internal static class PublicBasicPickables + { + internal const string ProtectiveWardsGuid = "shudnal.ProtectiveWards"; + + internal static void TryApply(Harmony harmony) + { + if (!Chainloader.PluginInfos.TryGetValue(ProtectiveWardsGuid, out BepInEx.PluginInfo plugin)) return; + + try + { + MethodInfo target = AccessTools.DeclaredMethod(plugin.Instance.GetType(), + "BlockUnauthorizedWardInteraction", new[] { typeof(Component), typeof(Humanoid), typeof(bool) }) + ?? throw new MissingMethodException("ProtectiveWards.BlockUnauthorizedWardInteraction(Component, Humanoid, bool)"); + harmony.Patch(target, prefix: new HarmonyMethod(typeof(PublicBasicPickables), nameof(AllowBasicPickable))); + PraetorisClientPlugin.Log.LogInfo("Protective Wards allows public flint, branch, and stone pickables."); + } + catch (Exception exception) + { + PraetorisClientPlugin.Log.LogWarning("Could not enable public basic pickables; ward protection remains unchanged: " + exception.Message); + } + } + + private static bool AllowBasicPickable(Component __0, ref bool __result) + { + if (__0 is not Pickable pickable) return true; + + string prefabName = Utils.GetPrefabName(pickable.gameObject); + if (prefabName != "Pickable_Flint" && prefabName != "Pickable_Branch" && prefabName != "Pickable_Stone") return true; + + // Skip only Protective Wards' denial. Pickable.Interact still runs its normal checks and RPC. + __result = false; + return false; + } + } +} diff --git a/Source/Core/Plugin.cs b/Source/Core/Plugin.cs index 74c5384..e2378a1 100644 --- a/Source/Core/Plugin.cs +++ b/Source/Core/Plugin.cs @@ -25,13 +25,14 @@ namespace PraetorisClient [BepInDependency(Jotunn.Main.ModGuid)] [BepInDependency(EpicLootApiBridge.PluginGuid, BepInDependency.DependencyFlags.SoftDependency)] [BepInDependency("org.tristan.rcon", BepInDependency.DependencyFlags.SoftDependency)] + [BepInDependency(PublicBasicPickables.ProtectiveWardsGuid, BepInDependency.DependencyFlags.SoftDependency)] [BepInDependency(ShippingPortDepartures.MwlGuid, BepInDependency.DependencyFlags.SoftDependency)] [BepInDependency(Tombstones.TombstoneAccess.GroupsGuid, BepInDependency.DependencyFlags.SoftDependency)] public class PraetorisClientPlugin : BaseUnityPlugin { private const string ModName = "PraetorisClient"; - private const string ModVersion = "0.1.100"; + private const string ModVersion = "0.1.101"; private const string Author = "warpalicious"; private const string ModGUID = Author + "." + ModName; private const string EpicLootGuid = "randyknapp.mods.epicloot"; @@ -166,6 +167,7 @@ public void Awake() RpcTraceTelemetry.Initialize(); ApplyHarmonyPatches(epicLootLoaded); CraftyBoxesWardGuard.TryApply(_harmony); + PublicBasicPickables.TryApply(_harmony); ShippingPortDepartures.Initialize(_harmony); ProtectedLocationNoBuild.ApplyToLoadedLocations(); SocketMetricPatches.ApplyManualPatches(_harmony); diff --git a/docs/public-basic-pickables-validation.md b/docs/public-basic-pickables-validation.md new file mode 100644 index 0000000..09b27c9 --- /dev/null +++ b/docs/public-basic-pickables-validation.md @@ -0,0 +1,28 @@ +# Public basic pickables validation + +Validated on Valnet client 02 on 2026-10-16. + +- Valheim 1.0.20, network version 41, matching production. +- Maintained `praetoris-season-8` profile with Season 8 modpack 8.0.45 dependencies and configuration. BepInEx remained at 5.4.2350 instead of the pack's 5.4.2351. +- Protective Wards 2.1.0; plant protection enabled; public access disabled; item pickup mode `AllowNonPlayerDropped`. +- Baseline PraetorisClient 0.1.98; candidate 0.1.101. +- Candidate DLL SHA-256: `f91ce9fa48900bafff689f5bd22d89a13383166a152815331309bbf6be6abe2b`. + +## Procedure and results + +Used the local `TestingWorld` on Valnet. Character `Odev` built and activated a ward through normal placement and interaction. A separate character, `BasicPickupQA`, had no permission. God and ghost modes were disabled for that guest. + +1. With the baseline DLL, attempted flint, branch, stone, and mushroom pickups through `Pickable.Interact`. All remained. The guest inventory was still empty after saving and reloading. +2. Restarted the game with the candidate DLL. The compatibility patch loaded successfully. +3. Repeated the pickups at the same ward. Both instances of each basic pickable were consumed. Further attempts found no matching basic pickables. The guest inventory showed wood, flint, and stone from their normal drops. +4. Repeated mushroom pickups while the ward was active. Both mushrooms remained pickable and produced no items. +5. Removed the test ward. The same mushrooms could then be picked and produced item drops. Further attempts found no unpicked mushroom in range. +6. Removed the remaining test objects and restored time of day. + +Evidence is saved under `/Users/benjmarston/Develop/artifacts/public-basic-pickables`, including command results, runtime logs, and `final-inventory.png`. + +This validates client interaction and item collection with the production season's mod set in a local world. A separate dedicated-server session was not part of this test. Other Protective Wards item pickup modes were not tested; their existing dropped-item rules still apply. + +## Build + +Release build passed with zero errors and 84 existing warnings. `git diff --check` passed. diff --git a/manifest.json b/manifest.json index 1e4c606..1fe85fc 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "PraetorisClient", "description": "Client-side Praetoris tools for Discord linking, creative server bridges, RPC tracing, socket metrics, and RPC probes.", - "version_number": "0.1.100", + "version_number": "0.1.101", "website_url": "https://discord.gg/3aaru2VyHJ", "dependencies": [ "denikson-BepInExPack_Valheim-5.4.2333", diff --git a/thunderstore.toml b/thunderstore.toml index d96ea56..c31b09d 100644 --- a/thunderstore.toml +++ b/thunderstore.toml @@ -4,7 +4,7 @@ schemaVersion = "0.0.1" [package] namespace = "praetoris" name = "PraetorisClient" -versionNumber = "0.1.98" +versionNumber = "0.1.101" description = "Client-side Praetoris tools for Discord linking, creative server bridges, RPC tracing, socket metrics, and RPC probes." websiteUrl = "https://discord.gg/3aaru2VyHJ" containsNsfwContent = false From d6ceafcc25d89b36b59ba63163427897efc82771 Mon Sep 17 00:00:00 2001 From: jneb802 <73610029+jneb802@users.noreply.github.com> Date: Fri, 16 Oct 2026 23:06:20 -0700 Subject: [PATCH 2/3] Record Valnet profile restoration --- docs/public-basic-pickables-validation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/public-basic-pickables-validation.md b/docs/public-basic-pickables-validation.md index 09b27c9..14dd3f2 100644 --- a/docs/public-basic-pickables-validation.md +++ b/docs/public-basic-pickables-validation.md @@ -18,6 +18,7 @@ Used the local `TestingWorld` on Valnet. Character `Odev` built and activated a 4. Repeated mushroom pickups while the ward was active. Both mushrooms remained pickable and produced no items. 5. Removed the test ward. The same mushrooms could then be picked and produced item drops. Further attempts found no unpicked mushroom in range. 6. Removed the remaining test objects and restored time of day. +7. Restored the original profile, registry, and owner character. Verified profile file checksums against the backup and confirmed the restored game reached the main menu. Evidence is saved under `/Users/benjmarston/Develop/artifacts/public-basic-pickables`, including command results, runtime logs, and `final-inventory.png`. From 11889b5d8bccfeed2f1ee4804a6bd713e37f980c Mon Sep 17 00:00:00 2001 From: jneb802 <73610029+jneb802@users.noreply.github.com> Date: Fri, 16 Oct 2026 23:09:44 -0700 Subject: [PATCH 3/3] Remove feature documentation from ward pickup change --- README.md | 4 ---- docs/public-basic-pickables-validation.md | 29 ----------------------- 2 files changed, 33 deletions(-) delete mode 100644 docs/public-basic-pickables-validation.md diff --git a/README.md b/README.md index fbdf306..2b455c4 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,6 @@ PraetorisClient is the shared client-and-server mod for Praetoris-specific gamep ### Player features -#### Public basic pickups - -With Protective Wards installed, everyone can interact with `Pickable_Flint`, `Pickable_Branch`, and `Pickable_Stone` inside a ward. This exception is always enabled and applies only to those three world pickables. Other pickables, dropped items, containers, and ward permissions retain their existing protection. Normal pickup checks still apply. Collecting the resulting items follows Protective Wards' existing item pickup mode; Praetoris uses `AllowNonPlayerDropped`. - #### Discord account linking - Enter `!link CODE` in game chat to link a Valheim character to Discord. diff --git a/docs/public-basic-pickables-validation.md b/docs/public-basic-pickables-validation.md deleted file mode 100644 index 14dd3f2..0000000 --- a/docs/public-basic-pickables-validation.md +++ /dev/null @@ -1,29 +0,0 @@ -# Public basic pickables validation - -Validated on Valnet client 02 on 2026-10-16. - -- Valheim 1.0.20, network version 41, matching production. -- Maintained `praetoris-season-8` profile with Season 8 modpack 8.0.45 dependencies and configuration. BepInEx remained at 5.4.2350 instead of the pack's 5.4.2351. -- Protective Wards 2.1.0; plant protection enabled; public access disabled; item pickup mode `AllowNonPlayerDropped`. -- Baseline PraetorisClient 0.1.98; candidate 0.1.101. -- Candidate DLL SHA-256: `f91ce9fa48900bafff689f5bd22d89a13383166a152815331309bbf6be6abe2b`. - -## Procedure and results - -Used the local `TestingWorld` on Valnet. Character `Odev` built and activated a ward through normal placement and interaction. A separate character, `BasicPickupQA`, had no permission. God and ghost modes were disabled for that guest. - -1. With the baseline DLL, attempted flint, branch, stone, and mushroom pickups through `Pickable.Interact`. All remained. The guest inventory was still empty after saving and reloading. -2. Restarted the game with the candidate DLL. The compatibility patch loaded successfully. -3. Repeated the pickups at the same ward. Both instances of each basic pickable were consumed. Further attempts found no matching basic pickables. The guest inventory showed wood, flint, and stone from their normal drops. -4. Repeated mushroom pickups while the ward was active. Both mushrooms remained pickable and produced no items. -5. Removed the test ward. The same mushrooms could then be picked and produced item drops. Further attempts found no unpicked mushroom in range. -6. Removed the remaining test objects and restored time of day. -7. Restored the original profile, registry, and owner character. Verified profile file checksums against the backup and confirmed the restored game reached the main menu. - -Evidence is saved under `/Users/benjmarston/Develop/artifacts/public-basic-pickables`, including command results, runtime logs, and `final-inventory.png`. - -This validates client interaction and item collection with the production season's mod set in a local world. A separate dedicated-server session was not part of this test. Other Protective Wards item pickup modes were not tested; their existing dropped-item rules still apply. - -## Build - -Release build passed with zero errors and 84 existing warnings. `git diff --check` passed.