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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_tamplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body:
attributes:
label: "Minecraft version"
description: "What version of Minecraft are you running? If your version is not displayed here, then it is no longer supported."
options: ["1.18.x", "1.19.x", "1.20.1", "1.20.4"]
options: ["1.20.1", "1.20.4", "1.21.1"]
validations:
required: true
- type: input
Expand Down
497 changes: 497 additions & 0 deletions .github/verify_lang_files.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ jobs:
python .github/git_utils.py genChangelogMd --next_tag=${{ steps.versioning.outputs.version_tag }}

# Install JDK and build with Gradle
- name: Set up JDK 1.8
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
java-version: '21'

- name: Cache Gradle packages
uses: actions/cache@v3
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/verify-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ name: Verify pull requests
on:
pull_request:
branches:
- main
- 1.*
- feature/**
- 1.20.1
- 1.19.x
- 1.18.x

jobs:
style_check:
Expand All @@ -24,6 +21,22 @@ jobs:
with:
configFile: .github/commitlint.config.js

lang_check:
name: Lang file verification
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v3

- name: Install Python 3.12.1
uses: actions/setup-python@v4
with:
python-version: 3.12.1

- name: Verify language files
run: python3 .github/verify_lang_files.py --verbose
shell: bash

build_test:
name: Build and Test
runs-on: ubuntu-latest
Expand Down Expand Up @@ -63,11 +76,11 @@ jobs:
echo "version=$version"
echo "version=$version" >> $GITHUB_OUTPUT

- name: Set up JDK 1.8
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
java-version: '21'

- name: Cache Gradle packages
uses: actions/cache@v3
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Thumbs.db
/*/build/
/run/
/*/run/
/runs/
/*/runs/
/projectFilesBackup/
#IDEA files from Gradle
.idea/
Expand Down
122 changes: 118 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ A Minecraft Forge mod all about Redstone circuity.
## Latest Versions
| MC Version | Branch | Latest Release | Latest Beta | Status |
|:----------:|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|
| 1.20.4 | `main` | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.20.4-release.json) | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.20.4-beta.json) | Active |
| 1.21.1 | `1.21.1` | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/638175d28f3bf15f4e5c0b964153a3ae/raw/projectred-badge-1.21.1-release.json) | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/638175d28f3bf15f4e5c0b964153a3ae/raw/projectred-badge-1.21.1-beta.json) | Active |
| 1.20.4 | `1.20.4` | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.20.4-release.json) | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.20.4-beta.json) | Active |
| 1.20.1 | `1.20.1` | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.20.1-release.json) | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.20.1-beta.json) | Active |
| 1.19.2 | `1.19.x` | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.19.2-release.json) | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.19.2-beta.json) | Maintenance |
| 1.18.2 | `1.18.x` | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.18-release.json) | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.18-beta.json) | Maintenance |
| 1.19.2 | `1.19.x` | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.19.2-release.json) | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.19.2-beta.json) | End-of-Life |
| 1.18.2 | `1.18.x` | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.18-release.json) | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.18-beta.json) | End-of-Life |
| 1.16.5 | `1.16.x` | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.16-release.json) | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.16-beta.json) | End-of-Life |
| 1.15.2 | `1.15.x` | N/A | ![badge](https://img.shields.io/endpoint?logo=.&url=https://gist.githubusercontent.com/MrTJP/3ef501bc64c896a86fd706dfea8ba367/raw/projectred-badge-1.15-beta.json) | End-of-Life |

Expand Down Expand Up @@ -76,4 +77,117 @@ dependencies {
```

### Usage
The primary entrypoint into the API is `mrtjp.projectred.api.ProjectRedAPI` where you will find static fields for each module of ProjectRed. If a module is installed, its corresponding field will be a non-null implementor of that module's API. See the javadocs for more information.
The primary entrypoint into the API is `mrtjp.projectred.api.ProjectRedAPI` where you will find static fields for each module of ProjectRed. If a module is installed, its corresponding field will be a non-null implementor of that module's API. See the javadocs for more information.

## Contributing Translations

We welcome community translations to make ProjectRed accessible to players worldwide! This section provides guidance for translators who want to contribute language files to the project.

### Language File Structure
The English language files are auto-generated. They are located in each module's `generated` directory:
```
<module>/src/main/generated/assets/projectred_<module>/lang/en_us.json
```
Translations should be placed in the `resources` directory:
```
<module>/src/main/resources/assets/projectred_<module>/lang/
```

### Getting Started

1. **Find the English reference files**: English translations are auto-generated and located in:
```
<module>/src/main/generated/assets/projectred_<module>/lang/en_us.json
```

2. **Create your translation file**: Add your language file in the `resources` directory:
```
<module>/src/main/resources/assets/projectred_<module>/lang/<your_language>.json
```
Use standard Minecraft language codes (e.g., `de_de.json` for German, `fr_fr.json` for French, `es_es.json` for Spanish).

3. **Copy the structure**: Start by copying the English file and translating the values while keeping the keys unchanged.

### Translation Verification Tool

We provide a Python utility to help ensure your translations are complete and correctly formatted. It is recommended that
you use it as it is automatically run on every pull request to ensure translations are correct.

#### Requirements
- Python 3.10 or higher
- No additional dependencies required

#### Basic Usage

**Check all language files:**
```bash
python3 .github/verify_lang_files.py
```

**Check a specific module:**
```bash
python3 .github/verify_lang_files.py --submodule core
```

**Check a specific language:**
```bash
python3 .github/verify_lang_files.py --language de_de
```

**Get detailed output:**
```bash
python3 .github/verify_lang_files.py --verbose
```

#### Auto-Fix Mode

The tool can automatically fix common issues in your translation files:

```bash
python3 .github/verify_lang_files.py --fix
```

This will:
- Add missing translation keys (using English text as placeholder)
- Fix key ordering to match the English reference
- Correct JSON formatting issues

#### What the Tool Checks

✅ **Completeness**: Ensures all keys from English files are present
✅ **Key Ordering**: Verifies keys are in the same order as English files
✅ **JSON Format**: Validates proper JSON structure and formatting
✅ **Data Quality**: Identifies empty values and potential duplicate translations

#### Understanding the Output

The tool provides categorized feedback:

- **❌ ERRORS**: Issues that must be fixed (missing keys, formatting problems)
- **⚠️ WARNINGS**: Potential issues to review (extra keys, empty values, duplicates)
- **🔧 FIXES APPLIED**: Automatic corrections made in fix mode

#### Example Workflow

1. Create or update your translation file
2. Run the verification tool:
```bash
python3 .github/verify_lang_files.py --language your_lang --verbose
```
3. Fix any reported issues
4. Use auto-fix for common problems:
```bash
python3 .github/verify_lang_files.py --language your_lang --fix
```
5. Verify everything is correct:
```bash
python3 .github/verify_lang_files.py --language your_lang
```
6. Commit your changes and submit a pull request

### Translation Guidelines
- **Maintain formatting**: Don't change indentation, etc.
- **Be consistent**: Use consistent terminology throughout all modules
- **No minimum!**: Feel free to submit partial translations. Any contribution is appreciated, and you can always update it later.

Thank you for helping make ProjectRed accessible to the global Minecraft community! 🌍
4 changes: 2 additions & 2 deletions api/src/main/java/mrtjp/projectred/api/IExpansionAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ public interface IExpansionAPI {
/**
* The capability instance for {@link Frame}
*/
BlockCapability<Frame, Void> FRAME_CAPABILITY = BlockCapability.createVoid(new ResourceLocation(ProjectRedAPI.EXPANSION_MOD_ID, "frame"), Frame.class);
BlockCapability<Frame, Void> FRAME_CAPABILITY = BlockCapability.createVoid(ResourceLocation.fromNamespaceAndPath(ProjectRedAPI.EXPANSION_MOD_ID, "frame"), Frame.class);

/**
* The capability instance for {@link MovementController}
*/
BlockCapability<MovementController, Void> MOVEMENT_CONTROLLER_CAPABILITY = BlockCapability.createVoid(new ResourceLocation(ProjectRedAPI.EXPANSION_MOD_ID, "movement_controller"), MovementController.class);
BlockCapability<MovementController, Void> MOVEMENT_CONTROLLER_CAPABILITY = BlockCapability.createVoid(ResourceLocation.fromNamespaceAndPath(ProjectRedAPI.EXPANSION_MOD_ID, "movement_controller"), MovementController.class);

/**
* Used to register a {@link BlockMover} to a specific block. This BlockMover will be engaged every time
Expand Down
6 changes: 3 additions & 3 deletions api/src/main/java/mrtjp/projectred/api/IScrewdriver.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package mrtjp.projectred.api;

import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;

public interface IScrewdriver
{
boolean canUse(Player player, ItemStack stack);
boolean canUse(Player player, InteractionHand hand);

//TODO, Improve context here
void damageScrewdriver(Player player, ItemStack stack); // Damage the item on usage
void damageScrewdriver(Player player, InteractionHand hand);
}
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ subprojects { p ->
// Add default repositories
repositories {
mavenLocal()
maven { url = "https://proxy-maven.covers1624.net/" }
maven { url = "https://squiddev.cc/maven/" }
maven { url = "https://maven.covers1624.net/" }
maven { url = "https://maven.squiddev.cc" }
maven { url = "https://maven.blamejared.com/" }
}

Expand All @@ -53,7 +53,7 @@ subprojects { p ->
inputs.property 'mod_version', mod_version
inputs.property 'mc_version', mc_version

filesMatching('META-INF/mods.toml') {
filesMatching('META-INF/neoforge.mods.toml') {
expand 'file': ['jarVersion': mod_version],
'mc_version': mc_version,
'forge_version': forge_version,
Expand Down
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs {
systemProperty 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"

workingDirectory file('run')
programArguments.addAll '--mod', mod_id, '--all', '--output', file("src/main/generated"), '--existing', file("src/main/resources")
arguments.addAll '--mod', mod_id, '--all', '--output', file("src/main/generated").absolutePath, '--existing', file("src/main/resources").absolutePath
modSource sourceSets.main
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.4 2024-11-23T19:52:38.925742 Loot Tables
a0514a25061c79be8aebe827aaf7dbc833bc142c data/projectred_core/loot_tables/blocks/electrotine_generator.json
// 1.21.1 2025-08-10T20:36:21.937017 Loot Tables
a0514a25061c79be8aebe827aaf7dbc833bc142c data/projectred_core/loot_table/blocks/electrotine_generator.json
Loading