Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void DoClean()
- {
- //Set up the variables we use
- Farm farm = Game1.getFarm();
- farm.objects.TryGetValue(_config.ChestLocation, out SObject obj);
- Chest myChest;
- //Check to make sure the object isnt null, and that it is my chest.
- if (obj != null && obj is Chest c)
- myChest = c;
- else
- {
- //If it failed add a new chest.
- myChest = new Chest(true);
- farm.objects.Add(_config.ChestLocation, myChest);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement