Cache after sleep near labeled chests

This commit is contained in:
Tanner
2026-11-08 17:08:12 +00:00
parent 930f4f3868
commit c79ee932a3
6 changed files with 166 additions and 10 deletions
+21
View File
@@ -52,6 +52,27 @@ class FakeGame:
class TestSleepWithBed(unittest.TestCase):
def test_confirmed_sleep_records_bed_for_following_cache_pass(self):
bed = (1, 64, 2)
g = Munch(world=FakeWorld(), path=[], look_at=None)
state = SleepWithBedStates(g)
state.area = bed
state.sleep_confirmed = True
state.cleanup()
self.assertEqual(g.post_sleep_cache_bed, bed)
def test_unconfirmed_sleep_does_not_trigger_post_sleep_cache(self):
g = Munch(world=FakeWorld(), path=[], look_at=None)
state = SleepWithBedStates(g)
state.area = (1, 64, 2)
state.sleep_confirmed = False
state.cleanup()
self.assertNotIn('post_sleep_cache_bed', g)
def test_bed_occupancy_only_logs_first_observation_and_changes(self):
bed_states = [
state for state in blocks.BED_IDS