Skip to content

Commit

Permalink
Update to 1.20 [build] [publish]
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrbysco committed Jun 26, 2023
1 parent e348773 commit ee7c158
Show file tree
Hide file tree
Showing 21 changed files with 98 additions and 76 deletions.
71 changes: 39 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,87 +1,91 @@
plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '5.1.+'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'com.modrinth.minotaur' version "2.+"
}

version = "${version}"
group = 'com.mrbysco.chowderexpress' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "ChowderExpress-${mc_version}"
group = "${mod_group}"
base {
archivesName = "${mod_archive_name}-${mc_version}"
}

// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
minecraft {
mappings channel: "${mcp_channel}", version: "${mcp_mappings}"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
mappings channel: mapping_channel, version: mapping_version

copyIdeResources = true

// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')
workingDirectory project.file('run')
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"

// Recommended logging data for a userdev environment
// property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.markers', 'REGISTRIES'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', 'chowderexpress'
property 'forge.enabledGameTestNamespaces', "${mod_id}"

mods {
chowderexpress {
"${mod_id}" {
source sourceSets.main
}
}
}

server {
workingDirectory project.file('run')
workingDirectory project.file('run')
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"

// Recommended logging data for a userdev environment
// property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.markers', 'REGISTRIES'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', 'chowderexpress'
property 'forge.enabledGameTestNamespaces', "${mod_id}"

mods {
chowderexpress {
"${mod_id}" {
source sourceSets.main
}
}
}

data {
workingDirectory project.file('run')
workingDirectory project.file('run')
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"

// Recommended logging data for a userdev environment
// property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.markers', 'REGISTRIES'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'

// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', 'chowderexpress', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', 'chowderexpress'
args '--mod', "${mod_id}", '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

mods {
chowderexpress {
"${mod_id}" {
source sourceSets.main
}
}
Expand All @@ -93,18 +97,15 @@ minecraft {
sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
maven {
url = "https://dvs1.progwml6.com/files/maven"
}
maven {
maven {
url = "https://maven.blamejared.com"
}
}
}

dependencies {
minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}"

compileOnly fg.deobf("mezz.jei:jei-${mc_version}-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${mc_version}-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}")

runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}")
Expand All @@ -114,7 +115,7 @@ dependencies {
jar {
manifest {
attributes([
"Specification-Title" : "chowderexpress",
"Specification-Title" : "${mod_id}",
"Specification-Vendor" : "Mrbysco",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
Expand All @@ -125,6 +126,12 @@ jar {
}
}

// Example configuration to allow publishing using the maven-publish plugin
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
// publish.dependsOn('reobfJar')

def reobfFile = file("$buildDir/reobfJar/output.jar")
def reobfArtifact = artifacts.add('default', reobfFile) {
type 'jar'
Expand All @@ -135,7 +142,7 @@ publishing {
mavenJava(MavenPublication) {
artifact(reobfArtifact) {
builtBy reobfArtifact
artifactId = archivesBaseName
artifactId = base.archivesName.get()
classifier null
}
}
Expand All @@ -158,4 +165,4 @@ tasks.withType(JavaCompile).configureEach {
}

apply from: 'gradle/curseforge.gradle'
apply from: 'gradle/modrinth.gradle'
apply from: 'gradle/modrinth.gradle'
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* Initial update to 1.19.4
* Initial update to 1.20
15 changes: 9 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

# Base info
mc_version=1.19.4
forge_version=45.0.43
mcp_channel=official
mcp_mappings=1.19.4
mc_version=1.20.1
forge_version=47.0.19
mapping_channel=official
mapping_version=1.20.1
mod_group=com.mrbysco.chowderexpress
mod_id=chowderexpress
mod_archive_name=ChowderExpress

#Publishing
mod_name=Chowder Express
curseforge_id=783410
modrinth_id=CcY0wAVw

# Version
version=1.3.0
version=2.0.0

# Dependencies
jei_version=13.1.0.2
jei_version=15.1.0.19
1 change: 1 addition & 0 deletions gradle/curseforge.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if (System.getenv().CURSEFORGE_KEY) {
id = project.curseforge_id
releaseType = "beta"
addGameVersion "Forge"
addGameVersion "1.20"
addGameVersion "${mc_version}"
addGameVersion "Java 17"
mainArtifact(jar)
Expand Down
4 changes: 2 additions & 2 deletions gradle/modrinth.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ if (System.getenv().MODRINTH_KEY) {
modrinth {
token = System.getenv().MODRINTH_KEY
projectId = project.modrinth_id
versionType = "release"
versionType = "beta"
versionName = "${mod_name} ${mc_version}"
versionNumber = project.version
uploadFile = jar
changelog = fileContents
gameVersions = ["${mc_version}"]
gameVersions = ["1.20", "${mc_version}"]
loaders = ["forge"]
}
}
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,5 +1,6 @@
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.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 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/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,10 +80,10 @@ 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##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# 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"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
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
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
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
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
9 changes: 8 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = 'https://maven.minecraftforge.net/' }
maven {
name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/'
}
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.19.4 2023-04-18T02:25:24.4893774 Tags for minecraft:item mod id chowderexpress
// 1.20.1 2023-06-26T18:13:11.439002 Tags for minecraft:item mod id chowderexpress
953a2d84283eb74fab164e4f15b3e025b4969366 data/chowderexpress/tags/items/soups.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.19.4 2023-04-18T02:25:24.4903748 Sound Definitions
// 1.20.1 2023-06-26T18:13:11.439502 Sound Definitions
45ca0a31bdc571cd49597904ef98727e71f3f745 assets/chowderexpress/sounds.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// 1.19.4 2023-04-18T02:25:24.4898744 Tags for minecraft:block mod id chowderexpress
// 1.20.1 2023-06-26T18:13:11.439502 Tags for minecraft:block mod id chowderexpress
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.19.4 2023-04-18T02:25:24.4873741 Item Models: chowderexpress
// 1.20.1 2023-06-26T18:13:11.4375015 Item Models: chowderexpress
6890e612ff24d2d617b406b23b447c50fa99328b assets/chowderexpress/models/item/soup_cart.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// 1.19.4 2023-04-18T02:25:24.4888746 Recipes
87697b9ff626777c081797471122ff69ff48481b data/chowderexpress/advancements/recipes/transportation/soup_cart.json
// 1.20.1 2023-06-26T18:13:11.4385013 Recipes
9d27610a044aab623f7aa8c99ca32ca55f24f39b data/chowderexpress/advancements/recipes/transportation/soup_cart.json
0c7d883f64cfaac177d4bdb70b2048282692ba1f data/chowderexpress/recipes/soup_cart.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.19.4 2023-04-18T02:25:24.4898744 Languages: en_us
// 1.20.1 2023-06-26T18:13:11.439002 Languages: en_us
63b8ca789489a584e633ade76911ec515a7315a7 assets/chowderexpress/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
"recipes": [
"chowderexpress:soup_cart"
]
}
},
"sends_telemetry_event": false
}
11 changes: 4 additions & 7 deletions src/main/java/com/mrbysco/chowderexpress/ChowderExpress.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.event.CreativeModeTabEvent;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.common.Mod;
Expand Down Expand Up @@ -41,11 +40,9 @@ public ChowderExpress() {
});
}

private void buildCreativeContents(CreativeModeTabEvent.BuildContents event) {
var entries = event.getEntries();
var visibility = CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS;
if (event.getTab() == CreativeModeTabs.TOOLS_AND_UTILITIES) {
entries.put(new ItemStack(CartRegistry.SOUP_CART_ITEM.get()), visibility);
private void buildCreativeContents(BuildCreativeModeTabContentsEvent event) {
if (event.getTabKey() == CreativeModeTabs.TOOLS_AND_UTILITIES) {
event.accept(new ItemStack(CartRegistry.SOUP_CART_ITEM.get()));
}
}
}
Loading

0 comments on commit ee7c158

Please sign in to comment.