Skip to content

Commit 75631db

Browse files
committed
Add support for 1.21.10 & 1.21.11
1 parent b93b41f commit 75631db

12 files changed

Lines changed: 265 additions & 9 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ run/
7373
# LabyGradle | Addon Plugin
7474
build-data.txt
7575
.assetsroot
76+
resources_index.json
7677

7778
# Don't ignore libraries
7879
!libs/*.jar

build.gradle.kts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import com.diffplug.spotless.LineEnding
12
import com.google.gson.GsonBuilder
23
import com.google.gson.annotations.SerializedName
34
import net.labymod.labygradle.common.extension.model.GameVersion
@@ -7,7 +8,7 @@ import java.nio.file.Files
78
plugins {
89
id("net.labymod.labygradle")
910
id("net.labymod.labygradle.addon")
10-
id("org.cadixdev.licenser") version ("0.6.1")
11+
id("com.diffplug.spotless") version ("8.0.0")
1112
}
1213

1314
val versions = providers.gradleProperty("net.labymod.minecraft-versions").get().split(";")
@@ -31,7 +32,7 @@ labyMod {
3132
}
3233

3334
val file = file("./game-runner/src/${this.sourceSetName}/resources/optifine-${versionId}.accesswidener");
34-
accessWidener.set(file)
35+
accessWidener(file)
3536
}
3637
}
3738

@@ -73,14 +74,17 @@ fun GameVersion.useOptiFine(enabled: Boolean) {
7374
subprojects {
7475
plugins.apply("net.labymod.labygradle")
7576
plugins.apply("net.labymod.labygradle.addon")
76-
plugins.apply("org.cadixdev.licenser")
77+
plugins.apply("com.diffplug.spotless")
7778

7879
group = rootProject.group
7980
version = rootProject.version
8081

81-
license {
82-
header(rootProject.file("gradle/LICENSE-HEADER.txt"))
83-
newLine.set(true)
82+
spotless {
83+
lineEndings = LineEnding.UNIX
84+
85+
java {
86+
licenseHeaderFile(rootProject.file("gradle/LICENSE-HEADER.txt"))
87+
}
8488
}
8589
}
8690

core/src/main/resources/assets/optifine/versions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@
7171
"game_version": "1.21.8",
7272
"of_version": "HD_U_J6_pre16",
7373
"preview": true
74+
},
75+
{
76+
"game_version": "1.21.10",
77+
"of_version": "HD_U_J7_pre11",
78+
"preview": true
79+
},
80+
{
81+
"game_version": "1.21.11",
82+
"of_version": "HD_U_J8"
7483
}
7584
]
7685
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* This library is free software; you can redistribute it and/or
3+
* modify it under the terms of the GNU Lesser General Public
4+
* License as published by the Free Software Foundation; either
5+
* version 2.1 of the License, or (at your option) any later version.
6+
*
7+
* This library is distributed in the hope that it will be useful,
8+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10+
* Lesser General Public License for more details.
11+
*
12+
* You should have received a copy of the GNU Lesser General Public
13+
* License along with this library; if not, write to the Free Software
14+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15+
*/
16+
17+
package net.labymod.addons.optifine.v1_21_10.client.gfx.renderer.shader;
18+
19+
import java.nio.FloatBuffer;
20+
import javax.inject.Singleton;
21+
import net.labymod.addons.optifine.client.gfx.renderer.shader.ShaderAccessor;
22+
import net.labymod.api.models.Implements;
23+
import net.optifine.shaders.Shaders;
24+
25+
@Singleton
26+
@Implements(ShaderAccessor.class)
27+
public class VersionedShaderAccessor implements ShaderAccessor {
28+
29+
public VersionedShaderAccessor() {
30+
}
31+
32+
@Override
33+
public boolean isShadowPass() {
34+
return Shaders.isShadowPass;
35+
}
36+
37+
@Override
38+
public FloatBuffer getShadowModelViewBuffer() {
39+
return Shaders.shadowModelView;
40+
}
41+
42+
@Override
43+
public FloatBuffer getShadowModelViewInverseBuffer() {
44+
return Shaders.shadowModelViewInverse;
45+
}
46+
47+
@Override
48+
public FloatBuffer getShadowProjectionBuffer() {
49+
return Shaders.shadowProjection;
50+
}
51+
52+
@Override
53+
public FloatBuffer getShadowProjectionInverseBuffer() {
54+
return Shaders.shadowProjectionInverse;
55+
}
56+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* This library is free software; you can redistribute it and/or
3+
* modify it under the terms of the GNU Lesser General Public
4+
* License as published by the Free Software Foundation; either
5+
* version 2.1 of the License, or (at your option) any later version.
6+
*
7+
* This library is distributed in the hope that it will be useful,
8+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10+
* Lesser General Public License for more details.
11+
*
12+
* You should have received a copy of the GNU Lesser General Public
13+
* License along with this library; if not, write to the Free Software
14+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15+
*/
16+
17+
package net.labymod.addons.optifine.v1_21_10.gui;
18+
19+
import java.util.function.BiFunction;
20+
import javax.inject.Singleton;
21+
import net.labymod.addons.optifine.gui.OptiFineScreen;
22+
import net.labymod.addons.optifine.gui.ScreenHandler;
23+
import net.labymod.api.client.gui.screen.game.GameScreen;
24+
import net.labymod.api.models.Implements;
25+
import net.minecraft.client.Minecraft;
26+
import net.minecraft.client.Options;
27+
import net.minecraft.client.gui.screens.Screen;
28+
import net.optifine.gui.GuiAnimationSettingsOF;
29+
import net.optifine.gui.GuiDetailSettingsOF;
30+
import net.optifine.gui.GuiOtherSettingsOF;
31+
import net.optifine.gui.GuiPerformanceSettingsOF;
32+
import net.optifine.gui.GuiQualitySettingsOF;
33+
import net.optifine.shaders.gui.GuiShaders;
34+
35+
@Singleton
36+
@Implements(ScreenHandler.class)
37+
public class VersionedScreenHandler extends ScreenHandler<Screen, Options> {
38+
39+
@Override
40+
public void onInitialize() {
41+
this.registerOptions(OptiFineScreen.ANIMATION, GuiAnimationSettingsOF.class, GuiAnimationSettingsOF::new);
42+
this.registerOptions(OptiFineScreen.DETAIL, GuiDetailSettingsOF.class, GuiDetailSettingsOF::new);
43+
this.registerOptions(OptiFineScreen.OTHER, GuiOtherSettingsOF.class, GuiOtherSettingsOF::new);
44+
this.registerOptions(OptiFineScreen.PERFORMANCE, GuiPerformanceSettingsOF.class, GuiPerformanceSettingsOF::new);
45+
this.registerOptions(OptiFineScreen.QUALITY, GuiQualitySettingsOF.class, GuiQualitySettingsOF::new);
46+
this.registerOptions(OptiFineScreen.SHADERS, GuiShaders.class, GuiShaders::new);
47+
}
48+
49+
@Override
50+
public void registerOptions(
51+
GameScreen screen,
52+
Class<?> screenClass,
53+
BiFunction<Screen, Options, Screen> screenFactory
54+
) {
55+
this.register(
56+
screen,
57+
screenClass,
58+
() -> screenFactory.apply(Minecraft.getInstance().screen, Minecraft.getInstance().options)
59+
);
60+
}
61+
62+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
accessWidener v1 named
2+
3+
accessible field net/optifine/shaders/Shaders *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* This library is free software; you can redistribute it and/or
3+
* modify it under the terms of the GNU Lesser General Public
4+
* License as published by the Free Software Foundation; either
5+
* version 2.1 of the License, or (at your option) any later version.
6+
*
7+
* This library is distributed in the hope that it will be useful,
8+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10+
* Lesser General Public License for more details.
11+
*
12+
* You should have received a copy of the GNU Lesser General Public
13+
* License along with this library; if not, write to the Free Software
14+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15+
*/
16+
17+
package net.labymod.addons.optifine.v1_21_11.client.gfx.renderer.shader;
18+
19+
import java.nio.FloatBuffer;
20+
import javax.inject.Singleton;
21+
import net.labymod.addons.optifine.client.gfx.renderer.shader.ShaderAccessor;
22+
import net.labymod.api.models.Implements;
23+
import net.optifine.shaders.Shaders;
24+
25+
@Singleton
26+
@Implements(ShaderAccessor.class)
27+
public class VersionedShaderAccessor implements ShaderAccessor {
28+
29+
public VersionedShaderAccessor() {
30+
}
31+
32+
@Override
33+
public boolean isShadowPass() {
34+
return Shaders.isShadowPass;
35+
}
36+
37+
@Override
38+
public FloatBuffer getShadowModelViewBuffer() {
39+
return Shaders.shadowModelView;
40+
}
41+
42+
@Override
43+
public FloatBuffer getShadowModelViewInverseBuffer() {
44+
return Shaders.shadowModelViewInverse;
45+
}
46+
47+
@Override
48+
public FloatBuffer getShadowProjectionBuffer() {
49+
return Shaders.shadowProjection;
50+
}
51+
52+
@Override
53+
public FloatBuffer getShadowProjectionInverseBuffer() {
54+
return Shaders.shadowProjectionInverse;
55+
}
56+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* This library is free software; you can redistribute it and/or
3+
* modify it under the terms of the GNU Lesser General Public
4+
* License as published by the Free Software Foundation; either
5+
* version 2.1 of the License, or (at your option) any later version.
6+
*
7+
* This library is distributed in the hope that it will be useful,
8+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10+
* Lesser General Public License for more details.
11+
*
12+
* You should have received a copy of the GNU Lesser General Public
13+
* License along with this library; if not, write to the Free Software
14+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15+
*/
16+
17+
package net.labymod.addons.optifine.v1_21_11.gui;
18+
19+
import java.util.function.BiFunction;
20+
import javax.inject.Singleton;
21+
import net.labymod.addons.optifine.gui.OptiFineScreen;
22+
import net.labymod.addons.optifine.gui.ScreenHandler;
23+
import net.labymod.api.client.gui.screen.game.GameScreen;
24+
import net.labymod.api.models.Implements;
25+
import net.minecraft.client.Minecraft;
26+
import net.minecraft.client.Options;
27+
import net.minecraft.client.gui.screens.Screen;
28+
import net.optifine.gui.GuiAnimationSettingsOF;
29+
import net.optifine.gui.GuiDetailSettingsOF;
30+
import net.optifine.gui.GuiOtherSettingsOF;
31+
import net.optifine.gui.GuiPerformanceSettingsOF;
32+
import net.optifine.gui.GuiQualitySettingsOF;
33+
import net.optifine.shaders.gui.GuiShaders;
34+
35+
@Singleton
36+
@Implements(ScreenHandler.class)
37+
public class VersionedScreenHandler extends ScreenHandler<Screen, Options> {
38+
39+
@Override
40+
public void onInitialize() {
41+
this.registerOptions(OptiFineScreen.ANIMATION, GuiAnimationSettingsOF.class, GuiAnimationSettingsOF::new);
42+
this.registerOptions(OptiFineScreen.DETAIL, GuiDetailSettingsOF.class, GuiDetailSettingsOF::new);
43+
this.registerOptions(OptiFineScreen.OTHER, GuiOtherSettingsOF.class, GuiOtherSettingsOF::new);
44+
this.registerOptions(OptiFineScreen.PERFORMANCE, GuiPerformanceSettingsOF.class, GuiPerformanceSettingsOF::new);
45+
this.registerOptions(OptiFineScreen.QUALITY, GuiQualitySettingsOF.class, GuiQualitySettingsOF::new);
46+
this.registerOptions(OptiFineScreen.SHADERS, GuiShaders.class, GuiShaders::new);
47+
}
48+
49+
@Override
50+
public void registerOptions(
51+
GameScreen screen,
52+
Class<?> screenClass,
53+
BiFunction<Screen, Options, Screen> screenFactory
54+
) {
55+
this.register(
56+
screen,
57+
screenClass,
58+
() -> screenFactory.apply(Minecraft.getInstance().screen, Minecraft.getInstance().options)
59+
);
60+
}
61+
62+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
accessWidener v1 named
2+
3+
accessible field net/optifine/shaders/Shaders *

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
org.gradle.jvmargs=-Xmx4096m
2-
net.labymod.minecraft-versions=1.8.9;1.12.2;1.16.5;1.17.1;1.18.2;1.19.2;1.19.3;1.19.4;1.20.1;1.20.2;1.20.4;1.20.6;1.21;1.21.1;1.21.3;1.21.4;1.21.8
2+
net.labymod.minecraft-versions=1.8.9;1.12.2;1.16.5;1.17.1;1.18.2;1.19.2;1.19.3;1.19.4;1.20.1;1.20.2;1.20.4;1.20.6;1.21;1.21.1;1.21.3;1.21.4;1.21.8;1.21.10;1.21.11

0 commit comments

Comments
 (0)