/********* ** Private methods *********/ /// <summary>Get whether an object is a machine with 'fast processing' enabled.</summary> /// <param name="context">The cheat context.</param> /// <param name="obj">The machine to check.</param> private bool IsFastMachine(CheatContext context, SObject obj) { // quick initial check bool mayBeMachine = obj != null && (obj.bigCraftable.Value || obj is CrabPot); if (!mayBeMachine) { return(false); } // specific check ModConfig config = context.Config; return(obj switch { Cask _ => config.FastCask, CrabPot _ => config.FastCrabPot, WoodChipper _ => config.FastWoodChipper, _ => obj.name switch { "Bee House" => config.FastBeeHouse, "Bone Mill" => config.FastBoneMill, "Charcoal Kiln" => config.FastCharcoalKiln, "Cheese Press" => config.FastCheesePress, "Coffee Maker" => config.FastCoffeeMaker, "Crystalarium" => config.FastCrystalarium, "Deconstructor" => config.FastDeconstructor, "Furnace" => config.FastFurnace, "Geode Crusher" => config.FastGeodeCrusher, "Heavy Tapper" => config.FastTapper, "Incubator" => config.FastIncubator, "Keg" => config.FastKeg, "Lightning Rod" => config.FastLightningRod, "Loom" => config.FastLoom, "Mayonnaise Machine" => config.FastMayonnaiseMachine, "Mushroom Box" => config.FastMushroomBox, "Oil Maker" => config.FastOilMaker, "Ostrich Incubator" => config.FastOstrichIncubator, "Preserves Jar" => config.FastPreservesJar, "Recycling Machine" => config.FastRecyclingMachine, "Seed Maker" => config.FastSeedMaker, "Slime Egg-Press" => config.FastSlimeEggPress, "Slime Incubator" => config.FastSlimeIncubator, "Soda Machine" => config.FastSodaMachine, "Solar Panel" => config.FastSolarPanel, "Statue Of Endless Fortune" => config.FastStatueOfEndlessFortune, "Statue Of Perfection" => config.FastStatueOfPerfection, "Statue Of True Perfection" => config.FastStatueOfTruePerfection, "Tapper" => config.FastTapper, "Worm Bin" => config.FastWormBin, _ => false } });
private static Color WoodChipperNeedsInputColor(WoodChipper obj) => ModEntry.Config.VanillaMachines[VanillaMachinesEnum.WoodChipper] && obj.heldObject.Value is null ? ModEntry.Config.EmptyColor : Color.White;
public static void WoodChipper_Postfix(WoodChipper __instance, Item __result) { Postfix(__instance as SObject, __result); }
public static void WoodChipper_Postfix(WoodChipper __instance, Item dropped_in_item, bool probe, Farmer who, ref bool __result) { Postfix(__instance as SObject, dropped_in_item, probe, who, ref __result); }
public static bool WoodChipper_Prefix(WoodChipper __instance, Item dropped_in_item, bool probe, Farmer who, ref bool __result) { return(Prefix(__instance as SObject, dropped_in_item, probe, who, ref __result)); }