Allow sleeping during thunderstorms
This commit is contained in:
1 parent
95e6d5e275
commit
36dfa312ad
2 files changed
+33
-3
No files matched your search
@@ -407,6 +407,32 @@ class TestSleepWithBed(unittest.TestCase):
|
||||
state.init()
|
||||
self.assertEqual(state.state, state.cleanup)
|
||||
|
||||
def test_daytime_thunderstorm_allows_sleep_attempt(self):
|
||||
state = SleepWithBedStates(Munch(
|
||||
time=1000, weather='thunderstorm', dimension='overworld'))
|
||||
|
||||
state.init()
|
||||
|
||||
self.assertEqual(state.state, state.find_beds)
|
||||
|
||||
def test_thunderstorm_allows_bed_use_during_daytime(self):
|
||||
bed_id = next(iter(blocks.BED_IDS))
|
||||
game = FakeGame()
|
||||
state = SleepWithBedStates(Munch(
|
||||
time=12400, weather='clear', dimension='overworld',
|
||||
world=FakeWorld(block=bed_id), game=game, path=[], look_at=None))
|
||||
state.init()
|
||||
state.area = (0, 64, 0)
|
||||
state.state = state.use_bed
|
||||
state.silent = True
|
||||
state.g.time = 1000
|
||||
state.g.weather = 'thunderstorm'
|
||||
|
||||
state.use_bed()
|
||||
|
||||
self.assertEqual(state.state, state.sleep_bed)
|
||||
self.assertEqual(len(game.placements), 1)
|
||||
|
||||
def test_placing_bed_uses_support_block_face_top(self):
|
||||
game = FakeGame()
|
||||
state = SleepWithBedStates(Munch(
|
||||
|
||||
Reference in new issue
Block a user