From 5943c8975a6ec21c246c089f0879add9160f596c Mon Sep 17 00:00:00 2001 From: espeon65536 Date: Fri, 2 Jul 2021 20:27:41 -0500 Subject: [PATCH] fixing the tests for bees again --- test/minecraft/TestMinecraft.py | 4 +++- worlds/minecraft/__init__.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/minecraft/TestMinecraft.py b/test/minecraft/TestMinecraft.py index 0ff4bf3c..06ed6fae 100644 --- a/test/minecraft/TestMinecraft.py +++ b/test/minecraft/TestMinecraft.py @@ -5,6 +5,7 @@ from worlds import AutoWorld from worlds.minecraft import MinecraftWorld from worlds.minecraft.Items import MinecraftItem, item_table from worlds.minecraft.Options import AdvancementGoal, CombatDifficulty +from Options import Toggle # Converts the name of an item into an item object def MCItemFactory(items, player: int): @@ -33,8 +34,9 @@ class TestMinecraft(TestBase): for pool in exclusion_pools: setattr(self.world, f"include_{pool}_advancements", [False, False]) setattr(self.world, "advancement_goal", {1: AdvancementGoal(30)}) - setattr(self.world, "shuffle_structures", {1: False}) + 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)}) AutoWorld.call_single(self.world, "create_regions", 1) AutoWorld.call_single(self.world, "generate_basic", 1) AutoWorld.call_single(self.world, "set_rules", 1) diff --git a/worlds/minecraft/__init__.py b/worlds/minecraft/__init__.py index 4491dfd7..1dba29f5 100644 --- a/worlds/minecraft/__init__.py +++ b/worlds/minecraft/__init__.py @@ -33,7 +33,7 @@ class MinecraftWorld(World): pool = [] pool_counts = item_frequencies.copy() - if getattr(self.world, "bee_traps", {}).get(self.player, False): + if getattr(self.world, "bee_traps")[self.player]: pool_counts.update({"Rotten Flesh": 0, "Bee Trap (Minecraft)": 4}) for item_name, item_data in item_table.items(): for count in range(pool_counts.get(item_name, 1)): @@ -43,7 +43,7 @@ class MinecraftWorld(World): prefill_pool.update(events_table) exclusion_pools = ['hard', 'insane', 'postgame'] for key in exclusion_pools: - if not getattr(self.world, f"include_{key}_advancements", {}).get(self.player, False): + if not getattr(self.world, f"include_{key}_advancements")[self.player]: prefill_pool.update(exclusion_table[key]) for loc_name, item_name in prefill_pool.items():