You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
2.1 KiB
99 lines
2.1 KiB
import json |
|
|
|
with open('minecraft_data/registries.json') as f: |
|
ITEMS = json.load(f)['minecraft:item']['entries'] |
|
|
|
BEDS = [ |
|
'white_bed', |
|
'orange_bed', |
|
'magenta_bed', |
|
'light_blue_bed', |
|
'yellow_bed', |
|
'lime_bed', |
|
'pink_bed', |
|
'gray_bed', |
|
'light_gray_bed', |
|
'cyan_bed', |
|
'purple_bed', |
|
'blue_bed', |
|
'brown_bed', |
|
'green_bed', |
|
'red_bed', |
|
'black_bed', |
|
] |
|
|
|
SHOVELS = [ |
|
'wooden_shovel', |
|
'stone_shovel', |
|
'golden_shovel', |
|
'iron_shovel', |
|
'diamond_shovel', |
|
'netherite_shovel', |
|
] |
|
|
|
AXES = [ |
|
'wooden_axe', |
|
'stone_axe', |
|
'golden_axe', |
|
'iron_axe', |
|
'diamond_axe', |
|
'netherite_axe', |
|
] |
|
|
|
SAPLINGS = [ |
|
'oak_sapling', |
|
'spruce_sapling', |
|
'birch_sapling', |
|
'jungle_sapling', |
|
'acacia_sapling', |
|
'dark_oak_sapling', |
|
] |
|
|
|
FOOD = [ |
|
'cooked_porkchop', |
|
'cooked_beef', |
|
'bread', |
|
'cooked_chicken', |
|
'cooked_cod', |
|
'cooked_salmon', |
|
] |
|
|
|
BED_IDS = set() |
|
for item_name in BEDS: |
|
BED_IDS.add(ITEMS['minecraft:'+item_name]['protocol_id']) |
|
|
|
SHOVEL_IDS = set() |
|
for item_name in SHOVELS: |
|
SHOVEL_IDS.add(ITEMS['minecraft:'+item_name]['protocol_id']) |
|
|
|
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']) |
|
|
|
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'] |
|
|
|
CHEST_ID = get_id('chest') |
|
GAPPLE_ID = get_id('enchanted_golden_apple') |
|
SAND_ID = get_id('sand') |
|
NETHERWART_ID = get_id('nether_wart') |
|
|
|
CARROT_ID = get_id('carrot') |
|
POTATO_ID = get_id('potato') |
|
WHEAT_SEEDS_ID = get_id('wheat_seeds') |
|
BEETROOT_SEEDS_ID = get_id('beetroot_seeds') |
|
|
|
NEEDED_ITEMS = BED_IDS | SHOVEL_IDS | AXE_IDS | FOOD_IDS | set([CHEST_ID]) |
|
WANTED_ITEMS = SAPLING_IDS | set([NETHERWART_ID, CARROT_ID, POTATO_ID, WHEAT_SEEDS_ID, BEETROOT_SEEDS_ID])
|
|
|