Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
4a41a14
Add new data generation for tiny flower data
SecretOnline Dec 15, 2025
9026ff5
Rename mod, and more datagen
SecretOnline Dec 15, 2025
d68b013
New recipe generation
SecretOnline Dec 16, 2025
3df8e40
Comment out a lot of block code
SecretOnline Dec 16, 2025
43d3586
Item model generation
SecretOnline Dec 16, 2025
a890d02
Add fallback string for flowers without a name
SecretOnline Dec 16, 2025
1230524
Add texture fallback for tiny flowers with an invalid component
SecretOnline Dec 16, 2025
639f94f
Start re-creating garden block
SecretOnline Dec 16, 2025
ae886f6
Implement most of the shears functionality back in
SecretOnline Dec 16, 2025
828c5e2
Fix registry issues and a couple of other bugs
SecretOnline Dec 18, 2025
0952ef4
Some level of item placement
SecretOnline Dec 18, 2025
0f6325d
Refactor data generation
SecretOnline Dec 19, 2025
ceb3126
Add tooltips to garden
SecretOnline Dec 19, 2025
7295432
Fix a lot to do with item placement
SecretOnline Dec 19, 2025
7bfc6e7
Add eyeblossom updating
SecretOnline Dec 19, 2025
a68e8f1
Start block entity renderer for gardens
SecretOnline Dec 19, 2025
b9ce21c
Add data generation for resources
SecretOnline Dec 20, 2025
ba11a41
Read flower resource info on reload
SecretOnline Dec 20, 2025
fccf93b
Fix some blockstate warnings
SecretOnline Dec 20, 2025
1118622
Start messing around with block entity renderer
SecretOnline Dec 20, 2025
5ecb09a
Create block models for each part
SecretOnline Dec 20, 2025
c115e34
Redo data generation again
SecretOnline Dec 20, 2025
f3830dd
Remove remnants of v1 datagen
SecretOnline Dec 20, 2025
50984f4
Some datagen cleanup
SecretOnline Dec 20, 2025
5b87137
Fix locations of some generated resources
SecretOnline Dec 20, 2025
113404a
Switch to model loading plugin to load models
SecretOnline Dec 20, 2025
e0bdb27
Use model manager to get block models in block entity renderer
SecretOnline Dec 21, 2025
3034c64
Make the rendering go
SecretOnline Dec 21, 2025
36c5a8e
Fix models used by pink petals and wildflowers
SecretOnline Dec 21, 2025
351a0b3
Try make block tinting work part 1
SecretOnline Dec 21, 2025
f771e9e
Fix gardens sometimes rotating when adding new flowers
SecretOnline Dec 21, 2025
824ccb9
Add tinting to resource definition
SecretOnline Dec 21, 2025
10f947d
Fix crashes when placing flowers
SecretOnline Dec 21, 2025
b8951b1
Set breaking particle from item texture
SecretOnline Dec 21, 2025
fe61a2a
Remove old FlowerVariant enum
SecretOnline Dec 21, 2025
88c609b
Fix suspicious stew recipe
SecretOnline Dec 21, 2025
f34fb35
Load item models dynamically
SecretOnline Dec 21, 2025
04db81b
Fix torchflower using incorrect model
SecretOnline Dec 21, 2025
c84e043
Add block drops for tiny flowers when breaking
SecretOnline Dec 23, 2025
109fc62
Remove particle texture from resource definitions
SecretOnline Dec 23, 2025
e5e5878
Make florists' shears properly dyeable
SecretOnline Dec 24, 2025
7ac3eaf
Fix eyeblossom state changes not propagating
SecretOnline Dec 24, 2025
1f1314e
Start building a mock datapack
SecretOnline Dec 25, 2025
3275977
Finish tiny dirt flower definition
SecretOnline Dec 25, 2025
c9e9fa8
Tidy up a couple of edge cases when a mod is removed
SecretOnline Dec 25, 2025
661f3c8
Rename fields in item definitions
SecretOnline Dec 25, 2025
59a1093
Add some documentation for adding new flower types
SecretOnline Dec 25, 2025
5baa553
Fix dirt flower pack
SecretOnline Dec 26, 2025
8905b1b
Attempt to add Tiny Flower items to the Creative menu
SecretOnline Dec 23, 2025
62cedf6
Add Tiny Flowers tab to Creative menu
SecretOnline Dec 26, 2025
5e69e2f
Add configuration for what blocks a tiny flower can be placed on
SecretOnline Dec 26, 2025
bf692ba
Add Svelte starter
SecretOnline Dec 26, 2025
ba8e916
Add state type definitions
SecretOnline Dec 27, 2025
ee1232a
Add default particle and stem textures to provided block models
SecretOnline Dec 28, 2025
520decd
Far too much work on making the pack generator
SecretOnline Dec 28, 2025
48fdf4b
Start styling page
SecretOnline Dec 28, 2025
97f1cfd
Add styling for replaced controls
SecretOnline Dec 28, 2025
73e524a
Add downloading of mod .jar file
SecretOnline Dec 28, 2025
92a2991
Update tiny dirt example mod to match output from the generator
SecretOnline Dec 28, 2025
0228a7e
Allow collapsing of flowers to save vertical space and noise
SecretOnline Dec 28, 2025
147d05e
Add .jar file upload
SecretOnline Dec 28, 2025
6eb79cc
Update example pack
SecretOnline Dec 29, 2025
c8bc620
Add icon generation to generator
SecretOnline Dec 29, 2025
cae01ee
Update icon generator description
SecretOnline Dec 29, 2025
2008dc6
Draw flowers during icon generation
SecretOnline Dec 30, 2025
c1b101d
Add inputs for flowers in the icon generator
SecretOnline Dec 30, 2025
459fbf8
Shift logos in icon generator
SecretOnline Dec 30, 2025
243ab28
Some changes to generation
SecretOnline Dec 30, 2025
fc60edb
Split form into multiple components
SecretOnline Dec 30, 2025
b7ffd01
Add more block tags to the Tiny Garden block
SecretOnline Dec 30, 2025
f6bdcf8
Add simple block texture generation
SecretOnline Dec 31, 2025
cc7224d
Some smaller changes and update READMEs
SecretOnline Dec 31, 2025
d8bfb03
Make eyeblossom behaviour data-driven
SecretOnline Dec 31, 2025
98b0610
Prevent mod generator from wiping out special features of flowers
SecretOnline Dec 31, 2025
0e30dcb
Fix gardens not breaking when the block underneath is removed
SecretOnline Dec 31, 2025
9ff43e8
Start some minor change-arounds
SecretOnline Jan 1, 2026
c4602c5
Most of an upgrade to 21.6
SecretOnline Jan 16, 2026
7ea5517
Most of an update to 26.1-snapshot6
SecretOnline Feb 7, 2026
c292dff
Make crafting recipes work through the power of mixins
SecretOnline Feb 7, 2026
ebd02f1
Rename eyeblossom special feature to be more generic
SecretOnline Feb 7, 2026
05bbd05
Add weather transformation special feature
SecretOnline Feb 7, 2026
e79992c
Add more specific weather transformation conditions
SecretOnline Feb 7, 2026
a537388
Fix datagen
SecretOnline Feb 7, 2026
9aee872
Move some datagen files around
SecretOnline Feb 8, 2026
b7f3d2e
Fix Chinese translation for v2
SecretOnline Feb 8, 2026
236e122
Add Multiloader template
SecretOnline Feb 13, 2026
3e28352
Move creative mode tag registering around
SecretOnline Feb 14, 2026
ebbe48e
Refactor registration
SecretOnline Feb 14, 2026
9c5a966
Split server and client initialization as much as possible
SecretOnline Feb 14, 2026
16a44d1
Start working on NeoForge
SecretOnline Feb 14, 2026
3787e3d
More refactor of registering
SecretOnline Feb 14, 2026
20722c8
Move flower garden part model loading out of mixins
SecretOnline Feb 15, 2026
02c9fc2
Make Fabric registering work again?
SecretOnline Feb 15, 2026
4ad1bdd
Move files around
SecretOnline Feb 15, 2026
c735855
Add NeoForge datagen
SecretOnline Feb 15, 2026
8cb10ed
Fix incorrect cast
SecretOnline Feb 15, 2026
1f23203
Resolve more inspections
SecretOnline Feb 15, 2026
140e6ba
Add creative tab to NeoForge
SecretOnline Feb 15, 2026
52d2dbd
Add sturdy placement behaviour
SecretOnline Feb 15, 2026
4acf838
Rename special features to behaviors
SecretOnline Feb 15, 2026
e92d5a7
Another slight change to Survivable's method
SecretOnline Feb 15, 2026
5f74a3f
Add NeoForge support to mod generator
SecretOnline Feb 15, 2026
32d984b
More renaming and moving
SecretOnline Feb 16, 2026
bb699d4
Fix block particles not being correct on NeoForge
SecretOnline Feb 16, 2026
a9e59a9
Factor out most creative mode tab logic
SecretOnline Feb 16, 2026
cf9eac6
Move some datagen code around
SecretOnline Feb 16, 2026
ae5446a
Update GitHub workflows to work with multiloader template
SecretOnline Feb 16, 2026
becb196
Add quick workflow for mod generator
SecretOnline Feb 16, 2026
627b30b
Fix datagen check
SecretOnline Feb 16, 2026
b2c52fd
Update changelog
SecretOnline Feb 16, 2026
771ecd3
Fix permission for Node update workflow
SecretOnline Mar 19, 2026
a9ed700
Try fix update workflow
SecretOnline Apr 18, 2026
dc89a0f
Update to Minecraft 26.1.2
github-actions[bot] Apr 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{yml,js,json}]
[*.{yml,js,json,md,ts}]
indent_style = space
23 changes: 17 additions & 6 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
* text eol=lf
*.bat text eol=crlf
*.patch text eol=lf
*.java text eol=lf
*.gradle text eol=crlf
*.png binary
*.gif binary
*.exe binary
*.dll binary
*.jar binary
*.lzma binary
*.zip binary
*.pyd binary
*.cfg text eol=lf
*.jks binary
*.ogg binary

# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

# While BlockBench files are actually JSON, they're minified so don't diff well.
*.bbmodel binary
10 changes: 0 additions & 10 deletions .github/actions/get-build-test-versions/action.yml

This file was deleted.

77 changes: 0 additions & 77 deletions .github/actions/get-build-test-versions/index.js

This file was deleted.

14 changes: 4 additions & 10 deletions .github/actions/update-versions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,20 @@ description: Get versions of the game for the build and test workflow
inputs:
minecraft-version:
description: Minecraft version to update to. If not supplied, falls back to latest version.
max-minecraft-version:
description: Maximum Minecraft version if there are known incompatibilities with later minor versions. If not specified then it's assumed that any future minor version will be compatible.
ignore-mod-dependencies:
description: Ignore mod dependency versions

outputs:
has-updates:
description: Whether there are updates to include
minecraft-version:
description: Highest Minecraft version supported
minecraft-version-range:
description: Range of Minecraft versions supported
java-version:
description: Java version required for this version
fabric-loader-version:
description: Version of Fabric loader used by this project
fabric-api-version:
description: Version of the Fabric API mod used by this project
mod-menu-version:
description: Version of the Mod Menu mod used by this project
loader-version:
description: Version of Fabric loader used by this project
neoforge-version:
description: Version of the NeoForge used by this project

