Skip to content

Commit

Permalink
Update code to 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiahwinsley committed Jul 12, 2023
1 parent 02892fc commit e80aec7
Show file tree
Hide file tree
Showing 126 changed files with 1,246 additions and 2,092 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Default to LF for all files
* text=auto eol=lf

# Batch files should use CRLF
*.bat text eol=crlf

# Disable autocrlf on generated files, they always generate with LF
# Add any extra files or paths here to make git stop saying they
# are changed when only line endings change.
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish to Curseforge

on:
workflow_dispatch:
inputs:
tag:
description: 'Release Tag'
required: true
type: string

jobs:
build:
runs-on: ubuntu-22.04
steps:
# Get the specified release by tag
- uses: octokit/[email protected]
id: get_release_by_tag
with:
route: GET /repos/{owner}/{repo}/releases/tags/{tag}
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
tag: ${{ inputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: robinraju/[email protected]
id: get_release_assets
with:
tag: ${{ inputs.tag }}
fileName: "*.jar"
out-file-path: "assets"
token: ${{ secrets.GITHUB_TOKEN }}
- uses: itsmeow/curseforge-upload@v3
with:
file_path: "${{ fromJson(steps.get_release_assets.outputs.downloaded_files)[0] }}"
game_endpoint: "minecraft"
game_versions: "Minecraft 1.20:1.20,Java 17,Forge"
project_id: "514045"
token: ${{ secrets.CF_API_TOKEN }}
changelog: "${{ fromJson(steps.get_release_by_tag.outputs.data).body }}"

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ build

# other
eclipse
renamefolder
src/generated/resources/.cache
tmp

# Files from Forge MDK
forge*changelog.txt
Expand Down
98 changes: 60 additions & 38 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
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 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
}

// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
Expand All @@ -22,7 +23,7 @@ minecraft {
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'official', version: '1.19.2'
mappings channel: 'official', version: minecraft_version

// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.

Expand All @@ -45,10 +46,10 @@ minecraft {
property 'forge.logging.console.level', 'debug'

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', 'allthecompressed'
property 'forge.enabledGameTestNamespaces', mod_id

mods {
allthecompressed {
"${mod_id}" {
source sourceSets.main
}
}
Expand All @@ -61,11 +62,10 @@ minecraft {

property 'forge.logging.console.level', 'debug'

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', 'allthecompressed'
property 'forge.enabledGameTestNamespaces', mod_id

mods {
allthecompressed {
"${mod_id}" {
source sourceSets.main
}
}
Expand All @@ -77,23 +77,14 @@ minecraft {
gameTestServer {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'

// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', 'allthecompressed'
property 'forge.enabledGameTestNamespaces', mod_id

mods {
allthecompressed {
"${mod_id}" {
source sourceSets.main
}
}
Expand All @@ -107,10 +98,18 @@ minecraft {
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', 'allthecompressed', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/'),
'--existing-mod', 'alltheores',
'--existing-mod', 'allthemodium',
'--existing-mod', 'allthetweaks',
'--existing-mod', 'botania',
'--existing-mod', 'enderio',
'--existing-mod', 'powah',
'--existing-mod', 'productivebees',
'--existing-mod', 'supplementaries'

mods {
allthecompressed {
"${mod_id}" {
source sourceSets.main
}
}
Expand All @@ -123,9 +122,9 @@ sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
maven {
// location of the maven that hosts JEI files
name = "Progwml6 maven"
url = "https://dvs1.progwml6.com/files/maven/"
// location of the maven that hosts JEI files since January 2023
name = "Jared's maven"
url = "https://maven.blamejared.com/"
content {
includeGroup "mezz.jei"
}
Expand All @@ -138,19 +137,40 @@ repositories {
includeGroup "mezz.jei"
}
}
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
flatDir {
dirs 'tmp'
}
}

dependencies {
// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
// that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft "net.minecraftforge:forge:1.19.2-43.1.1"
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"

// compile against the JEI API but do not include it at runtime
compileOnly(fg.deobf("mezz.jei:jei-${mc_version}-common-api:${jei_version}"))
compileOnly(fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}"))
compileOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}"))
compileOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}"))
// at runtime, use the full JEI jar for Forge
runtimeOnly(fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}"))
runtimeOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}"))

// runtimeOnly fg.deobf("curse.maven:ato-405593:4590570")
runtimeOnly fg.deobf("ato:alltheores:1.20-46.0.2-2.0.3")
runtimeOnly fg.deobf("curse.maven:productivebees-377897:4588445")
runtimeOnly fg.deobf("curse.maven:supplementaries-412082:4591988")
runtimeOnly fg.deobf("curse.maven:selene-499980:4591863") // required by supplementaries
runtimeOnly fg.deobf("curse.maven:powah-rearchitected-633483:4622661")
runtimeOnly fg.deobf("curse.maven:cloth-config-348521:4573055") // required by powah
runtimeOnly fg.deobf("curse.maven:architectury-api-419699:4581905") // required by powah
runtimeOnly fg.deobf("curse.maven:ender-io-64578:4637542")


// Examples using mod jars from ./libs
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")

Expand All @@ -161,25 +181,27 @@ dependencies {

// Example for how to get properties into the manifest for reading at runtime.
jar {
archiveBaseName.set("AllTheCompressed-${mc_version}")
archiveBaseName.set("${mod_id}-${minecraft_version}")
manifest {
attributes([
"Specification-Title" : mod_id,
"Specification-Vendor" : group,
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" : "pdiddy973",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "pdiddy973"
])
}
}

// 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')
// The settings below make sure that your build is reproducible
// More information at https://docs.gradle.org/current/userguide/working_with_files.html#sec:reproducible_archives
preserveFileTimestamps = false
reproducibleFileOrder = true

// Example configuration to allow publishing using the maven-publish plugin
// This is the preferred method to reobfuscate your jar file
finalizedBy('reobfJar')
}

publishing {
publications {
Expand Down
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ org.gradle.daemon=false

group=com.pdiddy973.allthecompressed
mod_id=allthecompressed
version=2.0.0
version=3.0.0

mc_version=1.19.2
jei_version=11.3.0.260
minecraft_version=1.20.1
forge_version=47.1.0
jei_version=15.0.0.12
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.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
28 changes: 19 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,10 +32,10 @@
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
Expand All @@ -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 Expand Up @@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

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

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
Loading

0 comments on commit e80aec7

Please sign in to comment.