Skip to content

Commit 8d2486a

Browse files
committed
port finished
1 parent 60d189e commit 8d2486a

16 files changed

Lines changed: 117 additions & 229 deletions

File tree

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ plugins {
1616

1717
toolkitLoomHelper {
1818
useOneConfig {
19-
version = "1.0.0-alpha.106"
20-
loaderVersion = "1.1.0-alpha.46"
19+
version = "1.0.0-alpha.160"
20+
loaderVersion = "1.1.0-alpha.49"
2121

2222
usePolyMixin = true
2323
polyMixinVersion = "0.8.4+build.2"

root.gradle.kts

Lines changed: 19 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,25 @@ preprocess {
1010
// "1.8.9-forge"(10809, "srg")
1111
// }
1212

13-
"1.21.5-fabric"(1_21_05, "yarn") {
14-
"1.21.5-neoforge"(1_21_05, "srg") {
15-
"1.21.4-neoforge"(1_21_04, "srg") {
16-
"1.21.4-fabric"(1_21_04, "yarn") {
17-
"1.21.3-fabric"(1_21_04, "yarn") {
18-
"1.21.3-neoforge"(1_21_03, "srg") {
19-
"1.21.2-neoforge"(1_21_02, "srg") {
20-
"1.21.2-fabric"(1_21_02, "yarn") {
21-
"1.21.1-fabric"(1_21_01, "yarn") {
22-
"1.21.1-neoforge"(1_21_01, "srg") {
23-
"1.20.6-neoforge"(1_20_06, "srg") {
24-
"1.20.6-fabric"(1_20_06, "yarn") {
25-
"1.20.4-fabric"(1_20_04, "yarn") {
26-
"1.20.4-neoforge"(1_20_04, "srg") {
27-
"1.20.4-forge"(1_20_04, "srg") {
28-
"1.20.1-forge"(1_20_01, "srg") {
29-
"1.20.1-fabric"(1_20_01, "yarn") {
30-
"1.19.4-fabric"(1_19_04, "yarn") {
31-
"1.19.4-forge"(1_19_04, "srg") {
32-
"1.19.2-forge"(1_19_02, "srg") {
33-
"1.19.2-fabric"(1_19_02, "yarn") {
34-
"1.18.2-fabric"(1_18_02, "yarn") {
35-
"1.18.2-forge"(1_18_02, "srg") {
36-
"1.17.1-forge"(1_17_01, "srg") {
37-
"1.17.1-fabric"(1_17_01, "yarn") {
38-
"1.16.5-fabric"(1_16_05, "yarn"){
39-
"1.16.5-forge"(1_16_05, "srg") {
40-
"1.12.2-forge"(1_12_02, "srg") {
41-
"1.12.2-fabric"(1_12_02, "yarn") {
42-
"1.8.9-fabric"(1_08_09, "yarn"){
43-
"1.8.9-forge"(1_08_09, "srg")
44-
}
45-
}
46-
}
47-
}
48-
}
49-
}
50-
}
51-
}
52-
}
53-
}
54-
}
55-
}
13+
"1.21.8-fabric"(1_21_08, "yarn") {
14+
"1.21.8-neoforge"(1_21_08, "srg") {
15+
"1.21.5-neoforge"(1_21_05, "srg") {
16+
"1.21.5-fabric"(1_21_05, "yarn") {
17+
"1.21.4-fabric"(1_21_04, "yarn") {
18+
"1.21.4-neoforge"(1_21_04, "srg") {
19+
"1.21.1-neoforge"(1_21_01, "srg") {
20+
"1.21.1-fabric"(1_21_01, "yarn") {
21+
"1.20.4-fabric"(1_20_04, "yarn") {
22+
"1.20.4-neoforge"(1_20_04, "srg") {
23+
"1.20.4-forge"(1_20_04, "srg") {
24+
"1.20.1-forge"(1_20_01, "srg") {
25+
"1.20.1-fabric"(1_20_01, "yarn") {
26+
"1.16.5-fabric"(1_16_05, "yarn") {
27+
"1.16.5-forge"(1_16_05, "srg") {
28+
"1.12.2-forge"(1_12_02, "srg") {
29+
"1.12.2-fabric"(1_12_02, "yarn") {
30+
"1.8.9-fabric"(1_08_09, "yarn") {
31+
"1.8.9-forge"(1_08_09, "srg")
5632
}
5733
}
5834
}

settings.gradle.kts

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ pluginManagement {
2323
}
2424

2525
plugins {
26-
kotlin("jvm") version("2.0.20")
27-
id("dev.deftu.gradle.multiversion-root") version("2.36.0")
26+
kotlin("jvm") version("2.2.10")
27+
id("dev.deftu.gradle.multiversion-root") version("2.57.0")
2828
}
2929
}
3030

@@ -49,42 +49,24 @@ listOf(
4949
"1.16.5-forge",
5050
"1.16.5-fabric",
5151

52-
"1.17.1-forge",
53-
"1.17.1-fabric",
54-
55-
"1.18.2-forge",
56-
"1.18.2-fabric",
57-
58-
"1.19.2-forge",
59-
"1.19.2-fabric",
60-
61-
"1.19.4-forge",
62-
"1.19.4-fabric",
63-
6452
"1.20.1-forge",
6553
"1.20.1-fabric",
6654

6755
"1.20.4-forge",
6856
"1.20.4-neoforge",
6957
"1.20.4-fabric",
7058

71-
"1.20.6-neoforge",
72-
"1.20.6-fabric",
73-
7459
"1.21.1-neoforge",
7560
"1.21.1-fabric",
7661

77-
"1.21.2-neoforge",
78-
"1.21.2-fabric",
79-
80-
"1.21.3-neoforge",
81-
"1.21.3-fabric",
82-
8362
"1.21.4-neoforge",
8463
"1.21.4-fabric",
8564

8665
"1.21.5-neoforge",
87-
"1.21.5-fabric"
66+
"1.21.5-fabric",
67+
68+
"1.21.8-neoforge",
69+
"1.21.8-fabric",
8870
).forEach { version ->
8971
include(":$version")
9072
project(":$version").apply {
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package org.polyfrost.damagetint;
22

33
public class DamageTintConstants {
4-
54
// Sets the variables from `gradle.properties`. Depends on the `bloom` DGT plugin.
65
public static final String ID = "@MOD_ID@";
76
public static final String NAME = "@MOD_NAME@";
87
public static final String VERSION = "@MOD_VERSION@";
9-
108
}

src/main/java/org/polyfrost/damagetint/DamageTintEntrypoint.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public class DamageTintEntrypoint
4141
//$$ implements ClientModInitializer
4242
//#endif
4343
{
44-
4544
//#if FORGE && MC >= 1.16.5
4645
//$$ public DamageTintEntrypoint() {
4746
//$$ setupForgeEvents(FMLJavaModLoadingContext.get().getModEventBus());
@@ -86,5 +85,4 @@ public void onInitializeClient(
8685
//$$ modEventBus.addListener(this::onInitializeClient);
8786
//$$ }
8887
//#endif
89-
9088
}

src/main/java/org/polyfrost/damagetint/DamageTintMixinPlugin.java

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
package org.polyfrost.damagetint.client;
22

3-
import org.polyfrost.oneconfig.api.commands.v1.CommandManager;
3+
import dev.deftu.omnicore.api.client.commands.OmniClientCommands;
4+
import org.polyfrost.damagetint.DamageTintConstants;
5+
import org.polyfrost.oneconfig.utils.v1.dsl.ScreensKt;
46

57
//#if MC >= 1.16.5
68
//$$ import org.polyfrost.oneconfig.api.event.v1.EventManager;
79
//$$ import org.polyfrost.oneconfig.api.event.v1.events.InitializationEvent;
810
//#endif
911

1012
public class DamageTintClient {
11-
1213
public static final DamageTintClient INSTANCE = new DamageTintClient();
1314

1415
public void initialize() {
1516
DamageTintConfig.INSTANCE.preload();
16-
CommandManager.register(new DamageTintCommand());
17+
OmniClientCommands.register(OmniClientCommands.literal(DamageTintConstants.ID).executes(ctx -> {
18+
return ctx.getSource().openScreen(ScreensKt.createScreen(DamageTintConfig.INSTANCE));
19+
}));
1720

1821
//#if MC >= 1.16.5
1922
//$$ EventManager.register(InitializationEvent.class, () -> DamageTintConfig.updateOverlayColor(DamageTintConfig.color));
2023
//#endif
2124
}
22-
2325
}

src/main/java/org/polyfrost/damagetint/client/DamageTintCommand.java

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/main/java/org/polyfrost/damagetint/client/DamageTintConfig.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,27 @@
99
import org.polyfrost.polyui.color.PolyColor;
1010

1111
//#if MC >= 1.16.5
12-
//$$ import dev.deftu.omnicore.client.OmniClient;
12+
//$$ import dev.deftu.omnicore.api.color.OmniColor;
13+
//$$ import dev.deftu.omnicore.api.client.OmniClient;
14+
//$$ import dev.deftu.omnicore.api.client.OmniClientRuntime;
1315
//$$ import net.minecraft.client.renderer.texture.OverlayTexture;
1416
//$$ import org.polyfrost.damagetint.client.utils.OverlayModifier;
1517
//#endif
1618

1719
public class DamageTintConfig extends Config {
18-
1920
public static final DamageTintConfig INSTANCE = new DamageTintConfig();
2021

22+
@Switch(title = "Enable Damage Tint")
23+
public static boolean enabled = true;
24+
2125
private static final int defaultColor = 1291780096;
2226

2327
@Color(title = "Damage Tint Colour")
2428
public static PolyColor color = ColorUtils.toColor(defaultColor);
2529

2630
@Button(title = "Reset Damage Tint", text = "Reset Color")
2731
private void resetColor() {
28-
color = ColorUtils.mutable(ColorUtils.toColor(defaultColor));
32+
color = ColorUtils.asMutable(ColorUtils.toColor(defaultColor));
2933
save();
3034
}
3135

@@ -40,7 +44,7 @@ private void resetColor() {
4044
public static boolean fade = false;
4145

4246
public DamageTintConfig() {
43-
super("damagetint.json", "/damagetint_dark.svg", DamageTintConstants.NAME, Category.QOL);
47+
super("damagetint.json", "/assets/damagetint/damagetint_dark.svg", DamageTintConstants.NAME, Category.QOL);
4448
save();
4549

4650
//#if MC >= 1.16.5
@@ -52,18 +56,17 @@ public DamageTintConfig() {
5256

5357
//#if MC >= 1.16.5
5458
//$$ public static void updateOverlayColor(PolyColor newColor) {
55-
//$$ OmniClient.execute(() -> {
59+
//$$ OmniClientRuntime.runOnMain(() -> {
5660
//$$ int red = newColor.red();
5761
//$$ int green = newColor.green();
5862
//$$ int blue = newColor.blue();
5963
//$$ // Alpha is flipped for some reason, so 0 is fully opaque and 255 is fully transparent... Why, Mojang?
6064
//$$ int alpha = 255 - newColor.alpha();
61-
//$$ int abgr = alpha << 24 | blue << 16 | green << 8 | red;
65+
//$$ OmniColor color = new OmniColor(red, green, blue, alpha);
6266
//$$
63-
//$$ OverlayTexture overlayTexture = OmniClient.getInstance().gameRenderer.overlayTexture();
64-
//$$ ((OverlayModifier) overlayTexture).setOverlayColor(abgr);
67+
//$$ OverlayTexture overlayTexture = OmniClient.get().gameRenderer.overlayTexture();
68+
//$$ ((OverlayModifier) overlayTexture).setOverlayColor(color);
6569
//$$ });
6670
//$$ }
6771
//#endif
68-
6972
}

src/main/java/org/polyfrost/damagetint/client/utils/OverlayModifier.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)