// Registers the plant slot for this item based on the slot buffer private void RegisterSlot() { if (!PLANT_SLOT_BUFFER.ContainsKey(PlantID)) { PLANT_SLOT_BUFFER.Add(PlantID, new GardenCatcher.PlantSlot() { id = PlantID, deluxePlantedPrefab = null, plantedPrefab = null }); } if (PLANT_SLOT_BUFFER[PlantID].plantedPrefab == null && !IsDeluxe) { PLANT_SLOT_BUFFER[PlantID].plantedPrefab = Prefab; } if (PLANT_SLOT_BUFFER[PlantID].deluxePlantedPrefab == null && IsDeluxe) { PLANT_SLOT_BUFFER[PlantID].deluxePlantedPrefab = Prefab; } if (PLANT_SLOT_BUFFER[PlantID].plantedPrefab != null && PLANT_SLOT_BUFFER[PlantID].deluxePlantedPrefab != null) { PlantSlotRegistry.RegisterPlantSlot(PLANT_SLOT_BUFFER[PlantID]); PLANT_SLOT_BUFFER.Remove(PlantID); } }
public static void Prefix(GardenCatcher __instance) { PlantSlotRegistry.Patch(__instance); }