Select a log to avoid using tools
This commit is contained in:
parent
3c3287a1d5
commit
f65967342a
13
items.py
13
items.py
|
@ -58,6 +58,15 @@ FOOD = [
|
|||
'cooked_salmon',
|
||||
]
|
||||
|
||||
LOGS = [
|
||||
'oak_log',
|
||||
'spruce_log',
|
||||
'birch_log',
|
||||
'jungle_log',
|
||||
'acacia_log',
|
||||
'dark_oak_log',
|
||||
]
|
||||
|
||||
BED_IDS = set()
|
||||
for item_name in BEDS:
|
||||
BED_IDS.add(ITEMS['minecraft:'+item_name]['protocol_id'])
|
||||
|
@ -78,6 +87,10 @@ SAPLING_IDS = set()
|
|||
for item_name in SAPLINGS:
|
||||
SAPLING_IDS.add(ITEMS['minecraft:'+item_name]['protocol_id'])
|
||||
|
||||
LOG_IDS = set()
|
||||
for item_name in LOGS:
|
||||
LOG_IDS.add(ITEMS['minecraft:'+item_name]['protocol_id'])
|
||||
|
||||
ITEM_NAMES = {}
|
||||
for item_name, item in ITEMS.items():
|
||||
ITEM_NAMES[ITEMS[item_name]['protocol_id']] = item_name.replace('minecraft:', '')
|
||||
|
|
9
jobs.py
9
jobs.py
|
@ -5,8 +5,6 @@ import random
|
|||
from itertools import count
|
||||
from math import hypot
|
||||
|
||||
from panda3d.core import LPoint3f
|
||||
|
||||
from minecraft.networking.types import BlockFace
|
||||
|
||||
from protocol.managers import ChunkNotLoadedException
|
||||
|
@ -1301,9 +1299,14 @@ class ClearLeavesStates:
|
|||
self.state = self.cleanup
|
||||
return
|
||||
|
||||
self.state = self.find_leaves
|
||||
self.state = self.select_log
|
||||
print('Clearing leaves...')
|
||||
|
||||
def select_log(self):
|
||||
# select a log to avoid using tools
|
||||
self.g.game.select_item(items.LOG_IDS)
|
||||
self.state = self.find_leaves
|
||||
|
||||
def find_leaves(self):
|
||||
w = self.g.world
|
||||
p = utils.pint(self.g.pos)
|
||||
|
|
Loading…
Reference in New Issue
Block a user