Skip to content

Commit 5943c89

Browse files
espeon65536Berserker66
authored andcommitted
fixing the tests for bees again
1 parent d9f97f6 commit 5943c89

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

test/minecraft/TestMinecraft.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from worlds.minecraft import MinecraftWorld
66
from worlds.minecraft.Items import MinecraftItem, item_table
77
from worlds.minecraft.Options import AdvancementGoal, CombatDifficulty
8+
from Options import Toggle
89

910
# Converts the name of an item into an item object
1011
def MCItemFactory(items, player: int):
@@ -33,8 +34,9 @@ def setUp(self):
3334
for pool in exclusion_pools:
3435
setattr(self.world, f"include_{pool}_advancements", [False, False])
3536
setattr(self.world, "advancement_goal", {1: AdvancementGoal(30)})
36-
setattr(self.world, "shuffle_structures", {1: False})
37+
setattr(self.world, "shuffle_structures", {1: Toggle(False)})
3738
setattr(self.world, "combat_difficulty", {1: CombatDifficulty(1)}) # normal
39+
setattr(self.world, "bee_traps", {1: Toggle(False)})
3840
AutoWorld.call_single(self.world, "create_regions", 1)
3941
AutoWorld.call_single(self.world, "generate_basic", 1)
4042
AutoWorld.call_single(self.world, "set_rules", 1)

worlds/minecraft/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def generate_basic(self):
3333

3434
pool = []
3535
pool_counts = item_frequencies.copy()
36-
if getattr(self.world, "bee_traps", {}).get(self.player, False):
36+
if getattr(self.world, "bee_traps")[self.player]:
3737
pool_counts.update({"Rotten Flesh": 0, "Bee Trap (Minecraft)": 4})
3838
for item_name, item_data in item_table.items():
3939
for count in range(pool_counts.get(item_name, 1)):
@@ -43,7 +43,7 @@ def generate_basic(self):
4343
prefill_pool.update(events_table)
4444
exclusion_pools = ['hard', 'insane', 'postgame']
4545
for key in exclusion_pools:
46-
if not getattr(self.world, f"include_{key}_advancements", {}).get(self.player, False):
46+
if not getattr(self.world, f"include_{key}_advancements")[self.player]:
4747
prefill_pool.update(exclusion_table[key])
4848

4949
for loc_name, item_name in prefill_pool.items():

0 commit comments

Comments
 (0)