Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.14 and flexibility upgrades #1

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@ import java.nio.charset.StandardCharsets
import java.time.Year

plugins {
id "fabric-loom" version "0.2.0-SNAPSHOT"
id "fabric-loom" version "0.2.4-SNAPSHOT"
id "com.matthewprenger.cursegradle" version "1.1.2"
id "net.minecrell.licenser" version "0.2.1"
id "maven-publish"
}

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8

group = "com.github.GlassPane"
archivesBaseName = "Fabric-Base-Mod"
group = project.maven_group
archivesBaseName = project.name
version = System.getenv("TRAVIS_TAG") ?: project.mod_version
println("Setting version: " + version)

apply from: "https://raw.githubusercontent.com/NerdHubMC/Gradle-Scripts/master/scripts/fabric/basic_project.gradle"
apply from: "https://raw.githubusercontent.com/NerdHubMC/Gradle-Scripts/master/scripts/fabric/dependencies/development_suite.gradle"
try {
apply from: "https://raw.githubusercontent.com/NerdHubMC/Gradle-Scripts/master/scripts/fabric/dependencies/${minecraft_version}/development_suite.gradle"
} catch (MissingResourceException e) {
System.err.println(e.message)
}

processResources {
// this will ensure that this task is redone when there"s a change
Expand All @@ -27,8 +31,9 @@ processResources {
include "fabric.mod.json"

// add mod metadata
expand "version": project.version /*, "changelog_url": project.changelog_url,
"curseforge_id": project.curseforge_id, "license": project.license_header*/
expand "version": project.version , //"changelog_url": project.changelog_url,
"curseforge_id": project.curseforge_id, "license": project.license_header,
"mod_name": project.mod_name

filter { String line ->
line.replace("\"fabric\": \"*\"", "\"fabric\": \"[${project.fabric_version},)\"")
Expand Down Expand Up @@ -59,30 +64,34 @@ repositories {
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings "net.fabricmc:yarn:${yarn_mappings}"
modCompile "net.fabricmc:fabric-loader:${loader_version}"
modImplementation "net.fabricmc:fabric-loader:${loader_version}"

modCompile "com.github.GlassPane:Mesh:${mesh_version}"
modApi "com.github.GlassPane:Mesh:${mesh_version}"

//optional dependency!
modCompile "net.fabricmc:fabric:${fabric_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
}

license {
header = file("code_quality/${project.license_header}_HEADER.txt")
header = rootProject.file("code_quality/${project.license_header}_HEADER.txt")

// Apply licenses only to main source set
sourceSets = [project.sourceSets.main]
include "**/*.java"
charset = StandardCharsets.UTF_8.name()

style {
java = "BLOCK_COMMENT"
}
newLine = false // Disables the empty line between the header and package name
//ignoreFailures = true //Ignore failures and only print a warning on license violations

//export variables
ext {
year = Year.now()
projectDisplayName = project.archivesBaseName
projectDisplayName = project.name
projectOwners = rootProject.owners
if (project.license_header.contains('GPL')) {
if (!project.hasProperty("gpl_version")) {
throw new RuntimeException("GPL version needs to be specified through the 'gpl_version' property")
}
gplVersion = project.gpl_version
}
}
}
15 changes: 15 additions & 0 deletions code_quality/GPL_HEADER.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
${projectDisplayName}
Copyright (C) ${year} ${projectOwners}

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version ${gplVersion} of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses>.
15 changes: 15 additions & 0 deletions code_quality/LGPL_HEADER.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
${projectDisplayName}
Copyright (C) ${year} ${projectOwners}

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version ${gplVersion} of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program; If not, see <https://www.gnu.org/licenses>.
2 changes: 1 addition & 1 deletion code_quality/MIT_HEADER.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
${projectDisplayName}
Copyright (C) ${year} GlassPane
Copyright (C) ${year} ${projectOwners}

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
31 changes: 21 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
#General
#see https://modmuss50.me/fabric.html
minecraft_version=19w09a
yarn_mappings=19w09a.2
loader_version=0.3.7.109
# General
# see https://modmuss50.me/fabric.html
minecraft_version=1.14.2
yarn_mappings=1.14.2+build.7
loader_version=0.4.8+build.155

#Fabric api
fabric_version=0.2.3.108
fabric_version=0.3.0+build.181

#Publishing
# Base properties
mod_name = Fabric Base Mod
mod_version = 1.0.0-SNAPSHOT
license_header = MIT
#curseforge_id =
release_type = release
owners = GlassPane
maven_group = io.github.GlassPane

#Other Dependencies
mesh_version = 1.0.0-SNAPSHOT

#Publishing
license_header = MIT
# FIXME set to the project's actual id
curseforge_id = xxx
curseforge_versions = 1.14; 1.14.1; 1.14.2
release_type = release

# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs = -Xmx2G


1 change: 1 addition & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#Sun May 12 13:31:56 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ pluginManagement {
gradlePluginPortal()
}
}
rootProject.name = 'Fabric-Base-Mod'
rootProject.name = mod_name.replace(' ', '-')

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.glasspane.basemod;
package io.github.glasspane.basemod;
Pyrofab marked this conversation as resolved.
Show resolved Hide resolved

import com.github.glasspane.mesh.api.annotation.CalledByReflection;
import net.fabricmc.api.ModInitializer;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package io.github.glasspane.basemod.mixin.client;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package io.github.glasspane.basemod.mixin.common;
33 changes: 24 additions & 9 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
{
"schemaVersion": 1,
"id": "fabric_base_mod",
"name": "Fabric Base Mod",
"name": "${mod_name}",
"description": "Basic Mod Template for Fabric Mods",
"version": "${version}",
"side": "universal",
"initializers": [
"com.github.glasspane.basemod.BaseMod"
"license": "${license}",

"environment": "*",
"entrypoints": {
"client": [

],
"main": [
"io.github.glasspane.basemod.BaseMod"
]
},
"mixins": [
{
"environment": "client",
"config": "mixins.base_mod.client.json"
},
{
"environment": "*",
"config": "mixins.base_mod.common.json"
}
],
"requires": {

"depends": {
"fabric": "*",
"mesh": "*"
},
"mixins": {
"client": "base_mod.client.json",
"common": "base_mod.common.json"
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"required": true,
"package": "com.github.glasspane.basemod.mixin.client",
"package": "io.github.glasspane.basemod.mixin.client",
"compatibilityLevel": "JAVA_8",
"mixins": [
"MixinItemModels"

],
"injectors": {
"defaultRequire": 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"required": true,
"package": "com.github.glasspane.basemod.mixin.common",
"package": "io.github.glasspane.basemod.mixin.common",
"compatibilityLevel": "JAVA_8",
"mixins": [
"MixinLivingEntity",
"MixinMobEntity"

],
"injectors": {
"defaultRequire": 1
Expand Down