Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minecraft updates #29

Merged
merged 29 commits into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bc2ea29
Implement excluded locations
espeon65536 Jul 14, 2021
f2fe516
Update Minecraft to use exclusion_rules for its exclusion pools
espeon65536 Jul 14, 2021
a0d9809
Flag the enchanted books as advancement so they don't go on excluded …
espeon65536 Jul 14, 2021
9295d12
update playerSettings for exclusion
espeon65536 Jul 14, 2021
56dc442
new items: 32 Arrows, Saddle, structure compasses for overworld struc…
espeon65536 Jul 15, 2021
476a6d4
move structure linking to create_regions instead of generate_basic
espeon65536 Jul 15, 2021
c276eb9
Merge branch 'main' of https://github.com/ArchipelagoMW/Archipelago i…
espeon65536 Jul 15, 2021
0717dbc
Update Minecraft to use LogicMixin
espeon65536 Jul 15, 2021
060d6c8
add separate can_exclude property, so non-progression items can be ma…
espeon65536 Jul 15, 2021
cf69ee9
separate fill step for nonadvancement nonexcluded items
espeon65536 Jul 15, 2021
38f0bf2
Merge branch 'minecraft' into main
espeon65536 Jul 16, 2021
2a67dcf
made Saddle not a progression item, but also nonexcluded
espeon65536 Jul 16, 2021
8912ce8
fix missing player arg
espeon65536 Jul 16, 2021
1706e34
remove higher xp amounts from pool, leaving only 50 XP
espeon65536 Jul 16, 2021
774f77a
fix new Minecraft item IDs
espeon65536 Jul 16, 2021
36b513f
Merge branch 'main' of https://github.com/ArchipelagoMW/Archipelago i…
espeon65536 Jul 17, 2021
75d28df
added shulker box item for starting inventory
espeon65536 Jul 20, 2021
dbabadb
increment client and data version
espeon65536 Jul 20, 2021
2c87986
Merge branch 'main' of https://github.com/ArchipelagoMW/Archipelago i…
espeon65536 Jul 20, 2021
7ed4fe4
change client_version to int instead of tuple
espeon65536 Jul 20, 2021
9611a3f
Merge branch 'main' of https://github.com/ArchipelagoMW/Archipelago i…
espeon65536 Jul 21, 2021
85be7ae
make saddle a progression item
espeon65536 Jul 21, 2021
fba201d
Merge branch 'main' of https://github.com/ArchipelagoMW/Archipelago i…
espeon65536 Jul 22, 2021
1f0ce2d
added structure compass option and appropriate logic for all compasses
espeon65536 Jul 22, 2021
942b6bd
Update playerSettings.yaml with MC options
espeon65536 Jul 22, 2021
f561f0b
Merge branch 'main' of https://github.com/ArchipelagoMW/Archipelago i…
espeon65536 Jul 22, 2021
955ee04
update minecraft tests
espeon65536 Jul 23, 2021
c89d630
update exclusion procedure for clarity
espeon65536 Jul 23, 2021
d7fbcda
Merge branch 'main' of https://github.com/ArchipelagoMW/Archipelago i…
espeon65536 Jul 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 0 additions & 85 deletions BaseClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,91 +741,6 @@ def can_get_glitched_speed_dw(self, player: int):
def can_bomb_clip(self, region: Region, player: int) -> bool:
return self.is_not_bunny(region, player) and self.has('Pegasus Boots', player)

# Minecraft logic functions
def has_iron_ingots(self, player: int):
return self.has('Progressive Tools', player) and self.has('Ingot Crafting', player)

def has_gold_ingots(self, player: int):
return self.has('Ingot Crafting', player) and (self.has('Progressive Tools', player, 2) or self.can_reach('The Nether', 'Region', player))

def has_diamond_pickaxe(self, player: int):
return self.has('Progressive Tools', player, 3) and self.has_iron_ingots(player)

def craft_crossbow(self, player: int):
return self.has('Archery', player) and self.has_iron_ingots(player)

def has_bottle_mc(self, player: int):
return self.has('Bottles', player) and self.has('Ingot Crafting', player)

def can_enchant(self, player: int):
return self.has('Enchanting', player) and self.has_diamond_pickaxe(player) # mine obsidian and lapis

def can_use_anvil(self, player: int):
return self.has('Enchanting', player) and self.has('Resource Blocks', player) and self.has_iron_ingots(player)

