Skip to content

Commit

Permalink
Merge branch 'refs/heads/dev/1.21' into rid/textures
Browse files Browse the repository at this point in the history
  • Loading branch information
ramidzkh committed Jul 7, 2024
2 parents 07d2843 + 54ca7c2 commit a10042f
Show file tree
Hide file tree
Showing 30 changed files with 325 additions and 253 deletions.
36 changes: 11 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: gradle/actions/wrapper-validation@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Use Gradle cache for faster builds
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
distribution: microsoft
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Generate data
run: ./gradlew runData --max-workers 1
run: ./gradlew runData
- name: Build
run: ./gradlew build --max-workers 1
run: ./gradlew build
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: appmek
path: build/libs/
24 changes: 14 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,33 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: gradle/actions/wrapper-validation@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
distribution: microsoft
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-disabled: true
- name: Generate data
run: ./gradlew runData --max-workers 1
run: ./gradlew runData
env:
APPMEK_VERSION: ${{ github.event.release.tag_name }}
- name: Build
run: ./gradlew build --max-workers 1
run: ./gradlew build
env:
APPMEK_VERSION: ${{ github.event.release.tag_name }}
- name: Upload Release Artifact
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: build/libs/Applied-Mekanistics-${{ github.event.release.tag_name }}.jar
tag_name: ${{ github.event.release.tag_name }}
- name: Upload to external sites
run: ./gradlew curseforge modrinth --max-workers 1
run: ./gradlew curseforge modrinth
env:
APPMEK_VERSION: ${{ github.event.release.tag_name }}
CURSEFORGE: ${{ secrets.CURSEFORGE }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
.vscode/
build/
libs/
runs/
run/
70 changes: 32 additions & 38 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("net.neoforged.gradle.userdev") version "7.0.80"
id("net.neoforged.moddev") version "0.1.126"
id("com.matthewprenger.cursegradle") version "1.4.0"
id("com.diffplug.spotless") version "6.25.0"
id("com.modrinth.minotaur") version "2.8.7"
Expand All @@ -19,28 +19,20 @@ repositories {
}
}

exclusiveContent {
forRepository {
maven {
name = "CurseForge"
url = uri("https://www.cursemaven.com")
}
}
maven {
name = "CurseForge"
url = uri("https://www.cursemaven.com")

filter {
content {
includeGroup("curse.maven")
}
}

exclusiveContent {
forRepository {
maven {
name = "TerraformersMC"
url = uri("https://maven.terraformersmc.com/")
}
}
maven {
name = "TerraformersMC"
url = uri("https://maven.terraformersmc.com/")

filter {
content {
includeGroup("dev.emi")
}
}
Expand All @@ -54,15 +46,11 @@ repositories {
}

dependencies {
implementation("net.neoforged:neoforge:${neoforge_version}")

// We depend on many AE2 internals, such as using their basic cell drive, thus not using classifier = "api"
implementation("appeng:appliedenergistics2-neoforge:${ae2_version}")
implementation("appeng:appliedenergistics2:${ae2_version}")

compileOnly("mekanism:Mekanism:${minecraft_version}-${mekanism_version}:api")
runtimeOnly("mekanism:Mekanism:${minecraft_version}-${mekanism_version}:all") {
exclude(group: "com.blamejared.crafttweaker")
}
runtimeOnly("mekanism:Mekanism:${minecraft_version}-${mekanism_version}:all")

implementation("dev.emi:emi-neoforge:${project.emi_version}+${project.minecraft_version}")

Expand All @@ -79,27 +67,33 @@ sourceSets {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
}
}

////////////////////
// Minecraft
runs {
configureEach {
systemProperty("forge.logging.console.level", "debug")
modSource(project.sourceSets.main)
}

client {
}

server {
programArgument("--nogui")
neoForge {
version = neoforge_version

runs {
client { client() }
server { server() }

data {
data()
programArguments.addAll(
"--mod", "appmek",
"--all",
"--output", file("src/generated/resources/").getAbsolutePath(),
"--existing", file("src/main/resources/").getAbsolutePath())
}
}

data {
programArguments.addAll("--mod", "appmek", "--all", "--output", file("src/generated/resources/").getAbsolutePath(), "--existing", file("src/main/resources/").getAbsolutePath())
mods {
appmek {
sourceSet sourceSets.main
}
}
}

Expand All @@ -121,7 +115,7 @@ tasks.withType(ProcessResources).configureEach {
]
inputs.properties(replaceProperties)

filesMatching(["META-INF/mods.toml"]) {
filesMatching(["META-INF/neoforge.mods.toml"]) {
expand replaceProperties
}
}
Expand Down
22 changes: 12 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
minecraft_version=1.20.4
neoforge_version=20.4.210
ae2_version=17.12.0-beta
mekanism_version=10.5.10.32
emi_version=1.1.4
jade_id=4980188
minecraft_version=1.21
neoforge_version=21.0.63-beta
ae2_version=19.0.8-alpha
mekanism_version=10.6.4.50
emi_version=1.1.10
jade_id=5493270

loader_version_range=[2,)
neo_version_range=[20.4,)
ae2_version_range=[17.0.0,18.0.0)
mekanism_version_range=[10.5.10,11-)
loader_version_range=[1,)
neo_version_range=[21.0,)
ae2_version_range=[19.0.0,20.0.0)
mekanism_version_range=[10.6.0,11-)

org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.parallel=true
org.gradle.warning.mode=all

# Temp fix for Spotless / Remove Unused Imports:
# https://github.com/diffplug/spotless/issues/834
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
24 changes: 14 additions & 10 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -130,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
8 changes: 0 additions & 8 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = 'https://maven.minecraftforge.net/' }
maven { url = 'https://maven.neoforged.net/releases' }
}
}

rootProject.name = "Applied-Mekanistics"
4 changes: 2 additions & 2 deletions src/main/java/me/ramidzkh/mekae2/AMItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ private static Item.Properties properties() {
// For block items, the block controls the creative tab
if (item instanceof AEBaseBlockItem baseItem
&& baseItem.getBlock() instanceof AEBaseBlock baseBlock) {
baseBlock.addToMainCreativeTab(output);
baseBlock.addToMainCreativeTab(params, output);
} else if (item instanceof AEBaseItem baseItem) {
baseItem.addToMainCreativeTab(output);
baseItem.addToMainCreativeTab(params, output);
} else {
output.accept(item);
}
Expand Down
Loading

0 comments on commit a10042f

Please sign in to comment.