Skip to content

Commit

Permalink
First real commit
Browse files Browse the repository at this point in the history
  • Loading branch information
leafreynolds committed Jan 29, 2022
1 parent 765d818 commit 9eb5dc6
Show file tree
Hide file tree
Showing 100 changed files with 5,401 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 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.
src/generated/**/.cache/cache text eol=lf
src/generated/**/*.json text eol=lf
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# eclipse
bin
*.launch
.settings
.metadata
.classpath
.project

# idea
out
*.ipr
*.iws
*.iml
.idea

# gradle
build
.gradle

# other
eclipse
run

# Files from Forge MDK
forge*changelog.txt
17 changes: 17 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
All Rights Reserved

Copyright (c) 2022 LeafReynolds

Permission is hereby granted, free of charge, to any person:

- to use the mod
- to distribute the mod as part of a modpack
- to publish images or videos depicting the mod
- to copy and modify the code (e.g. submitting pull requests)
- to learn from portions of the code and adapt for use in other projects
- to derive from or depend on this code as a dependency (e.g. for mod compatibility)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
264 changes: 264 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'


ext.configFile = file('gradle.properties')
ext.config = parseConfig(configFile)

version = "${forge_version}-b${build_number}"
group = 'leaf.soulhome' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "${project.jar_name}"

java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8.
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))

// Include resources generated by data generators.
sourceSets {
main.resources.srcDirs += 'src/main/generated'
}

minecraft {
// The mappings can be changed at any time, and must be in the following format.
// Channel: Version:
// snapshot YYYYMMDD Snapshot are built nightly.
// stable # Stables are built at the discretion of the MCP team.
// official MCVersion Official field/method names from Mojang mapping files
//
// You must be aware of the Mojang license when using the 'official' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// 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.16.5'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

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

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

workingDirectory project.file('run')
arg "-mixin.config=soulhome.mixins.json"

// Recommended logging data for a userdev environment
// The markers can be changed as needed.
// "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'

mods {
soulhome {
source sourceSets.main
}
}
}

server {
properties 'mixin.env.disableRefMap': 'true'
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
// The markers can be changed as needed.
// "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'

mods {
soulhome {
source sourceSets.main
}
}
}

data {
properties 'mixin.env.disableRefMap': 'true'
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
// The markers can be changed as needed.
// "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'

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

mods {
soulhome {
source sourceSets.main
}
}
}

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

mixin {
add sourceSets.main, "soulhome.refmap.json"
}

repositories {
maven {
// location of the maven that hosts JEI files
url "https://dvs1.progwml6.com/files/maven/"
}
maven {
//used for patchouli
url "https://maven.blamejared.com/"
}
maven {
//curio
url = "https://maven.theillusivec4.top/"
}
maven {
//HWYLA
url "https://maven.tehnut.info"
}
maven {
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
mavenCentral()
}

dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's 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:${forge_version}"

annotationProcessor 'org.spongepowered:mixin:0.8.2:processor'

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

compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}:api")
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}")

compileOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}:api")
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}")

compileOnly fg.deobf("mcp.mobius.waila:Hwyla:${hwyla_version}:api")
runtimeOnly fg.deobf("mcp.mobius.waila:Hwyla:${hwyla_version}")

//modname-modid:fileid?
implementation fg.deobf("curse.maven:appleskin-248787:3035787")
implementation fg.deobf("curse.maven:journeymap-32274:3397059")
//implementation fg.deobf("curse.maven:ctm-267602:2642375")
}

// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes([
"Specification-Title" : "soulhome",
"Specification-Vendor" : "soulhome",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : "${version}",
"Implementation-Vendor" : "soulhome",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConfigs" : "soulhome.mixins.json"

])
}
}

processResources {
// Exclude datagenerator .cache directory
exclude '.cache'

filesMatching('data/soulhome/patchouli_books/guide/book.json') {
filter {
it.replaceAll("buildNumber", config.build_number)
}
}
}

task incrementBuildNumber {
doFirst {
config.build_number = (config.build_number.toString().toInteger()) + 1
configFile.withWriter {
config.toProperties().store(it, "")
}
}
}

def parseConfig(File config) {
if(config.exists()){
config.withReader {
def prop = new Properties()
prop.load(it)
return (new ConfigSlurper().parse(prop))
}
} else {
return null
}
}

// Example configuration to allow publishing using the maven-publish task
// 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')

publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}

// Prevent Mixin annotation processor from getting into IDEA's annotation processor settings
if (System.getProperty("idea.sync.active") == "true") {
afterEvaluate {
tasks.withType(JavaCompile).all {
it.options.annotationProcessorPath = files()
}
}
}
11 changes: 11 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
#Sat Jan 29 12:10:33 NZDT 2022
forge_version=1.16.5-36.2.20
org.gradle.daemon=false
jar_name=SoulHome-Mod
jei_version=1.16.4\:7.6.0.62
hwyla_version=1.10.11-B78_1.16.2
org.gradle.jvmargs=-Xmx8G
curios_version=1.16.5-4.0.6.8
build_number=1
patchouli_version=1.16.4-51
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 9eb5dc6

Please sign in to comment.