Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions DEVELOPMENT.md

This file was deleted.

8 changes: 0 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def hasHudElementRegistry = stonecutter.eval(mcVersion, '>=1.21.6') // 1.21.6+

apply plugin: isLegacy ? 'net.fabricmc.fabric-loom-remap' : 'net.fabricmc.fabric-loom'

// Per-MC Java version (21 for 1.21.x, 25 for 26.1+).
def javaVersionInt = Integer.parseInt(project.java_version)
def javaLang = JavaVersion.toVersion(javaVersionInt)
def mixinJavaCompat = "JAVA_${javaVersionInt}"
Expand All @@ -31,12 +30,8 @@ repositories {
maven { url 'https://maven.terraformersmc.com/releases/' }
}

// Adds the Modrinth maven and modmenuDependency(), a fallback for when the
// TerraformersMC maven is unreachable.
apply from: "${rootDir}/gradle/modrinth-fallback.gradle"

// MC 26+ uses fabric-rendering-v1's transitive deps but rejects ASM coming from
// annotation processors.
if (!isLegacy) {
configurations.configureEach {
if (name.toLowerCase().contains('annotationprocessor')) {
Expand All @@ -45,9 +40,6 @@ if (!isLegacy) {
}
}

// Every variant declares fabric-api, modmenu, and cloth-config as runtime deps
// (not bundled). 1.21.x uses modImplementation for intermediary remapping; 26.x
// uses plain implementation against unobfuscated MC.
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"

Expand Down
3 changes: 0 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true

# IntelliJ IDEA is not yet fully compatible with configuration cache, see: https://github.com/FabricMC/fabric-loom/issues/1349
org.gradle.configuration-cache=false

# Acknowledge using Groovy DSL with Stonecutter (Kotlin DSL is recommended but Groovy works).
dev.kikugie.stonecutter.hard_mode=true

# Single loom version covers all MC variants. The `fabric-loom-remap` plugin id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
public class LaunchTestClient implements ClientModInitializer {
private static final boolean EXPECT_WORLD = Boolean.getBoolean("betterhud.launchtest.expectWorld");

// 200 ticks (10s) gives the software renderer on CI time to draw chunks.
private static final int WORLD_SCREENSHOT_TICK = 200;
private static final int WORLD_STOP_TICK = 240;
private static final int TITLE_SCREENSHOT_TICK = 40;
private static final int TITLE_STOP_TICK = 80;
// 2400 ticks (2min) is plenty to join the pre-generated flat world; bail
// out with a failure instead of hanging until the CI job timeout.
private static final int WORLD_JOIN_TIMEOUT_TICKS = 2400;

private int totalTicks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public void runTest(ClientGameTestContext context) {
.create()) {
singleplayer.getClientWorld().waitForChunksRender();

// Let the world tick a little with the HUD rendering before capturing evidence.
context.waitTicks(40);
assertScreenshotSaved(context.takeScreenshot("betterhud-survival-world"));
}
Expand Down
12 changes: 0 additions & 12 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,16 @@ plugins {
id 'dev.kikugie.stonecutter' version '0.9.3'
}

// Every supported Minecraft version, and the build variant that covers it,
// lives in supported-versions.json — the single source of truth also used by
// the launch tests, the CI matrices, and the modrinthBundle task.
def supportedVersions = new groovy.json.JsonSlurper().parse(file('supported-versions.json'))
def variants = supportedVersions.values()*.variant.unique()

stonecutter {
create(rootProject) {
// Each variant is one buildable subproject; the string is both the
// subproject name and the MC version it compiles against (see
// versions/<variant>/gradle.properties).
versions(*variants)

// vcsVersion is the variant whose form the sources are committed in
// (the "active" version when nothing else is selected).
vcsVersion = variants.last()
}
}

rootProject.name = 'betterhud'

// Not a Stonecutter variant: a sourceless harness that launches a production
// Fabric client for any supported MC version (-PtestMcVersion) with the
// matching variant's built jar. Used by the CI launch-test matrix.
include 'launchtest'
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public void runTest(ClientGameTestContext context) {
.create()) {
singleplayer.getClientLevel().waitForChunksRender();

// Let the world tick a little with the HUD rendering before capturing evidence.
context.waitTicks(40);
assertScreenshotSaved(context.takeScreenshot("betterhud-survival-world"));
}
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/dsns/betterhud/BetterHUD.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

@Environment(EnvType.CLIENT)
public class BetterHUD implements ClientModInitializer {

// This logger is used to write text to the console and the log file.
// It is considered best practice to use your mod id as the logger's name.
// That way, it's clear which mod wrote info, warnings, and errors.
public static final Logger LOGGER = LoggerFactory.getLogger("betterhud");

public static ArrayList<BaseMod> mods = new ArrayList<>(
Expand Down
1 change: 0 additions & 1 deletion src/main/java/dsns/betterhud/ModMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
.setParentScreen(parent)
.setTitle(Component.literal("BetterHUD Settings"));

// same as builder.setSavingRunnable(() -> Config.serialize());
builder.setSavingRunnable(Config::serialize);

ConfigEntryBuilder entryBuilder = builder.entryBuilder();
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/dsns/betterhud/mods/Biome.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public CustomText onStartTick(Minecraft client) {

if (player == null) return null;

// have to specify this because name of class is Biome
//? if >=26 {
// must use long type because name of class is Biome
Holder<net.minecraft.world.level.biome.Biome> biome = client.level.getBiome(player.blockPosition());

if (!biome.unwrapKey().isPresent()) return null;
Expand Down Expand Up @@ -99,17 +99,14 @@ public CustomText onStartTick(Minecraft client) {
}

public String formatSnakeCase(String biomeName) {
// Split the string by underscores
String[] words = biomeName.split("_");

// Capitalize each word
for (int i = 0; i < words.length; i++) {
words[i] =
words[i].substring(0, 1).toUpperCase() +
words[i].substring(1).toLowerCase();
}

// Join the words with spaces
return String.join(" ", words);
}
}
3 changes: 0 additions & 3 deletions src/main/java/dsns/betterhud/mods/Facing.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,14 @@ public CustomText onStartTick(Minecraft client) {
}

public String formatSnakeCase(String biomeName) {
// Split the string by underscores
String[] words = biomeName.split("_");

// Capitalize each word
for (int i = 0; i < words.length; i++) {
words[i] =
words[i].substring(0, 1).toUpperCase() +
words[i].substring(1).toLowerCase();
}

// Join the words with spaces
return String.join(" ", words);
}
}
28 changes: 0 additions & 28 deletions stonecutter.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,14 @@ plugins {
id 'dev.kikugie.stonecutter'
}

// The "active" version determines which variant the source tree currently shows
// uncommented. Switch with `./gradlew "Set active version to <ver>"` (Stonecutter task).
stonecutter.active('26.2') /* [SC] DO NOT EDIT */

// Stonecutter 0.7+ no longer needs explicit `registerChiseled` task: running
// `./gradlew build` from the root automatically runs `build` for every version
// subproject. Per-version commands like `./gradlew :1.21:build` also work.

// Groups every supported Minecraft version (supported-versions.json) by the
// build variant whose jar covers it, e.g. '1.21' -> ['1.21', ..., '1.21.5'].
def supportedVersions = new groovy.json.JsonSlurper().parse(file('supported-versions.json'))
def gameVersionsByVariant = [:]
supportedVersions.each { mc, info ->
gameVersionsByVariant.computeIfAbsent(info.variant) { [] } << mc
}

// Builds every variant and collects the release jars in build/modrinth/ along
// with UPLOAD.md, which lists exactly which Minecraft versions to select for
// each jar when uploading to Modrinth. CI publishes the same directory as the
// "modrinth-upload" artifact on every push.
tasks.register('modrinthBundle') {
group = 'publishing'
description = 'Collects the release jars and the per-jar Minecraft version lists for Modrinth.'
Expand All @@ -44,22 +32,6 @@ tasks.register('modrinthBundle') {
rows << "| `${jar.name}` | ${gameVersions.join(', ')} |"
}

def manifest = new File(outDir, 'UPLOAD.md')
manifest.text = [
"# Modrinth upload — betterhud ${project.mod_version}",
'',
'Upload each jar below as its own Modrinth version, selecting exactly',
'the listed Minecraft versions for it. Loader: Fabric. Required',
'dependencies: Fabric API, Cloth Config, Mod Menu.',
'',
'| File | Minecraft versions |',
'| --- | --- |',
*rows,
''
].join('\n')

println()
println manifest.text
println "Bundle written to ${outDir}"
}
}
3 changes: 0 additions & 3 deletions versions/1.21.6/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ minecraft_version=1.21.6
loader_version=0.17.3
java_version=21

# fabric.mod.json range
mc_dep=>=1.21.6 <1.22
loader_dep=>=0.16.10

# Fabric API + ecosystem (compile-time versions for this variant; the launch
# tests pin per-version runtime versions in supported-versions.json).
fabric_api_version=0.128.2+1.21.6
modmenu_version=15.0.2
cloth_config_version=19.0.147
3 changes: 0 additions & 3 deletions versions/1.21/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ minecraft_version=1.21
loader_version=0.17.3
java_version=21

# fabric.mod.json range
mc_dep=>=1.21 <=1.21.5
loader_dep=>=0.15.11

# Fabric API + ecosystem (compile-time versions for this variant; the launch
# tests pin per-version runtime versions in supported-versions.json).
fabric_api_version=0.102.0+1.21
modmenu_version=14.0.2
cloth_config_version=19.0.147
2 changes: 0 additions & 2 deletions versions/26.1/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ minecraft_version=26.1
loader_version=0.19.2
java_version=25

# fabric.mod.json range
mc_dep=>=26.1 <26.2
loader_dep=>=0.19

# Fabric API + ecosystem (runtime deps, not bundled)
fabric_api_version=0.145.1+26.1
modmenu_version=18.0.0-alpha.8
cloth_config_version=26.1.154
2 changes: 0 additions & 2 deletions versions/26.2/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ minecraft_version=26.2
loader_version=0.19.3
java_version=25

# fabric.mod.json range
mc_dep=>=26.2
loader_dep=>=0.19

# Fabric API + ecosystem (26.2 requires these as runtime deps, not bundled)
fabric_api_version=0.154.0+26.2
modmenu_version=18.0.0-alpha.8
cloth_config_version=26.1.154