Skip to content

Commit

Permalink
Minecraft 1.11 Wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Feb 27, 2017
1 parent 5b4dc92 commit 924f941
Show file tree
Hide file tree
Showing 127 changed files with 12,306 additions and 46 deletions.
1 change: 1 addition & 0 deletions minecraft/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
!/build.gradle
!/.gitignore

!/1.11
!/1.8
!/1.7
17 changes: 17 additions & 0 deletions minecraft/1.11/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Ignore All
/*

# Sources
!/src

# github
!/.gitignore
!/README.md

# gradle
!/build.gradle
!/build.properties
!/settings.gradle
!/gradle.properties
!/gradlew*
!/gradle
135 changes: 135 additions & 0 deletions minecraft/1.11/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
apply from: "https://raw.githubusercontent.com/NOVA-Team/NOVA-Gradle/master/shared-scripts/java.gradle"

apply plugin: "com.jfrog.artifactory"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "maven-publish"

idea.module.name = "Core-MC-1.11"
archivesBaseName = "NOVA-Core-Wrapper-MC1.11"

configurations {
fatJar
compile.extendsFrom fatJar
}

dependencies {
fatJar project(":")
testCompile project(path: ':', configuration: 'wrapperTests')

testCompile "junit:junit:4.12"
testCompile 'org.assertj:assertj-core:3.0.0'
testRuntime 'org.slf4j:slf4j-simple:1.7.10'
}

jar {
manifest {
attributes 'FMLCorePlugin': 'nova.core.wrapper.mc.forge.v1_11.NovaMinecraftCore'
attributes 'FMLCorePluginContainsFMLMod': 'true'
attributes 'FMLAT': 'nova_at.cfg'
}
}

task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
manifest {
attributes 'FMLCorePlugin': 'nova.core.wrapper.mc.forge.v1_11.NovaMinecraftCore'
attributes 'FMLCorePluginContainsFMLMod': 'true'
attributes 'FMLAT': 'nova_at.cfg'
}
}

/**
* Create fat jar file with all dependencies included.
*/
task fatJar(type: Jar) {
configurations.fatJar.each {dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
with jar

manifest {
attributes 'FMLCorePlugin': 'nova.core.wrapper.mc.forge.v1_11.NovaMinecraftCore'
attributes 'FMLCorePluginContainsFMLMod': 'true'
attributes 'FMLAT': 'nova_at.cfg'
}
classifier = 'fat'
}

artifacts {
archives deobfJar
archives fatJar
}

publishing {
publications {
main(MavenPublication) {
from components.java

artifactId archivesBaseName

artifact sourcesJar
artifact javadocJar
artifact deobfJar
artifact fatJar

pom.withXml(writePom(project.properties))
pom.withXml {xml ->
def children = xml.asNode().get("dependencies")[0]
for (child in children) {
def artifactId = child.get("artifactId")[0].value()[0]
if (artifactId.equals("forgeSrc") || artifactId.equals("forgeBin")) {
children.remove(child)
break;
}
}
}
}
}
}

artifactory {
publish {
defaults {
publications("main")
publishPom = true
}
}
}

apply plugin: 'net.minecraftforge.gradle.forge'

minecraft {
version = property("minecraft.version") + "-" + property("forge.version")
mappings = 'snapshot_20161220'
runDir = "run"
}

reobf {
// TODO Figure out how to make this work with maven-publish (creates a new task 'reobfFatJar' that isn't compatible with maven-publish)
fatJar {classpath += configurations.compile}
}

runClient {
jvmArgs '-Dfml.coreMods.load=nova.core.wrapper.mc.forge.v1_11.NovaMinecraftCore'
}

runServer {
jvmArgs '-Dfml.coreMods.load=nova.core.wrapper.mc.forge.v1_11.NovaMinecraftCore'
}

processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version

from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version, 'mcversion': project.minecraft.version
}

from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
10 changes: 10 additions & 0 deletions minecraft/1.11/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
group = nova.core

minecraft.version = 1.11
forge.version = 13.19.1.2189
forgeGradleVersion = 2.2-SNAPSHOT

packaging = jar
info.inceptionYear = 2016
info.description = The wrapper of the Nova API to the MinecraftForge 1.11 modding system.
info.organization.name = NOVA
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2015 NOVA, All rights reserved.
* This library is free software, licensed under GNU Lesser General Public License version 3
*
* This file is part of NOVA.
*
* NOVA 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 3 of the License, or
* (at your option) any later version.
*
* NOVA 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 NOVA. If not, see <http://www.gnu.org/licenses/>.
*/

package nova.core.wrapper.mc.forge.v1_11;

import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.MCVersion;
import nova.core.wrapper.mc.forge.v1_11.asm.transformers.Transformers;

import java.util.Map;

@MCVersion(value = "1.11")
public class NovaMinecraftCore implements IFMLLoadingPlugin {
@Override
public String[] getASMTransformerClass() {
return new String[] { Transformers.class.getName() };
}

@Override
public String getModContainerClass() {
return "nova.core.wrapper.mc.forge.v1_11.NovaMinecraftPreloader";
}

@Override
public String getSetupClass() {
return null;
}

@Override
public void injectData(Map<String, Object> data) {

}

@Override
public String getAccessTransformerClass() {
return null;
}
}
Loading

0 comments on commit 924f941

Please sign in to comment.