def fortress_loot(self, player: int): # saddles, blaze rods, wither skulls
return self.can_reach('Nether Fortress', 'Region', player) and self.basic_combat(player)

def can_brew_potions(self, player: int):
return self.fortress_loot(player) and self.has('Brewing', player) and self.has_bottle_mc(player)

def can_piglin_trade(self, player: int):
return self.has_gold_ingots(player) and (self.can_reach('The Nether', 'Region', player) or self.can_reach('Bastion Remnant', 'Region', player))

def enter_stronghold(self, player: int):
return self.fortress_loot(player) and self.has('Brewing', player) and self.has('3 Ender Pearls', player)

# Difficulty-dependent functions
def combat_difficulty(self, player: int):
return self.world.combat_difficulty[player].get_option_name()

def can_adventure(self, player: int):
if self.combat_difficulty(player) == 'easy':
return self.has('Progressive Weapons', player, 2) and self.has_iron_ingots(player)
elif self.combat_difficulty(player) == 'hard':
return True
return self.has('Progressive Weapons', player) and (self.has('Ingot Crafting', player) or self.has('Campfire', player))

def basic_combat(self, player: int):
if self.combat_difficulty(player) == 'easy':
return self.has('Progressive Weapons', player, 2) and self.has('Progressive Armor', player) and \
self.has('Shield', player) and self.has_iron_ingots(player)
elif self.combat_difficulty(player) == 'hard':
return True
return self.has('Progressive Weapons', player) and (self.has('Progressive Armor', player) or self.has('Shield', player)) and self.has_iron_ingots(player)

def complete_raid(self, player: int):
reach_regions = self.can_reach('Village', 'Region', player) and self.can_reach('Pillager Outpost', 'Region', player)
if self.combat_difficulty(player) == 'easy':
return reach_regions and \
self.has('Progressive Weapons', player, 3) and self.has('Progressive Armor', player, 2) and \
self.has('Shield', player) and self.has('Archery', player) and \
self.has('Progressive Tools', player, 2) and self.has_iron_ingots(player)
elif self.combat_difficulty(player) == 'hard': # might be too hard?
return reach_regions and self.has('Progressive Weapons', player, 2) and self.has_iron_ingots(player) and \
(self.has('Progressive Armor', player) or self.has('Shield', player))
return reach_regions and self.has('Progressive Weapons', player, 2) and self.has_iron_ingots(player) and \
self.has('Progressive Armor', player) and self.has('Shield', player)

def can_kill_wither(self, player: int):
normal_kill = self.has("Progressive Weapons", player, 3) and self.has("Progressive Armor", player, 2) and self.can_brew_potions(player) and self.can_enchant(player)
if self.combat_difficulty(player) == 'easy':
return self.fortress_loot(player) and normal_kill and self.has('Archery', player)
elif self.combat_difficulty(player) == 'hard': # cheese kill using bedrock ceilings
return self.fortress_loot(player) and (normal_kill or self.can_reach('The Nether', 'Region', player) or self.can_reach('The End', 'Region', player))
return self.fortress_loot(player) and normal_kill

def can_kill_ender_dragon(self, player: int):
# Since it is possible to kill the dragon without getting any of the advancements related to it, we need to require that it can be respawned.
respawn_dragon = self.can_reach('The Nether', 'Region', player) and self.has('Ingot Crafting', player)
if self.combat_difficulty(player) == 'easy':
return respawn_dragon and self.has("Progressive Weapons", player, 3) and self.has("Progressive Armor", player, 2) and \
self.has('Archery', player) and self.can_brew_potions(player) and self.can_enchant(player)
if self.combat_difficulty(player) == 'hard':
return respawn_dragon and ((self.has('Progressive Weapons', player, 2) and self.has('Progressive Armor', player)) or \
(self.has('Progressive Weapons', player, 1) and self.has('Bed', player)))
return respawn_dragon and self.has('Progressive Weapons', player, 2) and self.has('Progressive Armor', player) and self.has('Archery', player)

