mirror of
https://github.com/unmojang/meta.git
synced 2025-09-25 20:21:58 -04:00
Added supported features to not polute traits
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
bec6650d02
commit
74fddd3673
@ -35,6 +35,7 @@ from meta.model.mojang import (
|
||||
MojangVersion,
|
||||
LegacyOverrideIndex,
|
||||
LibraryPatches,
|
||||
SUPPORTED_FEATURES,
|
||||
)
|
||||
|
||||
APPLY_SPLIT_NATIVES_WORKAROUND = True
|
||||
@ -198,22 +199,20 @@ def adapt_new_style_arguments(arguments):
|
||||
pprint(arg)
|
||||
return " ".join(foo)
|
||||
|
||||
|
||||
def adapt_new_style_arguments_to_traits(arguments):
|
||||
foo = []
|
||||
# we ignore the jvm arguments entirely.
|
||||
# grab the object, log the errors
|
||||
for arg in arguments.game:
|
||||
if not isinstance(arg, str):
|
||||
try:
|
||||
for rule in arg["rules"]:
|
||||
for k,v in rule["features"].items():
|
||||
if rule["action"] == "allow" and v:
|
||||
foo.append(f"feature:{k}")
|
||||
except:
|
||||
print("something did not go as planed")
|
||||
pprint(arg)
|
||||
if isinstance(arg, dict):
|
||||
for rule in arg["rules"]:
|
||||
for k, v in rule["features"].items():
|
||||
if rule["action"] == "allow" and v and k in SUPPORTED_FEATURES:
|
||||
foo.append(f"feature:{k}")
|
||||
return foo
|
||||
|
||||
|
||||
def is_macos_only(rules: Optional[MojangRules]):
|
||||
allows_osx = False
|
||||
allows_all = False
|
||||
@ -503,7 +502,9 @@ def main():
|
||||
v.minecraft_arguments = adapt_new_style_arguments(mojang_version.arguments)
|
||||
if not v.additional_traits:
|
||||
v.additional_traits = []
|
||||
v.additional_traits.extend(adapt_new_style_arguments_to_traits(mojang_version.arguments))
|
||||
v.additional_traits.extend(
|
||||
adapt_new_style_arguments_to_traits(mojang_version.arguments)
|
||||
)
|
||||
out_filename = os.path.join(
|
||||
LAUNCHER_DIR, MINECRAFT_COMPONENT, f"{v.version}.json"
|
||||
)
|
||||
|
@ -18,6 +18,7 @@ SUPPORTED_LAUNCHER_VERSION = 21
|
||||
SUPPORTED_COMPLIANCE_LEVEL = 1
|
||||
DEFAULT_JAVA_MAJOR = 8 # By default, we should recommend Java 8 if we don't know better
|
||||
COMPATIBLE_JAVA_MAPPINGS = {16: [17]}
|
||||
SUPPORTED_FEATURES = ["is_quick_play_multiplayer"]
|
||||
|
||||
"""
|
||||
Mojang index files look like this:
|
||||
|
Loading…
x
Reference in New Issue
Block a user