From 31dfd4a99a18133319afc73ec02d42f325cf4d17 Mon Sep 17 00:00:00 2001 From: mikx Date: Sat, 24 Jan 2026 23:26:12 -0500 Subject: [PATCH] first commit --- .gitignore | 261 +++++++++++++++++++++++++++ MxValheim.slnx | 3 + MxValheim/MxValheim.cs | 28 +++ MxValheim/MxValheim.csproj | 64 +++++++ MxValheim/Patch/Ores.cs | 38 ++++ MxValheim/Properties/AssemblyInfo.cs | 33 ++++ README.md | 14 ++ 7 files changed, 441 insertions(+) create mode 100644 .gitignore create mode 100644 MxValheim.slnx create mode 100644 MxValheim/MxValheim.cs create mode 100644 MxValheim/MxValheim.csproj create mode 100644 MxValheim/Patch/Ores.cs create mode 100644 MxValheim/Properties/AssemblyInfo.cs create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c4efe2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,261 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +#*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc \ No newline at end of file diff --git a/MxValheim.slnx b/MxValheim.slnx new file mode 100644 index 0000000..0f16135 --- /dev/null +++ b/MxValheim.slnx @@ -0,0 +1,3 @@ + + + diff --git a/MxValheim/MxValheim.cs b/MxValheim/MxValheim.cs new file mode 100644 index 0000000..758960d --- /dev/null +++ b/MxValheim/MxValheim.cs @@ -0,0 +1,28 @@ +using BepInEx; +using BepInEx.Configuration; +using HarmonyLib; +using System.Collections.Generic; +using UnityEngine; + +[BepInPlugin(ModGUID, ModName, ModVersion)] +public class MxValheimMod : BaseUnityPlugin +{ + private const string ModGUID = "ovh.mxdev.mxvalheim"; + private const string ModName = "MxValheim"; + private const string ModVersion = "1.0.0"; + + public static ConfigEntry OreMultiplier; + + // Set your multiplier here + public static int Multiplier = 3; + + void Awake() + { + OreMultiplier = Config.Bind("General","OreMultiplier",3,"How many items should drop for every 1 ore/scrap found."); + + Harmony harmony = new Harmony(ModGUID); + harmony.PatchAll(); + + Logger.LogInfo($"{ModName} loaded with multiplier: {OreMultiplier.Value}x"); + } +} \ No newline at end of file diff --git a/MxValheim/MxValheim.csproj b/MxValheim/MxValheim.csproj new file mode 100644 index 0000000..aa7d3b3 --- /dev/null +++ b/MxValheim/MxValheim.csproj @@ -0,0 +1,64 @@ + + + + + Debug + AnyCPU + {49A57AC4-1A2B-4603-8559-AF3CB950B40E} + Library + Properties + MxValheim + MxValheim + v4.6.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + E:\SteamLibrary\steamapps\common\Valheim\BepInEx\core\0Harmony.dll + + + E:\SteamLibrary\steamapps\common\Valheim\Valheim_Data\Managed\assembly_valheim.dll + + + E:\SteamLibrary\steamapps\common\Valheim\BepInEx\core\BepInEx.dll + + + + + + + + + + + E:\SteamLibrary\steamapps\common\Valheim\Valheim_Data\Managed\UnityEngine.dll + + + E:\SteamLibrary\steamapps\common\Valheim\Valheim_Data\Managed\UnityEngine.CoreModule.dll + + + + + + + + + \ No newline at end of file diff --git a/MxValheim/Patch/Ores.cs b/MxValheim/Patch/Ores.cs new file mode 100644 index 0000000..6186c25 --- /dev/null +++ b/MxValheim/Patch/Ores.cs @@ -0,0 +1,38 @@ +using BepInEx; +using HarmonyLib; +using System.Collections.Generic; +using UnityEngine; + +namespace MxValheim.Patch +{ + public class Ores + { + [HarmonyPatch(typeof(DropTable), nameof(DropTable.GetDropList), new[] { typeof(int) })] + static class DropTable_Patch + { + static void Postfix(ref List __result) + { + if (__result == null || __result.Count == 0) return; + + int countToAdd = MxValheimMod.OreMultiplier.Value - 1; + if (countToAdd <= 0) return; + + List extraDrops = new List(); + + foreach (var item in __result) + { + string name = item.name.ToLower(); + if (name.Contains("ore") || name.Contains("scrap")) + { + for (int i = 0; i < countToAdd; i++) + { + extraDrops.Add(item); + } + } + } + + __result.AddRange(extraDrops); + } + } + } +} diff --git a/MxValheim/Properties/AssemblyInfo.cs b/MxValheim/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1d0b5d1 --- /dev/null +++ b/MxValheim/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Les informations générales relatives à un assembly dépendent de +// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations +// associées à un assembly. +[assembly: AssemblyTitle("MxValheim")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MxValheim")] +[assembly: AssemblyCopyright("Copyright © 2026")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly +// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de +// COM, affectez la valeur true à l'attribut ComVisible sur ce type. +[assembly: ComVisible(false)] + +// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM +[assembly: Guid("49a57ac4-1a2b-4603-8559-af3cb950b40e")] + +// Les informations de version pour un assembly se composent des quatre valeurs suivantes : +// +// Version principale +// Version secondaire +// Numéro de build +// Révision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/README.md b/README.md new file mode 100644 index 0000000..aac17e7 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +![logo](https://mxdev.ovh/wp-content/uploads/2025/09/mxdev-1.png) + +## Jsarus +Official Mx Valheim Mod. + +## Features +- Ore drop multiplier. (Value available in the generated config.) + +## How-To Install +1. Download the latest dll. +2. Copy it to your (Client/Server) "BepInEx­\plugins". +3. Run your (Client/Server) at least one time. +4. Tweaks the config in "BepInEx­\config\ovh.mxdev.mxvalheim.cfg" to your liking. +5. Enjoy! \ No newline at end of file