Skip to content
This repository was archived by the owner on May 7, 2020. It is now read-only.

Commit 63875f2

Browse files
committed
Sync Final-2.0
0 parents  commit 63875f2

9 files changed

Lines changed: 784 additions & 0 deletions

File tree

build.gradle

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
buildscript {
2+
repositories {
3+
jcenter()
4+
maven { url = "http://files.minecraftforge.net/maven" }
5+
}
6+
dependencies {
7+
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
8+
}
9+
}
10+
apply plugin: 'net.minecraftforge.gradle.forge'
11+
12+
//Use on upper Java 9
13+
//apply plugin: 'application'
14+
//applicationDefaultJvmArgs += "-Djava.ext.dirs=nothing"
15+
16+
//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup.
17+
18+
19+
version = "2.0.0"
20+
group= "nonupdate.forge" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
21+
archivesBaseName = "NonUpdate"
22+
ext.env = System.getenv()
23+
if (env.BUILD_NUMBER != null) {
24+
version += "build" + env.BUILD_NUMBER
25+
}
26+
27+
sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly.
28+
compileJava {
29+
sourceCompatibility = targetCompatibility = "1.8"
30+
}
31+
32+
minecraft {
33+
version = "1.12.2-14.23.3.2655"
34+
runDir = "run"
35+
36+
// the mappings can be changed at any time, and must be in the following format.
37+
// snapshot_YYYYMMDD snapshot are built nightly.
38+
// stable_# stables are built at the discretion of the MCP team.
39+
// Use non-default mappings at your own risk. they may not allways work.
40+
// simply re-run your setup task after changing the mappings to update your workspace.
41+
mappings = "snapshot_20180722"
42+
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
43+
}
44+
45+
dependencies {
46+
// you may put jars on which you depend on in ./libs
47+
// or you may define them like so..
48+
//compile "some.group:artifact:version:classifier"
49+
//compile "some.group:artifact:version"
50+
51+
// real examples
52+
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
53+
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
54+
55+
// the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
56+
//provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
57+
58+
// the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
59+
// except that these dependencies get remapped to your current MCP mappings
60+
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
61+
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
62+
63+
// for more info...
64+
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
65+
// http://www.gradle.org/docs/current/userguide/dependency_management.html
66+
67+
}
68+
69+
def commonManifest = {
70+
attributes 'FMLCorePlugin': 'nonupdate.forge.NonUpdate',
71+
'FMLCorePluginContainsFMLMod': 'true'
72+
}
73+
74+
jar {
75+
baseName = "${archivesBaseName}-AllMCVersion-Final-${version}"
76+
manifest commonManifest
77+
classifier = 'universal'
78+
79+
from 'README.txt'
80+
}
81+
82+
processResources
83+
{
84+
// this will ensure that this task is redone when the versions change.
85+
inputs.property "version", project.version
86+
inputs.property "mcversion", project.minecraft.version
87+
88+
// replace stuff in mcmod.info, nothing else
89+
from(sourceSets.main.resources.srcDirs) {
90+
include 'mcmod.info'
91+
92+
// replace version and mcversion
93+
expand 'version':project.version, 'mcversion':project.minecraft.version
94+
}
95+
96+
// copy everything else, thats not the mcmod.info
97+
from(sourceSets.main.resources.srcDirs) {
98+
exclude 'mcmod.info'
99+
}
100+
}
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
/*
2+
* Forge Mod Loader
3+
* Copyright (c) 2012-2013 cpw.
4+
* All rights reserved. This program and the accompanying materials
5+
* are made available under the terms of the GNU Lesser Public License v2.1
6+
* which accompanies this distribution, and is available at
7+
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
8+
*
9+
* Contributors:
10+
* cpw - implementation
11+
*/
12+
13+
package cpw.mods.fml.relauncher;
14+
15+
import java.lang.annotation.ElementType;
16+
import java.lang.annotation.Retention;
17+
import java.lang.annotation.RetentionPolicy;
18+
import java.lang.annotation.Target;
19+
import java.util.Map;
20+
21+
/**
22+
* The base plugin that provides class name meta information to FML to
23+
* enhance the classloading lifecycle for mods in FML
24+
*
25+
* @author cpw
26+
*
27+
*/
28+
public interface IFMLLoadingPlugin
29+
{
30+
/**
31+
* Return a list of classes that implements the IClassTransformer interface
32+
* @return a list of classes that implements the IClassTransformer interface
33+
*/
34+
String[] getASMTransformerClass();
35+
36+
/**
37+
* Return a class name that implements "ModContainer" for injection into the mod list
38+
* The "getName" function should return a name that other mods can, if need be,
39+
* depend on.
40+
* Trivially, this modcontainer will be loaded before all regular mod containers,
41+
* which means it will be forced to be "immutable" - not susceptible to normal
42+
* sorting behaviour.
43+
* All other mod behaviours are available however- this container can receive and handle
44+
* normal loading events
45+
*/
46+
String getModContainerClass();
47+
48+
/**
49+
* Return the class name of an implementor of "IFMLCallHook", that will be run, in the
50+
* main thread, to perform any additional setup this coremod may require. It will be
51+
* run <strong>prior</strong> to Minecraft starting, so it CANNOT operate on minecraft
52+
* itself. The game will deliberately crash if this code is detected to trigger a
53+
* minecraft class loading (TODO: implement crash ;) )
54+
*/
55+
String getSetupClass();
56+
57+
/**
58+
* Inject coremod data into this coremod
59+
* This data includes:
60+
* "mcLocation" : the location of the minecraft directory,
61+
* "coremodList" : the list of coremods
62+
* "coremodLocation" : the file this coremod loaded from,
63+
*/
64+
void injectData(Map<String, Object> data);
65+
66+
/**
67+
* Return an optional access transformer class for this coremod. It will be injected post-deobf
68+
* so ensure your ATs conform to the new srgnames scheme.
69+
* @return the name of an access transformer class or null if none is provided
70+
*/
71+
String getAccessTransformerClass();
72+
73+
/**
74+
* Annotate your load plugin with a list of package prefixes that will *not* be
75+
* processed by the ASM transformation stack.
76+
*
77+
* Your plugin, and any transformers should *definitely* be in this list, because
78+
* otherwise you can face problems with the classloader trying to transform classes
79+
* with your transformer, whilst it is *loading* your transformer. Not pretty.
80+
*
81+
* @author cpw
82+
*
83+
*/
84+
@Retention(RetentionPolicy.RUNTIME)
85+
@Target(ElementType.TYPE)
86+
public @interface TransformerExclusions
87+
{
88+
public String[] value() default "";
89+
}
90+
91+
/**
92+
* Use this to target a specific minecraft version for your coremod. It will refuse to load with an error if
93+
* minecraft is not this exact version.
94+
*
95+
* @author cpw
96+
*
97+
*/
98+
@Retention(RetentionPolicy.RUNTIME)
99+
@Target(ElementType.TYPE)
100+
public @interface MCVersion
101+
{
102+
public String value() default "";
103+
}
104+
105+
/**
106+
* Name this coremod something other than the "short class name"
107+
* @author cpw
108+
*
109+
*/
110+
@Retention(RetentionPolicy.RUNTIME)
111+
@Target(ElementType.TYPE)
112+
public @interface Name
113+
{
114+
public String value() default "";
115+
}
116+
117+
@Retention(RetentionPolicy.RUNTIME)
118+
@Target(ElementType.TYPE)
119+
public @interface DependsOn
120+
{
121+
public String[] value() default {};
122+
}
123+
124+
/**
125+
* A simple sorting index, interleaved with other tweakers from other sources, as well as FML
126+
* @author cpw
127+
*
128+
*/
129+
@Retention(RetentionPolicy.RUNTIME)
130+
@Target(ElementType.TYPE)
131+
public @interface SortingIndex
132+
{
133+
public int value() default 0;
134+
}
135+
136+
}
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
/*
2+
* Minecraft Forge
3+
* Copyright (c) 2016.
4+
*
5+
* This library is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU Lesser General Public
7+
* License as published by the Free Software Foundation version 2.1
8+
* of the License.
9+
*
10+
* This library is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
* Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public
16+
* License along with this library; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
package net.minecraftforge.fml.relauncher;
21+
22+
import javax.annotation.Nullable;
23+
import java.lang.annotation.ElementType;
24+
import java.lang.annotation.Retention;
25+
import java.lang.annotation.RetentionPolicy;
26+
import java.lang.annotation.Target;
27+
import java.util.Map;
28+
29+
/**
30+
* The base plugin that provides class name meta information to FML to
31+
* enhance the classloading lifecycle for mods in FML
32+
*
33+
* @author cpw
34+
*
35+
*/
36+
public interface IFMLLoadingPlugin
37+
{
38+
/**
39+
* Return a list of classes that implements the IClassTransformer interface
40+
* @return a list of classes that implements the IClassTransformer interface
41+
*/
42+
String[] getASMTransformerClass();
43+
44+
/**
45+
* Return a class name that implements "ModContainer" for injection into the mod list
46+
* The "getName" function should return a name that other mods can, if need be,
47+
* depend on.
48+
* Trivially, this modcontainer will be loaded before all regular mod containers,
49+
* which means it will be forced to be "immutable" - not susceptible to normal
50+
* sorting behaviour.
51+
* All other mod behaviours are available however- this container can receive and handle
52+
* normal loading events
53+
*/
54+
String getModContainerClass();
55+
56+
/**
57+
* Return the class name of an implementor of "IFMLCallHook", that will be run, in the
58+
* main thread, to perform any additional setup this coremod may require. It will be
59+
* run <strong>prior</strong> to Minecraft starting, so it CANNOT operate on minecraft
60+
* itself. The game will deliberately crash if this code is detected to trigger a
61+
* minecraft class loading
62+
* TODO: implement crash ;)
63+
*/
64+
@Nullable
65+
String getSetupClass();
66+
67+
/**
68+
* Inject coremod data into this coremod
69+
* This data includes:
70+
* "mcLocation" : the location of the minecraft directory,
71+
* "coremodList" : the list of coremods
72+
* "coremodLocation" : the file this coremod loaded from,
73+
*/
74+
void injectData(Map<String, Object> data);
75+
76+
/**
77+
* Return an optional access transformer class for this coremod. It will be injected post-deobf
78+
* so ensure your ATs conform to the new srgnames scheme.
79+
* @return the name of an access transformer class or null if none is provided
80+
*/
81+
String getAccessTransformerClass();
82+
83+
/**
84+
* Annotate your load plugin with a list of package prefixes that will *not* be
85+
* processed by the ASM transformation stack.
86+
*
87+
* Your plugin, and any transformers should *definitely* be in this list, because
88+
* otherwise you can face problems with the classloader trying to transform classes
89+
* with your transformer, whilst it is *loading* your transformer. Not pretty.
90+
*
91+
* @author cpw
92+
*
93+
*/
94+
@Retention(RetentionPolicy.RUNTIME)
95+
@Target(ElementType.TYPE)
96+
@interface TransformerExclusions
97+
{
98+
String[] value() default "";
99+
}
100+
101+
/**
102+
* Use this to target a specific minecraft version for your coremod. It will refuse to load with an error if
103+
* minecraft is not this exact version.
104+
*
105+
* @author cpw
106+
*
107+
*/
108+
@Retention(RetentionPolicy.RUNTIME)
109+
@Target(ElementType.TYPE)
110+
@interface MCVersion
111+
{
112+
String value() default "";
113+
}
114+
115+
/**
116+
* Name this coremod something other than the "short class name"
117+
* @author cpw
118+
*
119+
*/
120+
@Retention(RetentionPolicy.RUNTIME)
121+
@Target(ElementType.TYPE)
122+
@interface Name
123+
{
124+
String value() default "";
125+
}
126+
127+
@Retention(RetentionPolicy.RUNTIME)
128+
@Target(ElementType.TYPE)
129+
@interface DependsOn
130+
{
131+
String[] value() default {};
132+
}
133+
134+
/**
135+
* A simple sorting index, interleaved with other tweakers from other sources, as well as FML
136+
* @author cpw
137+
*
138+
*/
139+
@Retention(RetentionPolicy.RUNTIME)
140+
@Target(ElementType.TYPE)
141+
@interface SortingIndex
142+
{
143+
int value() default 0;
144+
}
145+
146+
}

0 commit comments

Comments
 (0)