diff options
| author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-04-08 07:34:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-08 07:34:10 +0200 |
| commit | ca8216298713b2bf1e03407f96de0f2750489e26 (patch) | |
| tree | a3b6ea3f90f24cf185f59fdbdfd0fcddd37b2dec | |
| parent | 6ba77e6b461080be8389d721ff8656e5b0c93281 (diff) | |
| parent | 913a24fa383a5beaad83f0a8f5eb04ea55385d62 (diff) | |
| download | GT5-Unofficial-ca8216298713b2bf1e03407f96de0f2750489e26.tar.gz GT5-Unofficial-ca8216298713b2bf1e03407f96de0f2750489e26.tar.bz2 GT5-Unofficial-ca8216298713b2bf1e03407f96de0f2750489e26.zip | |
Merge pull request #13 from bartimaeusnek/0.4.X
0.4.3
Former-commit-id: ff9b82f52689e1ce915b85ffa93f4a4956a229f3
76 files changed, 4203 insertions, 253 deletions
diff --git a/build.gradle b/build.gradle index ae10e3f9a3..229a4f71c1 100644 --- a/build.gradle +++ b/build.gradle @@ -21,8 +21,14 @@ plugins { } apply plugin: 'forge' -apply plugin: 'idea' apply plugin: 'signing' +apply plugin: 'idea' +idea{ + module { + downloadJavadoc = true + downloadSources = true + } +} import de.undercouch.gradle.tasks.download.Download @@ -61,10 +67,34 @@ repositories { name = "ic2" url = "http://maven.ic2.player.to/" } + maven { // AppleCore + url "http://www.ryanliptak.com/maven/" + } + maven { // GalacticGreg, YAMCore,.. + name 'UsrvDE' + url "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/" + } + ivy { + name 'gtnh_download_source_stupid_underscore_typo' + artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]" + } + ivy { + name 'gtnh_download_source' + artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]" + } + maven { + name = "gt" + url = "https://gregtech.overminddl1.com/" + } + } dependencies { compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev" + compileOnly "applecore:AppleCore:${config.applecore.version}:api" + compile "micdoodle8.mods:MicdoodleCore:${config.galacticraft.version}:Dev" + compile "micdoodle8.mods:GalacticraftCore:${config.galacticraft.version}:Dev" + compile "micdoodle8.mods:Galacticraft-Planets:${config.galacticraft.version}:Dev" } //task getGregTech(type: Download) { @@ -102,6 +132,13 @@ processResources } } +jar { + manifest { + attributes 'FMLCorePlugin': 'com.github.bartimaeusnek.ASM.BWCorePlugin', + 'FMLCorePluginContainsFMLMod': 'true' + } +} + task apiJar(type: Jar){ from(sourceSets.main.output) { include 'com/github/bartimaeusnek/bartworks/API/**' diff --git a/build.properties b/build.properties index 72b745fd12..c81d017315 100644 --- a/build.properties +++ b/build.properties @@ -22,9 +22,11 @@ mc_version=1.7.10 majorUpdate=0 -minorUpdate=3 -buildNumber=24 -APIVersion=4 +minorUpdate=4 +buildNumber=3 +APIVersion=5 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 -gregtech.jenkinsbuild=143
\ No newline at end of file +gregtech.jenkinsbuild=143 +applecore.version=1.7.10-3.1.1 +galacticraft.version=1.7-3.0.12.504
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java new file mode 100644 index 0000000000..f4b61a17ba --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.ASM; + +import org.objectweb.asm.tree.MethodNode; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +public class ASMUtils { + + public static String matchAny(String toCompare, String... args) { + for (int i = 0; i < args.length; i++) { + if (toCompare.equalsIgnoreCase(args[i])) + return args[i]; + } + return ""; + } + + /** + * Call this Method twice, one time for the Descriptor and one time for the Name. + */ + public static boolean isCorrectMethod(MethodNode methodNode, String... args) { + for (int i = 0; i < args.length; i++) { + if (methodNode.name.equalsIgnoreCase(args[i]) || methodNode.desc.equalsIgnoreCase(args[i])) + return true; + } + return false; + } + + public static boolean writeClassToDisk(byte[] towrite, String Classname, String Path) { + try { + OutputStream os = new FileOutputStream(new File(Path + Classname + ".class")); + os.write(towrite); + } catch (IOException e) { + e.printStackTrace(); + return false; + } + return true; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java new file mode 100644 index 0000000000..9c76b3dd82 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.ASM; + +import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import com.google.common.eventbus.EventBus; +import com.google.common.eventbus.Subscribe; +import cpw.mods.fml.common.DummyModContainer; +import cpw.mods.fml.common.LoadController; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.DefaultArtifactVersion; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.ArrayList; +import java.util.List; + +public class BWCore extends DummyModContainer { + + public static final String BWCORE_NAME = "BartWorks ASM Core"; + public static final Logger BWCORE_LOG = LogManager.getLogger(BWCORE_NAME); + + public BWCore() { + super(new ModMetadata()); + ModMetadata metadata = getMetadata(); + metadata.modId = "BWCore"; + metadata.name = BWCORE_NAME; + metadata.version = "0.0.1"; + metadata.authorList.add("bartimaeusnek"); + metadata.dependants = getDependants(); + } + + @Subscribe + public void preInit(FMLPreInitializationEvent event) { + } + + @Override + public List<ArtifactVersion> getDependants() { + List<ArtifactVersion> ret = new ArrayList<ArtifactVersion>(); + ret.add(new DefaultArtifactVersion("ExtraUtilities", true)); + ret.add(new DefaultArtifactVersion(BartWorksCrossmod.MOD_ID, true)); + return ret; + } + + @Override + public boolean registerBus(EventBus bus, LoadController controller) { + bus.register(this); + return true; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java new file mode 100644 index 0000000000..018690d312 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.ASM; + +import cpw.mods.fml.relauncher.FMLInjectionData; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin; +import net.minecraftforge.common.config.Configuration; + +import java.io.File; +import java.util.Map; + +@IFMLLoadingPlugin.SortingIndex(999999999)//Load as late as possible (after fastcraft/OptiFine). +@IFMLLoadingPlugin.MCVersion("1.7.10") +@IFMLLoadingPlugin.TransformerExclusions({"com.github.bartimaeusnek.ASM"}) +@IFMLLoadingPlugin.Name(BWCorePlugin.BWCORE_PLUGIN_NAME) +public class BWCorePlugin implements IFMLLoadingPlugin { + + public static final String BWCORE_PLUGIN_NAME = "BartWorks ASM Core Plugin"; + + public static File minecraftDir = null; + + public BWCorePlugin() { + //Injection Code taken from CodeChickenLib + if (minecraftDir != null) + return;//get called twice, once for IFMLCallHook + minecraftDir = (File) FMLInjectionData.data()[6]; + + Configuration asmconfighandler = new Configuration(new File(new File(minecraftD |
