Skip to content

Commit 52b4b1a

Browse files
authored
Update to 1.21.11 (#54)
- Downgrade java requirement to 21 - Update Loom and Gradle
2 parents ed6fa04 + 2509ba7 commit 52b4b1a

File tree

13 files changed

+88
-25
lines changed

13 files changed

+88
-25
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
- name: Setup Java
1111
uses: actions/setup-java@v4
1212
with:
13-
java-version: '23'
13+
java-version: '25'
1414
distribution: 'temurin'
1515
architecture: x64
1616
- name: Setup Gradle
1717
uses: gradle/actions/setup-gradle@v4
1818
with:
19-
gradle-version: 8.14
19+
gradle-version: 9.2.1
2020
- name: Setup workspace
2121
run: gradle preprocessBase
2222
- name: Build
@@ -38,7 +38,7 @@ jobs:
3838
strategy:
3939
max-parallel: 1
4040
matrix:
41-
version: ["1.20.4", "1.20.6", "1.21.1", "1.21.3", "1.21.4", "1.21.5", "1.21.8", "1.21.10"]
41+
version: ["1.20.4", "1.20.6", "1.21.1", "1.21.3", "1.21.4", "1.21.5", "1.21.8", "1.21.10", "1.21.11"]
4242
steps:
4343
- uses: actions/download-artifact@v4
4444
with:

1.21.11/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
plugins {
2+
id 'fabric-loom' version "${loom_version}"
3+
}
4+
5+
apply from: "../common.gradle"

1.21.11/gradle.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
org.gradle.jvmargs=-Xmx3G
2+
3+
minecraft_version=1.21.11
4+
allowed_mc_version=>1.21.10 <=1.21.11
5+
fabric_version=0.139.5+1.21.11

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ You only need to open the build.gradle file in LoTAS-Light (not in sub projects
3232
1. Set your workspace folder to the parent folder of the LoTAS-Light folder, so if you have something like `workspace/LoTAS-Light`, set the workspace folder to "workspace".
3333
2. Click `File>Import` then search for "Existing Gradle project" and click next
3434
3. Select the "LoTAS-Light" folder as a project root directory then click next
35-
4. (optional) In this step you can set up a specific JDK and gradle version if you haven't set that up yet, but currently this project needs JDK 23 and a Gradle version greater than 8.12.1.
35+
4. (optional) In this step you can set up a specific JDK and gradle version if you haven't set that up yet, but currently this project needs at least JDK 21 and a Gradle version greater than 9.2.1.
3636
5. Then click finish and wait for it to set up
3737

3838
### 5. Decompile source and download assets

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44

55
discombobulator {
66
versions = [
7+
"1.21.11":"",
78
"1.21.10":"",
89
"1.21.8":"",
910
"1.21.5":"",

common.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ java {
44
}
55

66
def snapshot = project.release=="true" ? "" : "-SNAPSHOT"
7-
version = project.mod_version + snapshot
7+
def mod_version = project.mod_version + snapshot
8+
def allowed_mc_version = project.allowed_mc_version
9+
version = mod_version
810
group = project.maven_group
911

1012
base {
@@ -51,13 +53,13 @@ loom {
5153
}
5254

5355
processResources {
54-
inputs.property "version", project.version
55-
inputs.property "allowedMcVersion", project.allowed_mc_version
56+
inputs.property "version", mod_version
57+
inputs.property "allowedMcVersion", allowed_mc_version
5658

5759
filesMatching("fabric.mod.json") { file ->
58-
expand "version": project.version
60+
expand "version": mod_version
5961
filter { String line ->
60-
line.replace('"minecraft": "*",', '"minecraft": "' + project.allowed_mc_version + '",')
62+
line.replace('"minecraft": "*",', '"minecraft": "' + allowed_mc_version + '",')
6163
};
6264
}
6365
}

gradle.properties

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
org.gradle.jvmargs=-Xmx3G
2+
org.gradle.configuration-cache=true
23

34
# fabric
4-
loader_version=0.17.2
5-
loom_version=1.11-SNAPSHOT
5+
loader_version=0.18.2
6+
loom_version=1.14-SNAPSHOT
67

78
# preprocessor
8-
discombobulator_version=1.3.1
9+
discombobulator_version=1.4
910

1011
# mod
1112
mod_name=LoTAS-Light
12-
mod_version=1.3.3
13+
mod_version=1.3.4
1314
maven_group=com.minecrafttas
1415
release=false

src/main/java/com/minecrafttas/lotas_light/LoTASLightClient.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636
import net.minecraft.client.resources.language.I18n;
3737
import net.minecraft.client.server.IntegratedServer;
3838
import net.minecraft.network.chat.Component;
39+
//# 1.21.11
40+
//$$import net.minecraft.resources.Identifier;
41+
//# def
3942
import net.minecraft.resources.ResourceLocation;
43+
//# end
4044
import net.minecraft.server.MinecraftServer;
4145
import net.minecraft.server.ServerTickRateManager;
4246
import net.minecraft.server.level.ServerLevel;
@@ -58,6 +62,8 @@
5862
public class LoTASLightClient implements ClientModInitializer {
5963

6064
private KeybindManager keybindManager = new KeybindManager(KeybindManager::isKeyDownExceptTextField);
65+
// # 1.21.11
66+
//$$ private static final KeyMapping.Category LOTASLIGHT_CATEGORY = KeyMapping.Category.register(Identifier.fromNamespaceAndPath("lotaslight", "lotaslight"));
6167
// # 1.21.10
6268
//$$ private static final KeyMapping.Category LOTASLIGHT_CATEGORY = KeyMapping.Category.register(ResourceLocation.fromNamespaceAndPath("lotaslight", "lotaslight"));
6369
//# end
@@ -203,6 +209,11 @@ private void advanceTickrate(Minecraft client) {
203209
}
204210

205211
private void drawHud(GuiGraphics context, float deltaTicks) { //@GraphicsDelta;
212+
//# 1.21.11
213+
//$$ int i = ARGB.colorFromFloat(.2F, 1f, 1f, 1f);
214+
//$$ context.blit(RenderPipelines.GUI_TEXTURED, Identifier.fromNamespaceAndPath("lotaslight", "potion.png"), Minecraft.getInstance().getWindow().getGuiScaledWidth() / 2
215+
//$$ - 10, Minecraft.getInstance().getWindow().getGuiScaledHeight()
216+
//$$ - 50, 0, 0, 20, 20, 20, 20, i);
206217
//# 1.21.8
207218
//$$ int i = ARGB.colorFromFloat(.2F, 1f, 1f, 1f);
208219
//$$ context.blit(RenderPipelines.GUI_TEXTURED, ResourceLocation.fromNamespaceAndPath("lotaslight", "potion.png"), Minecraft.getInstance().getWindow().getGuiScaledWidth() / 2
@@ -245,7 +256,13 @@ private void advanceTickrate(Minecraft client) {
245256
}
246257

247258
private void renderIcon(IndicatorLocation location, float uvCoordinate, GuiGraphics context) {
248-
ResourceLocation streamIcons = new ResourceLocation("lotaslight", "stream_indicator.png"); //@ResourceLocation;
259+
//# 1.21.11
260+
//$$ Identifier streamIcons = Identifier.fromNamespaceAndPath("lotaslight", "stream_indicator.png");
261+
//# 1.21.1
262+
//$$ ResourceLocation streamIcons = ResourceLocation.fromNamespaceAndPath("lotaslight", "stream_indicator.png");
263+
//# def
264+
ResourceLocation streamIcons = new ResourceLocation("lotaslight", "stream_indicator.png");
265+
//# end
249266

250267
int x = 0;
251268
int y = 0;

src/main/java/com/minecrafttas/lotas_light/keybind/KeybindManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
import com.mojang.blaze3d.platform.InputConstants.Type;
1212

1313
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
14+
//# 1.21.11
15+
//$$import net.minecraft.util.Util;
16+
//# def
1417
import net.minecraft.Util;
18+
//# end
1519
import net.minecraft.client.KeyMapping;
1620
import net.minecraft.client.Minecraft;
1721
import net.minecraft.client.gui.screens.ChatScreen;

src/main/java/com/minecrafttas/lotas_light/mixin/MixinMinecraftServer.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
import com.minecrafttas.lotas_light.LoTASLightClient;
1515
import com.minecrafttas.lotas_light.duck.Tickratechanger;
1616

17+
//# 1.21.11
18+
//$$import net.minecraft.util.Util;
19+
//# def
1720
import net.minecraft.Util;
21+
//# end
1822
import net.minecraft.client.server.IntegratedServer;
1923
import net.minecraft.core.RegistryAccess;
2024
import net.minecraft.nbt.CompoundTag;
@@ -43,13 +47,21 @@ public long modifyVariable_preventOverload(long original) {
4347
else
4448
return original;
4549
}
46-
50+
51+
//# 1.21.11
52+
//$$ @Redirect(method = "runServer", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;getNanos()J"))
53+
//# def
4754
@Redirect(method = "runServer", at = @At(value = "INVOKE", target = "Lnet/minecraft/Util;getNanos()J"))
55+
//# end
4856
public long redirectGetMeasuringTimeMsInRun() {
4957
return getCurrentTime();
5058
}
5159

60+
//# 1.21.11
61+
//$$ @Redirect(method = "haveTime", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;getNanos()J"))
62+
//# def
5263
@Redirect(method = "haveTime", at = @At(value = "INVOKE", target = "Lnet/minecraft/Util;getNanos()J"))
64+
//# end
5365
public long redirectGetMeasuringTimeMsInShouldKeepTicking() {
5466
return getCurrentTime();
5567
}

0 commit comments

Comments
 (0)