Skip to content

Commit 0b78567

Browse files
authored
Merge pull request #2 from Kathund/twoconfig
2 parents da5c000 + c36e09e commit 0b78567

File tree

8 files changed

+218
-10
lines changed

8 files changed

+218
-10
lines changed

build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ plugins {
1717

1818
toolkitLoomHelper {
1919
useOneConfig {
20-
version = "1.0.0-alpha.70"
21-
loaderVersion = "1.1.0-alpha.44"
20+
version = "1.0.0-alpha.106"
21+
loaderVersion = "1.1.0-alpha.46"
2222

2323
usePolyMixin = true
2424
polyMixinVersion = "0.8.4+build.2"
@@ -30,6 +30,8 @@ toolkitLoomHelper {
3030
}
3131
}
3232

33+
useDevAuth("1.2.1")
34+
3335
// Turns off the server-side run configs, as we're building a client-sided mod.
3436
disableRunConfigs(GameSide.SERVER)
3537

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ org.gradle.parallel=true
55
org.gradle.configureoncommand=true
66
org.gradle.parallel.threads=4
77
org.gradle.jvmargs=-Xmx2G
8+
loom.ignoreDependencyLoomVersionValidation=true
89

910
mod.name=ColorSaturation
1011
mod.id=colorsaturation

root.gradle.kts

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,66 @@ preprocess {
99
// "1.12.2-forge"(11202, "srg") {
1010
// "1.8.9-forge"(10809, "srg")
1111
// }
12-
13-
"1.8.9-forge"(10809, "srg") {
14-
"1.8.9-fabric"(10809, "yarn")
12+
"1.21.5-fabric"(1_21_05, "yarn") {
13+
"1.21.5-neoforge"(1_21_05, "srg") {
14+
"1.21.4-neoforge"(1_21_04, "srg") {
15+
"1.21.4-fabric"(1_21_04, "yarn") {
16+
"1.21.3-fabric"(1_21_04, "yarn") {
17+
"1.21.3-neoforge"(1_21_03, "srg") {
18+
"1.21.2-neoforge"(1_21_02, "srg") {
19+
"1.21.2-fabric"(1_21_02, "yarn") {
20+
"1.21.1-fabric"(1_21_01, "yarn") {
21+
"1.21.1-neoforge"(1_21_01, "srg") {
22+
"1.20.6-neoforge"(1_20_06, "srg") {
23+
"1.20.6-fabric"(1_20_06, "yarn") {
24+
"1.20.4-fabric"(1_20_04, "yarn") {
25+
"1.20.4-neoforge"(1_20_04, "srg") {
26+
"1.20.4-forge"(1_20_04, "srg") {
27+
"1.20.1-forge"(1_20_01, "srg") {
28+
"1.20.1-fabric"(1_20_01, "yarn") {
29+
"1.19.4-fabric"(1_19_04, "yarn") {
30+
"1.19.4-forge"(1_19_04, "srg") {
31+
"1.19.2-forge"(1_19_02, "srg") {
32+
"1.19.2-fabric"(1_19_02, "yarn") {
33+
"1.18.2-fabric"(1_18_02, "yarn") {
34+
"1.18.2-forge"(1_18_02, "srg") {
35+
"1.17.1-forge"(1_17_01, "srg") {
36+
"1.17.1-fabric"(1_17_01, "yarn") {
37+
"1.16.5-fabric"(1_16_05, "yarn"){
38+
"1.16.5-forge"(1_16_05, "srg") {
39+
"1.12.2-forge"(1_12_02, "srg") {
40+
"1.12.2-fabric"(1_12_02, "yarn") {
41+
"1.8.9-fabric"(1_08_09, "yarn") {
42+
"1.8.9-forge"(1_08_09, "srg")
43+
}
44+
}
45+
}
46+
}
47+
}
48+
}
49+
}
50+
}
51+
}
52+
}
53+
}
54+
}
55+
}
56+
}
57+
}
58+
}
59+
}
60+
}
61+
}
62+
}
63+
}
64+
}
65+
}
66+
}
67+
}
68+
}
69+
}
70+
}
71+
}
1572
}
1673

1774
strictExtraMappings.set(true)

settings.gradle.kts

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

2525
plugins {
26-
kotlin("jvm") version("2.0.0")
27-
id("dev.deftu.gradle.multiversion-root") version("2.27.1")
26+
kotlin("jvm") version("2.0.10")
27+
id("dev.deftu.gradle.multiversion-root") version("2.35.0")
2828
}
2929
}
3030

@@ -42,6 +42,49 @@ rootProject.buildFileName = "root.gradle.kts"
4242
listOf(
4343
"1.8.9-forge",
4444
"1.8.9-fabric",
45+
46+
"1.12.2-forge",
47+
"1.12.2-fabric",
48+
49+
"1.16.5-forge",
50+
"1.16.5-fabric",
51+
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+
64+
"1.20.1-forge",
65+
"1.20.1-fabric",
66+
67+
"1.20.4-forge",
68+
"1.20.4-neoforge",
69+
"1.20.4-fabric",
70+
71+
"1.20.6-neoforge",
72+
"1.20.6-fabric",
73+
74+
"1.21.1-neoforge",
75+
"1.21.1-fabric",
76+
77+
"1.21.2-neoforge",
78+
"1.21.2-fabric",
79+
80+
"1.21.3-neoforge",
81+
"1.21.3-fabric",
82+
83+
"1.21.4-neoforge",
84+
"1.21.4-fabric",
85+
86+
"1.21.5-neoforge",
87+
"1.21.5-fabric"
4588
).forEach { version ->
4689
include(":$version")
4790
project(":$version").apply {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
package org.polyfrost.colorsaturation;
22

3+
//#if MC >= 11700
4+
//#if MC >= 12105
5+
//#else
6+
//$$ import net.minecraft.client.renderer.PostChain;
7+
//#endif
8+
//#else
39
import net.minecraft.client.shader.ShaderGroup;
10+
//#endif
411

512
public interface EntityRendererHook {
13+
//#if MC >= 11700
14+
//#if MC >= 12105
15+
//#else
16+
//$$ PostChain colorSaturation$getSaturationShader();
17+
//$$ void colorSaturation$setSaturationShader(PostChain saturationShader);
18+
//#endif
19+
//#else
620
ShaderGroup colorSaturation$getSaturationShader();
721
void colorSaturation$setSaturationShader(ShaderGroup saturationShader);
22+
//#endif
823
}

src/main/java/org/polyfrost/colorsaturation/command/SaturationCommand.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
import org.polyfrost.colorsaturation.ColorSaturation;
44
import org.polyfrost.oneconfig.api.commands.v1.factories.annotated.Command;
5+
import org.polyfrost.oneconfig.api.commands.v1.factories.annotated.Handler;
56
import org.polyfrost.oneconfig.utils.v1.dsl.ScreensKt;
67

78
@Command(ColorSaturation.ID)
89
public class SaturationCommand {
9-
@Command
10+
11+
@Handler
1012
private void main() {
1113
// TODO Implement openGui
1214
// ColorSaturation.getConfig().openGui();

src/main/java/org/polyfrost/colorsaturation/mixin/EntityRendererMixin.java

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
package org.polyfrost.colorsaturation.mixin;
22

3+
//#if MC >= 11700
4+
//#if MC >= 12105
5+
//$$ import net.minecraft.client.renderer.GameRenderer;
6+
//#else
7+
//$$ import net.minecraft.client.renderer.GameRenderer;
8+
//$$ import com.mojang.blaze3d.systems.RenderSystem;
9+
//$$ import net.minecraft.client.renderer.PostChain;
10+
//#endif
11+
//#else
312
import net.minecraft.client.renderer.EntityRenderer;
413
import net.minecraft.client.renderer.GlStateManager;
514
import net.minecraft.client.renderer.OpenGlHelper;
615
import net.minecraft.client.shader.ShaderGroup;
16+
//#endif
17+
718
import org.polyfrost.colorsaturation.EntityRendererHook;
819
import org.spongepowered.asm.mixin.Mixin;
920
import org.spongepowered.asm.mixin.Shadow;
@@ -13,34 +24,95 @@
1324
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
1425
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
1526

27+
//#if MC >= 11700
28+
//$$ @Mixin(GameRenderer.class)
29+
//#else
1630
@Mixin(EntityRenderer.class)
31+
//#endif
1732
public class EntityRendererMixin implements EntityRendererHook {
33+
//#if MC >= 11700
34+
//#if MC >= 12105
35+
//#else
36+
//$$ @Shadow
37+
//$$ private PostChain postEffect;
38+
//$$ @Unique
39+
//$$ private PostChain colorSaturation$saturationShader;
40+
//#endif
41+
//#else
1842
@Shadow
1943
private ShaderGroup theShaderGroup;
2044
@Unique
2145
private ShaderGroup colorSaturation$saturationShader;
46+
//#endif
2247

48+
//#if MC >= 11700
49+
//#if MC >= 12105
50+
//#else
51+
//$$ @Inject(method = "checkEntityPostEffect", at = @At("HEAD"), cancellable = true)
52+
//$$ private void onIsShaderActive(CallbackInfoReturnable<Boolean> cir) {
53+
//$$ if (colorSaturation$saturationShader != null) {
54+
//$$ cir.setReturnValue(true);
55+
//$$ }
56+
//$$ }
57+
//#endif
58+
//#else
2359
@Inject(method = "isShaderActive", at = @At("HEAD"), cancellable = true)
2460
private void onIsShaderActive(CallbackInfoReturnable<Boolean> cir) {
2561
if (colorSaturation$saturationShader != null && OpenGlHelper.shadersSupported) {
2662
cir.setReturnValue(true);
2763
}
2864
}
65+
//#endif
2966

67+
//#if MC >= 11700
68+
//#if MC >= 12105
69+
//#else
70+
//$$ @Inject(method = "getPostEffect", at = @At("HEAD"), cancellable = true)
71+
//$$ private void onGetShaderGroup(CallbackInfoReturnable<PostChain> cir) {
72+
//$$ if (colorSaturation$saturationShader != null && this.postEffect == null) {
73+
//$$ cir.setReturnValue(colorSaturation$saturationShader);
74+
//$$ }
75+
//$$ }
76+
//#endif
77+
//#else
3078
@Inject(method = "getShaderGroup", at = @At("HEAD"), cancellable = true)
3179
private void onGetShaderGroup(CallbackInfoReturnable<ShaderGroup> cir) {
3280
if (colorSaturation$saturationShader != null && OpenGlHelper.shadersSupported && this.theShaderGroup == null) {
3381
cir.setReturnValue(colorSaturation$saturationShader);
3482
}
3583
}
84+
//#endif
3685

86+
//#if MC >= 11700
87+
//#if MC >= 12105
88+
//#else
89+
//$$ @Inject(method = "resize", at = @At("TAIL"))
90+
//$$ private void updatePhosphor(int width, int height, CallbackInfo ci) {
91+
//$$ if (colorSaturation$saturationShader != null) {
92+
//$$ colorSaturation$saturationShader.resize(width, height);
93+
//$$ }
94+
//$$ }
95+
//#endif
96+
//#else
3797
@Inject(method = "updateShaderGroupSize", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderGlobal;createBindEntityOutlineFbs(II)V"))
3898
private void updatePhosphor(int width, int height, CallbackInfo ci) {
3999
if (colorSaturation$saturationShader != null) {
40100
colorSaturation$saturationShader.createBindFramebuffers(width, height);
41101
}
42102
}
103+
//#endif
43104

105+
//#if MC >= 11700
106+
//#if MC >= 12105
107+
//#else
108+
//$$ @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LevelRenderer;renderLevel(Lcom/mojang/blaze3d/vertex/PoseStack;FJZLnet/minecraft/client/Camera;Lnet/minecraft/client/renderer/GameRenderer;Lnet/minecraft/client/renderer/LightTexture;Lcom/mojang/math/Matrix4f;)V", shift = At.Shift.AFTER))
109+
//$$ private void renderPhosphor(float partialTicks, long nanoTime, boolean renderLevel, CallbackInfo ci) {
110+
//$$ if (this.colorSaturation$saturationShader != null) {
111+
//$$ this.colorSaturation$saturationShader.process(partialTicks);
112+
//$$ }
113+
//$$ }
114+
//#endif
115+
//#else
44116
@Inject(method = "updateCameraAndRender", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderGlobal;renderEntityOutlineFramebuffer()V", shift = At.Shift.AFTER))
45117
private void renderPhosphor(float partialTicks, long nanoTime, CallbackInfo ci) {
46118
if (this.colorSaturation$saturationShader != null) {
@@ -51,7 +123,22 @@ private void renderPhosphor(float partialTicks, long nanoTime, CallbackInfo ci)
51123
GlStateManager.popMatrix();
52124
}
53125
}
126+
//#endif
54127

128+
//#if MC >= 11700
129+
//#if MC >= 12105
130+
//#else
131+
//$$ @Override
132+
//$$ public PostChain colorSaturation$getSaturationShader() {
133+
//$$ return colorSaturation$saturationShader;
134+
//$$ }
135+
//$$
136+
//$$ @Override
137+
//$$ public void colorSaturation$setSaturationShader(PostChain saturationShader) {
138+
//$$ this.colorSaturation$saturationShader = saturationShader;
139+
//$$ }
140+
//#endif
141+
//#else
55142
@Override
56143
public ShaderGroup colorSaturation$getSaturationShader() {
57144
return colorSaturation$saturationShader;
@@ -61,4 +148,5 @@ private void renderPhosphor(float partialTicks, long nanoTime, CallbackInfo ci)
61148
public void colorSaturation$setSaturationShader(ShaderGroup saturationShader) {
62149
this.colorSaturation$saturationShader = saturationShader;
63150
}
64-
}
151+
//#endif
152+
}

src/main/resources/mixins.colorsaturation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"maxShiftBy": 5
88
},
99
"client": [
10-
"BlurHandlerMixin",
10+
"BlurHandlerMixin",
1111
"BlurModMixin",
1212
"EntityRendererMixin",
1313
"OptifineConfigMixin",

0 commit comments

Comments
 (0)