runs:
using: "node20"
Expand Down
162 changes: 68 additions & 94 deletions .github/actions/update-versions/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
import { getInput, info, setOutput, warning } from "@actions/core";
import { readFile } from "node:fs/promises";
import { join } from "node:path";
import { URL, URLSearchParams } from "node:url";
import { minSatisfying, satisfies } from "semver";
import { compare, SemVer } from "semver";
import { getAllMinecraftVersions, getMinecraftVersion } from "../lib/mojang.js";
import {
addAllZeroVersions,
parseVersionSafe,
trimAllZeroVersions,
} from "../lib/versions.js";

const fileString = await readFile(
join(process.cwd(), "src/main/resources", "fabric.mod.json"),
{ encoding: "utf8" }
);
const modJson = JSON.parse(fileString);
const recommendsRange = addAllZeroVersions(modJson.recommends.minecraft);
import { parseVersionSafe, trimAllZeroVersions } from "../lib/versions.js";

const allVersions = await getAllMinecraftVersions();

Expand All @@ -33,84 +20,17 @@ function getUpdateVersion() {
return allVersions.latest.release;
}

/**
* @returns {string | null}
*/
function getMaxUpdateVersion() {
const inputValue = getInput("max-minecraft-version");
if (inputValue) {
return inputValue;
}

return null;
}

const versionToUpdate = getUpdateVersion();
const versionToUpdateSemver = new SemVer(versionToUpdate);
const updateVersionInfo = await getMinecraftVersion(versionToUpdate);

async function getNewVersionRange() {
if (updateVersionInfo.type !== "release") {
return versionToUpdate;
}

const updateSemver = parseVersionSafe(versionToUpdate);

if (recommendsRange === updateSemver.toString()) {
return versionToUpdate;
}

if (satisfies(updateSemver, recommendsRange)) {
// New version already satisfies the current range, but double check Java version first.
const allReleaseVersions = allVersions.versions.filter(
(v) => v.type === "release"
);
const minMatchingSemver = minSatisfying(
allReleaseVersions.map((v) => parseVersionSafe(v.id)),
recommendsRange
);
if (!minMatchingSemver) {
throw new Error(`No versions matched range ${recommendsRange}`);
}

const minMatchingInfo = await getMinecraftVersion(
minMatchingSemver.toString()
);

const isSameJava =
updateVersionInfo.javaVersion.majorVersion ===
minMatchingInfo.javaVersion.majorVersion;
if (isSameJava) {
return recommendsRange;
}

// New version satisfies range, but has new Java version so is incompatible.
}

const minVersion = versionToUpdate;
const maxUpdateVersion = getMaxUpdateVersion();
// Current rules mean that the minor version is always the same, so we can use a range here
// Also we're assuming middle versions are compatible. This should always be the case, but
// I can't wait to eat my words on that one.
const simplified = trimAllZeroVersions(
maxUpdateVersion !== null
? `${minVersion} - ${maxUpdateVersion}`
: `~${minVersion}`
);

info(
`New version is likely compatible with existing versions of Minecraft. Adding to version range ${simplified}`
);

return simplified;
}

