diff --git a/BetterJunimos/BetterJunimos.sln b/BetterJunimos/BetterJunimos.sln index 2e2b10e..f3a5659 100644 --- a/BetterJunimos/BetterJunimos.sln +++ b/BetterJunimos/BetterJunimos.sln @@ -3,8 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BetterJunimos", "BetterJunimos.csproj", "{0F382ADA-3DBB-4309-A020-8CF5326E8709}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BetterJunimosForestry", "BetterJunimosForestry\BetterJunimosForestry.csproj", "{754179AA-634E-473C-A40A-B1B59B5ADA2D}" -EndProject + Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/BetterJunimos/Patches/JunimoHarvesterPatches.cs b/BetterJunimos/Patches/JunimoHarvesterPatches.cs index df3a071..c2ef2a9 100644 --- a/BetterJunimos/Patches/JunimoHarvesterPatches.cs +++ b/BetterJunimos/Patches/JunimoHarvesterPatches.cs @@ -48,11 +48,11 @@ public static bool Prefix(JunimoHarvester __instance, ref int ___harvestTimer, r int time; var junimoAbility = Util.Abilities.IdentifyJunimoAbility(__instance.currentLocation, pos, id); - if (__instance.currentLocation.IsGreenhouse) - { - BetterJunimos.SMonitor.Log($"PatchTryToHarvestHere , Is greenhouse but {__instance.controller.pathToEndPoint != null} | {junimoAbility}", LogLevel.Debug); + // if (__instance.currentLocation.IsGreenhouse) + // { + // BetterJunimos.SMonitor.Log($"PatchTryToHarvestHere , Is greenhouse but {__instance.controller.pathToEndPoint != null} | {junimoAbility}", LogLevel.Debug); - } + // } if (junimoAbility != null) { // if (__instance.currentLocation.IsGreenhouse) { // BetterJunimos.SMonitor.Log( diff --git a/BetterJunimos/Patches/JunimoHutPatches.cs b/BetterJunimos/Patches/JunimoHutPatches.cs index 4a99d35..2eec1e8 100644 --- a/BetterJunimos/Patches/JunimoHutPatches.cs +++ b/BetterJunimos/Patches/JunimoHutPatches.cs @@ -50,6 +50,7 @@ private static bool SearchAroundHut(JunimoHut hut) { var gh = Game1.getLocationFromName("Greenhouse"); if (ghb != null) { + BetterJunimos.SMonitor.Log($"SearchAroundHut: Greenhouse find on location {hut.GetParentLocation().NameOrUniqueName}", LogLevel.Debug); gh = ghb.GetIndoors(); } diff --git a/BetterJunimos/Utils/JunimoGreenhouse.cs b/BetterJunimos/Utils/JunimoGreenhouse.cs index 12cbfe8..b457d4b 100644 --- a/BetterJunimos/Utils/JunimoGreenhouse.cs +++ b/BetterJunimos/Utils/JunimoGreenhouse.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Threading; using Microsoft.Xna.Framework; using StardewModdingAPI; using StardewValley; @@ -25,6 +26,20 @@ public bool HutHasGreenhouse(Guid id) { internal static GreenhouseBuilding GreenhouseBuildingAtPos(GameLocation location, Vector2 tile) { if (!location.IsBuildableLocation()) return null; foreach (var building in location.buildings) { + if (building.HasIndoors() && (building.GetIndoors()?.IsGreenhouse ?? false)) + { + if (building is not GreenhouseBuilding) + { + var ghb = building as GreenhouseBuilding; + if (ghb != null) + { + if (ghb.occupiesTile(tile)) { + return ghb; + } + } + BetterJunimos.SMonitor.Log($"{building.GetIndoors()?.NameOrUniqueName} {(building as GreenhouseBuilding)?.parentLocationName}", LogLevel.Debug); + } + } if (building is not GreenhouseBuilding greenhouseBuilding) continue; if (greenhouseBuilding.occupiesTile(tile)) { return greenhouseBuilding;