Skip to content

Commit

Permalink
Finish port to 1.19.4
Browse files Browse the repository at this point in the history
Builds off of #36. Also syncs with latest mod template and updates dependencies.
  • Loading branch information
NebelNidas committed May 22, 2024
1 parent 0fa2fce commit 1c19cd1
Show file tree
Hide file tree
Showing 21 changed files with 360 additions and 278 deletions.
11 changes: 0 additions & 11 deletions .github/dependabot.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Build mod
- name: Build the mod
run: ./gradlew build --stacktrace

- name: Upload build artifacts
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: ./gradlew build --stacktrace

- name: Publish mod
uses: Kir-Antipov/mc-publish@v3.2
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: 548fsydf
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
Expand All @@ -42,13 +42,16 @@ jobs:
files-primary: build/libs/!(*-@(dev|sources)).jar
files-secondary: null

name: 0.3.3 for MC 1.16 to 1.19
version: 0.3.3+1.16-1.19.3
name: 0.3.3 for MC 1.19.4
version: 0.3.3+1.19.4
version-type: release

loaders: |
fabric
game-versions: |
1.19.4
dependencies: |
fabric-api | depends
cloth-config | depends
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img height="70" align="right" src="projects/too-many-binds/src/main/resources/assets/toomanybinds/icon.png">
<img height="70" align="right" src="./assets/icon.png">