/**
* @param {string} projectId
* @returns {Promise<string>}
*/
async function getModrinthProjectVersion(projectId) {
const url = new URL(
`https://api.modrinth.com/v2/project/${projectId}/version`
`https://api.modrinth.com/v2/project/${projectId}/version`,
);
url.search = new URLSearchParams({
game_versions: `["${versionToUpdate}"]`,
Expand All @@ -128,12 +48,12 @@ async function getModrinthProjectVersion(projectId) {
getInput("ignore-mod-dependencies") === "true";
if (!shouldIgnoreModDependencies) {
throw new Error(
`No versions of ${projectId} for Minecraft ${versionToUpdate}`
`No versions of ${projectId} for Minecraft ${versionToUpdate}`,
);
}

warning(
`No versions of ${projectId} for Minecraft ${versionToUpdate}. Ignoring, but you may need to revert some changes until I update this action`
`No versions of ${projectId} for Minecraft ${versionToUpdate}. Ignoring, but you may need to revert some changes until I update this action`,
);
return "";
}
Expand Down Expand Up @@ -165,18 +85,72 @@ async function getFabricLoaderVersion() {
return data[0].version;
}

// Early exit if latest version already matches
const newVersionRange = await getNewVersionRange();
/**
* @returns {Promise<{neoforge:string;}>}
*/
async function getArchitecturyVersions() {
const response = await fetch(
"https://generate.architectury.dev/version_index.json",
{
headers: {
"user-agent": "secret_online/mod-auto-updater (mc@secretonline.co)",
},
},
);
/** @type {Record<string,any>} */
const data = await response.json();

const versionData = data[versionToUpdate];
if (versionData) {
if (!versionData.neoforge) {
throw new Error(`No Neoforge version in Architectury index`);
}

info(`Found Architectury data: neoforge ${versionData.neoforge}`);

return versionData;
}

warning(
`No version for ${versionToUpdate} in Architectury index. Trying Neoforge release`,
);

// Get latest Neoforge version from Neoforge Maven
const neoforgeResponse = await fetch(
"https://maven.neoforged.net/api/maven/versions/releases/net%2Fneoforged%2Fneoforge",
{
headers: {
"user-agent": "secret_online/mod-auto-updater (mc@secretonline.co)",
},
},
);
/** @type {{versions:string[]}} */
const neoforgeData = await neoforgeResponse.json();
const matchRegex = new RegExp(
`^${versionToUpdateSemver.major}.${versionToUpdateSemver.minor}.`,
);
const matchingVersions = neoforgeData.versions.filter((version) =>
matchRegex.test(version),
);
if (matchingVersions.length === 0) {
throw new Error(`No version for ${versionToUpdate} in Neoforge Maven`);
}
matchingVersions.sort();
const neoforgeVersion = matchingVersions[0];
info(`Found Neoforge data: neoforge ${neoforgeVersion}`);

return {
neoforge: neoforgeVersion,
};
}

const fabricApiVersion = await getModrinthProjectVersion("fabric-api");
const modMenuVersion = await getModrinthProjectVersion("modmenu");
const fabricLoaderVersion = await getFabricLoaderVersion();
const { neoforge } = await getArchitecturyVersions();

setOutput("has-updates", true);
setOutput("minecraft-version", versionToUpdate);
setOutput("minecraft-version-range", newVersionRange);
setOutput("java-version", updateVersionInfo.javaVersion.majorVersion);
setOutput("fabric-api-version", fabricApiVersion);
setOutput("mod-menu-version", modMenuVersion);
setOutput("loader-version", fabricLoaderVersion);
// Do not add code below the above closing brace, as it will run whether or not any updates happened.
// Control flow is hard.
setOutput("fabric-loader-version", fabricLoaderVersion);
setOutput("neoforge-version", neoforge);
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,12 @@ updates:
all:
patterns:
- "*"
- package-ecosystem: "npm"
directory: "/misc/mod-generator"
schedule:
interval: "monthly"
timezone: "Pacific/Auckland"
groups:
all:
patterns:
- "*"
Binary file added .github/pack-generator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading