Skip to content

Commit d13f6fb

Browse files
committed
fix branding patch api compat with lifecycle events api in beta
1 parent 781af9d commit d13f6fb

File tree

13 files changed

+103
-3
lines changed

13 files changed

+103
-3
lines changed

libraries/branding/branding-client-mca1.2.2-1624-mc12w30e/build.gradle renamed to libraries/branding/branding-client-mc12w18a-mc12w30e/build.gradle

File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
environment = client
2+
min_mc_version = 12w18a
3+
max_mc_version = 12w30e
4+
mc_version_range = >=1.3.1-alpha.12.30.a <=1.3.1-alpha.12.30.e
5+
6+
feather_build = 9
7+
nests_build = 1

libraries/branding/branding-client-mca1.2.2-1624-mc12w30e/src/main/java/net/ornithemc/osl/branding/api/BrandingPatch.java renamed to libraries/branding/branding-client-mc12w18a-mc12w30e/src/main/java/net/ornithemc/osl/branding/api/BrandingPatch.java

File renamed without changes.

libraries/branding/branding-client-mca1.2.2-1624-mc12w30e/src/main/java/net/ornithemc/osl/branding/impl/BrandingPatchImpl.java renamed to libraries/branding/branding-client-mc12w18a-mc12w30e/src/main/java/net/ornithemc/osl/branding/impl/BrandingPatchImpl.java

File renamed without changes.

libraries/branding/branding-client-mca1.2.2-1624-mc12w30e/src/main/java/net/ornithemc/osl/branding/impl/mixin/client/TitleScreenMixin.java renamed to libraries/branding/branding-client-mc12w18a-mc12w30e/src/main/java/net/ornithemc/osl/branding/impl/mixin/client/TitleScreenMixin.java

File renamed without changes.

libraries/branding/branding-client-mca1.2.2-1624-mc12w30e/src/main/resources/osl.branding.mixins.json renamed to libraries/branding/branding-client-mc12w18a-mc12w30e/src/main/resources/osl.branding.mixins.json

File renamed without changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
setUpModule(project,
2+
'entrypoints-client-mca1.0.6-mc12w30e',
3+
'lifecycle-events-client-mcb1.8-pre1-201109081459-mc12w17a'
4+
)

libraries/branding/branding-client-mca1.2.2-1624-mc12w30e/gradle.properties renamed to libraries/branding/branding-client-mca1.2.2-1624-mc12w17a/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
environment = client
22
min_mc_version = a1.2.2-1624
3-
max_mc_version = 12w30e
4-
mc_version_range = >=1.0.0-alpha.2.2 <=1.3.1-alpha.12.30.e
3+
max_mc_version = 12w17a
4+
mc_version_range = >=1.0.0-alpha.2.2 <=1.3.1-alpha.12.17.a
55

66
feather_build = 9
77
nests_build = 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package net.ornithemc.osl.branding.api;
2+
3+
import net.ornithemc.osl.branding.impl.BrandingPatchImpl;
4+
5+
public class BrandingPatch {
6+
7+
/**
8+
* Modifies the given branding information for the given context.
9+
*
10+
* @return the modified string
11+
*/
12+
public static String apply(BrandingContext context, String s) {
13+
return BrandingPatchImpl.apply(context, s);
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package net.ornithemc.osl.branding.impl;
2+
3+
import net.ornithemc.osl.branding.api.BrandingContext;
4+
import net.ornithemc.osl.branding.api.BrandingPatchEvents;
5+
import net.ornithemc.osl.branding.api.Operation;
6+
import net.ornithemc.osl.entrypoints.api.client.ClientLaunchEvents;
7+
import net.ornithemc.osl.entrypoints.api.client.ClientModInitializer;
8+
import net.ornithemc.osl.lifecycle.api.MinecraftEvents;
9+
10+
public class BrandingPatchImpl implements ClientModInitializer {
11+
12+
private static BrandingModifiers modifiers = new BrandingModifiers();
13+
14+
public static String apply(BrandingContext context, String s) {
15+
return modifiers.apply(context, s);
16+
}
17+
18+
@Override
19+
public void initClient() {
20+
ClientLaunchEvents.PARSE_RUN_ARGS.register(args -> {
21+
String versionType = args.getParameter(Constants.VERSION_TYPE);
22+
23+
if (versionType != null && !Constants.RELEASE.equals(versionType)) {
24+
modifiers.register(BrandingContext.ALL, Constants.VERSION_TYPE_COMPONENT, Operation.APPEND, "/" + versionType);
25+
}
26+
});
27+
MinecraftEvents.START.register(minecraft -> {
28+
BrandingPatchEvents.REGISTER_MODIFIER_COMPONENT.invoker().accept(modifiers);
29+
});
30+
}
31+
}

0 commit comments

Comments
 (0)