# Too Many Binds
[![CurseForge downloads](https://cf.way2muchnoise.eu/412915.svg)](https://www.curseforge.com/minecraft/mc-mods/too-many-binds)
Expand Down
File renamed without changes
207 changes: 103 additions & 104 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,141 +1,140 @@
plugins {
id 'fabric-loom' apply false
id 'io.github.juuxel.loom-quiltflower' apply false
id 'fabric-loom'
id 'checkstyle'
id 'com.diffplug.spotless'
}


allprojects {
apply plugin: 'fabric-loom'
apply plugin: 'io.github.juuxel.loom-quiltflower'
apply plugin: 'checkstyle'

checkstyle {
configFile = file("${rootDir}/checkstyle.xml")
toolVersion = project.checkstyle_version
}
version = rootProject.mod_version
group = rootProject.maven_group

base {
archivesName = project.archives_base_name
}

version = rootProject.mod_version
group = rootProject.maven_group
archivesBaseName = rootProject.archives_base_name

checkstyle {
configFile = file("${rootDir}/checkstyle.xml")
toolVersion = project.checkstyle_version
}

configurations {
modRuntimeOnly {
transitive = true
exclude module: 'fabric-loader'
exclude module: 'fabric-api-base'
}
spotless {
java {
removeUnusedImports()
importOrder("java", "javax", "", "net.minecraft", "com.github.reviversmc")
indentWithTabs()
trimTrailingWhitespace()
}
}

repositories {
if (project.use_third_party_mods == 'true') {
maven {
name = 'Modrinth'
url = 'https://api.modrinth.com/maven'
content {
includeGroup 'maven.modrinth'
}
}
maven {
url = 'https://cursemaven.com'
content {
includeGroup 'curse.maven'
}
}
}
maven {
name "Siphalor's Maven"
url 'https://maven.siphalor.de/'
}
maven {
name = 'TerraformersMC'
url = 'https://maven.terraformersmc.com/releases'
}
maven {
url = 'https://maven.shedaniel.me/'
}

repositories {
if (project.use_third_party_mods == 'true') {
maven {
name = 'JitPack'
url = 'https://jitpack.io'
name = 'Modrinth'
url = 'https://api.modrinth.com/maven'
content {
includeGroup 'maven.modrinth'
}
}
maven {
name = 'NucleoidMC'
url = 'https://maven.nucleoid.xyz/'
url = 'https://cursemaven.com'
content {
includeGroup 'curse.maven'
}
}
mavenCentral()
}
maven {
name "Siphalor's Maven"
url 'https://maven.siphalor.de/'
}
maven {
name = 'TerraformersMC'
url = 'https://maven.terraformersmc.com/releases'
}
maven {
url = 'https://maven.shedaniel.me/'
}
mavenCentral()
}

dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"

minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
// Fabric
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
modImplementation fabricApi.module('fabric-api-base', project.fabric_api_version)
modImplementation fabricApi.module('fabric-lifecycle-events-v1', project.fabric_api_version)
modImplementation fabricApi.module('fabric-key-binding-api-v1', project.fabric_api_version)

// Required Fabric API modules
modImplementation fabricApi.module('fabric-api-base', project.fabric_api_version)
modImplementation fabricApi.module('fabric-lifecycle-events-v1', project.fabric_api_version)
modImplementation fabricApi.module('fabric-key-binding-api-v1', project.fabric_api_version)
// Other mods
modCompileOnly "de.siphalor:amecsapi-1.19:${project.amecs_api_version}"
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"

// Amecs API
//modImplementation "de.siphalor:amecsapi-1.19:${project.amecs_api_version}"
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: 'net.fabricmc.fabric-api')
}

// ModMenu
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
// Cloth Config
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: 'net.fabricmc.fabric-api')
}

if (project.use_third_party_mods == 'true') {
configurations {
modRuntimeOnly {
exclude module: 'fabric-lifecycle-events-v1'
exclude module: 'fabric-key-binding-api-v1'
}
if (project.use_third_party_mods == 'true') {
configurations {
modRuntimeOnly {
transitive = true
exclude module: 'fabric-loader'
exclude module: 'fabric-lifecycle-events-v1'
exclude module: 'fabric-key-binding-api-v1'
}

modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
//modRuntimeOnly "maven.modrinth:sodium:${project.sodium_version}"
//modRuntimeOnly "maven.modrinth:lithium:${project.lithium_version}"
modRuntimeOnly "maven.modrinth:starlight:${project.starlight_version}"
//modRuntimeOnly "maven.modrinth:smoothboot-fabric:${project.smoothboot_version}"
modRuntimeOnly "curse.maven:no-fade-452768:${project.no_fade_version}"
}

// Comment out the following line to check vanilla compatibility
modRuntimeOnly "de.siphalor:amecsapi-1.19:${project.amecs_api_version}"

// Use full Fabric API bundle while debugging, since transitive deps aren't always declared correctly
modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"

modRuntimeOnly "maven.modrinth:sodium:${project.sodium_version}"
modRuntimeOnly "maven.modrinth:lithium:${project.lithium_version}"
modRuntimeOnly "maven.modrinth:starlight:${project.starlight_version}"
modRuntimeOnly "maven.modrinth:ferrite-core:${project.ferritecore_version}"
modRuntimeOnly "curse.maven:smooth-boot-415758:${project.smoothboot_version}"
modRuntimeOnly "curse.maven:no-fade-452768:${project.no_fade_version}"
}
}


processResources {
inputs.property 'version', project.version
processResources {
inputs.property 'version', project.version

filesMatching('fabric.mod.json') {
expand 'version': project.version
}
filesMatching('fabric.mod.json') {
expand 'version': project.version
}

tasks.withType(JavaCompile).configureEach {
// Ensure that the encoding is set to UTF-8, no matter what the system default is.
// This fixes some edge cases with special characters not displaying correctly,
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html.
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = 'UTF-8'
from("${rootDir}/assets/icon.png") {
into 'assets/toomanybinds/'
}
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present. If you remove this line, sources will not be generated.
withSourcesJar()
tasks.withType(JavaCompile).configureEach {
// Ensure that the encoding is set to UTF-8, no matter what the system default is.
// This fixes some edge cases with special characters not displaying correctly,
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html.
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = 'UTF-8'

// If this mod is going to be a library, then it should also generate Javadocs in order to aid
// with development. Uncomment this line to generate them.
// withJavadocJar()
}
// Minecraft 1.18-pre2 upwards uses Java 17.
it.options.release = 17
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

processResources {
from("${rootDir}/assets/icon.png") {
into "assets/toomanybinds/"
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present. If you remove this line, sources will not be generated.
withSourcesJar()

// If this mod is going to be a library, then it should also generate Javadocs in order to aid
// with development. Uncomment this line to generate them.
// withJavadocJar()
}
30 changes: 22 additions & 8 deletions checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">

<!-- ReviversMC checkstyle v1.1 -->
<!-- ReviversMC checkstyle v2.0 -->

<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="fileExtensions" value="java"/>
<property name="localeLanguage" value="en"/>
<property name="localeCountry" value="US"/>
<property name="tabWidth" value="4"/>

<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
Expand Down Expand Up @@ -68,16 +69,29 @@
<property name="message" value="missing blank line after block at same indentation level"/>
</module>

<!-- Allow `@SuppressWarnings("checkstyle:...")` to suppress certain checkstyle errors -->
<module name="SuppressWarningsFilter"/>

<module name="TreeWalker">
<!-- Required counterpart to `SuppressWarningsFilter` -->
<module name="SuppressWarningsHolder"/>

<!-- Allow "//CHECKSTYLE.OFF: <InspectionName>" and "//CHECKSTYLE.ON: <InspectionName>" pairs to toggle some inspections -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>

<!-- Ensure all imports are ship shape -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>

<module name="ImportOrder">
<property name="groups" value="java,javax,*,com.github.reviversmc"/>
<property name="ordered" value="false"/><!-- the plugin orders alphabetically without considering separators.. -->
<property name="groups" value="java,javax,*,net.minecraft,com.github.reviversmc"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="option" value="top"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
Expand Down Expand Up @@ -115,11 +129,11 @@
</module>

<module name="Indentation">
<property name="basicOffset" value="8"/>
<property name="caseIndent" value="8"/>
<property name="throwsIndent" value="8"/>
<property name="arrayInitIndent" value="8"/>
<property name="lineWrappingIndentation" value="16"/>
<property name="basicOffset" value="4"/>
<property name="caseIndent" value="4"/>
<property name="throwsIndent" value="4"/>
<property name="arrayInitIndent" value="4"/>
<property name="lineWrappingIndentation" value="8"/>
</module>

<module name="ParenPad"/>
Expand Down
Loading

0 comments on commit 1c19cd1

Please sign in to comment.