Skip to content

Commit cb4a937

Browse files
committed
Update to Minecraft 1.21.11
1 parent a89422a commit cb4a937

13 files changed

Lines changed: 103 additions & 105 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout repository
14-
uses: actions/checkout@v6
14+
uses: actions/checkout@v5
1515
- name: Validate gradle wrapper
1616
uses: gradle/actions/wrapper-validation@v5
1717
- name: Setup JDK 21

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This mod achieves it's goal by removing all button except the Quit Game button,
1515
Don't worry! Whether you are indecisive or you crave for more games, there's something for you as well!
1616
If you can re-arrange the letter in the splash text to start with "start", "menu", "play" and "poison", you *get to be in the game*, how incredible.
1717

18-
https://github.com/Kenny-Hui/QuitGame/assets/28094366/92e1460f-4441-40c6-9e28-e102b2b938d2
18+
https://github.com/AmberIsFrozen/QuitGame/assets/28094366/92e1460f-4441-40c6-9e28-e102b2b938d2
1919

2020
For gamers, that is 65% more game per game! (Don't get the right letter? Better luck next time!)
2121

build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.13-SNAPSHOT'
2+
id 'fabric-loom' version "$loom_version"
33
id 'maven-publish'
44
}
55

@@ -16,13 +16,18 @@ repositories {
1616
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
1717
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
1818
// for more information about repositories.
19+
20+
maven { url 'https://repo.sleeping.town/' }
1921
}
2022

2123
dependencies {
2224
// To change the versions see the gradle.properties file
2325
minecraft "com.mojang:minecraft:${project.minecraft_version}"
2426
mappings loom.officialMojangMappings()
2527
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
28+
29+
implementation 'folk.sisby:kaleido-config:0.3.3+1.3.2'
30+
include 'folk.sisby:kaleido-config:0.3.3+1.3.2'
2631
}
2732