def collect(self, item: Item, event: bool = False, location: Location = None) -> bool:
if location:
self.locations_checked.add(location)
Expand Down
6 changes: 6 additions & 0 deletions playerSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ Minecraft:
shuffle_structures: # Enables shuffling of villages, outposts, fortresses, bastions, and end cities.
on: 0
off: 1
structure_compasses: # Adds structure compasses to the item pool, which point to the nearest indicated structure.
on: 0
off: 1
bee_traps: # Adds bee traps to the item pool, which spawn multiple angered bees around every player when received.
on: 0
off: 1
A Link to the Past:
### Logic Section ###
glitches_required: # Determine the logic required to complete the seed
Expand Down
20 changes: 11 additions & 9 deletions test/minecraft/TestAdvancements.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,12 @@ def test_42015(self):
["This Boat Has Legs", False, [], ['Progressive Weapons']],
["This Boat Has Legs", False, [], ['Progressive Armor', 'Shield']],
["This Boat Has Legs", False, [], ['Fishing Rod']],
["This Boat Has Legs", False, [], ['Saddle']],
["This Boat Has Legs", False, ['Progressive Tools', 'Progressive Tools'], ['Bucket', 'Progressive Tools']],
["This Boat Has Legs", True, ['Ingot Crafting', 'Progressive Tools', 'Progressive Weapons', 'Progressive Armor', 'Flint and Steel', 'Bucket', 'Fishing Rod']],
["This Boat Has Legs", True, ['Ingot Crafting', 'Progressive Tools', 'Progressive Weapons', 'Progressive Armor', 'Flint and Steel', 'Progressive Tools', 'Progressive Tools', 'Fishing Rod']],
["This Boat Has Legs", True, ['Ingot Crafting', 'Progressive Tools', 'Progressive Weapons', 'Shield', 'Flint and Steel', 'Bucket', 'Fishing Rod']],
["This Boat Has Legs", True, ['Ingot Crafting', 'Progressive Tools', 'Progressive Weapons', 'Shield', 'Flint and Steel', 'Progressive Tools', 'Progressive Tools', 'Fishing Rod']],
["This Boat Has Legs", True, ['Saddle', 'Ingot Crafting', 'Progressive Tools', 'Progressive Weapons', 'Progressive Armor', 'Flint and Steel', 'Bucket', 'Fishing Rod']],
["This Boat Has Legs", True, ['Saddle', 'Ingot Crafting', 'Progressive Tools', 'Progressive Weapons', 'Progressive Armor', 'Flint and Steel', 'Progressive Tools', 'Progressive Tools', 'Fishing Rod']],
["This Boat Has Legs", True, ['Saddle', 'Ingot Crafting', 'Progressive Tools', 'Progressive Weapons', 'Shield', 'Flint and Steel', 'Bucket', 'Fishing Rod']],
["This Boat Has Legs", True, ['Saddle', 'Ingot Crafting', 'Progressive Tools', 'Progressive Weapons', 'Shield', 'Flint and Steel', 'Progressive Tools', 'Progressive Tools', 'Fishing Rod']],
])

def test_42016(self):
Expand Down Expand Up @@ -1099,13 +1100,14 @@ def test_42088(self):
["When Pigs Fly", False, [], ['Progressive Weapons']],
["When Pigs Fly", False, [], ['Progressive Armor', 'Shield']],
["When Pigs Fly", False, [], ['Fishing Rod']],
["When Pigs Fly", False, [], ['Saddle']],
["When Pigs Fly", False, ['Progressive Weapons'], ['Flint and Steel', 'Progressive Weapons', 'Progressive Weapons']],
["When Pigs Fly", False, ['Progressive Tools', 'Progressive Tools', 'Progressive Weapons'], ['Bucket', 'Progressive Tools', 'Progressive Weapons', 'Progressive Weapons']],
["When Pigs Fly", True, ['Ingot Crafting', 'Progressive Tools', 'Flint and Steel', 'Bucket', 'Progressive Weapons', 'Progressive Armor', 'Fishing Rod']],
["When Pigs Fly", True, ['Ingot Crafting', 'Progressive Tools', 'Flint and Steel', 'Progressive Tools', 'Progressive Tools', 'Progressive Weapons', 'Progressive Armor', 'Fishing Rod']],
["When Pigs Fly", True, ['Ingot Crafting', 'Progressive Tools', 'Flint and Steel', 'Bucket', 'Progressive Weapons', 'Shield', 'Fishing Rod']],
["When Pigs Fly", True, ['Ingot Crafting', 'Progressive Tools', 'Flint and Steel', 'Progressive Tools', 'Progressive Tools', 'Progressive Weapons', 'Shield', 'Fishing Rod']],
["When Pigs Fly", True, ['Progressive Weapons', 'Progressive Weapons', 'Progressive Armor', 'Shield', 'Ingot Crafting', 'Progressive Tools', 'Fishing Rod']],
["When Pigs Fly", True, ['Saddle', 'Ingot Crafting', 'Progressive Tools', 'Flint and Steel', 'Bucket', 'Progressive Weapons', 'Progressive Armor', 'Fishing Rod']],
["When Pigs Fly", True, ['Saddle', 'Ingot Crafting', 'Progressive Tools', 'Flint and Steel', 'Progressive Tools', 'Progressive Tools', 'Progressive Weapons', 'Progressive Armor', 'Fishing Rod']],
["When Pigs Fly", True, ['Saddle', 'Ingot Crafting', 'Progressive Tools', 'Flint and Steel', 'Bucket', 'Progressive Weapons', 'Shield', 'Fishing Rod']],
["When Pigs Fly", True, ['Saddle', 'Ingot Crafting', 'Progressive Tools', 'Flint and Steel', 'Progressive Tools', 'Progressive Tools', 'Progressive Weapons', 'Shield', 'Fishing Rod']],
["When Pigs Fly", True, ['Saddle', 'Progressive Weapons', 'Progressive Weapons', 'Progressive Armor', 'Shield', 'Ingot Crafting', 'Progressive Tools', 'Fishing Rod']],
])

