Skip to content

Commit

Permalink
Port to Minecraft 1.20.1 (#9)
Browse files Browse the repository at this point in the history
* update gradle wrapper

* update buildscript and dependencies

* fix mixins

* rework item groups and registration

* misc fixes and use constant for mod ID

* fix materials

* group vanilla materials with their tools

* update loom

* move tags into their own classes, merge peridots

* fix item class

* remove libcd dependency declaration

* add datagen

* add fix for loom bug

* add recipe generation

* update emi integration

* enable deprecated api modules at runtime

EMI needs this to not crash

* refactor crook emi recipe

* start on datapack migration

* rest of datapack migration

* add contributor information

* Polish the port

* Removed unused BetterEnd crooks
the textures were nice :(

* whoops

* empty line

* Remove Industrial Revolution integration
That mod no longer has the vanilla tool sets that it had before; watch the mod get smaller!

* Update the Fluix Crook recipe

* Nuke jitpack.yml

* Prepare for merge

* This is more like it

---------

Co-authored-by: Ennui Langeweile <[email protected]>
  • Loading branch information
UpcraftLP and EnnuiL authored Dec 24, 2023
1 parent 6ec5ad4 commit 9b382f2
Show file tree
Hide file tree
Showing 139 changed files with 605 additions and 1,447 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ classes/
# Quilt Loom
run/

# Fabric Data Generation
src/main/generated/

# Eclipse
*.launch

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2022 Ennui Langeweile
Copyright (c) 2020 Ennui Langeweile

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Crooked Crooks

Crooked Crooks is a mod that adds crooks, a tool which can pull mobs and multiply the drops from leaves and grasses, currently has crooks for all vanilla materials and materials added by [Tech Reborn](https://www.curseforge.com/minecraft/mc-mods/techreborn), [Applied Energistics 2](https://www.curseforge.com/minecraft/mc-mods/applied-energistics-2), [Industrial Revolution](https://www.curseforge.com/minecraft/mc-mods/industrial-revolution) and [Additional Additions](https://www.curseforge.com/minecraft/mc-mods/additional-additions). Inspired by the crook from the Ex Nihilo mod family. Depends on the [Quilt Standard Libraries](https://modrinth.com/mod/qsl). A port of [LibCD](https://github.com/EnnuiL/LibCD) is bundled in the JAR file.
Crooked Crooks is a mod that adds crooks, a tool which can pull mobs and multiply the drops from leaves and grasses, currently has crooks for all vanilla materials and materials added by [Tech Reborn](https://www.curseforge.com/minecraft/mc-mods/techreborn), [Applied Energistics 2](https://modrinth.com/mod/ae2) and [Additional Additions](https://modrinth.com/mod/addadd). Inspired by the crook from the Ex Nihilo mod family. Depends on the [Quilt Standard Libraries](https://modrinth.com/mod/qsl).

## Download

Expand Down
65 changes: 51 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
plugins {
id "maven-publish"
alias libs.plugins.quilt.loom
alias libs.plugins.machete
}

archivesBaseName = project.archives_base_name
base.archivesName = project.mod_id
version = "${project.version}+${libs.versions.minecraft.get()}"
group = project.maven_group

// FIXME - Workaround for Quilt Loom bug
project.configurations.configureEach {
exclude(group: "net.fabricmc", module: "fabric-loader")
exclude(group: "net.fabricmc.fabric-api")
}

repositories {
maven { url "https://maven.terraformersmc.com/releases/" }
maven { url "https://jitpack.io" }
}

loom {
mods {
"crooked_crooks" {
// Tell Loom about each source set used by your mod here. This ensures that your mod's classes are properly transformed by Loader.
sourceSet("main")
}
}
}

// All the dependencies are declared at gradle/libs.version.toml and referenced with "libs.<id>"
// See https://docs.gradle.org/current/userguide/platforms.html for information on how version catalogs work.
dependencies {
Expand All @@ -22,11 +36,16 @@ dependencies {

// QSL is not a complete API; You will need Quilted Fabric API to fill in the gaps.
// Quilted Fabric API will automatically pull in the correct QSL version.
modImplementation libs.quilted.fabric.api
modImplementation libs.libcd
modImplementation libs.emi
modImplementation(libs.quilted.fabric.api) {
exclude(group: "org.quiltmc", module: "quilt-loader")
}
// I despise this hecker, but EMI requires it..
modRuntimeOnly(libs.quilted.fabric.api.deprecated) {
exclude(group: "org.quiltmc", module: "quilt-loader")
}

include libs.libcd
modCompileOnly libs.emi
modRuntimeOnly libs.emi
}

processResources {
Expand All @@ -37,10 +56,34 @@ processResources {
}
}

sourceSets {
main {
resources {
srcDirs += [
'src/main/generated'
]
}
}
}

loom {
runs {
datagen {
inherit server
name "Data Generation"
vmArg "-Dfabric-api.datagen"
vmArg "-Dfabric-api.datagen.output-dir=${file("src/main/generated")}"
vmArg "-Dfabric-api.datagen.modid=${project.mod_id}"

runDir "build/datagen"
}
}
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
it.options.release.set(17)
}

java {
Expand All @@ -63,13 +106,7 @@ jar {
rename { "${it}_${archivesBaseName}" }
}
}

machete {
// JSON minification isn't effective on this scale and sacrifices readability
optimizations.json = false
}
// This prevents issues with execution optimizations and therefore, Gradle deprecation warnings
prepareRemapJar.dependsOn("optimizeOutputsOfJar")
tasks.jar.dependsOn(tasks.runDatagen)

// Configure the maven publication
publishing {
Expand Down
6 changes: 0 additions & 6 deletions crook_src/betterend/aeternium.json

This file was deleted.

6 changes: 0 additions & 6 deletions crook_src/betterend/terminite.json

This file was deleted.

6 changes: 0 additions & 6 deletions crook_src/betterend/thallasium.json

This file was deleted.

4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ org.gradle.jvmargs = -Xmx1G
org.gradle.parallel = true

# Mod Properties
version = 3.1.1
version = 3.2.0
maven_group = io.github.ennuil
archives_base_name = crooked_crooks
mod_id = crooked_crooks

# Dependencies are managed at gradle/libs.versions.toml
23 changes: 13 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
[versions]
# The latest versions are available at https://lambdaurora.dev/tools/import_quilt.html
minecraft = "1.19.2"
quilt_mappings = "1.19.2+build.21"
quilt_loader = "0.17.4"
minecraft = "1.20.1"
quilt_mappings = "1.20.1+build.23"
quilt_loader = "0.22.1-beta.4"

quilted_fabric_api = "4.0.0-beta.16+0.64.0-1.19.2"
libcd = "946618669f"
emi = "0.4.0+1.19"
quilted_fabric_api = "7.4.0+0.90.0-1.20.1"
emi = "1.0.28+1.20.1"

[libraries]
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
quilt_mappings = { module = "org.quiltmc:quilt-mappings", version.ref = "quilt_mappings" }
quilt_loader = { module = "org.quiltmc:quilt-loader", version.ref = "quilt_loader" }

quilted_fabric_api = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api", version.ref = "quilted_fabric_api" }
libcd = { module = "com.github.EnnuiL:LibCD", version.ref = "libcd" }
emi = { module = "dev.emi:emi", version.ref = "emi" }
quilted_fabric_api_deprecated = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api-deprecated", version.ref = "quilted_fabric_api" }

emi = { module = "dev.emi:emi-fabric", version.ref = "emi" }

# If you have multiple similar dependencies, you can declare a dependency bundle and reference it on the build script with "libs.bundles.example".
[bundles]
quilted_fabric_api = ["quilted_fabric_api", "quilted_fabric_api_deprecated"]

[plugins]
quilt_loom = { id = "org.quiltmc.loom", version = "1.0.+" }
machete = { id = "io.github.p03w.machete", version = "1.2.+" }
quilt_loom = { id = "org.quiltmc.loom", version = "1.4.+" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
35 changes: 22 additions & 13 deletions gradlew
100644 → 100755
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/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/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 All @@ -80,13 +80,11 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# 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"'
# 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 @@ -133,22 +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=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=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# 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.

# 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, 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
1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
5 changes: 0 additions & 5 deletions jitpack.yml

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9b382f2

Please sign in to comment.