Compare commits
No commits in common. "5ff0394dc36137417575e99b15924bfa9fc4fbf4" and "fc929db6589e68409efd364f8b6d988d07e3dc40" have entirely different histories.
5ff0394dc3
...
fc929db658
102
blocks.py
102
blocks.py
|
@ -28,6 +28,10 @@ EMERALD_BLOCK = 5407
|
|||
TEST_BLOCK = (616, 78, 496)
|
||||
|
||||
|
||||
WATER = [
|
||||
'water',
|
||||
]
|
||||
|
||||
AVOID = [
|
||||
'lava',
|
||||
'water',
|
||||
|
@ -259,37 +263,89 @@ INDEXED = [
|
|||
'barrel',
|
||||
] + BEDS
|
||||
|
||||
def get_set(ids):
|
||||
result = set()
|
||||
for block_name in ids:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
result.add(state['id'])
|
||||
return result
|
||||
|
||||
NON_SOLID_IDS = get_set(NON_SOLID)
|
||||
NON_SOLID_IDS.add(SINGLE_SNOW)
|
||||
NON_SOLID_IDS = set([SINGLE_SNOW])
|
||||
for block_name in NON_SOLID:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
NON_SOLID_IDS.add(state['id'])
|
||||
|
||||
AVOID_IDS = set()
|
||||
for block_name in AVOID:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
AVOID_IDS.add(state['id'])
|
||||
|
||||
WATER_IDS = set()
|
||||
for block_name in WATER:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
WATER_IDS.add(state['id'])
|
||||
|
||||
LOG_IDS = set()
|
||||
for block_name in LOGS:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
LOG_IDS.add(state['id'])
|
||||
|
||||
LEAF_IDS = set()
|
||||
for block_name in LEAVES:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
LEAF_IDS.add(state['id'])
|
||||
|
||||
CHEST_IDS = set()
|
||||
for block_name in ['chest']:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
CHEST_IDS.add(state['id'])
|
||||
|
||||
BARREL_IDS = set()
|
||||
for block_name in ['barrel']:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
BARREL_IDS.add(state['id'])
|
||||
|
||||
TRAPPED_CHEST_IDS = set()
|
||||
for block_name in ['trapped_chest']:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
TRAPPED_CHEST_IDS.add(state['id'])
|
||||
|
||||
NETHERWART_IDS = set()
|
||||
for block_name in ['nether_wart']:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
NETHERWART_IDS.add(state['id'])
|
||||
|
||||
WHEAT_IDS = set()
|
||||
for block_name in ['wheat']:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
WHEAT_IDS.add(state['id'])
|
||||
|
||||
POTATO_IDS = set()
|
||||
for block_name in ['potatoes']:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
POTATO_IDS.add(state['id'])
|
||||
|
||||
CARROT_IDS = set()
|
||||
for block_name in ['carrots']:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
CARROT_IDS.add(state['id'])
|
||||
|
||||
BEETROOT_IDS = set()
|
||||
for block_name in ['beetroots']:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
BEETROOT_IDS.add(state['id'])
|
||||
|
||||
SAPLING_IDS = set()
|
||||
for block_name in SAPLINGS:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
SAPLING_IDS.add(state['id'])
|
||||
|
||||
BED_IDS = set()
|
||||
for block_name in BEDS:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
BED_IDS.add(state['id'])
|
||||
|
||||
|
||||
AVOID_IDS = get_set(AVOID)
|
||||
WATER_IDS = get_set(['water'])
|
||||
LOG_IDS = get_set(LOGS)
|
||||
LEAF_IDS = get_set(LEAVES)
|
||||
CHEST_IDS = get_set(['chest'])
|
||||
BARREL_IDS = get_set(['barrel'])
|
||||
TRAPPED_CHEST_IDS = get_set(['trapped_chest'])
|
||||
NETHERWART_IDS = get_set(['nether_wart'])
|
||||
WHEAT_IDS = get_set(['wheat'])
|
||||
POTATO_IDS = get_set(['potatoes'])
|
||||
CARROT_IDS = get_set(['carrots'])
|
||||
BEETROOT_IDS = get_set(['beetroots'])
|
||||
SAPLING_IDS = get_set(SAPLINGS)
|
||||
BED_IDS = get_set(BEDS)
|
||||
|
||||
INDEXED_IDS = set()
|
||||
for block_name in INDEXED:
|
||||
for state in JSON_BLOCKS['minecraft:' + block_name]['states']:
|
||||
INDEXED_IDS.add(state['id'])
|
||||
|
||||
|
||||
MATURE_WHEAT_ID = max(WHEAT_IDS)
|
||||
MATURE_POTATO_ID = max(POTATO_IDS)
|
||||
MATURE_CARROT_ID = max(CARROT_IDS)
|
||||
|
|
4
bot.py
4
bot.py
|
@ -226,8 +226,8 @@ def init(global_state):
|
|||
|
||||
g.filling = False
|
||||
|
||||
g.minimum_cache_slots = 27
|
||||
g.maximum_supply_slots = 33
|
||||
g.minimum_cache_slots = 33
|
||||
g.maximum_supply_slots = 27
|
||||
|
||||
def bot(global_state):
|
||||
g = global_state
|
||||
|
|
39
items.py
39
items.py
|
@ -67,25 +67,34 @@ LOGS = [
|
|||
'dark_oak_log',
|
||||
]
|
||||
|
||||
BED_IDS = set()
|
||||
for item_name in BEDS:
|
||||
BED_IDS.add(ITEMS['minecraft:'+item_name]['protocol_id'])
|
||||
|
||||
def get_set(ids):
|
||||
result = set()
|
||||
for item_name in ids:
|
||||
result.add(ITEMS['minecraft:'+item_name]['protocol_id'])
|
||||
return result
|
||||
SHOVEL_IDS = set()
|
||||
for item_name in SHOVELS:
|
||||
SHOVEL_IDS.add(ITEMS['minecraft:'+item_name]['protocol_id'])
|
||||
|
||||
BED_IDS = get_set(BEDS)
|
||||
SHOVEL_IDS = get_set(SHOVELS)
|
||||
AXE_IDS = get_set(AXES)
|
||||
FOOD_IDS = get_set(FOOD)
|
||||
SAPLING_IDS = get_set(SAPLINGS)
|
||||
LOG_IDS = get_set(LOGS)
|
||||
AXE_IDS = set()
|
||||
for item_name in AXES:
|
||||
AXE_IDS.add(ITEMS['minecraft:'+item_name]['protocol_id'])
|
||||
|
||||
FOOD_IDS = set()
|
||||
for item_name in FOOD:
|
||||
FOOD_IDS.add(ITEMS['minecraft:'+item_name]['protocol_id'])
|
||||
|
||||
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:', '')
|
||||
|
||||
|
||||
def get_id(name):
|
||||
return ITEMS['minecraft:' + name]['protocol_id']
|
||||
|
||||
|
@ -106,16 +115,14 @@ BERRIES_ID = get_id('sweet_berries')
|
|||
IRON_INGOT_ID = get_id('iron_ingot')
|
||||
|
||||
|
||||
INIT_NEEDED_ITEMS = BED_IDS | FOOD_IDS
|
||||
INIT_NEEDED_ITEMS.add(CHEST_ID)
|
||||
|
||||
INIT_NEEDED_ITEMS = BED_IDS | FOOD_IDS | set([CHEST_ID])
|
||||
NEEDED_ITEMS = INIT_NEEDED_ITEMS
|
||||
|
||||
INIT_WANTED_ITEMS = set()
|
||||
WANTED_ITEMS = INIT_WANTED_ITEMS
|
||||
|
||||
def set_needed(items):
|
||||
NEEDED_ITEMS = INIT_NEEDED_ITEMS | items
|
||||
NEEDED_ITEMS = INIT_WANTED_ITEMS | items
|
||||
|
||||
def set_wanted(items):
|
||||
WANTED_ITEMS = INIT_WANTED_ITEMS | items
|
||||
|
|
10
jobs.py
10
jobs.py
|
@ -2298,11 +2298,11 @@ class JobStates:
|
|||
self.sleep_with_bed_states.silent = True
|
||||
self.cache_items_states.silent = True
|
||||
self.grab_supplies_states.supplies = {
|
||||
tuple([items.PUMPKIN_ID]): (64, 3),
|
||||
tuple([items.BERRIES_ID]): (64, 3),
|
||||
tuple([items.IRON_INGOT_ID]): (64, 3),
|
||||
tuple([items.WHEAT_ID]): (64, 3),
|
||||
tuple([items.POTATO_ID]): (64, 3),
|
||||
tuple([items.PUMPKIN_ID]): (64, 9),
|
||||
tuple([items.BERRIES_ID]): (64, 9),
|
||||
tuple([items.IRON_INGOT_ID]): (64, 9),
|
||||
tuple([items.WHEAT_ID]): (64, 9),
|
||||
tuple([items.POTATO_ID]): (64, 9),
|
||||
}
|
||||
|
||||
items.set_needed(set([
|
||||
|
|
Loading…
Reference in New Issue
Block a user