Consolidate bot runtime on Minecraft 26.3
This commit is contained in:
+20
-1
@@ -55,7 +55,7 @@ for module in [
|
||||
importlib.reload(module)
|
||||
|
||||
|
||||
class JobStates:
|
||||
class LegacyJobStates:
|
||||
def idle(self):
|
||||
return []
|
||||
|
||||
@@ -262,3 +262,22 @@ class JobStates:
|
||||
|
||||
def tick(self):
|
||||
self.run_machines(self.state())
|
||||
|
||||
|
||||
class JobStates(LegacyJobStates):
|
||||
"""26.3 job facade; crop gathering is the currently migrated job."""
|
||||
def __init__(self, global_state):
|
||||
self.g = global_state
|
||||
self.gather_crop_states = gather_crop.GatherCropStates(global_state)
|
||||
self.state = self.idle
|
||||
|
||||
def farm_crop(self):
|
||||
return [self.gather_crop_states]
|
||||
|
||||
def stop(self):
|
||||
if self.g.get('breaking'):
|
||||
self.g.game.cancel_break()
|
||||
self.g.path = []
|
||||
self.g.look_at = None
|
||||
self.gather_crop_states.state = self.gather_crop_states.idle
|
||||
self.state = self.idle
|
||||
|
||||
Reference in New Issue
Block a user