From c1e5e5745f297d2ea0c7b0b02efe57180b348a14 Mon Sep 17 00:00:00 2001 From: "diogo.garrett93" Date: Tue, 21 Sep 2021 04:08:30 +0100 Subject: [PATCH] Possible fix for ore drop quantities --- README.md | 7 ++++--- VeinMine/Patches.cs | 7 ++++--- VeinMine/Properties/AssemblyInfo.cs | 4 ++-- VeinMine/VeinMine.cs | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cff882d..19898e7 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ ![enter image description here](https://i.imgur.com/OAfRGXK.jpg) Tired of mining for ages? -With VeinMine you're able to mine the whole ore/rock vein at once! +With Veinmine you're able to mine the whole ore/rock vein at once! You can do this by holding down the assigned key (Left Alt by default) while mining! -This mod does essentially the same thing as [SeleniumMineBoom](https://valheim.thunderstore.io/package/SeleniumCoreTeam/SeleniumMineBoom/) but lets you configure a key, so you don't always mine a whole vein at once if you don't want to. ## **Version 1.0.0 - Progressive mode added!** @@ -20,7 +19,9 @@ What does 2 mean, you ask? It's simple! A standard 2x2 floor piece has a length of 2, exactly like its name suggests. # Changelog -## 1.2.1 +## 1.2.2 + - Possible fix for ore drop quantities (Not sure why they weren't correct, as I don't change drop rates) +### 1.2.1 - Compatibility for Hearth and Home; - Tentative fix for ores spawning at 0,0 (unable to test without other players) ### 1.2.0 diff --git a/VeinMine/Patches.cs b/VeinMine/Patches.cs index b5ae74b..5e23f48 100644 --- a/VeinMine/Patches.cs +++ b/VeinMine/Patches.cs @@ -70,7 +70,7 @@ public static void MineRock5_Damage_Patch(MineRock5 __instance, ZNetView ___m_nv { foreach (var index in __state) { - hit.m_point = index.Value; + //hit.m_point = index.Value; if (Player.m_localPlayer.GetCurrentWeapon().m_durability > 0 || !Player.m_localPlayer.GetCurrentWeapon().m_shared.m_useDurability) { try @@ -152,9 +152,10 @@ public static bool MineRock5_DamageArea_Prefix(MineRock5 __instance, HitData hit { if (isVeinmined) { - Vector3 position = closestPlayer.GetTransform().localPosition + new Vector3 { x = 0, y = 2, z = 0 } + UnityEngine.Random.insideUnitSphere * 0.3f; + Vector3 position = hit.m_point + UnityEngine.Random.insideUnitSphere * 0.3f; + //Vector3 position = closestPlayer.GetTransform().localPosition + new Vector3 { x = 0, y = 2, z = 0 } + UnityEngine.Random.insideUnitSphere * 0.3f; UnityEngine.Object.Instantiate(gameObject, position, Quaternion.identity); - hit.m_point = closestPlayer.GetTransform().localPosition + new Vector3 { x = 0, y = 2, z = 0 }; + //hit.m_point = closestPlayer.GetTransform().localPosition + new Vector3 { x = 0, y = 2, z = 0 }; } else if (!isVeinmined) { diff --git a/VeinMine/Properties/AssemblyInfo.cs b/VeinMine/Properties/AssemblyInfo.cs index aecf3cb..43664ad 100644 --- a/VeinMine/Properties/AssemblyInfo.cs +++ b/VeinMine/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.1.0")] -[assembly: AssemblyFileVersion("1.2.1.0")] +[assembly: AssemblyVersion("1.2.2.0")] +[assembly: AssemblyFileVersion("1.2.2.0")] diff --git a/VeinMine/VeinMine.cs b/VeinMine/VeinMine.cs index 4198b6f..c836a51 100644 --- a/VeinMine/VeinMine.cs +++ b/VeinMine/VeinMine.cs @@ -14,7 +14,7 @@ public class VeinMine : BaseUnityPlugin { private const string MOD_ID = "com.wisehorror.Veinmine"; private const string MOD_NAME = "Veinmine"; - private const string VERSION = "1.2.1"; + private const string VERSION = "1.2.2"; public static ManualLogSource logger = BepInEx.Logging.Logger.CreateLogSource("Veinmine");