2833
processResources {

gradle.properties

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ org.gradle.parallel=true
44

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.21.10
8-
loader_version=0.18.1
7+
minecraft_version=1.21.11
8+
loader_version=0.18.3
9+
loom_version=1.14-SNAPSHOT
910

1011
# Mod Properties
11-
mod_version = 1.0.4
12+
mod_version = 1.1.0
1213
maven_group = com.lx862
1314
archives_base_name = quitgame
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
package com.lx862.quitgame;
22

3-
import com.lx862.quitgame.config.Config;
3+
import com.lx862.quitgame.config.QuitGameConfig;
44
import net.fabricmc.api.ModInitializer;
55
import org.apache.logging.log4j.LogManager;
66
import org.apache.logging.log4j.Logger;
77

8-
import java.util.ArrayList;
9-
import java.util.List;
10-
118
public class QuitGame implements ModInitializer {
12-
public static final Logger LOGGER = LogManager.getLogger("QuitGame");
9+
public static final String MOD_ID = "quitgame";
10+
public static final Logger LOGGER = LogManager.getLogger(MOD_ID);
1311
public static double scale = 1.8;
14-
public static float rotAngle = 20.0F;
15-
public static List<String> keywords = new ArrayList<>();
1612
public static boolean unlocked = false;
1713
public static float unlockedAlpha = 0;
1814

1915
@Override
2016
public void onInitialize() {
21-
Config.load();
17+
QuitGameConfig.init();
2218
LOGGER.info("[QuitGame] QuitGame loaded");
2319
}
2420
}

src/main/java/com/lx862/quitgame/ReorderableSplashText.java

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
package com.lx862.quitgame;
22

3+
import net.minecraft.client.gui.Font;
4+
import net.minecraft.network.chat.Component;
5+
36
import java.util.LinkedList;
47
import java.util.stream.Collectors;
58

69
public class ReorderableSplashText {
7-
public String text;
10+
public static final float SPLASH_TILT_ANGLE = 20.0F;
11+
private final Component text;
812
public LinkedList<SplashTextCharacter> chars;
9-
public ReorderableSplashText(String text) {
13+
14+
public ReorderableSplashText(Font font, Component text) {
1015
this.text = text;
1116
chars = new LinkedList<>();
12-
for(int i = 0; i < text.length(); i++) {
13-
chars.add(new SplashTextCharacter(text.charAt(i)));
14-
}
17+
18+
text.getVisualOrderText().accept((i, style, j) -> {
19+
chars.add(new SplashTextCharacter(font, String.valueOf((char)j), style));
20+
return true;
21+
});
1522
}
1623

1724
public void reorder(SplashTextCharacter object, int idx) {
@@ -34,7 +41,11 @@ public void reorder(SplashTextCharacter object, int idx) {
3441
}
3542

3643
public boolean startsWith(String str) {
37-
String formedStr = chars.stream().map(e -> String.valueOf(e.getChar())).collect(Collectors.joining());
44+
String formedStr = chars.stream().map(e -> e.getChar()).collect(Collectors.joining());
3845
return formedStr.trim().toLowerCase().startsWith(str.toLowerCase());
3946
}
47+
48+
public Component asComponent() {
49+
return this.text;
50+
}
4051
}

src/main/java/com/lx862/quitgame/SplashTextCharacter.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
package com.lx862.quitgame;
22

3-
import net.minecraft.client.Minecraft;
43
import net.minecraft.client.gui.Font;
54
import net.minecraft.client.gui.GuiGraphics;
6-
import net.minecraft.util.ARGB;
5+
import net.minecraft.network.chat.Component;
6+
import net.minecraft.network.chat.Style;
77
import org.joml.Vector2f;
88

99
public class SplashTextCharacter {
10-
private final char character;
10+
private final String character;
11+
private final Style style;
1112
private Vector2f startPos;
1213
private Vector2f targetPos;
1314
private Vector2f renderedPos;
1415
private boolean dragging;
1516
public double width;
1617

17-
public SplashTextCharacter(char character) {
18+
public SplashTextCharacter(Font font, String character, Style style) {
1819
this.character = character;
20+
this.style = style;
1921
this.targetPos = new Vector2f(0, 0);
2022
this.renderedPos = new Vector2f(0, 0);
21-
this.width = Minecraft.getInstance().font.width(String.valueOf(character));
23+
this.width = font.width(Component.literal(character).withStyle(style));
2224
}
2325

24-
public char getChar() {
26+
public String getChar() {
2527
return character;
2628
}
2729

@@ -58,8 +60,8 @@ public void render(GuiGraphics guiGraphics, double deltaTime, float alpha, Font
5860

5961
guiGraphics.pose().pushMatrix();
6062
guiGraphics.pose().translate(renderedPos.x, renderedPos.y);
61-
guiGraphics.pose().rotate((float)(-QuitGame.rotAngle * Math.PI) / 180f);
62-
guiGraphics.drawString(font, String.valueOf(character), 0, 0, ARGB.color(alpha, 16776960));
63+
guiGraphics.pose().rotate((float)(-ReorderableSplashText.SPLASH_TILT_ANGLE * Math.PI) / 180f);
64+
guiGraphics.drawString(font, getComponent(), 0, 0, 0xFFFFFFFF /*ARGB.color(alpha, 16776960)*/);
6365
guiGraphics.pose().popMatrix();
6466
}
6567

@@ -69,7 +71,11 @@ public void renderBoundary(GuiGraphics guiGraphics, double deltaTime, Font font)
6971
double endX = ((width + 0.5) * QuitGame.scale);
7072
double endY = ((8 + 2) * QuitGame.scale);
7173

72-
guiGraphics.submitOutline((int)startX, (int)startY, (int)endX, (int)endY, 0xFFFFFFFF);
74+
guiGraphics.renderOutline((int)startX, (int)startY, (int)endX, (int)endY, 0xFFFFFFFF);
75+
}
76+
77+
public Component getComponent() {
78+
return Component.literal(character).withStyle(style);
7379
}
7480

7581
public void dragged() {

src/main/java/com/lx862/quitgame/config/Config.java

Lines changed: 0 additions & 61 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.lx862.quitgame.config;
2+
3+
import com.lx862.quitgame.QuitGame;
4+
import folk.sisby.kaleido.api.WrappedConfig;
5+
import folk.sisby.kaleido.lib.quiltconfig.api.annotations.Comment;
6+
import folk.sisby.kaleido.lib.quiltconfig.api.values.ValueList;
7+
import net.fabricmc.loader.api.FabricLoader;
8+
9+
import java.nio.file.Path;
10+
import java.util.List;
11+
12+
public class QuitGameConfig extends WrappedConfig {
13+
public static final Path configDir = FabricLoader.getInstance().getConfigDir();
14+
public static final QuitGameConfig INSTANCE = createToml(configDir, "", QuitGame.MOD_ID, QuitGameConfig.class);
15+
16+
@Comment("Whether to directly unlock the game, the splash will still be reorderable after that.")
17+
public boolean alwaysUnlock = false;
18+
19+
@Comment("A list of keywords the rearranged splash have to start with in order to unlock the game")
20+
public List<String> keywords = ValueList.create("", "init", "start", "menu", "play", "poison");
21+
22+
// Static initialization
23+
public static void init() {
24+
}
25+
}

0 commit comments

Comments
 (0)