Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TheobaldTheBird committed Sep 10, 2024
0 parents commit 8ac7761
Show file tree
Hide file tree
Showing 482 changed files with 76,532 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.sc linguist-language=Python
*.scl linguist-language=Python
28 changes: 28 additions & 0 deletions .github/workflows/build-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Pull Request Builds

on: [pull_request]

jobs:
Build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 21
cache: 'gradle'
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- uses: actions/upload-artifact@v3
with:
name: "Compiled artifacts for Pull Request #${{github.event.number}}"
path: build/libs
28 changes: 28 additions & 0 deletions .github/workflows/devbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Development Builds

on: [push]

jobs:
Build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 21
cache: 'gradle'
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- uses: actions/upload-artifact@v3
with:
name: Compiled artifacts for ${{ github.sha }}
path: build/libs
192 changes: 192 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
name: Publish Release

on:
release:
types: [published]
jobs:
Get-Properties:
runs-on: ubuntu-latest
outputs:
release-type: ${{ steps.type.outputs.release-type }}
carpet-version: ${{ steps.properties.outputs.mod_version }}
minecraft-version: ${{ steps.properties.outputs.minecraft_version }}
curse-versions: ${{ steps.properties.outputs.release-curse-versions }}
matrix-exclude-branch: ${{ steps.processmatrix.outputs.matrix-to-exclude }}
extra-branch-name: ${{ steps.properties.outputs.release-extra-branch-name }}
extra-branch-curse-version: ${{ steps.properties.outputs.release-extra-curse-version }}
steps:
- name: Checkout the sources
uses: actions/checkout@v3
- name: Determine release type
id: type
run: |
if ${{ github.event.release.prerelease }}; then
echo "release-type=beta" >> $GITHUB_OUTPUT
else
echo "release-type=release" >> $GITHUB_OUTPUT
fi
- name: Read relevant fields from gradle.properties
id: properties
run: | # From christian-draeger/read-properties, using the action makes it extremely messy until christian-draeger/read-properties#2
path='./gradle.properties'
for property in mod_version minecraft_version release-curse-versions release-extra-branch release-extra-branch-name release-extra-curse-version
do
result=$(sed -n "/^[[:space:]]*$property[[:space:]]*=[[:space:]]*/s/^[[:space:]]*$property[[:space:]]*=[[:space:]]*//p" "$path")
echo "$property: $result"
echo "$property=$result" >> $GITHUB_OUTPUT
done
- name: Process property for matrix
id: processmatrix
run: |
if ! ${{ steps.properties.outputs.release-extra-branch }}; then
echo "matrix-to-exclude=Snapshots" >> $GITHUB_OUTPUT
fi
- uses: actions/github-script@v6
env:
READ_VERSION: ${{ steps.properties.outputs.mod_version }}
with:
script: |
const { READ_VERSION } = process.env;
console.log('Read version is: ' + READ_VERSION);
let releases = (await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo
})).data;
console.log('Previous release was: ' + releases[1].name);
for (let release of releases.slice(1)) {
if (release.name.includes(READ_VERSION))
core.setFailed('Version number is the same as a previous release!')
}
Build-And-Publish:
runs-on: ubuntu-latest
needs: [Get-Properties]
strategy:
matrix:
branch: [Release, Snapshots]
exclude:
- branch: ${{ needs.Get-Properties.outputs.matrix-exclude-branch }}
steps:
- name: Get info from branch to run
id: getbranchinfo
run: |
if ${{ matrix.branch == 'Snapshots'}}; then
echo "branchname=${{ needs.Get-Properties.outputs.extra-branch-name }}" >> $GITHUB_OUTPUT
echo "version=${{ needs.Get-Properties.outputs.extra-branch-curse-version }}" >> $GITHUB_OUTPUT
echo "curse-versions=${{ needs.Get-Properties.outputs.extra-branch-curse-version }}" >> $GITHUB_OUTPUT
else
echo "version=${{ needs.Get-Properties.outputs.minecraft-version }}" >> $GITHUB_OUTPUT
echo "curse-versions=${{ needs.Get-Properties.outputs.curse-versions }}" >> $GITHUB_OUTPUT
fi
- name: Checkout the sources
uses: actions/checkout@v3
with:
ref: ${{ steps.getbranchinfo.outputs.branchname }}
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 21
cache: 'gradle'
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Find correct JAR
id: findjar
run: |
output="$(find build/libs/ ! -name "*-dev.jar" ! -name "*-sources.jar" -type f -printf "%f\n")"
echo "jarname=$output" >> $GITHUB_OUTPUT
- name: Save build artifacts in the action
uses: actions/upload-artifact@v3
with:
name: Artifacts for ${{ matrix.branch }}
path: build/libs
- name: Upload to the Github release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/libs/${{ steps.findjar.outputs.jarname }}
asset_name: ${{ steps.findjar.outputs.jarname }}
asset_content_type: application/java-archive
- name: Upload to Curseforge
uses: itsmeow/curseforge-upload@v3
with:
token: ${{ secrets.CF_API_TOKEN }}
project_id: 349239
game_endpoint: minecraft
file_path: build/libs/${{ steps.findjar.outputs.jarname }}
changelog_type: markdown
changelog: ${{ github.event.release.body }}
display_name: Carpet v${{ needs.Get-Properties.outputs.carpet-version }} for ${{ steps.getbranchinfo.outputs.version }}
game_versions: 7499,4458,${{ steps.getbranchinfo.outputs.curse-versions }} #Fabric,Java 8,[version (s) for the branch]
release_type: ${{ needs.Get-Properties.outputs.release-type }}
- name: Ask Gradle to publish
run: ./gradlew publish
- name: Save publish folder in action's artifacts # Remove when automated
uses: actions/upload-artifact@v3
with:
name: Maven publishing artifacts for ${{ matrix.branch }}
path: publish/carpet/fabric-carpet/
Publish-To-Discord:
runs-on: ubuntu-latest
needs: [Build-And-Publish]
steps:
- name: Publish to discord
uses: Crec0/announce-n-crosspost@v1
with:
bot-token: ${{ secrets.DISCORD_BOT_TOKEN }}
channel: '897934715200339999'
content: |
**${{ github.event.release.name }}** has been released!
${{ github.event.release.body }}
Get it on Github Releases: <${{ github.event.release.html_url }}>
Or on CurseForge
Merge-Scarpet-Docs:
runs-on: ubuntu-latest
steps:
- name: Checkout the sources
uses: actions/checkout@v3
with:
ref: master
- name: Merge docs
run: |
./mergedoc.sh
- name: Commit merged docs
continue-on-error: true
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git commit -am "Merge docs for '${{ github.event.release.name }}'" || exit 0
git push
Update-Rules-Wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout Carpet sources
uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 21
cache: 'gradle'
- name: Checkout wiki
uses: actions/checkout@v3
with:
repository: ${{github.repository}}.wiki
path: wiki
- name: Run rule printer into the wiki page
run: |
chmod +x gradlew
./gradlew runServer --args="-- -carpetDumpRules -dumpPath ../wiki/Current-Available-Settings.md"
- name: Commit updated wiki page
continue-on-error: true
run: |
cd wiki
git config --global user.name 'github-actions-bot' # Releases don't have valid commiter info :(
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git commit -am "Update wiki for '${{ github.event.release.name }}'" || exit 0
git push
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# gradle

