-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from anatawa12/master
Add support for 1.7.10
- Loading branch information
Showing
5 changed files
with
138 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,51 @@ | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
maven { url = "https://files.minecraftforge.net/maven" } | ||
} | ||
dependencies { | ||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' | ||
} | ||
} | ||
apply plugin: 'net.minecraftforge.gradle.forge' | ||
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. | ||
// It's not required to use ForgeGradle because re-obfuscation is not required for this. | ||
// Re-obfuscation (reobf task) will work and required for minecraft's identifiers | ||
// but this project doesn't use minecraft's classes so ForgeGradle is not required | ||
|
||
apply plugin: 'java' | ||
|
||
version = "1.0.0" | ||
group = "zone.rong.nukejndilookupfromlog4j" // http://maven.apache.org/guides/mini/guide-naming-conventions.html | ||
group = "zone.rong.nukejndilookupfromlog4j" | ||
archivesBaseName = "nukejndilookupfromlog4j" | ||
|
||
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. | ||
compileJava { | ||
sourceCompatibility = targetCompatibility = '1.8' | ||
sourceCompatibility = targetCompatibility = '1.8' | ||
|
||
repositories { | ||
maven { url = "https://files.minecraftforge.net/maven" } | ||
maven { url = "https://libraries.minecraft.net/" } | ||
} | ||
|
||
minecraft { | ||
version = "1.12.2-14.23.5.2847" | ||
runDir = "run" | ||
|
||
// the mappings can be changed at any time, and must be in the following format. | ||
// snapshot_YYYYMMDD snapshot are built nightly. | ||
// stable_# stables are built at the discretion of the MCP team. | ||
// 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 = "stable_39" | ||
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. | ||
sourceSets { | ||
forge1122 | ||
forge1710 | ||
} | ||
|
||
processResources { | ||
// this will ensure that this task is redone when the versions change. | ||
inputs.property "version", project.version | ||
inputs.property "mcversion", project.minecraft.version | ||
|
||
// replace stuff in mcmod.info, nothing else | ||
from(sourceSets.main.resources.srcDirs) { | ||
include 'mcmod.info' | ||
// replace version and mcversion | ||
expand 'version':project.version, 'mcversion':project.minecraft.version | ||
} | ||
// copy everything else except the mcmod.info | ||
from(sourceSets.main.resources.srcDirs) { | ||
exclude 'mcmod.info' | ||
} | ||
dependencies { | ||
// common dependencies | ||
//noinspection GradlePackageUpdate // suppress IDEA | ||
implementation "org.apache.logging.log4j:log4j-api:2.8.1" | ||
//noinspection GradlePackageUpdate // suppress IDEA | ||
implementation "org.apache.logging.log4j:log4j-core:2.8.1" | ||
implementation "net.minecraft:launchwrapper:1.12" | ||
|
||
// the dependency for forge 1.12.2 part | ||
forge1122Implementation "net.minecraftforge:forge:1.12.2-14.23.5.2856:universal" | ||
//noinspection GradlePackageUpdate // suppress IDEA | ||
forge1122Implementation "com.google.guava:guava:21.0" | ||
|
||
// the dependency for forge 1.7.10 part | ||
forge1710Implementation "net.minecraftforge:forge:1.7.10-10.13.4.1614-1.7.10:universal" | ||
//noinspection GradlePackageUpdate // suppress IDEA | ||
forge1710Implementation "com.google.guava:guava:17.0" | ||
} | ||
|
||
jar { | ||
from sourceSets.forge1122.output | ||
from sourceSets.forge1710.output | ||
|
||
manifest { | ||
attributes([ | ||
"FMLCorePluginContainsFMLMod": true, | ||
"FMLCorePlugin": 'zone.rong.nukejndilookupfromlog4j.NukeJndiLookupFromLog4j', | ||
"ForceLoadAsMod": true | ||
"TweakClass": 'zone.rong.nukejndilookupfromlog4j.tweaker.NukeJndiLookupFromLog4j', | ||
]) | ||
} | ||
} |
Empty file.
33 changes: 33 additions & 0 deletions
33
ForgeMod/src/forge1122/java/zone/rong/nukejndilookupfromlog4j/supports/Support1122.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package zone.rong.nukejndilookupfromlog4j.supports; | ||
|
||
import com.google.common.eventbus.EventBus; | ||
import net.minecraftforge.fml.common.DummyModContainer; | ||
import net.minecraftforge.fml.common.LoadController; | ||
import net.minecraftforge.fml.common.ModMetadata; | ||
import net.minecraftforge.fml.relauncher.FMLInjectionData; | ||
|
||
@SuppressWarnings("unused") // used by reflection | ||
public class Support1122 { | ||
public static void runSupport() { | ||
FMLInjectionData.containers.add(Container.class.getName()); | ||
} | ||
|
||
public static class Container extends DummyModContainer { | ||
public Container() { | ||
super(new ModMetadata()); | ||
ModMetadata meta = this.getMetadata(); | ||
meta.modId = "nukejndilookupfromlog4j"; | ||
meta.name = "NukeJndiLookupFromLog4j"; | ||
meta.description = "Prevents a major vulnerability introduced by log4j from being abused."; | ||
meta.version = "1.0.0"; | ||
meta.authorList.add("Rongmario"); | ||
meta.credits = "https://github.com/apache/logging-log4j2/pull/608"; | ||
} | ||
|
||
@Override | ||
public boolean registerBus(EventBus bus, LoadController controller) { | ||
bus.register(this); | ||
return true; | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
ForgeMod/src/forge1710/java/zone/rong/nukejndilookupfromlog4j/supports/Support1710.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package zone.rong.nukejndilookupfromlog4j.supports; | ||
|
||
import com.google.common.eventbus.EventBus; | ||
import cpw.mods.fml.common.DummyModContainer; | ||
import cpw.mods.fml.common.LoadController; | ||
import cpw.mods.fml.common.ModMetadata; | ||
import cpw.mods.fml.relauncher.FMLInjectionData; | ||
|
||
@SuppressWarnings("unused") // used by reflection | ||
public class Support1710 { | ||
public static void runSupport() { | ||
FMLInjectionData.containers.add(Container.class.getName()); | ||
} | ||
|
||
public static class Container extends DummyModContainer { | ||
public Container() { | ||
super(new ModMetadata()); | ||
ModMetadata meta = this.getMetadata(); | ||
meta.modId = "nukejndilookupfromlog4j"; | ||
meta.name = "NukeJndiLookupFromLog4j"; | ||
meta.description = "Prevents a major vulnerability introduced by log4j from being abused."; | ||
meta.version = "1.0.0"; | ||
meta.authorList.add("Rongmario"); | ||
meta.credits = "https://github.com/apache/logging-log4j2/pull/608"; | ||
} | ||
|
||
@Override | ||
public boolean registerBus(EventBus bus, LoadController controller) { | ||
bus.register(this); | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters