Skip to content

Commit

Permalink
initial 1.16.1 fabric port
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIllusiveC4 committed Jul 25, 2020
1 parent 8840c42 commit 9165f5b
Show file tree
Hide file tree
Showing 40 changed files with 675 additions and 839 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2018-2019 C4
Copyright (C) 2018-2020 C4

Caelus is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
Expand Down
163 changes: 61 additions & 102 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,144 +1,103 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
maven { url 'https://plugins.gradle.org/m2/' }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.4.0'
}
plugins {
id 'fabric-loom' version '0.4-SNAPSHOT'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'maven-publish'
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'com.matthewprenger.cursegradle'
apply plugin: 'maven-publish'

version = "${version_minecraft}-${mod_version}"
group = "${mod_group}"
archivesBaseName = "${mod_id}"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

minecraft {
mappings channel: 'snapshot', version: "${version_mcp}".toString()

runs {
client {
workingDirectory project.file('run')

property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'

mods {
caelus {
source sourceSets.main
}
}
}

server {
workingDirectory project.file('run')

property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
}

mods {
caelus {
source sourceSets.main
}
}
}
repositories {
maven {
url = "https://www.cursemaven.com"
}
}

dependencies {
minecraft "net.minecraftforge:forge:${version_forge}"
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"

modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
}

sourceSets {
main {
resources {
srcDirs += 'docs'
}
processResources {
inputs.property "version", project.version

from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand 'version': project.version
}
}

jar {
manifest {
attributes(["Specification-Title": "${mod_name}",
"Specification-Vendor": "${mod_author}",
"Specification-Version": "${version}",
"Implementation-Title": "${mod_name}",
"Implementation-Version": "${version}",
"Implementation-Vendor" :"${mod_author}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}

def reobfFile = file("build/reobfJar/output.jar")
def reobfArtifact = artifacts.add('default', reobfFile) {
type 'jar'
builtBy 'reobfJar'
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}

task apiJar(type: Jar) {
classifier = 'api'
include 'top/theillusivec4/caelus/api/**/*'
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set("sources")
from sourceSets.main.allSource
from sourceSets.main.output
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}

task deobfJar(type: Jar) {
classifier = 'deobf'
from sourceSets.main.output
}

tasks.build.dependsOn apiJar, sourcesJar, deobfJar

processResources {

from(sourceSets.main.resources.srcDirs) {
include 'META-INF/mods.toml'
expand 'version': project.version, 'mod_id' : mod_id, 'mod_name': mod_name, 'mod_url': mod_url, 'mod_author': mod_author, 'mod_description': mod_description, 'mod_icon': mod_icon
}

from(sourceSets.main.resources.srcDirs) {
exclude 'META-INF/mods.toml'
sourceSets {
main {
resources {
srcDirs += 'docs'
}
}
}


curseforge {

project {
apiKey = findProperty('curseKey') ?: 0
id = "${curse_id}"
releaseType = "${curse_release}"
changelogType = 'markdown'
changelog = file('docs/CHANGELOG.md')
addGameVersion "Java 8"
addGameVersion "Fabric"
addGameVersion project.minecraft_version
addArtifact(sourcesJar)
addArtifact(apiJar)
addArtifact(deobfJar)
mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"))

relations {
requiredDependency 'fabric-api'
}

afterEvaluate {
uploadTask.dependsOn(remapJar)
}
}

options {
forgeGradleIntegration = false
}
}

publishing {
tasks.publish.dependsOn 'build'
publications {

publications {
mavenJava(MavenPublication) {
artifactId project.archivesBaseName

artifact reobfArtifact
artifact sourcesJar
artifact apiJar
artifact deobfJar
artifactId = project.archives_base_name

artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}

Expand All @@ -158,4 +117,4 @@ publishing {
}
}
}
}
}
31 changes: 14 additions & 17 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
# Gradle
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

# Mod
mod_version=2.0-beta5
mod_group=top.theillusivec4.caelus
mod_id=caelus
mod_name=Caelus API
mod_url=https://www.curseforge.com/minecraft/mc-mods/caelus
mod_author=C4
mod_description=A coremod and API to provide developers access to elytra flight mechanics through an entity attribute.
mod_icon=caelus_icon.png
# Fabric Properties
minecraft_version=1.16.1
yarn_mappings=1.16.1+build.1
loader_version=0.8.8+build.202

# Mod Properties
mod_version=0.0.1-1.16.1
maven_group=top.theillusivec4.caelus
archives_base_name=caelus-fabric

# Dependencies
version_minecraft=FORGE-1.16.1
version_forge=1.16.1-32.0.34
version_mcp=20200514-1.16
fabric_version=0.13.1+build.370-1.16

# Curse
curse_id=308989
curse_release=beta
curse_id=397876
curse_release=beta
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jul 01 02:12:49 PDT 2020
#Sat Jul 11 00:56:44 PDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
51 changes: 31 additions & 20 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$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"'
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down Expand Up @@ -109,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
Expand Down Expand Up @@ -138,19 +154,19 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -159,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
21 changes: 20 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -13,8 +29,11 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m"
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
11 changes: 11 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
maven { url 'https://plugins.gradle.org/m2/' }
}
}
Loading

0 comments on commit 9165f5b

Please sign in to comment.