Support harvesting and caching red sand

This commit is contained in:
Tanner committed 2026-11-17 19:29:13 +00:00
1 parent 9918baefdc
commit ebf325f48b
7 files changed
+48 -31

No files matched your search

+3 -3
View File
@@ -807,7 +807,7 @@ class World:
state_id = self.block_at(*position)
if state_id is None:
return False, 'block is not loaded'
if state_id != blocks.SAND:
if state_id not in blocks.SAND_IDS:
name = blocks.BLOCKS.get(state_id, 'unknown block')
return False, 'block is {}, not sand'.format(name)
@@ -845,7 +845,7 @@ class World:
name = blocks.BLOCKS.get(adjacent, 'hazard block')
return False, 'unsafe adjacent {} at {}'.format(
name, adjacent_pos)
if adjacent == blocks.SAND:
if adjacent in blocks.SAND_IDS:
supported, reason = self._sand_has_immediate_support(
adjacent_pos)
if not supported:
@@ -856,7 +856,7 @@ class World:
def find_sand(self, center, distance, player):
sand = []
sand.extend(self.find_blocks(center, distance, [blocks.SAND], 25))
sand.extend(self.find_blocks(center, distance, blocks.SAND_IDS, 25))
safe_sand = [sand for sand in sand
if self.sand_safety(sand)[0]]