def test_42089(self):
Expand Down
1 change: 1 addition & 0 deletions test/minecraft/TestMinecraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def setUp(self):
setattr(self.world, "shuffle_structures", {1: Toggle(False)})
setattr(self.world, "combat_difficulty", {1: CombatDifficulty(1)}) # normal
setattr(self.world, "bee_traps", {1: Toggle(False)})
setattr(self.world, "structure_compasses", {1: Toggle(False)})
AutoWorld.call_single(self.world, "create_regions", 1)
AutoWorld.call_single(self.world, "generate_basic", 1)
AutoWorld.call_single(self.world, "set_rules", 1)
Expand Down
23 changes: 19 additions & 4 deletions worlds/minecraft/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ class MinecraftItem(Item):
"8 Gold Ore": ItemData(45032, False),
"Rotten Flesh": ItemData(45033, False),
"Single Arrow": ItemData(45034, False),
"32 Arrows": ItemData(45035, False),
"Saddle": ItemData(45036, True),
"Structure Compass (Village)": ItemData(45037, True),
"Structure Compass (Pillager Outpost)": ItemData(45038, True),
"Structure Compass (Nether Fortress)": ItemData(45039, True),
"Structure Compass (Bastion Remnant)": ItemData(45040, True),
"Structure Compass (End City)": ItemData(45041, True),
"Shulker Box": ItemData(45042, False),
"Bee Trap (Minecraft)": ItemData(45100, False),

"Victory": ItemData(None, True)
Expand All @@ -62,16 +70,23 @@ class MinecraftItem(Item):
"4 Emeralds": 8,
"4 Diamond Ore": 4,
"16 Iron Ore": 4,
"500 XP": 4, # 2 after exclusions
"100 XP": 10, # 4 after exclusions
"50 XP": 12, # 4 after exclusions
"500 XP": 0,
"100 XP": 0,
"50 XP": 21,
"3 Ender Pearls": 4,
"4 Lapis Lazuli": 2,
"16 Porkchops": 8,
"8 Gold Ore": 4,
"Rotten Flesh": 4,
"Single Arrow": 0,
"Bee Trap (Minecraft)": 0
"32 Arrows": 4,
"Structure Compass (Village)": 0,
"Structure Compass (Pillager Outpost)": 0,
"Structure Compass (Nether Fortress)": 0,
"Structure Compass (Bastion Remnant)": 0,
"Structure Compass (End City)": 0,
"Shulker Box": 0,
"Bee Trap (Minecraft)": 0,
}

lookup_id_to_name: typing.Dict[int, str] = {data.code: item_name for item_name, data in item_table.items() if data.code}
3 changes: 2 additions & 1 deletion worlds/minecraft/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class CombatDifficulty(Choice):
"include_hard_advancements": Toggle,
"include_insane_advancements": Toggle,
"include_postgame_advancements": Toggle,
"shuffle_structures": Toggle,
"shuffle_structures": Toggle,
"structure_compasses": Toggle,
"bee_traps": Toggle
}
Loading