diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-10-06 21:41:32 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-10-29 11:28:07 -0400 |
commit | 773ebf54065c16ce4715e8e43ab04480010cc08a (patch) | |
tree | c7ea606cbdda158ca6cac6500d4f7d283809886f /src/SMAPI.Mods.ConsoleCommands | |
parent | be79a042060757b7cb48ccbcc29f395757049a8c (diff) | |
download | SMAPI-773ebf54065c16ce4715e8e43ab04480010cc08a.tar.gz SMAPI-773ebf54065c16ce4715e8e43ab04480010cc08a.tar.bz2 SMAPI-773ebf54065c16ce4715e8e43ab04480010cc08a.zip |
update for honey changes in SDV 1.4 (#638)
Diffstat (limited to 'src/SMAPI.Mods.ConsoleCommands')
-rw-r--r-- | src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs | 50 |
1 files changed, 8 insertions, 42 deletions
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs index 1dfb3129..4d9091b0 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs @@ -178,50 +178,16 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework // flower honey else if (item.Category == SObject.flowersCategory) { - // get honey type - SObject.HoneyType? type = null; - switch (item.ParentSheetIndex) - { - case 376: - type = SObject.HoneyType.Poppy; - break; - case 591: - type = SObject.HoneyType.Tulip; - break; - case 593: - type = SObject.HoneyType.SummerSpangle; - break; - case 595: - type = SObject.HoneyType.FairyRose; - break; - case 597: - type = SObject.HoneyType.BlueJazz; - break; - case 421: // sunflower standing in for all other flowers - type = SObject.HoneyType.Wild; - break; - } - - // yield honey - if (type != null) + yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 5 + id, () => { - yield return this.TryCreate(ItemType.Object, this.CustomIDOffset * 5 + id, () => + SObject honey = new SObject(Vector2.Zero, 340, $"{item.Name} Honey", false, true, false, false) { - SObject honey = new SObject(Vector2.Zero, 340, item.Name + " Honey", false, true, false, false) - { - Name = "Wild Honey" - }; - honey.honeyType.Value = type; - - if (type != SObject.HoneyType.Wild) - { - honey.Name = $"{item.Name} Honey"; - honey.Price += item.Price * 2; - } - - return honey; - }); - } + Name = $"{item.Name} Honey", + preservedParentSheetIndex = { item.ParentSheetIndex } + }; + honey.Price += item.Price * 2; + return honey; + }); } } } |