.gradle/
build/
out/
lout/
classes/
publish/

# git

.shelf/

# idea

.idea/
*.iml
*.ipr
*.iws

# eclipse
*.launch

# vscode

.settings/
.vscode/
bin/
.classpath
.project
*.code-workspace

# fabric

run/
logs/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 gnembon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<img src="./src/main/resources/assets/carpet/icon.png" align="right" width="128px"/>

# Fabric Carpet

[![Development Builds](https://github.com/gnembon/fabric-carpet/actions/workflows/devbuild.yml/badge.svg)](https://github.com/gnembon/fabric-carpet/actions/workflows/devbuild.yml)
[![CurseForge downloads](http://cf.way2muchnoise.eu/full_349239_downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/carpet)
[![Modrinth downloads](https://img.shields.io/modrinth/dt/carpet?label=Modrinth%20downloads&logo=modrinth)](https://modrinth.com/mod/carpet)
[![GitHub downloads](https://img.shields.io/github/downloads/gnembon/fabric-carpet/total?label=Github%20downloads&logo=github)](https://github.com/gnembon/fabric-carpet/releases)
[![GitHub contributors](https://img.shields.io/github/contributors/gnembon/fabric-carpet?label=Contributors&logo=github)](https://github.com/gnembon/fabric-carpet/graphs/contributors)
[![Discord](https://badgen.net/discord/online-members/gn99m4QRY4?icon=discord&label=Discord&list=what)](https://discord.gg/gn99m4QRY4)

Cause all carpets are made of fabric?
This is the [Fabric](https://fabricmc.net/) version of Carpet Mod, for Minecraft 1.14.X, 1.15.X, 1.16.X and above.

Carpet Mod is a mod for vanilla Minecraft that allows you to take full control of what matters from a technical perspective of the game.

* Test your farms over several hours in only a few minutes using [`/tick warp`](https://github.com/gnembon/fabric-carpet/wiki/Commands#usage-tick-warp-ticks-cmd), as fast as your computer can
* ...and then see a detailed breakdown of the items they produce using [`hopperCounters`](https://github.com/gnembon/fabric-carpet/wiki/Current-Available-Settings#hoppercounters)
* See the server mobcap, TPS, etc. update live with [`/log`](https://github.com/gnembon/fabric-carpet/wiki/Commands#log)
* Let pistons push block entities (ie. chests) with [`movableBlockEntities`](https://github.com/gnembon/fabric-carpet/wiki/Current-Available-Settings#movableblockentities)
* [Fix](https://github.com/gnembon/fabric-carpet/wiki/Current-Available-Settings#leadfix) [many](https://github.com/gnembon/fabric-carpet/wiki/Current-Available-Settings#portalsuffocationfix) [things](https://github.com/gnembon/fabric-carpet/wiki/Current-Available-Settings#unloadedentityfix)

# Carpet mod ecosystem

For core carpet functionality, this is the right place. Check available downloads on the [release page](https://github.com/gnembon/fabric-carpet/releases)

<img src="https://raw.githubusercontent.com/gnembon/carpet-extra/master/src/main/resources/assets/carpet-extra/icon.png" align="right" width="128px"/>

## carpet-extra

Check [carpet-extra](https://github.com/gnembon/carpet-extra/) add-on mod for more whacky and crazy features, including autocrafting, block-placing dispensers, and even chicken-shearing!

## scarpet app store

If you want to browse or contribute to the scarpet app store check available apps, go [here](https://github.com/gnembon/scarpet), its free!

## quick-carpet

Have problems with the recent snapshot or someone is slacking with releasing the base carpet mod, but you need some basic carpet functionality, check the minimal build of [quick-carpet](https://github.com/gnembon/quick-carpet/releases). It hopefully works just fine. You will not be able to add any extensions or use scarpet apps on this one though.

## Other community-based extensions to carpet

Here is a [list of other carpet extensions](https://github.com/gnembon/fabric-carpet/wiki/List-of-Carpet-extensions) created by the community.

Everybody can create their own carpet features or extend scarpet language with some new API, by creating a carpet extension using this [carpet extension mod template](https://github.com/gnembon/fabric-carpet-extension-example-mod).

# How? Hwat?

Follow instructions for all other fabric mods in https://fabricmc.net/use/ and dump [carpet...jar](https://github.com/gnembon/fabric-carpet/releases) in `mods` folder along with other compatible mods.

See the [mod showcase](https://www.youtube.com/watch?v=Lt-ooRGpLz4) on youtube for an explanation of every setting and command, and check the List of all currently available settings on the wiki for an updated list of every setting.

# Carpet Mod Settings
See [List of all currently available settings][settings] on the wiki

[settings]: https://github.com/gnembon/fabric-carpet/wiki/Current-Available-Settings

For previous Minecraft versions: 1.13 check [gnembon/carpetmod](https://github.com/gnembon/carpetmod) and for 1.12 check [gnembon/carpetmod112](https://github.com/gnembon/carpetmod112).
Loading

0 comments on commit 8ac7761

Please sign in to comment.