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
21 changes: 9 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Contributing to Infinitely-Printer

Thank you for your interest in contributing! This project is a Minecraft mod
that targets multiple Minecraft versions and mod loaders (Fabric, NeoForge, and
Forge) via [Stonecutter](https://stonecutter.kikugie.dev/), built with Gradle
Kotlin DSL and Architectury Loom.
built with Gradle Kotlin DSL and Fabric Loom. Multi-version and multi-loader
support is planned but not yet implemented — currently targeting Minecraft 26.2
with Fabric.

This guide covers the contribution workflow and the conventions we expect all
contributors to follow. By contributing, you agree that your contributions will
Expand Down Expand Up @@ -34,11 +34,8 @@ be licensed under the same license as the project.
./gradlew build
```

This builds the currently active version (see `stonecutter.gradle.kts`).
The repository is versioned and loader-switched through Stonecutter, so a
change may need to build against multiple targets. When you submit a pull
request, make sure the change at least builds for the active target, and
note in the PR description which versions/loaders you verified.
This builds the mod for Minecraft 26.2 with Fabric. Make sure the build
succeeds before opening a pull request.

## Code Style

Expand Down Expand Up @@ -171,10 +168,10 @@ Do not submit work you have not tested. Before opening a pull request:
./gradlew test
```

3. **Verify against the relevant version/loader.** Because this mod targets
multiple Minecraft versions and loaders via Stonecutter, test your change in
the target(s) your change affects. If you cannot test every target, say so
explicitly in the PR description so reviewers know what was verified.
3. **Verify against the target version.** This mod currently targets Minecraft
26.2 with Fabric. Test your change against this version. If you cannot test
in-game, say so explicitly in the PR description so reviewers know what was
verified.
4. **Launch the client** if your change affects gameplay behavior, and
manually verify the behavior you changed (for example, `./gradlew runClient`
or the IDE run configuration for the active version).
Expand Down
30 changes: 26 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
name: Build
on: [push, pull_request]
jobs:
discover:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.versions.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: versions
shell: bash
run: |
VERSIONS=$(ls -d versions/*/ | sed 's|^versions/||; s|/$||' | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "matrix={\"version\":${VERSIONS}}" >> "$GITHUB_OUTPUT"
echo "Discovered versions: ${VERSIONS}"
build:
needs: discover
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.discover.outputs.matrix) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Gradle JVM is Java 25 (Loom 1.17 requirement); per-version Java target
# (25/21/17) is set by build.gradle.kts via options.release.
- uses: actions/setup-java@v4
with: { java-version: '25', distribution: 'temurin' }
with:
java-version: '25'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with: { gradle-version: "9.5.1" }
- name: Build
- name: Build ${{ matrix.version }}
run: |
chmod +x gradlew
./gradlew build
./gradlew :${{ matrix.version }}:build --no-daemon
- uses: actions/upload-artifact@v4
with: { name: infinitely-printer-dev, path: build/libs/*.jar }
with:
name: infinitely-printer-${{ matrix.version }}
path: versions/${{ matrix.version }}/build/libs/*.jar
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with: { java-version: '25', distribution: 'temurin' }
- run: ./gradlew chiseledBuild
- uses: gradle/actions/setup-gradle@v3
- run: chmod +x gradlew && ./gradlew build
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
Expand Down
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Infinitely Printer

A feature-complete Litematica printer mod for Minecraft.

## Version Support

| Minecraft | Loader | Status |
|-----------|-------------|----------------|
| 26.2 | Fabric | In Development |
| 1.21.1 | Fabric | Planned |
| 1.21.1 | NeoForge | Planned |
| 1.20.1 | Fabric | Planned |
| 1.20.1 | Forge | Planned |
| 1.18.2 | Fabric | Planned |

## Features

- Auto printing with accurate block placement
- Bedrock breaking (6-direction, standalone mode)
- Block replacement and weed clearing
- Auto tool switching
- Remote container inventory access
- Anti-cheat bypass (multi-mode packet sending)
- Cruise control (auto-move to next build position)
- Do Not Disturb (hostile mob handling)
- Void mode (17x17 chunk perimeter excavation)
- Quick shulker box access
- Reach extension (auto-operation only)

## Dependencies

- [MaLiLib](https://www.curseforge.com/minecraft/mc-mods/malilib) >= 0.29.3
- [Litematica](https://www.curseforge.com/minecraft/mc-mods/litematica) >= 0.28.4
- [Fabric API](https://modrinth.com/mod/fabric-api) >= 0.154.0

## Documentation

| Language | Links |
|----------|-------|
| English | [README](docs/README.md) · [Changelog](docs/CHANGELOG.md) · [Contributing](docs/CONTRIBUTING.md) · [Security](docs/SECURITY.md) |
| 中文 | [自述](docs/README_zh.md) · [更新日志](docs/CHANGELOG_zh.md) · [贡献指南](docs/CONTRIBUTING_zh.md) · [安全政策](docs/SECURITY_zh.md) |

## License

[MIT](LICENSE)
76 changes: 63 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,47 +1,97 @@
plugins {
id("net.fabricmc.fabric-loom") version "1.17-SNAPSHOT"
id("dev.kikugie.loom-back-compat")
}

val mcVersion = stonecutter.current.version
val loaderName = stonecutter.current.project.split("-").last()

group = "me.github.minecraft269"
version = property("mod_version") as String
base.archivesName.set("infinitely-printer-${mcVersion}-${loaderName}")

// Java target version by MC version: 26.x->25, 1.21.x->21, <1.20.5->17
val javaTarget = when {
stonecutter.eval(mcVersion, ">=26") -> 25
stonecutter.eval(mcVersion, ">=1.21") -> 21
else -> 17
}

repositories {
mavenCentral()
// Masa family mods (sakura-ryoko forks: malilib + 26.2 litematica)
maven("https://masa.dy.fi/maven/sakura-ryoko") {
content { includeGroupAndSubgroups("fi.dy.masa") }
}
// Fabric ecosystem
maven("https://maven.fabricmc.net/")
maven("https://maven.fallenbreath.me/releases") {
content { includeGroupAndSubgroups("me.fallenbreath") }
}
maven("https://maven.terraformersmc.com/releases/") {
content { includeGroupAndSubgroups("com.terraformersmc") }
}
// Modrinth (for litematica/malilib versions not on masa.dy.fi)
maven("https://api.modrinth.com/maven") {
content { includeGroup("maven.modrinth") }
}
}

dependencies {
minecraft("com.mojang:minecraft:${property("minecraft_version")}")
implementation("net.fabricmc:fabric-loader:${property("loader_version")}")
implementation("net.fabricmc.fabric-api:fabric-api:${property("fabric_api_version")}")
implementation("fi.dy.masa.malilib:malilib-fabric-${property("minecraft_version")}:${property("malilib_version")}")
implementation("fi.dy.masa.litematica:litematica-fabric-${property("minecraft_version")}:${property("litematica_version")}")
compileOnly("com.terraformersmc:modmenu:20.0.0-beta.3")
runtimeOnly("com.terraformersmc:modmenu:20.0.0-beta.3")
// mojmap mappings so the mojmap-named source compiles on every MC version.
// loomx.applyMojangMappings() adds mappings only for obfuscated versions; 26.x needs none.
loomx.applyMojangMappings()
"modImplementation"("net.fabricmc:fabric-loader:${property("fabric_loader_version")}")
"modImplementation"("net.fabricmc.fabric-api:fabric-api:${property("fabric_api_version")}")
"modImplementation"(property("malilib_dep") as String)
"modImplementation"(property("litematica_dep") as String)
"modCompileOnly"(property("modmenu_dep") as String)
"modRuntimeOnly"(property("modmenu_dep") as String)
}

loom {
// Shared fabric.mod.json lives at the repo root (src/main/resources)
fabricModJsonPath = rootProject.file("src/main/resources/fabric.mod.json")
}

tasks.withType(JavaCompile::class).configureEach {
options.release = 25
options.release = javaTarget
}

java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
val javaVer = when (javaTarget) {
25 -> JavaVersion.VERSION_25
21 -> JavaVersion.VERSION_21
else -> JavaVersion.VERSION_17
}
sourceCompatibility = javaVer
targetCompatibility = javaVer
}

val modVersion = project.property("mod_version") as String
val packFormat = project.property("pack_format") as String
val loaderVersion = project.property("fabric_loader_version") as String
val malilibVersion = project.property("malilib_version") as String
val litematicaVersion = project.property("litematica_version") as String

tasks.processResources {
val version = project.version
inputs.property("version", version)
inputs.property("version", modVersion)
inputs.property("pack_format", packFormat)
inputs.property("minecraft", mcVersion)
inputs.property("fabric_loader_version", loaderVersion)
inputs.property("malilib_version", malilibVersion)
inputs.property("litematica_version", litematicaVersion)
filesMatching("fabric.mod.json") {
expand("version" to version)
expand(
"version" to modVersion,
"minecraft_version" to mcVersion,
"fabric_loader_version" to loaderVersion,
"malilib_version" to malilibVersion,
"litematica_version" to litematicaVersion
)
}
filesMatching("pack.mcmeta") {
expand("pack_format" to packFormat)
}
}
22 changes: 14 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
# Gradle
# Gradle JVM settings (shared)
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true
org.gradle.configuration-cache=false

# Fabric Properties (26.2)
minecraft_version=26.2
loader_version=0.19.3
loom_version=1.17-SNAPSHOT

# Mod Properties
# Mod Properties (shared)
mod_version=0.1.0
maven_group=me.github.minecraft269

# Dependencies
# Loom version for loom-back-compat (auto-selects fabric-loom / fabric-loom-remap per MC version)
loomx.loom_version=1.17-SNAPSHOT

# Resource pack format (shared; 1.18.2=8 1.20.1=15 1.21.1=34 26.2=88)
pack_format=88

# Active-version defaults (26.2). Overridden per version in versions/<ver>/gradle.properties
minecraft_version=26.2
fabric_loader_version=0.19.3
fabric_api_version=0.154.0+26.2
malilib_dep=fi.dy.masa.malilib:malilib-fabric-26.2:0.29.3
malilib_version=0.29.3
litematica_dep=fi.dy.masa.litematica:litematica-fabric-26.2:0.28.4
litematica_version=0.28.4
modmenu_dep=com.terraformersmc:modmenu:20.0.0-beta.3
22 changes: 22 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
pluginManagement {
repositories {
maven("https://maven.fabricmc.net/")
maven("https://maven.kikugie.dev/releases")
maven("https://maven.kikugie.dev/snapshots")
mavenCentral()
gradlePluginPortal()
}
}

plugins {
id("dev.kikugie.stonecutter") version "0.9.7"
id("dev.kikugie.loom-back-compat") version "0.4"
}

stonecutter {
kotlinController = true
centralScript = "build.gradle.kts"

shared {
version("26.2-fabric", "26.2")
version("1.21.1-fabric", "1.21.1")
version("1.20.1-fabric", "1.20.1")
version("1.18.2-fabric", "1.18.2")
}

create(rootProject)
}

rootProject.name = "infinitely-printer"
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@
import fi.dy.masa.malilib.config.ConfigManager;
import fi.dy.masa.malilib.interfaces.IInitializationHandler;
import fi.dy.masa.malilib.registry.Registry;
import fi.dy.masa.malilib.util.data.ModInfo;
import fi.dy.masa.malilib.util.i18n.i18nMode;
import me.github.minecraft269.infinitelyprinter.config.Config;
import me.github.minecraft269.infinitelyprinter.config.ConfigGui;

public class InitHandler implements IInitializationHandler
{
@Override
public void registerModHandlers()
{
ConfigManager.getInstance().registerConfigHandler(Reference.MOD_ID, new Config());
Registry.CONFIG_SCREEN.registerConfigScreenFactory(
new ModInfo(Reference.MOD_ID, Reference.MOD_NAME, ConfigGui::new)
);
Config.LANG.ifPresent(manager -> {
Registry.TRANSLATION_OVERRIDE_MANAGER.registerTranslationManager(Reference.MOD_ID, manager, i18nMode.FOLLOW_VANILLA);
// Follow the game's current language (translation keys resolve to readable text)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
package me.github.minecraft269.infinitelyprinter;

import net.fabricmc.loader.api.FabricLoader;

public class Reference
{
public static final String MOD_ID = "infinitely-printer";
public static final String MOD_NAME = "Infinitely Printer";
public static final String MOD_VERSION = "0.1.0";

/**
* Returns the mod version from fabric.mod.json at runtime.
* The version is injected by Gradle's processResources task during build.
*/
public static String getModVersion()
{
return FabricLoader.getInstance()
.getModContainer(MOD_ID)
.map(c -> c.getMetadata().getVersion().getFriendlyString())
.orElse("0.1.0"); // fallback for dev environments
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public static void loadFromFile()

JsonObject root = element.getAsJsonObject();
ConfigUtils.readConfigBase(root, "Printer", PrinterConfig.OPTIONS);
ConfigUtils.readConfigBase(root, "PrinterHotkeys", PrinterConfig.HOTKEY_LIST);
ConfigUtils.readConfigBase(root, "Bedrock", BedrockConfig.OPTIONS);
ConfigUtils.readConfigBase(root, "Replacement", ReplacementConfig.OPTIONS);
ConfigUtils.readConfigBase(root, "Cruise", CruiseConfig.OPTIONS);
Expand All @@ -48,7 +47,6 @@ public static void saveToFile()

JsonObject root = new JsonObject();
ConfigUtils.writeConfigBase(root, "Printer", PrinterConfig.OPTIONS);
ConfigUtils.writeConfigBase(root, "PrinterHotkeys", PrinterConfig.HOTKEY_LIST);
ConfigUtils.writeConfigBase(root, "Bedrock", BedrockConfig.OPTIONS);
ConfigUtils.writeConfigBase(root, "Replacement", ReplacementConfig.OPTIONS);
ConfigUtils.writeConfigBase(root, "Cruise", CruiseConfig.OPTIONS);
Expand Down
Loading
Loading