MC: 1.17 support (#120)

* MC: add death_link option

* Minecraft: 1.17 advancements and logic support

* Update Minecraft tracker to 1.17

* Minecraft: add tests for new advancements

* removed jdk/forge download install out of iss and into MinecraftClient.py using flag --install

* Add required_bosses option
choices are none, ender_dragon, wither, both
postgame advancements are set according to the required boss for completion

* fix docstring for PostgameAdvancements

* Minecraft: add starting_items
List of dicts: item, amount, nbt

* Update descriptions for AdvancementGoal and EggShardsRequired

* Minecraft: fix tests for required_bosses attribute

* Minecraft: updated logic for various dragon-related advancements
Split the logic into can_respawn and can_kill dragon
Free the End, Monsters Hunted, The End Again still require both respawn and kill, since the player needs to kill and be credited with the kill
You Need a Mint and Is It a Plane now require only respawn, since the dragon need only be alive; if killed out of logic, it's ok
The Next Generation only requires kill, since the egg spawns regardless of whether the player was credited with the kill or not

* Minecraft client: ignore prereleases unless --prerelease flag is on

* explicitly state all defaults
change structure shuffle and structure compass defaults to true
update install tutorial to point to player-settings page, as well as removing instructions for manual install

* Minecraft client: add Minecraft version check
Adds a minecraft_version field in the apmc, and downloads only mods which contain that version in the name of the .jar file.
This ensures that the client remains compatible even if new mods are released for later versions, since they won't download a mod for a later version than the apmc says.

Co-authored-by: Kono Tyran <Kono.Tyran@gmail.com>
This commit is contained in:
espeon65536
2021-11-30 20:37:11 -05:00
committed by GitHub
parent d7509972e4
commit 3fa253bac5
15 changed files with 501 additions and 408 deletions

View File

@@ -1,37 +1,51 @@
import typing
from Options import Choice, Option, Toggle, Range
from Options import Choice, Option, Toggle, Range, OptionList, DeathLink
class AdvancementGoal(Range):
"""Number of advancements required to spawn the Ender Dragon."""
"""Number of advancements required to spawn bosses."""
displayname = "Advancement Goal"
range_start = 0
range_end = 87
default = 50
range_end = 92
default = 40
class EggShardsRequired(Range):
"""Number of dragon egg shards to collect before the Ender Dragon will spawn."""
"""Number of dragon egg shards to collect to spawn bosses."""
displayname = "Egg Shards Required"
range_start = 0
range_end = 30
range_end = 40
default = 0
class EggShardsAvailable(Range):
"""Number of dragon egg shards available to collect."""
displayname = "Egg Shards Available"
range_start = 0
range_end = 30
range_end = 40
default = 0
class BossGoal(Choice):
"""Bosses which must be defeated to finish the game."""
displayname = "Required Bosses"
option_none = 0
option_ender_dragon = 1
option_wither = 2
option_both = 3
default = 1
class ShuffleStructures(Toggle):
"""Enables shuffling of villages, outposts, fortresses, bastions, and end cities."""
displayname = "Shuffle Structures"
default = 1
class StructureCompasses(Toggle):
"""Adds structure compasses to the item pool, which point to the nearest indicated structure."""
displayname = "Structure Compasses"
default = 1
class BeeTraps(Range):
@@ -39,6 +53,7 @@ class BeeTraps(Range):
displayname = "Bee Trap Percentage"
range_start = 0
range_end = 100
default = 0
class CombatDifficulty(Choice):
@@ -53,33 +68,46 @@ class CombatDifficulty(Choice):
class HardAdvancements(Toggle):
"""Enables certain RNG-reliant or tedious advancements."""
displayname = "Include Hard Advancements"
default = 0
class InsaneAdvancements(Toggle):
class UnreasonableAdvancements(Toggle):
"""Enables the extremely difficult advancements "How Did We Get Here?" and "Adventuring Time.\""""
displayname = "Include Insane Advancements"
displayname = "Include Unreasonable Advancements"
default = 0
class PostgameAdvancements(Toggle):
"""Enables advancements that require spawning and defeating the Ender Dragon."""
"""Enables advancements that require spawning and defeating the required bosses."""
displayname = "Include Postgame Advancements"
default = 0
class SendDefeatedMobs(Toggle):
"""Send killed mobs to other Minecraft worlds which have this option enabled."""
displayname = "Send Defeated Mobs"
default = 0
class StartingItems(OptionList):
"""Start with these items. Each entry should be of this format: {item: "item_name", amount: #, nbt: "nbt_string"}"""
displayname = "Starting Items"
default = 0
minecraft_options: typing.Dict[str, type(Option)] = {
"advancement_goal": AdvancementGoal,
"egg_shards_required": EggShardsRequired,
"egg_shards_available": EggShardsAvailable,
"shuffle_structures": ShuffleStructures,
"structure_compasses": StructureCompasses,
"bee_traps": BeeTraps,
"combat_difficulty": CombatDifficulty,
"include_hard_advancements": HardAdvancements,
"include_insane_advancements": InsaneAdvancements,
"include_postgame_advancements": PostgameAdvancements,
"send_defeated_mobs": SendDefeatedMobs,
"advancement_goal": AdvancementGoal,
"egg_shards_required": EggShardsRequired,
"egg_shards_available": EggShardsAvailable,
"required_bosses": BossGoal,
"shuffle_structures": ShuffleStructures,
"structure_compasses": StructureCompasses,
"bee_traps": BeeTraps,
"combat_difficulty": CombatDifficulty,
"include_hard_advancements": HardAdvancements,
"include_unreasonable_advancements": UnreasonableAdvancements,
"include_postgame_advancements": PostgameAdvancements,
"send_defeated_mobs": SendDefeatedMobs,
"starting_items": StartingItems,
"death_link": DeathLink,
}