From a124a7a82a19a936fda95d2d7671bc637b2050c6 Mon Sep 17 00:00:00 2001 From: espeon65536 Date: Sat, 28 Aug 2021 16:44:48 -0500 Subject: [PATCH] Create event Blaze Spawner containing Blaze Rods, preventing scenarios where the only progression in a sphere is to gain access to a fortress, which crashes playthrough generation --- worlds/minecraft/Items.py | 1 + worlds/minecraft/Locations.py | 1 + worlds/minecraft/Rules.py | 5 +++-- worlds/minecraft/__init__.py | 6 +++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/worlds/minecraft/Items.py b/worlds/minecraft/Items.py index 63e10ea0..b2806ab5 100644 --- a/worlds/minecraft/Items.py +++ b/worlds/minecraft/Items.py @@ -58,6 +58,7 @@ item_table = { "Dragon Egg Shard": ItemData(45043, True), "Bee Trap (Minecraft)": ItemData(45100, False), + "Blaze Rods": ItemData(None, True), "Victory": ItemData(None, True) } diff --git a/worlds/minecraft/Locations.py b/worlds/minecraft/Locations.py index 0e8e85d1..768e7ae8 100644 --- a/worlds/minecraft/Locations.py +++ b/worlds/minecraft/Locations.py @@ -109,6 +109,7 @@ advancement_table = { "Librarian": AdvData(42090, 'Overworld'), "Overpowered": AdvData(42091, 'Overworld'), + "Blaze Spawner": AdvData(None, 'Nether Fortress'), "Ender Dragon": AdvData(None, 'The End') } diff --git a/worlds/minecraft/Rules.py b/worlds/minecraft/Rules.py index ae220394..90885074 100644 --- a/worlds/minecraft/Rules.py +++ b/worlds/minecraft/Rules.py @@ -31,7 +31,7 @@ class MinecraftLogic(LogicMixin): return self.can_reach('Nether Fortress', 'Region', player) and self._mc_basic_combat(player) def _mc_can_brew_potions(self, player: int): - return self._mc_fortress_loot(player) and self.has('Brewing', player) and self._mc_has_bottle(player) + return self.has('Blaze Rods', player) and self.has('Brewing', player) and self._mc_has_bottle(player) def _mc_can_piglin_trade(self, player: int): return self._mc_has_gold_ingots(player) and ( @@ -39,7 +39,7 @@ class MinecraftLogic(LogicMixin): player)) def _mc_enter_stronghold(self, player: int): - return self._mc_fortress_loot(player) and self.has('Brewing', player) and self.has('3 Ender Pearls', player) + return self.has('Blaze Rods', player) and self.has('Brewing', player) and self.has('3 Ender Pearls', player) # Difficulty-dependent functions def _mc_combat_difficulty(self, player: int): @@ -135,6 +135,7 @@ def set_rules(world: MultiWorld, player: int): set_rule(world.get_entrance("The End Structure", player), lambda state: state._mc_can_adventure(player) and state._mc_has_structure_compass("The End Structure", player)) set_rule(world.get_location("Ender Dragon", player), lambda state: can_complete(state)) + set_rule(world.get_location("Blaze Spawner", player), lambda state: state._mc_fortress_loot(player)) set_rule(world.get_location("Who is Cutting Onions?", player), lambda state: state._mc_can_piglin_trade(player)) set_rule(world.get_location("Oh Shiny", player), lambda state: state._mc_can_piglin_trade(player)) diff --git a/worlds/minecraft/__init__.py b/worlds/minecraft/__init__.py index 71c0575e..78ab60b9 100644 --- a/worlds/minecraft/__init__.py +++ b/worlds/minecraft/__init__.py @@ -72,9 +72,9 @@ class MinecraftWorld(World): exclusion_pool.update(exclusion_table[key]) exclusion_rules(self.world, self.player, exclusion_pool) - # Prefill the Ender Dragon with the completion condition - completion = self.create_item("Victory") - self.world.get_location("Ender Dragon", self.player).place_locked_item(completion) + # Prefill event locations with their events + self.world.get_location("Blaze Spawner", self.player).place_locked_item(self.create_item("Blaze Rods")) + self.world.get_location("Ender Dragon", self.player).place_locked_item(self.create_item("Victory")) self.world.itempool += itempool