1
0
forked from xjboss/KCauldronX

Update forge to 1481

This commit is contained in:
Prototik 2015-06-27 19:47:27 +07:00
parent 8c50b9899f
commit eedf6789a0
19 changed files with 507 additions and 486 deletions

View File

@ -1,6 +1,7 @@
import groovy.json.JsonSlurper
import kcauldron.CreateChangelog
import kcauldron.InstallBundle
import kcauldron.VersionParser
buildscript {
repositories {
@ -96,7 +97,7 @@ def gitInfo(String key) {
}
ext.mcVersion = "1.7.10"
ext.forgeVersion = "1448"
ext.forgeVersion = "1481"
ext.revision = project.hasProperty('revision') ? project.getProperty('revision') : buildInfo('nextBuildNumber')
version = "${mcVersion}-${forgeVersion}.${revision}"
if (project.hasProperty('officialBuild')) println "Updated KCauldron version: ${version}"
@ -114,7 +115,7 @@ configurations {
dependencies {
bootstrap 'pw.prok:KBootstrap:0.0.10+'
libraries 'net.minecraft:launchwrapper:1.11'
libraries 'net.minecraft:launchwrapper:1.12@jar'
libraries 'org.ow2.asm:asm-all:5.0.3'
libraries 'com.typesafe.akka:akka-actor_2.11:2.3.3'
libraries 'com.typesafe:config:1.2.1'
@ -178,7 +179,7 @@ def generateManifest(boolean legacy = false) {
'Specification-Vendor' : 'Bukkit Team',
'Specification-Title' : 'Bukkit',
'Specification-Version' : '1.7.10-R0.1-SNAPSHOT',
'Forge-Version' : '10.13.3.1448',
'Forge-Version' : VersionParser.parseForgeRevision(file('forge/src/main/java/net/minecraftforge/common/ForgeVersion.java'), file('src/main/resources/fmlversion.properties')),
'TweakClass' : 'cpw.mods.fml.common.launcher.FMLTweaker',
'Main-Class' : 'cpw.mods.fml.relauncher.ServerLaunchWrapper',
'Class-Path' : generateClasspath(legacy)

View File

@ -4,4 +4,3 @@ dependencies {
compile gradleApi()
compile localGroovy()
}

View File

@ -0,0 +1,21 @@
package kcauldron
import java.util.regex.Matcher
class VersionParser {
public static String parseForgeRevision(File forgeFile, File propsFile) {
def forgeVersion = forgeFile.text
def int majorVersion = v(forgeVersion =~ /.+int majorVersion\s+=\s+(\d+);/)
def int minorVersion = v(forgeVersion =~ /.+int minorVersion\s+=\s+(\d+);/)
def int revisionVersion = v(forgeVersion =~ /.+int revisionVersion\s+=\s+(\d+);/)
def props = new Properties();
propsFile.withInputStream { props.load(it) }
def int buildVersion = props['fmlbuild.build.number'] as int
return "${majorVersion}.${minorVersion}.${revisionVersion}.${buildVersion}"
}
static int v(Matcher matcher) {
matcher.find()
matcher.group(1) as int
}
}

2
forge

@ -1 +1 @@
Subproject commit b3a1548cfaac77e9756168a8887270f8181487ad
Subproject commit 204cb16bc45e7f60a87aac2cdaa49816bb0e7d12

View File

@ -1,29 +1,6 @@
--- ../src-base/minecraft/cpw/mods/fml/relauncher/CoreModManager.java
+++ ../src-work/minecraft/cpw/mods/fml/relauncher/CoreModManager.java
@@ -27,10 +27,14 @@
import java.util.Map;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
+
+import kcauldron.KCauldronClassTransformer;
import net.minecraft.launchwrapper.ITweaker;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader;
+
import org.apache.logging.log4j.Level;
+
import com.google.common.base.Strings;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
@@ -38,6 +42,7 @@
import com.google.common.collect.Maps;
import com.google.common.collect.ObjectArrays;
import com.google.common.primitives.Ints;
+
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.asm.transformers.ModAccessTransformer;
import cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker;
@@ -53,7 +58,7 @@
@@ -60,7 +60,7 @@
private static final Attributes.Name COREMODCONTAINSFMLMOD = new Attributes.Name("FMLCorePluginContainsFMLMod");
private static final Attributes.Name MODTYPE = new Attributes.Name("ModType");
private static final Attributes.Name MODSIDE = new Attributes.Name("ModSide");
@ -32,7 +9,7 @@
private static List<String> loadedCoremods = Lists.newArrayList();
private static List<FMLPluginWrapper> loadPlugins;
private static boolean deobfuscatedEnvironment;
@@ -94,6 +99,7 @@
@@ -101,6 +101,7 @@
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
@ -40,7 +17,7 @@
FMLRelaunchLog.fine("Injecting coremod %s {%s} class transformers", name, coreModInstance.getClass().getName());
if (coreModInstance.getASMTransformerClass() != null) for (String transformer : coreModInstance.getASMTransformerClass())
{
@@ -153,6 +159,9 @@
@@ -160,6 +161,9 @@
}
@ -50,7 +27,7 @@
public static void handleLaunch(File mcDir, LaunchClassLoader classLoader, FMLTweaker tweaker)
{
CoreModManager.mcDir = mcDir;
@@ -212,6 +221,19 @@
@@ -219,6 +223,19 @@
loadCoreMod(classLoader, coreModClassName, null);
}
discoverCoreMods(mcDir, classLoader);
@ -70,7 +47,7 @@
}
@@ -293,6 +315,10 @@
@@ -336,6 +353,10 @@
String cascadedTweaker = mfAttributes.getValue("TweakClass");
if (cascadedTweaker != null)
{
@ -81,7 +58,7 @@
FMLRelaunchLog.info("Loading tweaker %s from %s", cascadedTweaker, coreMod.getName());
Integer sortOrder = Ints.tryParse(Strings.nullToEmpty(mfAttributes.getValue("TweakOrder")));
sortOrder = (sortOrder == null ? Integer.valueOf(0) : sortOrder);
@@ -322,6 +348,10 @@
@@ -365,6 +386,10 @@
FMLRelaunchLog.fine("Not found coremod data in %s", coreMod.getName());
continue;
}
@ -92,7 +69,7 @@
// Support things that are mod jars, but not FML mod jars
try
{
@@ -424,8 +454,11 @@
@@ -467,8 +492,11 @@
MCVersion requiredMCVersion = coreModClazz.getAnnotation(IFMLLoadingPlugin.MCVersion.class);
if (!Arrays.asList(rootPlugins).contains(coreModClass) && (requiredMCVersion == null || Strings.isNullOrEmpty(requiredMCVersion.value())))
{

View File

@ -5,7 +5,7 @@
public static final int revisionVersion = 4;
//This number is incremented every time Jenkins builds Forge, and never reset. Should always be 0 in the repo code.
- public static final int buildVersion = 0;
+ public static final int buildVersion = 1448; // Cauldron
+ public static final int buildVersion = kcauldron.KCauldron.lookupForgeRevision(); // KCauldron
private static Status status = PENDING;
private static String target = null;

View File

@ -1,6 +1,7 @@
package kcauldron;
import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Enumeration;
@ -8,6 +9,8 @@ import java.util.Properties;
import org.spigotmc.RestartCommand;
import cpw.mods.fml.common.FMLCommonHandler;
public class KCauldron {
private static boolean sManifestParsed = false;
@ -101,4 +104,24 @@ public class KCauldron {
public static void restart() {
RestartCommand.restart(true);
}
private static int sForgeRevision = 0;
public static int lookupForgeRevision() {
if (sForgeRevision != 0) return sForgeRevision;
int revision = 0;
try {
Properties p = new Properties();
p.load(KCauldron.class
.getResourceAsStream("/fmlversion.properties"));
revision = Integer.parseInt(String.valueOf(p.getOrDefault(
"fmlbuild.build.number", "0")));
} catch (Exception e) {
}
if (revision == 0) {
KLog.get().warning("KCauldron: could not parse forge revision, critical error");
FMLCommonHandler.instance().exitJava(1, false);
}
return sForgeRevision = revision;
}
}

View File

@ -1,6 +1,6 @@
fmlbuild.major.number=7
fmlbuild.minor.number=99
fmlbuild.revision.number=4
fmlbuild.build.number=1448
fmlbuild.build.number=1481
fmlbuild.mcversion=1.7.10
fmlbuild.mcpversion=9.05