From 28ccbea718ff539b26e2ff6408f050448c68ff4e Mon Sep 17 00:00:00 2001 From: Bernardo Balvanera Date: Sun, 2 Nov 2025 14:22:07 -0600 Subject: [PATCH] Update game dependencies to 2025 patch and Nautilus --- DecorationsMod/DecorationItem.cs | 11 ++-------- DecorationsMod/DecorationsMod.csproj | 7 +------ DecorationsMod/Fixers/EquipmentFixer.cs | 5 +++-- DecorationsMod/Fixers/KnifeFixer.cs | 2 +- DecorationsMod/NewItems/BarBottle1.cs | 20 ++++++++++--------- DecorationsMod/NewItems/BarBottle2.cs | 18 +++++++++-------- DecorationsMod/NewItems/BarBottle3.cs | 18 +++++++++-------- DecorationsMod/NewItems/BarBottle4.cs | 18 +++++++++-------- DecorationsMod/NewItems/BarBottle5.cs | 18 +++++++++-------- .../NewItems/DecorationsSpecimenAnalyzer.cs | 12 +++++------ 10 files changed, 64 insertions(+), 65 deletions(-) diff --git a/DecorationsMod/DecorationItem.cs b/DecorationsMod/DecorationItem.cs index 880f2cb..6b9605a 100644 --- a/DecorationsMod/DecorationItem.cs +++ b/DecorationsMod/DecorationItem.cs @@ -1,6 +1,4 @@ using UnityEngine; -using System.Collections; -using System; #if SUBNAUTICA_NAUTILUS using Nautilus.Assets; @@ -35,13 +33,8 @@ public abstract class DecorationItem : SMLHelper.V2.Assets.ModPrefab, IDecoratio public DecorationItem(string classID, string name, string desc, string icon) : this( PrefabInfo.WithTechType(classID, name, desc, unlockAtStart: true) .WithFileName(DefaultResourcePath + classID) - .WithIcon(AssetsHelper.Assets.LoadAsset(icon))) { } - - [SetsRequiredMembers] - public DecorationItem(string classID, string name, string desc, Atlas.Sprite icon) : this( - PrefabInfo.WithTechType(classID, name, desc, unlockAtStart: true) - .WithFileName(DefaultResourcePath + classID) - .WithIcon(icon)) { } + .WithIcon(AssetsHelper.Assets.LoadAsset(icon))) + { } [SetsRequiredMembers] public DecorationItem(string classID, string name, string desc, Sprite icon) : this( diff --git a/DecorationsMod/DecorationsMod.csproj b/DecorationsMod/DecorationsMod.csproj index 7af1434..6bd5577 100644 --- a/DecorationsMod/DecorationsMod.csproj +++ b/DecorationsMod/DecorationsMod.csproj @@ -98,11 +98,6 @@ configurator.ico - - - $(SubnauticaDir)\BepInEx\plugins\Modding Helper\SMLHelper.dll - - @@ -342,7 +337,7 @@ - + diff --git a/DecorationsMod/Fixers/EquipmentFixer.cs b/DecorationsMod/Fixers/EquipmentFixer.cs index 991050e..fabad88 100644 --- a/DecorationsMod/Fixers/EquipmentFixer.cs +++ b/DecorationsMod/Fixers/EquipmentFixer.cs @@ -9,7 +9,7 @@ public static bool AllowedToAdd_Prefix(Equipment __instance, ref bool __result, if (slotType == EquipmentType.BatteryCharger && ModdedBatteriesFixer.BatteriesTechTypes().Contains(objTechType)) { #if SUBNAUTICA - EquipmentType eType = CraftData.GetEquipmentType(objTechType); + EquipmentType eType = TechData.GetEquipmentType(objTechType); #else EquipmentType eType = TechData.GetEquipmentType(objTechType); #endif @@ -26,7 +26,7 @@ public static bool AllowedToAdd_Prefix(Equipment __instance, ref bool __result, else if (slotType == EquipmentType.PowerCellCharger && ModdedBatteriesFixer.PowercellsTechTypes().Contains(objTechType)) { #if SUBNAUTICA - EquipmentType eType = CraftData.GetEquipmentType(objTechType); + EquipmentType eType = TechData.GetEquipmentType(objTechType); #else EquipmentType eType = TechData.GetEquipmentType(objTechType); #endif @@ -39,6 +39,7 @@ public static bool AllowedToAdd_Prefix(Equipment __instance, ref bool __result, return false; } } + return true; } } diff --git a/DecorationsMod/Fixers/KnifeFixer.cs b/DecorationsMod/Fixers/KnifeFixer.cs index e331aaf..5e14c80 100644 --- a/DecorationsMod/Fixers/KnifeFixer.cs +++ b/DecorationsMod/Fixers/KnifeFixer.cs @@ -16,7 +16,7 @@ public static void GiveResourceOnDamage_Postfix(GameObject target, bool isAlive, Logger.Debug("DEBUG: Entering custom purple pinecone event. techType=[" + (int)techType + "][" + techType.AsString(false) + "] purplePineConeTechType=[" + (int)purplePineConeTechType + "][" + purplePineConeTechType.AsString(false) + "]"); #endif #if SUBNAUTICA - HarvestType harvestTypeFromTech = CraftData.GetHarvestTypeFromTech(techType); + HarvestType harvestTypeFromTech = TechData.GetHarvestType(techType); #else HarvestType harvestTypeFromTech = TechData.GetHarvestType(techType); #endif diff --git a/DecorationsMod/NewItems/BarBottle1.cs b/DecorationsMod/NewItems/BarBottle1.cs index 4d84ca3..1f3597f 100644 --- a/DecorationsMod/NewItems/BarBottle1.cs +++ b/DecorationsMod/NewItems/BarBottle1.cs @@ -1,8 +1,8 @@ -using DecorationsMod.Controllers; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using DecorationsMod.Controllers; +using Nautilus.Handlers; using UnityEngine; -using static CraftData; namespace DecorationsMod.NewItems { @@ -51,7 +51,7 @@ public override void RegisterItem() // Scale model model.transform.localScale *= 22f; - + // Set tech tag var techTag = _barBottle1.AddComponent(); techTag.type = this.TechType; @@ -123,22 +123,24 @@ public override void RegisterItem() eatable.despawns = false; eatable.kDecayRate = 0.0f; eatable.despawnDelay = 0.0f; - CraftData.useEatSound[this.TechType] = "event:/player/drink"; + + // Set eating sound + CraftDataHandler.SetEatingSound(this.TechType, "event:/player/drink"); // Associate recipe to the new TechType - Nautilus.Handlers.CraftDataHandler.SetRecipeData(this.TechType, this.Recipe); + CraftDataHandler.SetRecipeData(this.TechType, this.Recipe); // Add the new TechType to Hand Equipment type. - Nautilus.Handlers.CraftDataHandler.SetEquipmentType(this.TechType, EquipmentType.Hand); + CraftDataHandler.SetEquipmentType(this.TechType, EquipmentType.Hand); // Set quick slot type. - Nautilus.Handlers.CraftDataHandler.SetQuickSlotType(this.TechType, QuickSlotType.Selectable); + CraftDataHandler.SetQuickSlotType(this.TechType, QuickSlotType.Selectable); // Set the buildable prefab this.Register(); // Set the custom sprite - Nautilus.Handlers.SpriteHandler.RegisterSprite(this.TechType, AssetsHelper.Assets.LoadAsset("barbottle01icon")); + SpriteHandler.RegisterSprite(this.TechType, AssetsHelper.Assets.LoadAsset("barbottle01icon")); this.IsRegistered = true; } diff --git a/DecorationsMod/NewItems/BarBottle2.cs b/DecorationsMod/NewItems/BarBottle2.cs index c202a86..036656a 100644 --- a/DecorationsMod/NewItems/BarBottle2.cs +++ b/DecorationsMod/NewItems/BarBottle2.cs @@ -1,8 +1,8 @@ -using DecorationsMod.Controllers; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using DecorationsMod.Controllers; +using Nautilus.Handlers; using UnityEngine; -using static CraftData; namespace DecorationsMod.NewItems { @@ -123,22 +123,24 @@ public override void RegisterItem() eatable.despawns = false; eatable.kDecayRate = 0.0f; eatable.despawnDelay = 0.0f; - CraftData.useEatSound[this.TechType] = "event:/player/drink"; + + // Set eating sound + CraftDataHandler.SetEatingSound(this.TechType, "event:/player/drink"); // Associate recipe to the new TechType - Nautilus.Handlers.CraftDataHandler.SetRecipeData(this.TechType, this.Recipe); + CraftDataHandler.SetRecipeData(this.TechType, this.Recipe); // Add the new TechType to Hand Equipment type. - Nautilus.Handlers.CraftDataHandler.SetEquipmentType(this.TechType, EquipmentType.Hand); + CraftDataHandler.SetEquipmentType(this.TechType, EquipmentType.Hand); // Set quick slot type. - Nautilus.Handlers.CraftDataHandler.SetQuickSlotType(this.TechType, QuickSlotType.Selectable); + CraftDataHandler.SetQuickSlotType(this.TechType, QuickSlotType.Selectable); // Set the buildable prefab this.Register(); // Set the custom sprite - Nautilus.Handlers.SpriteHandler.RegisterSprite(this.TechType, AssetsHelper.Assets.LoadAsset("barbottle02icon")); + SpriteHandler.RegisterSprite(this.TechType, AssetsHelper.Assets.LoadAsset("barbottle02icon")); this.IsRegistered = true; } diff --git a/DecorationsMod/NewItems/BarBottle3.cs b/DecorationsMod/NewItems/BarBottle3.cs index 7b13268..2f6a804 100644 --- a/DecorationsMod/NewItems/BarBottle3.cs +++ b/DecorationsMod/NewItems/BarBottle3.cs @@ -1,8 +1,8 @@ -using DecorationsMod.Controllers; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using DecorationsMod.Controllers; +using Nautilus.Handlers; using UnityEngine; -using static CraftData; namespace DecorationsMod.NewItems { @@ -123,22 +123,24 @@ public override void RegisterItem() eatable.despawns = false; eatable.kDecayRate = 0.0f; eatable.despawnDelay = 0.0f; - CraftData.useEatSound[this.TechType] = "event:/player/drink"; + + // Set eating sound + CraftDataHandler.SetEatingSound(this.TechType, "event:/player/drink"); // Associate recipe to the new TechType - Nautilus.Handlers.CraftDataHandler.SetRecipeData(this.TechType, this.Recipe); + CraftDataHandler.SetRecipeData(this.TechType, this.Recipe); // Add the new TechType to Hand Equipment type. - Nautilus.Handlers.CraftDataHandler.SetEquipmentType(this.TechType, EquipmentType.Hand); + CraftDataHandler.SetEquipmentType(this.TechType, EquipmentType.Hand); // Set quick slot type. - Nautilus.Handlers.CraftDataHandler.SetQuickSlotType(this.TechType, QuickSlotType.Selectable); + CraftDataHandler.SetQuickSlotType(this.TechType, QuickSlotType.Selectable); // Set the buildable prefab this.Register(); // Set the custom sprite - Nautilus.Handlers.SpriteHandler.RegisterSprite(this.TechType, AssetsHelper.Assets.LoadAsset("barbottle03icon")); + SpriteHandler.RegisterSprite(this.TechType, AssetsHelper.Assets.LoadAsset("barbottle03icon")); this.IsRegistered = true; } diff --git a/DecorationsMod/NewItems/BarBottle4.cs b/DecorationsMod/NewItems/BarBottle4.cs index dbc5b03..0015cd8 100644 --- a/DecorationsMod/NewItems/BarBottle4.cs +++ b/DecorationsMod/NewItems/BarBottle4.cs @@ -1,8 +1,8 @@ -using DecorationsMod.Controllers; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using DecorationsMod.Controllers; +using Nautilus.Handlers; using UnityEngine; -using static CraftData; namespace DecorationsMod.NewItems { @@ -123,22 +123,24 @@ public override void RegisterItem() eatable.despawns = false; eatable.kDecayRate = 0.0f; eatable.despawnDelay = 0.0f; - CraftData.useEatSound[this.TechType] = "event:/player/drink"; + + // Set eating sound + CraftDataHandler.SetEatingSound(this.TechType, "event:/player/drink"); // Associate recipe to the new TechType - Nautilus.Handlers.CraftDataHandler.SetRecipeData(this.TechType, this.Recipe); + CraftDataHandler.SetRecipeData(this.TechType, this.Recipe); // Add the new TechType to Hand Equipment type. - Nautilus.Handlers.CraftDataHandler.SetEquipmentType(this.TechType, EquipmentType.Hand); + CraftDataHandler.SetEquipmentType(this.TechType, EquipmentType.Hand); // Set quick slot type. - Nautilus.Handlers.CraftDataHandler.SetQuickSlotType(this.TechType, QuickSlotType.Selectable); + CraftDataHandler.SetQuickSlotType(this.TechType, QuickSlotType.Selectable); // Set the buildable prefab this.Register(); // Set the custom sprite - Nautilus.Handlers.SpriteHandler.RegisterSprite(this.TechType, AssetsHelper.Assets.LoadAsset("barbottle04icon")); + SpriteHandler.RegisterSprite(this.TechType, AssetsHelper.Assets.LoadAsset("barbottle04icon")); this.IsRegistered = true; } diff --git a/DecorationsMod/NewItems/BarBottle5.cs b/DecorationsMod/NewItems/BarBottle5.cs index 98f942c..7550cdc 100644 --- a/DecorationsMod/NewItems/BarBottle5.cs +++ b/DecorationsMod/NewItems/BarBottle5.cs @@ -1,8 +1,8 @@ -using DecorationsMod.Controllers; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using DecorationsMod.Controllers; +using Nautilus.Handlers; using UnityEngine; -using static CraftData; namespace DecorationsMod.NewItems { @@ -123,22 +123,24 @@ public override void RegisterItem() eatable.despawns = false; eatable.kDecayRate = 0.0f; eatable.despawnDelay = 0.0f; - CraftData.useEatSound[this.TechType] = "event:/player/drink"; + + // Set eating sound + CraftDataHandler.SetEatingSound(this.TechType, "event:/player/drink"); // Associate recipe to the new TechType - Nautilus.Handlers.CraftDataHandler.SetRecipeData(this.TechType, this.Recipe); + CraftDataHandler.SetRecipeData(this.TechType, this.Recipe); // Add the new TechType to Hand Equipment type. - Nautilus.Handlers.CraftDataHandler.SetEquipmentType(this.TechType, EquipmentType.Hand); + CraftDataHandler.SetEquipmentType(this.TechType, EquipmentType.Hand); // Set quick slot type. - Nautilus.Handlers.CraftDataHandler.SetQuickSlotType(this.TechType, QuickSlotType.Selectable); + CraftDataHandler.SetQuickSlotType(this.TechType, QuickSlotType.Selectable); // Set the buildable prefab this.Register(); // Set the custom sprite - Nautilus.Handlers.SpriteHandler.RegisterSprite(this.TechType, AssetsHelper.Assets.LoadAsset("barbottle05icon")); + SpriteHandler.RegisterSprite(this.TechType, AssetsHelper.Assets.LoadAsset("barbottle05icon")); this.IsRegistered = true; } diff --git a/DecorationsMod/NewItems/DecorationsSpecimenAnalyzer.cs b/DecorationsMod/NewItems/DecorationsSpecimenAnalyzer.cs index 352c44d..282b195 100644 --- a/DecorationsMod/NewItems/DecorationsSpecimenAnalyzer.cs +++ b/DecorationsMod/NewItems/DecorationsSpecimenAnalyzer.cs @@ -1,9 +1,8 @@ -using DecorationsMod.Controllers; -using DecorationsMod.Fixers; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using DecorationsMod.Controllers; +using DecorationsMod.Fixers; using UnityEngine; -using static CraftData; namespace DecorationsMod.NewItems { @@ -76,7 +75,7 @@ public override void RegisterItem() // Set the custom icon Nautilus.Handlers.SpriteHandler.RegisterSprite(this.TechType, AssetsHelper.Assets.LoadAsset("specimenanalyzer")); - + this.IsRegistered = true; } } @@ -122,7 +121,7 @@ public override GameObject GetGameObject() // Remove "Constructable" possibility Constructable construct = prefab.GetComponent(); GameObject.DestroyImmediate(construct); - + // Disable colliders to prevent physics bug in Cyclops, and add a small one so we can // pick the Specimen Analyzer. Collider[] colliders = prefab.GetComponentsInChildren(); @@ -130,6 +129,7 @@ public override GameObject GetGameObject() { coll.enabled = false; } + SphereCollider newCollider = prefab.AddComponent(); newCollider.radius = 0.9f;