mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24ec338a51 | ||
|
|
4f634855ac | ||
|
|
9f01e3407e | ||
|
|
adeaeb74aa | ||
|
|
e13c3966e0 | ||
|
|
02c3b4e74b | ||
|
|
89a07d3668 | ||
|
|
b52eb6d699 | ||
|
|
3281faf2be | ||
|
|
3d25b4e793 | ||
|
|
f4532410ec | ||
|
|
8f87021b0f | ||
|
|
bc57ff9e83 | ||
|
|
de8ab934d8 | ||
|
|
81fe1c9682 | ||
|
|
58a299aabc | ||
|
|
243a21a353 | ||
|
|
f0dc530b28 | ||
|
|
dac7f590ea | ||
|
|
bf54d4d667 | ||
|
|
da4337efbf | ||
|
|
f92962bbbb | ||
|
|
2714da1022 | ||
|
|
96be82343c | ||
|
|
58577775d2 | ||
|
|
fc3e7647d2 | ||
|
|
a381874bb9 | ||
|
|
55525f6d2e | ||
|
|
bc64ceabef | ||
|
|
63ba3aa009 | ||
|
|
5265e34a35 | ||
|
|
35ab9f52b0 | ||
|
|
9b55f1f48f | ||
|
|
e356f4d713 | ||
|
|
bfc25bc5da | ||
|
|
9f0f9e7288 | ||
|
|
ce6404fd5b | ||
|
|
8f18a3de9a | ||
|
|
9815d8c379 | ||
|
|
1d902df581 | ||
|
|
8e26c99de3 | ||
|
|
fc8c3bef03 | ||
|
|
a4de22c1ad | ||
|
|
70cffe6982 | ||
|
|
39620f1e41 | ||
|
|
0e80fcb8f7 | ||
|
|
4a94c2c71b | ||
|
|
79c39f8b7c | ||
|
|
f6190e8752 | ||
|
|
0950b9fc84 | ||
|
|
25981706ef | ||
|
|
82d896a35e | ||
|
|
e7dd728f95 | ||
|
|
8f2e675581 | ||
|
|
ff75416a32 | ||
|
|
95afc95b24 | ||
|
|
34493b0d99 | ||
|
|
e77d2547ad | ||
|
|
40a34af431 | ||
|
|
352117fd78 | ||
|
|
81328b6684 | ||
|
|
b5af446d71 | ||
|
|
d0c6e92900 | ||
|
|
2a9c485edc | ||
|
|
a13598b17e | ||
|
|
40b54013b4 | ||
|
|
1c9a853868 | ||
|
|
da70cdd35a | ||
|
|
b993cf4a98 | ||
|
|
ac065ff5f7 | ||
|
|
913f6f6d36 | ||
|
|
9468e41bbf | ||
|
|
ffdd056a18 | ||
|
|
f157e7a6ec | ||
|
|
4a9d0f9bd5 | ||
|
|
0398916666 | ||
|
|
dec9a3924d | ||
|
|
2470120680 | ||
|
|
ba90b61607 | ||
|
|
9a5e24e338 | ||
|
|
29ef3d5ab4 | ||
|
|
f46a538b41 | ||
|
|
182aa9c0cb | ||
|
|
1857064afa | ||
|
|
cb05c8c4aa | ||
|
|
f275a24b43 | ||
|
|
1d84e8063e | ||
|
|
57befa89bb | ||
|
|
10b16d32da | ||
|
|
3f21a2c1b4 | ||
|
|
b2958c9066 | ||
|
|
9520978b81 | ||
|
|
4981aa3421 | ||
|
|
c48b48ee15 | ||
|
|
9947ba8503 | ||
|
|
a3f48734ff | ||
|
|
0378355c37 | ||
|
|
c625ef3009 | ||
|
|
d4b30422b6 | ||
|
|
6de36d78f5 | ||
|
|
7348929819 | ||
|
|
b9f4b02cb0 | ||
|
|
20e93a412e | ||
|
|
e44e8b3112 | ||
|
|
bab4d87ce7 | ||
|
|
bc9d1fe657 | ||
|
|
d4d522c597 | ||
|
|
97269a5e3d | ||
|
|
c913258ca3 | ||
|
|
c7ab872c85 | ||
|
|
e91431fb70 | ||
|
|
dfa3a2665d | ||
|
|
4fa375683f | ||
|
|
0db4624b27 | ||
|
|
c997f2adbc | ||
|
|
26e5f4b4ff | ||
|
|
2336002f20 | ||
|
|
e88a0cd13f | ||
|
|
dbf5fe38ce | ||
|
|
c47d08c89d | ||
|
|
7af5c21d74 | ||
|
|
6f96d89e2b | ||
|
|
111b0216fd | ||
|
|
1d0384f8f6 | ||
|
|
adc8972277 | ||
|
|
5990e29af7 | ||
|
|
2676c8999c | ||
|
|
3a200e901e | ||
|
|
c97ac284a5 | ||
|
|
54e06e841d | ||
|
|
7ce84491d1 | ||
|
|
532bee7ce1 | ||
|
|
e24f949517 | ||
|
|
4545beb49d | ||
|
|
3f4bf61ae6 | ||
|
|
155e846818 | ||
|
|
ba3707af22 | ||
|
|
ad79b9ed86 | ||
|
|
5f7df5e742 | ||
|
|
7aa7221756 | ||
|
|
8844554da6 | ||
|
|
6f0eedc9a6 | ||
|
|
f21cd286ca | ||
|
|
f1b533ad87 | ||
|
|
5a97d183df | ||
|
|
fbd57b3264 | ||
|
|
efc369ee83 | ||
|
|
91ecf71109 | ||
|
|
9b6525e805 | ||
|
|
dc7d02ebf6 | ||
|
|
7037184a4e | ||
|
|
bf38d94756 | ||
|
|
3d17434510 | ||
|
|
29d6c875d0 | ||
|
|
902772ed0c | ||
|
|
1229c4c4ea | ||
|
|
7fecf2ad6b | ||
|
|
c418da353f | ||
|
|
110cf372eb | ||
|
|
7a004087f7 | ||
|
|
70cfe24e67 | ||
|
|
8960f6869f | ||
|
|
71a92de5d9 | ||
|
|
3f15cd54c2 | ||
|
|
12c928c538 | ||
|
|
7406b38d8a | ||
|
|
ef646d3146 | ||
|
|
18371bd8c9 | ||
|
|
e35e4b16ff | ||
|
|
3711da9c45 | ||
|
|
6a318ddb78 | ||
|
|
2766f9a293 | ||
|
|
2e3f2461fa | ||
|
|
95f7345ff7 | ||
|
|
bc02f3e67b | ||
|
|
8db42c44bf | ||
|
|
404e6f1cc0 | ||
|
|
5741f669d5 | ||
|
|
6a67149b16 | ||
|
|
c8d934bafd | ||
|
|
075e240303 | ||
|
|
d00665ee65 | ||
|
|
ebb74a5f30 | ||
|
|
5b0117ec76 | ||
|
|
e06d9d0fbc | ||
|
|
ab91647546 | ||
|
|
b236a4a4db | ||
|
|
a480a83a98 | ||
|
|
3a9f123a16 | ||
|
|
8d27fb0692 | ||
|
|
d369fe1c25 | ||
|
|
98b71f2dd4 | ||
|
|
fef0f6422d | ||
|
|
2eb81ac88b | ||
|
|
e02a91f008 | ||
|
|
ced1b95155 | ||
|
|
8f910dfa5d | ||
|
|
05a854cd2a | ||
|
|
22738de028 | ||
|
|
cd0466395a | ||
|
|
24c4056651 | ||
|
|
59fe905695 | ||
|
|
6f3da97365 | ||
|
|
edc1fb24e2 | ||
|
|
f1d68ed4c8 | ||
|
|
ac97370f94 | ||
|
|
82e9de8641 | ||
|
|
843a13c1ab | ||
|
|
3bf50c4bbe | ||
|
|
4922e90d81 | ||
|
|
a3a920437f | ||
|
|
787c0c4a6a | ||
|
|
8517a824e5 | ||
|
|
2cca7aa759 | ||
|
|
23b070c7d0 | ||
|
|
49111e9c5c | ||
|
|
c0cca7f41d | ||
|
|
99bb50d8f8 | ||
|
|
00f00b17bf | ||
|
|
62fdbad74c |
No files matched your search
@@ -1,9 +1,13 @@
|
||||
* text eol=lf
|
||||
*.bat text eol=crlf
|
||||
*.patch text eol=lf
|
||||
*.java text eol=lf
|
||||
*.gradle text eol=crlf
|
||||
*.png binary
|
||||
*.exe binary
|
||||
*.dll binary
|
||||
*.jar binary
|
||||
*.lzma binary
|
||||
*.zip binary
|
||||
*.pyd binary
|
||||
*.cfg text eol=lf
|
||||
|
||||
+15
-13
@@ -1,14 +1,16 @@
|
||||
#eclipse
|
||||
/bin
|
||||
/minecraft_server
|
||||
/mods
|
||||
/fmlbuild.properties
|
||||
/fmlversion.properties
|
||||
/difflist.txt
|
||||
/target
|
||||
fmlbranding.properties
|
||||
/fernflower.zip
|
||||
/commands.py.bck
|
||||
/mcp*.zip
|
||||
/mcp
|
||||
/eclipse
|
||||
/deobfuscation_data*.zip
|
||||
/.settings
|
||||
/.classpath
|
||||
|
||||
#idea
|
||||
/.idea
|
||||
*.iml
|
||||
|
||||
#gradle
|
||||
/build
|
||||
/.gradle
|
||||
|
||||
#occupational hazards
|
||||
/eclipse/
|
||||
/repo/
|
||||
@@ -7,10 +7,10 @@ minecraft servers, minecraft bukkit servers, and minecraft clients.
|
||||
|
||||
The code is authored by cpw.
|
||||
|
||||
It implements API defined by the client side ModLoader, authored by Risugami.
|
||||
It (partially) implements API defined by the client side ModLoader, authored by Risugami.
|
||||
http://www.minecraftforum.net/topic/75440-
|
||||
|
||||
It also contains suggestions and hints from LexManos, author of MinecraftForge.
|
||||
It also contains suggestions and hints and generous helpings of code from LexManos, author of MinecraftForge.
|
||||
http://www.minecraftforge.net/
|
||||
|
||||
Additionally, it contains an implementation of topological sort based on that
|
||||
@@ -19,6 +19,9 @@ published at http://keithschwarz.com/interesting/code/?dir=topological-sort
|
||||
It also contains code from the Maven project for performing versioned dependency
|
||||
resolution. http://maven.apache.org/
|
||||
|
||||
It also contains a partial repackaging of the javaxdelta library from http://sourceforge.net/projects/javaxdelta/
|
||||
with credit to it's authors.
|
||||
|
||||
Forge Mod Loader downloads components from the Minecraft Coder Pack
|
||||
(http://mcp.ocean-labs.de/index.php/Main_Page) with kind permission from the MCP team.
|
||||
|
||||
@@ -9,6 +9,12 @@ included based on guidelines at
|
||||
http://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html
|
||||
with notices intact. The only change is a non-functional change of package name.
|
||||
|
||||
This software contains a partial repackaging of javaxdelta, a BSD licensed program for generating
|
||||
binary differences and applying them, sourced from the subversion at http://sourceforge.net/projects/javaxdelta/
|
||||
authored by genman, heikok, pivot.
|
||||
The only changes are to replace some Trove collection types with standard Java collections, and repackaged.
|
||||
|
||||
|
||||
=== MCP Data ===
|
||||
This software includes data from the Minecraft Coder Pack (MCP), with kind permission
|
||||
from them. The license to MCP data is not transitive - distribution of this data by
|
||||
@@ -16,6 +22,14 @@ third parties requires independent licensing from the MCP team. This data is not
|
||||
redistributable without permission from the MCP team.
|
||||
|
||||
=== Sharing ===
|
||||
I grant permission for some parts of FML to be redistributed outside the terms of the LGPL, for the benefit of
|
||||
the minecraft modding community. All contributions to these parts should be licensed under the same additional grant.
|
||||
|
||||
-- Runtime patcher --
|
||||
License is granted to redistribute the runtime patcher code (common/cpw/mods/fml/patcher and subdirectories) under
|
||||
any alternative open source license as classified by the OSI (http://opensource.org/licenses)
|
||||
|
||||
-- ASM transformers --
|
||||
License is granted to redistribute the ASM transformer code (common/cpw/mods/fml/common/asm/ and subdirectories)
|
||||
under any alternative open source license as classified by the OSI (http://opensource.org/licenses)
|
||||
|
||||
|
||||
Executable → Regular
+10
-13
@@ -40,8 +40,8 @@ contributors through github.
|
||||
|
||||
Notable integrations
|
||||
====================
|
||||
Optifine, with the Cx series have started performing the actions necessary for
|
||||
FML compatibility. This means optifine will work well alongside an FML or
|
||||
Optifine has FML compatibility. It varies from Optifine release to release, however
|
||||
in general it will work well alongside an FML or
|
||||
Minecraft Forge installation. FML will detect and ensure the good operation of
|
||||
Optifine (you can see it in your client as an additional data line on the
|
||||
bottom left).
|
||||
@@ -49,9 +49,8 @@ bottom left).
|
||||
Client notes
|
||||
============
|
||||
FML does provide a standard pattern for mods to provide HD textures. This is why
|
||||
optifine needed integration code. FML supports very very basic HD texture packs
|
||||
up to 128x resolution (some 256x resolution packs work but not all). For full
|
||||
featured HD optifine is recommended.
|
||||
optifine needed integration code. FML supports HD texture packs
|
||||
up to 128x resolution.
|
||||
|
||||
Mod information
|
||||
===============
|
||||
@@ -68,15 +67,13 @@ or server):
|
||||
|
||||
Installation
|
||||
============
|
||||
To install this on it's own into a minecraft environment, simply copy the
|
||||
contents of the fml zip file into the minecraft jar file, using your preferred
|
||||
zip management tool (I recommend 7 zip on windows).
|
||||
To install on a server, simply execute the FML or Forge jar file, with a copy of
|
||||
minecraft_server.jar placed in the same directory. FML will launch it's patched
|
||||
copy.
|
||||
|
||||
For servers: the minecraft jar file is minecraft_server.jar.
|
||||
For clients: the minecraft jar file is minecraft.jar. You will additionally need
|
||||
to delete the "META-INF" folder in the minecraft.jar file.
|
||||
For bukkit: the mcportcentral custom builds of craftbukkit contain all you need
|
||||
already. Please refer to mcportcentral.co.za for more information.
|
||||
To install on a client, FIRST delete META-INF from the minecraft.jar file, then
|
||||
copy the contents of the FML or Forge jar file into it. FML and Forge provide
|
||||
their own META-INF data which should *not* be deleted.
|
||||
|
||||
Forge Installation
|
||||
==================
|
||||
@@ -1,14 +0,0 @@
|
||||
import os, sys
|
||||
|
||||
def main():
|
||||
fml_dir = os.path.abspath(sys.argv[1])
|
||||
work_dir = os.path.normpath(sys.argv[2])
|
||||
mcp_dir = os.path.normpath(sys.argv[3])
|
||||
|
||||
sys.path.append(os.path.join(fml_dir, 'install'))
|
||||
from fml import apply_fml_patches
|
||||
|
||||
apply_fml_patches(fml_dir, mcp_dir, work_dir, False)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
import static net.minecraftforge.gradle.dev.FmlDevPlugin.*
|
||||
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'fmldev'
|
||||
|
||||
repositories {
|
||||
flatDir {
|
||||
name "fileRepo"
|
||||
dirs "repo"
|
||||
}
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = '1.6.4'
|
||||
fmlDir = projectDir.getAbsolutePath();
|
||||
mainClass = 'cpw.mods.fml.relauncher.ServerLaunchWrapper'
|
||||
installerVersion = "1.4"
|
||||
}
|
||||
|
||||
group = 'cpw.mods'
|
||||
version = getVersionFromGit(project)
|
||||
|
||||
jenkins {
|
||||
job = 'fml'
|
||||
}
|
||||
|
||||
uploadArchives {
|
||||
repositories {
|
||||
if (project.hasProperty("filesmaven")) {
|
||||
logger.info('Publishing to files server')
|
||||
|
||||
mavenDeployer {
|
||||
configuration = configurations.deployerJars
|
||||
|
||||
repository(url: project.filesmaven.url) {
|
||||
authentication(userName: project.filesmaven.username, privateKey: project.filesmaven.key)
|
||||
}
|
||||
|
||||
pom {
|
||||
groupId = project.group
|
||||
version = project.version
|
||||
artifactId = project.archivesBaseName
|
||||
project {
|
||||
name project.archivesBaseName
|
||||
packaging 'jar'
|
||||
description 'ForgeModLoader'
|
||||
url 'https://github.com/MinecraftForge/FML'
|
||||
|
||||
scm {
|
||||
url 'https://github.com/MinecraftForge/FML'
|
||||
connection 'scm:git:git://github.com/MinecraftForge/FML.git'
|
||||
developerConnection 'scm:git:[email protected]:MinecraftForge/FML.git'
|
||||
}
|
||||
|
||||
issueManagement {
|
||||
system 'github'
|
||||
url 'https://github.com/MinecraftForge/FML/issues'
|
||||
}
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name 'GNU Lesser Public License (LGPL), Version 2.1'
|
||||
url 'http://www.gnu.org/licenses/lgpl-2.1.txt'
|
||||
distribution 'repo'
|
||||
}
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id 'cpw'
|
||||
name 'cpw'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id 'LexManos'
|
||||
name 'Lex Manos'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.info('Publishing to repo folder')
|
||||
|
||||
mavenDeployer {
|
||||
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,370 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- ======================================================================
|
||||
30 Mar 2012 13:35:40
|
||||
|
||||
FML
|
||||
The Forge Mod Loader
|
||||
|
||||
cpw
|
||||
====================================================================== -->
|
||||
<project name="FML" default="jenkinsbuild">
|
||||
<description>The Forge Mod Loader</description>
|
||||
<target name="writeversion" depends="buildenvsetup">
|
||||
<exec executable="${python.exe}" dir="${basedir}" failonerror="true">
|
||||
<arg value="${basedir}/getversion.py" />
|
||||
<arg value="${mcp.home}" />
|
||||
</exec>
|
||||
<propertyfile file="fmlversion.properties">
|
||||
<entry key="fmlbuild.build.number" type="int" value="${version.build}"/>
|
||||
<entry key="fmlbuild.deobfuscation.hash" type="string" value="${deobf.checksum}"/>
|
||||
</propertyfile>
|
||||
</target>
|
||||
|
||||
<target name="buildenvsetup">
|
||||
<tstamp>
|
||||
<format pattern="yyMMddHHmmss" property="timestamp" />
|
||||
</tstamp>
|
||||
<property environment="env" />
|
||||
<property name="modname" value="fml" />
|
||||
<condition property="mcp.home" value="${env.WORKSPACE}/mcp" else="${basedir}/mcp">
|
||||
<isset property="env.WORKSPACE" />
|
||||
</condition>
|
||||
<property name="fml.python.dir" location="${basedir}/python" />
|
||||
<condition property="python.exe" value="${fml.python.dir}/python_fml" else="python">
|
||||
<os family="Windows" />
|
||||
</condition>
|
||||
<condition property="mcp.exists">
|
||||
<available file="${mcp.home}/runtime/commands.py"/>
|
||||
</condition>
|
||||
<condition property="signature.exists">
|
||||
<available file="${env.JENKINS_HOME}/fmlsigned.properties"/>
|
||||
</condition>
|
||||
<property name="mcp.obfoutput" location="${mcp.home}/reobf" />
|
||||
<property name="client.mcp.obfoutput" location="${mcp.obfoutput}/minecraft" />
|
||||
<property name="mcp.srcdir" location="${mcp.home}/src" />
|
||||
<property name="client.mcp.srcdir" location="${mcp.srcdir}/minecraft" />
|
||||
<property name="clean.mcp.srcdir" location="${mcp.home}/src-base" />
|
||||
<property name="patch.mcp.srcdir" location="${mcp.home}/src-work" />
|
||||
<property name="tmp.mcp.srcdir" location="${mcp.home}/src-tmp" />
|
||||
<property name="renamed.mcp.srcdir" location="${mcp.home}/src-renamed" />
|
||||
<property name="common.src.dir" location="${basedir}/common" />
|
||||
<property name="client.src.dir" location="${basedir}/client" />
|
||||
<property name="patch.src.dir" location="${basedir}/patches" />
|
||||
<property name="fml.conf.dir" location="${basedir}/conf" />
|
||||
<condition property="version.build" value="${env.BUILD_NUMBER}" else="1">
|
||||
<isset property="env.BUILD_NUMBER" />
|
||||
</condition>
|
||||
<available file="eclipse" property="eclipse.exists"/>
|
||||
</target>
|
||||
|
||||
<target name="makeversion" depends="buildenvsetup">
|
||||
<antcall target="writeversion" />
|
||||
<property file="fmlversion.properties" />
|
||||
<property name="build.number" value="${fmlbuild.major.number}.${fmlbuild.minor.number}.${fmlbuild.revision.number}" />
|
||||
<property name="version.major" value="${fmlbuild.major.number}" />
|
||||
<property name="version.minor" value="${fmlbuild.minor.number}" />
|
||||
<property name="version.rev" value="${fmlbuild.revision.number}" />
|
||||
<property name="version.minecraft" value="${fmlbuild.mcversion}" />
|
||||
<property name="version.branch" value="${fmlbuild.branch}" />
|
||||
<property name="version" value="${version.major}.${version.minor}.${version.rev}.${version.build}" />
|
||||
</target>
|
||||
|
||||
<target name="makeclean" depends="buildenvsetup" if="mcp.exists">
|
||||
<exec executable="${python.exe}" dir="${mcp.home}">
|
||||
<arg value="${mcp.home}/runtime/cleanup.py" />
|
||||
<arg value="-f" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="clean" depends="buildenvsetup,makeclean" if="mcp.exists">
|
||||
<exec executable="${python.exe}" dir="${mcp.home}">
|
||||
<arg value="${basedir}/decompile.py" />
|
||||
<arg value="${mcp.home}" />
|
||||
<arg value="${basedir}" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="reobfuscate" depends="buildenvsetup,recompile">
|
||||
<exec executable="${python.exe}" dir="${mcp.home}" failonerror="true">
|
||||
<arg value="${mcp.home}/runtime/reobfuscate.py" />
|
||||
</exec>
|
||||
<fail message="Reobfuscation failed">
|
||||
<condition>
|
||||
<not>
|
||||
<and>
|
||||
<available file="${mcp.home}/temp/client.md5"/>
|
||||
<available file="${mcp.home}/temp/client_reobf.md5"/>
|
||||
</and>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<exec executable="${python.exe}" dir="${mcp.home}">
|
||||
<arg value="${basedir}/generatechangedfilelist.py"/>
|
||||
<arg value="${mcp.home}"/>
|
||||
<arg value="${basedir}/difflist.txt"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="recompile" depends="buildenvsetup">
|
||||
<exec executable="${python.exe}" dir="${mcp.home}" failonerror="true">
|
||||
<arg value="${mcp.home}/runtime/recompile.py" />
|
||||
</exec>
|
||||
<fail message="Compilation failed">
|
||||
<condition>
|
||||
<not>
|
||||
<available file="${mcp.home}/bin/minecraft/net/minecraft/client/Minecraft.class"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
</target>
|
||||
|
||||
<target name="merge-client" depends="buildenvsetup">
|
||||
<copy todir="${client.mcp.srcdir}" overwrite="true" verbose="true">
|
||||
<fileset dir="${client.src.dir}" includes="**/*.java" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="merge-common">
|
||||
<copy todir="${client.mcp.srcdir}" overwrite="true" verbose="true">
|
||||
<fileset dir="${common.src.dir}" includes="**/*.java" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="merge-source" depends="buildenvsetup,merge-client,merge-common" />
|
||||
|
||||
<target name="build-universal" depends="buildenvsetup,merge-client,merge-common,reobfuscate,makeversion">
|
||||
<condition property="universal.jarname" value="${modname}-universal-${version.minecraft}-${version}" else="${modname}-universal-${version.minecraft}-${version}-${version.branch}">
|
||||
<equals arg1="${version.branch}" arg2="master" />
|
||||
</condition>
|
||||
|
||||
<mkdir dir="${basedir}/target" />
|
||||
<jar destfile="${basedir}/target/${universal.jarname}.zip" duplicate="preserve">
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="net.minecraft.server.MinecraftServer"/>
|
||||
<attribute name="Class-Path" value="minecraft_server.jar"/>
|
||||
</manifest>
|
||||
<fileset dir="${client.mcp.obfoutput}" includes="**/*.class" excludes="*.class"/>
|
||||
</jar>
|
||||
<antcall target="signjar"/>
|
||||
<zip update="true" destfile="${basedir}/target/${universal.jarname}.zip" >
|
||||
<fileset dir="${client.mcp.obfoutput}" includes="*.class"/>
|
||||
<zipfileset dir="${basedir}" includes="fmlversion.properties"/>
|
||||
<zipfileset dir="${basedir}" includes="LICENSE-fml.txt" />
|
||||
<zipfileset dir="${common.src.dir}" includes="mcpmod.info" />
|
||||
<zipfileset dir="${client.src.dir}" includes="mcp.png" />
|
||||
<zipfileset dir="${basedir}" includes="install/CREDITS-fml.txt" fullpath="CREDITS-fml.txt"/>
|
||||
<zipfileset dir="${common.src.dir}" includes="*.cfg" />
|
||||
<mappedresources>
|
||||
<concat>
|
||||
<fileset dir="${basedir}/install" includes="README.txt" />
|
||||
<filterchain>
|
||||
<replacetokens>
|
||||
<token key="MAJOR" value="${version.major}" />
|
||||
<token key="MINOR" value="${version.minor}" />
|
||||
<token key="REV" value="${version.rev}" />
|
||||
<token key="BUILD" value="${version.build}" />
|
||||
<token key="MCVERSION" value="${version.minecraft}" />
|
||||
</replacetokens>
|
||||
</filterchain>
|
||||
</concat>
|
||||
<mergemapper to="README-fml.txt" />
|
||||
</mappedresources>
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="build-source-pack" depends="makeversion">
|
||||
<property name="srcpack.jarname" value="${modname}-src-${version.minecraft}-${version}-${version.branch}" />
|
||||
<zip destfile="${basedir}/target/${srcpack.jarname}.zip">
|
||||
<zipfileset dir="${basedir}" includes="LICENSE-fml.txt,difflist.txt,commands.patch,mcp_merge.cfg,mc_versions.cfg" prefix="fml" />
|
||||
<zipfileset dir="${common.src.dir}" includes="**/*.java" prefix="fml/common" />
|
||||
<zipfileset dir="${client.src.dir}" includes="**/*.java" prefix="fml/client" />
|
||||
<zipfileset dir="${client.src.dir}" includes="mcp.png" prefix="fml/client" />
|
||||
<zipfileset dir="${basedir}" includes="fmlversion.properties" prefix="fml/common" />
|
||||
<zipfileset dir="${common.src.dir}" includes="*.cfg" prefix="fml/common" />
|
||||
<zipfileset dir="${common.src.dir}" includes="mcpmod.info" prefix="fml/common" />
|
||||
<zipfileset dir="${patch.src.dir}" includes="**/*.patch" prefix="fml/patches" />
|
||||
<zipfileset dir="${fml.conf.dir}" prefix="fml/conf" />
|
||||
<zipfileset dir="${fml.python.dir}" prefix="fml/python" />
|
||||
<mappedresources>
|
||||
<concat>
|
||||
<fileset dir="${basedir}/install" includes="README.txt" />
|
||||
<filterchain>
|
||||
<replacetokens>
|
||||
<token key="MAJOR" value="${version.major}" />
|
||||
<token key="MINOR" value="${version.minor}" />
|
||||
<token key="REV" value="${version.rev}" />
|
||||
<token key="BUILD" value="${version.build}" />
|
||||
<token key="MCVERSION" value="${version.minecraft}" />
|
||||
</replacetokens>
|
||||
</filterchain>
|
||||
</concat>
|
||||
<mergemapper to="fml/README-fml.txt" />
|
||||
</mappedresources>
|
||||
<zipfileset dir="${basedir}/install" excludes="README.txt,fml.pyc" prefix="fml" />
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="build-deobf-data" depends="makeversion">
|
||||
<mkdir dir="build-tmp-deobf"/>
|
||||
<copy todir="build-tmp-deobf">
|
||||
<mappedresources>
|
||||
<fileset dir="${mcp.home}/conf" includes="packaged.srg"/>
|
||||
<globmapper from="packaged.srg" to="joined.srg"/>
|
||||
</mappedresources>
|
||||
</copy>
|
||||
<touch millis="0" file="build-tmp-deobf/joined.srg"/>
|
||||
<zip file="deobfuscation_data_${version.minecraft}.zip" encoding="UTF-8">
|
||||
<fileset dir="build-tmp-deobf" includes="joined.srg"/>
|
||||
</zip>
|
||||
<checksum algorithm="SHA1" property="deobf.checksum" file="deobfuscation_data_${version.minecraft}.zip"/>
|
||||
<antcall target="writeversion"/>
|
||||
<delete dir="build-tmp-deobf" />
|
||||
</target>
|
||||
|
||||
<target name="build" depends="buildenvsetup,merge-client,merge-common,build-deobf-data,build-universal,build-source-pack" />
|
||||
|
||||
<target name="jenkinsbuild" depends="buildenvsetup,jenkinsfmldecompile,patch,build"/>
|
||||
|
||||
<target name="patch" depends="buildenvsetup">
|
||||
<exec executable="${python.exe}" dir="${basedir}">
|
||||
<arg value="${basedir}/applypatches.py" />
|
||||
<arg value="${basedir}" />
|
||||
<arg value="${mcp.srcdir}" />
|
||||
<arg value="${mcp.home}" />
|
||||
</exec>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="setupenvironment" depends="buildenvsetup">
|
||||
<input message="This will clean the mcp environment at ${mcp.home} and backup any src-work folder there (src-base will be erased). Continue?" validargs="y,n" addproperty="do.continue" />
|
||||
<condition property="do.not.continue">
|
||||
<equals arg1="n" arg2="${do.continue}" />
|
||||
</condition>
|
||||
<fail if="do.not.continue">You have decided not to continue. This script will stop now.</fail>
|
||||
<echo>Preparing the MCP environment at ${mcp.home}</echo>
|
||||
<antcall target="fmldecompile"/>
|
||||
<echo>Moving old patched sources at ${patch.mcp.srcdir} out of the way</echo>
|
||||
<move todir="${mcp.home}/src-work${timestamp}" failonerror="false" verbose="true">
|
||||
<fileset dir="${patch.mcp.srcdir}"/>
|
||||
</move>
|
||||
<echo>Deleting old patch references at ${clean.mcp.srcdir}</echo>
|
||||
<delete dir="${clean.mcp.srcdir}" failonerror="false"/>
|
||||
<echo>Creating new patch references at ${clean.mcp.srcdir}</echo>
|
||||
<copy todir="${clean.mcp.srcdir}">
|
||||
<fileset dir="${mcp.srcdir}"/>
|
||||
</copy>
|
||||
<antcall target="cleanargo"/>
|
||||
<antcall target="patch"/>
|
||||
<echo>Creating clean patched references at ${patch.mcp.srcdir}</echo>
|
||||
<copy todir="${patch.mcp.srcdir}">
|
||||
<fileset dir="${mcp.srcdir}"/>
|
||||
</copy>
|
||||
<antcall target="writeversion"/>
|
||||
<antcall target="makeeclipse"/>
|
||||
<echo>Setup complete! You should now be able to open ${basedir}/eclipse as a workspace in eclipse and import/refresh the FML project</echo>
|
||||
</target>
|
||||
|
||||
<target name="fmldecompile" depends="buildenvsetup,makeclean">
|
||||
<exec executable="${python.exe}" dir="${basedir}">
|
||||
<arg value="${basedir}/decompile.py" />
|
||||
<arg value="${mcp.home}" />
|
||||
<arg value="${basedir}" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="jenkinsfmldecompile" depends="buildenvsetup,makeclean">
|
||||
<exec executable="${python.exe}" dir="${basedir}">
|
||||
<arg value="${basedir}/decompile.py" />
|
||||
<arg value="${mcp.home}" />
|
||||
<arg value="${basedir}" />
|
||||
<arg value="-no_gen_conf" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="repatch" depends="buildenvsetup,checkpatches">
|
||||
<echo>Moving old patched sources at ${mcp.home}/src-work out of the way</echo>
|
||||
<move todir="${mcp.home}/src-work${timestamp}" failonerror="false" verbose="true">
|
||||
<fileset dir="${patch.mcp.srcdir}"/>
|
||||
</move>
|
||||
<delete dir="${mcp.srcdir}"/>
|
||||
<copy todir="${mcp.srcdir}">
|
||||
<fileset dir="${clean.mcp.srcdir}"/>
|
||||
</copy>
|
||||
|
||||
<antcall target="cleanargo"/>
|
||||
|
||||
<antcall target="patch"/>
|
||||
<copy todir="${patch.mcp.srcdir}">
|
||||
<fileset dir="${mcp.srcdir}"/>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="repatchclean" depends="buildenvsetup">
|
||||
<delete dir="${mcp.srcdir}"/>
|
||||
<copy todir="${mcp.srcdir}">
|
||||
<fileset dir="${clean.mcp.srcdir}"/>
|
||||
</copy>
|
||||
|
||||
<antcall target="cleanargo"/>
|
||||
|
||||
<antcall target="patch"/>
|
||||
</target>
|
||||
|
||||
<target name="cleanargo" depends="buildenvsetup">
|
||||
<delete dir="${client.mcp.srcdir}/argo"/>
|
||||
<delete dir="${client.mcp.srcdir}/org"/>
|
||||
</target>
|
||||
|
||||
<target name="checkpatches" depends="buildenvsetup">
|
||||
<uptodate property="checkUptodate.uptodate">
|
||||
<srcfiles dir="${patch.mcp.srcdir}" includes="**/*.java">
|
||||
<present targetdir="${patch.src.dir}">
|
||||
<globmapper from="*.java" to="*.java.patch"/>
|
||||
</present>
|
||||
</srcfiles>
|
||||
<globmapper from="*.java" to="${patch.src.dir}/*.java.patch"/>
|
||||
</uptodate>
|
||||
<fail unless="checkUptodate.uptodate">
|
||||
A patch is out of date. Update your patches!
|
||||
</fail>
|
||||
</target>
|
||||
|
||||
<target name="updatepatches" depends="buildenvsetup">
|
||||
<exec executable="${python.exe}" dir="${basedir}">
|
||||
<arg value="${basedir}/update_patches.py" />
|
||||
<arg value="${mcp.home}"/>
|
||||
<arg value="${basedir}"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="makeeclipse" depends="buildenvsetup" unless="eclipse.exists">
|
||||
<echo>
|
||||
Extracting fresh eclipse workspace to ${basedir}/eclipse
|
||||
</echo>
|
||||
<unzip src="${basedir}/eclipse-workspace-dev.zip" dest="${basedir}"/>
|
||||
</target>
|
||||
|
||||
<target name="makerenamedsource" depends="buildenvsetup,repatch,merge-client,merge-common,reobfuscate">
|
||||
<copy todir="${tmp.mcp.srcdir}">
|
||||
<fileset dir="${mcp.srcdir}"/>
|
||||
</copy>
|
||||
<exec executable="${python.exe}" dir="${mcp.home}">
|
||||
<arg value="${mcp.home}/runtime/updatenames.py" />
|
||||
<arg value="-f" />
|
||||
</exec>
|
||||
<copy todir="${renamed.mcp.srcdir}">
|
||||
<fileset dir="${mcp.srcdir}"/>
|
||||
</copy>
|
||||
<move todir="${mcp.srcdir}">
|
||||
<fileset dir="${tmp.mcp.srcdir}"/>
|
||||
</move>
|
||||
</target>
|
||||
<target name="signjar" depends="buildenvsetup,makeversion" if="signature.exists">
|
||||
<condition property="universal.jarname" value="${modname}-universal-${version.minecraft}-${version}" else="${modname}-universal-${version.minecraft}-${version}-${version.branch}">
|
||||
<equals arg1="${version.branch}" arg2="master" />
|
||||
</condition>
|
||||
<property file="${env.JENKINS_HOME}/fmlsigned.properties" prefix="sign"/>
|
||||
<echo>${env.JENKINS_HOME} ${universal.jarname} ${sign.KEYPASS}</echo>
|
||||
<signjar alias="FML" jar="${basedir}/target/${universal.jarname}.zip" keypass="${sign.KEYPASS}" keystore="${env.JENKINS_HOME}/${sign.KEYSTORE}" storepass="${sign.STOREPASS}" verbose="true"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -1,637 +0,0 @@
|
||||
/*
|
||||
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; either version 2.1 of the License, or any later version.
|
||||
*
|
||||
* This library 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package cpw.mods.fml.server;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import net.minecraft.server.Block;
|
||||
import net.minecraft.server.Item;
|
||||
import net.minecraft.server.LocaleLanguage;
|
||||
import net.minecraft.server.MLProp;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.BaseMod;
|
||||
import net.minecraft.server.BiomeBase;
|
||||
import net.minecraft.server.EntityItem;
|
||||
import net.minecraft.server.EntityHuman;
|
||||
import net.minecraft.server.IChunkProvider;
|
||||
import net.minecraft.server.ICommandListener;
|
||||
import net.minecraft.server.IInventory;
|
||||
import net.minecraft.server.ItemStack;
|
||||
import net.minecraft.server.NetworkManager;
|
||||
import net.minecraft.server.Packet1Login;
|
||||
import net.minecraft.server.Packet250CustomPayload;
|
||||
import net.minecraft.server.Packet3Chat;
|
||||
import net.minecraft.server.BukkitRegistry;
|
||||
import net.minecraft.server.SidedProxy;
|
||||
import net.minecraft.server.World;
|
||||
import net.minecraft.server.WorldType;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.IFMLSidedHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.ModContainer;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
import cpw.mods.fml.common.ProxyInjector;
|
||||
import cpw.mods.fml.common.Side;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
import cpw.mods.fml.common.modloader.ModLoaderModContainer;
|
||||
import cpw.mods.fml.common.modloader.ModProperty;
|
||||
import cpw.mods.fml.common.registry.FMLRegistry;
|
||||
|
||||
/**
|
||||
* Handles primary communication from hooked code into the system
|
||||
*
|
||||
* The FML entry point is {@link #onPreLoad(MinecraftServer)} called from {@link MinecraftServer}
|
||||
*
|
||||
* Obfuscated code should focus on this class and other members of the "server" (or "client") code
|
||||
*
|
||||
* The actual mod loading is handled at arms length by {@link Loader}
|
||||
*
|
||||
* It is expected that a similar class will exist for each target environment: Bukkit and Client side.
|
||||
*
|
||||
* It should not be directly modified.
|
||||
*
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
public class FMLBukkitHandler implements IFMLSidedHandler
|
||||
{
|
||||
/**
|
||||
* The singleton
|
||||
*/
|
||||
private static final FMLBukkitHandler INSTANCE = new FMLBukkitHandler();
|
||||
|
||||
/**
|
||||
* A reference to the server itself
|
||||
*/
|
||||
private MinecraftServer server;
|
||||
|
||||
/**
|
||||
* A handy list of the default overworld biomes
|
||||
*/
|
||||
private BiomeBase[] defaultOverworldBiomes;
|
||||
|
||||
FMLBukkitProfiler profiler;
|
||||
|
||||
/**
|
||||
* Called to start the whole game off from {@link MinecraftServer#startServer}
|
||||
* @param minecraftServer
|
||||
*/
|
||||
public void onPreLoad(MinecraftServer minecraftServer)
|
||||
{
|
||||
try
|
||||
{
|
||||
Class.forName("BaseModMp", false, getClass().getClassLoader());
|
||||
MinecraftServer.log.severe(""
|
||||
+ "Forge Mod Loader has detected that this server has an ModLoaderMP installed alongside Forge Mod Loader.\n"
|
||||
+ "This will cause a serious problem with compatibility. To protect your worlds, this minecraft server will now shutdown.\n"
|
||||
+ "You should follow the installation instructions of either Minecraft Forge of Forge Mod Loader and NOT install ModLoaderMP \n"
|
||||
+ "into the minecraft_server.jar file "
|
||||
+ "before this server will be allowed to start up.\n\nFailure to do so will simply result in more startup failures.\n\n"
|
||||
+ "The authors of Minecraft Forge and Forge Mod Loader strongly suggest you talk to your mod's authors and get them to\nupdate their "
|
||||
+ "requirements. ModLoaderMP is not compatible with Minecraft Forge on the server and they will need to update their mod\n"
|
||||
+ "for Minecraft Forge and other server compatibility, unless they are Minecraft Forge mods, in which case they already\n"
|
||||
+ "don't need ModLoaderMP and the mod author simply has failed to update his requirements and should be informed appropriately.\n\n"
|
||||
+ "The authors of Forge Mod Loader would like to be compatible with ModLoaderMP but it is closed source and owned by SDK.\n"
|
||||
+ "SDK, the author of ModLoaderMP, has a standing invitation to submit compatibility patches \n"
|
||||
+ "to the open source community project that is Forge Mod Loader so that this incompatibility doesn't last. \n"
|
||||
+ "Users who wish to enjoy mods of both types are "
|
||||
+ "encouraged to request of SDK that he submit a\ncompatibility patch to the Forge Mod Loader project at \n"
|
||||
+ "http://github.com/cpw/FML.\nPosting on the minecraft forums at\nhttp://www.minecraftforum.net/topic/86765- (the MLMP thread)\n"
|
||||
+ "may encourage him in this effort. However, I ask that your requests be polite.\n"
|
||||
+ "Now, the server has to shutdown so you can reinstall your minecraft_server.jar\nproperly, until such time as we can work together.");
|
||||
throw new RuntimeException(
|
||||
"This FML based server has detected an installation of ModLoaderMP alongside. This will cause serious compatibility issues, so the server will now shut down.");
|
||||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
// We're safe. continue
|
||||
}
|
||||
server = minecraftServer;
|
||||
FMLCommonHandler.instance().beginLoading(this);
|
||||
FMLRegistry.registerRegistry(new BukkitRegistry());
|
||||
Loader.instance().loadMods();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called a bit later on during server initialization to finish loading mods
|
||||
*/
|
||||
public void onLoadComplete()
|
||||
{
|
||||
Loader.instance().initializeMods();
|
||||
for (Item i : Item.byId) {
|
||||
if (i!=null && Material.getMaterial(i.id).name().startsWith("X")) {
|
||||
Material.setMaterialName(i.id, i.l());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onWorldLoadTick()
|
||||
{
|
||||
FMLCommonHandler.instance().tickStart(EnumSet.of(TickType.WORLDLOAD));
|
||||
}
|
||||
|
||||
/**
|
||||
* Every tick just before world and other ticks occur
|
||||
*/
|
||||
public void onPreWorldTick(World world)
|
||||
{
|
||||
FMLCommonHandler.instance().tickStart(EnumSet.of(TickType.WORLD),world);
|
||||
}
|
||||
|
||||
/**
|
||||
* Every tick just after world and other ticks occur
|
||||
*/
|
||||
public void onPostWorldTick(World world)
|
||||
{
|
||||
FMLCommonHandler.instance().tickEnd(EnumSet.of(TickType.WORLD), world);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the server instance
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public MinecraftServer getServer()
|
||||
{
|
||||
return server;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a handle to the server's logger instance
|
||||
*/
|
||||
public Logger getMinecraftLogger()
|
||||
{
|
||||
return MinecraftServer.log;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from ChunkProviderServer when a chunk needs to be populated
|
||||
*
|
||||
* To avoid polluting the worldgen seed, we generate a new random from the world seed and
|
||||
* generate a seed from that
|
||||
*
|
||||
* @param chunkProvider
|
||||
* @param chunkX
|
||||
* @param chunkZ
|
||||
* @param world
|
||||
* @param generator
|
||||
*/
|
||||
public void onChunkPopulate(IChunkProvider chunkProvider, int chunkX, int chunkZ, World world, IChunkProvider generator)
|
||||
{
|
||||
FMLCommonHandler.instance().handleWorldGeneration(chunkX, chunkZ, world.getSeed(), world, generator, chunkProvider);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from the furnace to lookup fuel values
|
||||
*
|
||||
* @param itemId
|
||||
* @param itemDamage
|
||||
* @return
|
||||
*/
|
||||
public int fuelLookup(int itemId, int itemDamage)
|
||||
{
|
||||
int fv = 0;
|
||||
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
fv = Math.max(fv, mod.lookupFuelValue(itemId, itemDamage));
|
||||
}
|
||||
|
||||
return fv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the offered class and instance of BaseMod and therefore a ModLoader mod?
|
||||
*/
|
||||
public boolean isModLoaderMod(Class<?> clazz)
|
||||
{
|
||||
return BaseMod.class.isAssignableFrom(clazz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the supplied mod class into a mod container
|
||||
*/
|
||||
public ModContainer loadBaseModMod(Class<?> clazz, File canonicalFile)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
Class <? extends BaseMod > bmClazz = (Class <? extends BaseMod >) clazz;
|
||||
return new ModLoaderModContainer(bmClazz, canonicalFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to notify that an item was picked up from the world
|
||||
*
|
||||
* @param entityItem
|
||||
* @param entityPlayer
|
||||
*/
|
||||
public void notifyItemPickup(EntityItem entityItem, EntityHuman entityPlayer)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsPickupNotification())
|
||||
{
|
||||
mod.getPickupNotifier().notifyPickup(entityItem, entityPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Raise an exception
|
||||
*
|
||||
* @param exception
|
||||
* @param message
|
||||
* @param stopGame
|
||||
*/
|
||||
public void raiseException(Throwable exception, String message, boolean stopGame)
|
||||
{
|
||||
FMLCommonHandler.instance().getFMLLogger().throwing("FMLHandler", "raiseException", exception);
|
||||
throw new RuntimeException(exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to dispense the item as an entity other than just as a the item itself
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param xVelocity
|
||||
* @param zVelocity
|
||||
* @param item
|
||||
* @return
|
||||
*/
|
||||
public boolean tryDispensingEntity(World world, double x, double y, double z, byte xVelocity, byte zVelocity, ItemStack item)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsToDispense() && mod.getDispenseHandler().dispense(x, y, z, xVelocity, zVelocity, world, item))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the instance
|
||||
*/
|
||||
public static FMLBukkitHandler instance()
|
||||
{
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a list of default overworld biomes
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public BiomeBase[] getDefaultOverworldBiomes()
|
||||
{
|
||||
if (defaultOverworldBiomes == null)
|
||||
{
|
||||
ArrayList<BiomeBase> biomes = new ArrayList<BiomeBase>(20);
|
||||
|
||||
for (int i = 0; i < 23; i++)
|
||||
{
|
||||
if ("Sky".equals(BiomeBase.biomes[i].y) || "Hell".equals(BiomeBase.biomes[i].y))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
biomes.add(BiomeBase.biomes[i]);
|
||||
}
|
||||
|
||||
defaultOverworldBiomes = new BiomeBase[biomes.size()];
|
||||
biomes.toArray(defaultOverworldBiomes);
|
||||
}
|
||||
|
||||
return defaultOverworldBiomes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an item is crafted
|
||||
*
|
||||
* @param player
|
||||
* @param craftedItem
|
||||
* @param craftingGrid
|
||||
*/
|
||||
public void onItemCrafted(EntityHuman player, ItemStack craftedItem, IInventory craftingGrid)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsCraftingNotification())
|
||||
{
|
||||
mod.getCraftingHandler().onCrafting(player, craftedItem, craftingGrid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an item is smelted
|
||||
*
|
||||
* @param player
|
||||
* @param smeltedItem
|
||||
*/
|
||||
public void onItemSmelted(EntityHuman player, ItemStack smeltedItem)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsCraftingNotification())
|
||||
{
|
||||
mod.getCraftingHandler().onSmelting(player, smeltedItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a chat packet is received
|
||||
*
|
||||
* @param chat
|
||||
* @param player
|
||||
* @return true if you want the packet to stop processing and not echo to the rest of the world
|
||||
*/
|
||||
public boolean handleChatPacket(Packet3Chat chat, EntityHuman player)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsNetworkPackets() && mod.getNetworkHandler().onChat(chat, player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a packet 250 packet is received from the player
|
||||
*
|
||||
* @param packet
|
||||
* @param player
|
||||
*/
|
||||
public void handlePacket250(Packet250CustomPayload packet, EntityHuman player)
|
||||
{
|
||||
if ("REGISTER".equals(packet.tag) || "UNREGISTER".equals(packet.tag))
|
||||
{
|
||||
handleClientRegistration(packet, player);
|
||||
return;
|
||||
}
|
||||
|
||||
ModContainer mod = FMLCommonHandler.instance().getModForChannel(packet.tag);
|
||||
|
||||
if (mod != null)
|
||||
{
|
||||
mod.getNetworkHandler().onPacket250Packet(packet, player);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle register requests for packet 250 channels
|
||||
*
|
||||
* @param packet
|
||||
*/
|
||||
private void handleClientRegistration(Packet250CustomPayload packet, EntityHuman player)
|
||||
{
|
||||
if (packet.data==null) {
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
for (String channel : new String(packet.data, "UTF8").split("\0"))
|
||||
{
|
||||
// Skip it if we don't know it
|
||||
if (FMLCommonHandler.instance().getModForChannel(channel) == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ("REGISTER".equals(packet.tag))
|
||||
{
|
||||
FMLCommonHandler.instance().activateChannel(player, channel);
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLCommonHandler.instance().deactivateChannel(player, channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (UnsupportedEncodingException e)
|
||||
{
|
||||
getMinecraftLogger().warning("Received invalid registration packet");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a login
|
||||
*
|
||||
* @param loginPacket
|
||||
* @param networkManager
|
||||
*/
|
||||
public void handleLogin(Packet1Login loginPacket, NetworkManager networkManager)
|
||||
{
|
||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
packet.tag = "REGISTER";
|
||||
packet.data = FMLCommonHandler.instance().getPacketRegistry();
|
||||
packet.length = packet.data.length;
|
||||
if (packet.length>0) {
|
||||
networkManager.queue(packet);
|
||||
}
|
||||
}
|
||||
|
||||
public void announceLogin(EntityHuman player) {
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsPlayerTracking())
|
||||
{
|
||||
mod.getPlayerTracker().onPlayerLogin(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getMinecraftRootDirectory()
|
||||
{
|
||||
try {
|
||||
return server.a(".").getCanonicalFile();
|
||||
} catch (IOException ioe) {
|
||||
return new File(".");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param var2
|
||||
* @return
|
||||
*/
|
||||
public boolean handleServerCommand(String command, String player, ICommandListener listener)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList()) {
|
||||
if (mod.wantsConsoleCommands() && mod.getConsoleHandler().handleCommand(command, player, listener)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
*/
|
||||
public void announceLogout(EntityHuman player)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsPlayerTracking())
|
||||
{
|
||||
mod.getPlayerTracker().onPlayerLogout(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param p_28168_1_
|
||||
*/
|
||||
public void announceDimensionChange(EntityHuman player)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsPlayerTracking())
|
||||
{
|
||||
mod.getPlayerTracker().onPlayerChangedDimension(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param biome
|
||||
*/
|
||||
public void addBiomeToDefaultWorldGenerator(BiomeBase biome)
|
||||
{
|
||||
WorldType.NORMAL.addNewBiome(biome);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param biome
|
||||
*/
|
||||
public void removeBiomeFromDefaultWorldGenerator(BiomeBase biome)
|
||||
{
|
||||
WorldType.NORMAL.removeBiome(biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getMinecraftInstance() {
|
||||
return server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCurrentLanguage()
|
||||
{
|
||||
return LocaleLanguage.a().getCurrentLanguage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Properties getCurrentLanguageTable()
|
||||
{
|
||||
return LocaleLanguage.a().getCurrentLanguageTable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectName(Object instance)
|
||||
{
|
||||
String objectName;
|
||||
if (instance instanceof Item) {
|
||||
objectName=((Item)instance).getName();
|
||||
} else if (instance instanceof Block) {
|
||||
objectName=((Block)instance).getName();
|
||||
} else if (instance instanceof ItemStack) {
|
||||
objectName=Item.byId[((ItemStack)instance).id].a((ItemStack)instance);
|
||||
} else {
|
||||
throw new IllegalArgumentException(String.format("Illegal object for naming %s",instance));
|
||||
}
|
||||
objectName+=".name";
|
||||
return objectName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModMetadata readMetadataFrom(InputStream input, ModContainer mod) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void profileStart(String profileLabel) {
|
||||
if (profiler!=null)
|
||||
{
|
||||
profiler.start(profileLabel);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void profileEnd() {
|
||||
if (profiler!=null)
|
||||
{
|
||||
profiler.end();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModProperty getModLoaderPropertyFor(Field f) {
|
||||
if (f.isAnnotationPresent(MLProp.class)) {
|
||||
MLProp prop = f.getAnnotation(MLProp.class);
|
||||
return new ModProperty(prop.info(), prop.min(), prop.max(), prop.name());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAdditionalBrandingInformation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Side getSide() {
|
||||
return Side.BUKKIT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProxyInjector findSidedProxyOn(cpw.mods.fml.common.modloader.BaseMod mod) {
|
||||
for (Field f : mod.getClass().getDeclaredFields())
|
||||
{
|
||||
if (f.isAnnotationPresent(SidedProxy.class))
|
||||
{
|
||||
SidedProxy sp = f.getAnnotation(SidedProxy.class);
|
||||
return new ProxyInjector(sp.clientSide(), sp.serverSide(), sp.bukkitSide(), f);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void onServerPostTick() {
|
||||
FMLCommonHandler.instance().tickEnd(EnumSet.of(TickType.GAME));
|
||||
}
|
||||
|
||||
public void onServerPreTick() {
|
||||
FMLCommonHandler.instance().tickStart(EnumSet.of(TickType.GAME));
|
||||
}
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
package cpw.mods.fml.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableMultiset;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Multiset;
|
||||
import com.google.common.collect.Multiset.Entry;
|
||||
import com.google.common.collect.Multisets;
|
||||
import com.google.common.collect.TreeMultiset;
|
||||
import com.google.common.primitives.Ints;
|
||||
|
||||
public class FMLBukkitProfiler {
|
||||
private static FMLBukkitProfiler lastInstance;
|
||||
private static long endTime;
|
||||
private LinkedList<String> profiles = new LinkedList<String>();
|
||||
private TreeMultiset<String> hitCounter = TreeMultiset.create();
|
||||
private TreeMultiset<String> timings = TreeMultiset.create();
|
||||
private long timestamp;
|
||||
|
||||
public static long beginProfiling(int seconds)
|
||||
{
|
||||
long now = System.currentTimeMillis();
|
||||
if (lastInstance == null)
|
||||
{
|
||||
lastInstance = new FMLBukkitProfiler();
|
||||
FMLBukkitHandler.instance().profiler = lastInstance;
|
||||
endTime = now + seconds * 1000;
|
||||
}
|
||||
if (endTime > now)
|
||||
{
|
||||
return (endTime - now) / 1000;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static long endProfiling()
|
||||
{
|
||||
FMLBukkitHandler.instance().profiler = null;
|
||||
return endTime - System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public static void resetProfiling()
|
||||
{
|
||||
endProfiling();
|
||||
lastInstance = null;
|
||||
}
|
||||
|
||||
public void start(String profileLabel)
|
||||
{
|
||||
profiles.push(profileLabel);
|
||||
timestamp = System.nanoTime();
|
||||
}
|
||||
|
||||
public void end()
|
||||
{
|
||||
int timing = (int)((System.nanoTime() - timestamp)/1000L);
|
||||
String label = Joiner.on('.').join(profiles);
|
||||
profiles.pop();
|
||||
hitCounter.add(label);
|
||||
timings.add(label,timing);
|
||||
if (System.currentTimeMillis()>endTime)
|
||||
{
|
||||
endProfiling();
|
||||
}
|
||||
}
|
||||
|
||||
public static String[] dumpProfileData(int count)
|
||||
{
|
||||
if (lastInstance == null)
|
||||
{
|
||||
return new String[] { "No profile data available" };
|
||||
}
|
||||
|
||||
if (endTime > System.currentTimeMillis())
|
||||
{
|
||||
return new String[] { String.format("Timing is being gathered for another %d seconds", endTime - System.currentTimeMillis()) };
|
||||
}
|
||||
return lastInstance.profileData(count);
|
||||
}
|
||||
|
||||
private String[] profileData(int count) {
|
||||
List<Entry<String>> sortedTiming = getEntriesSortedByFrequency(timings, false);
|
||||
ArrayList<String> timeLine = new ArrayList<String>();
|
||||
|
||||
double totalTime = timings.size();
|
||||
|
||||
for (Entry<String> hit : sortedTiming)
|
||||
{
|
||||
if (--count == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
timeLine.add(String.format("%s : %d microseconds, %d invocations. %.2f %% of overall time",hit.getElement(), hit.getCount(), hitCounter.count(hit.getElement()), 100.0 * hit.getCount()/totalTime));
|
||||
}
|
||||
return timeLine.toArray(new String[0]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Code from http://stackoverflow.com/questions/4345633/simplest-way-to-iterate-through-a-multiset-in-the-order-of-element-frequency
|
||||
*/
|
||||
private enum EntryComp implements Comparator<Multiset.Entry<?>>{
|
||||
DESCENDING{
|
||||
@Override
|
||||
public int compare(final Entry<?> a, final Entry<?> b){
|
||||
return Ints.compare(b.getCount(), a.getCount());
|
||||
}
|
||||
},
|
||||
ASCENDING{
|
||||
@Override
|
||||
public int compare(final Entry<?> a, final Entry<?> b){
|
||||
return Ints.compare(a.getCount(), b.getCount());
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
private static <E> List<Entry<E>> getEntriesSortedByFrequency(final Multiset<E> ms, final boolean ascending) {
|
||||
final List<Entry<E>> entryList = Lists.newArrayList(ms.entrySet());
|
||||
Collections.sort(entryList, ascending ? EntryComp.ASCENDING : EntryComp.DESCENDING);
|
||||
return entryList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,409 +0,0 @@
|
||||
/*
|
||||
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; either version 2.1 of the License, or any later version.
|
||||
*
|
||||
* This library 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.craftbukkit.generator.NetherChunkGenerator;
|
||||
import org.bukkit.craftbukkit.generator.NormalChunkGenerator;
|
||||
|
||||
import cpw.mods.fml.common.TickType;
|
||||
|
||||
public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseMod
|
||||
{
|
||||
// CALLBACK MECHANISMS
|
||||
|
||||
/**
|
||||
* @param minecraftInstance
|
||||
* @return
|
||||
*/
|
||||
public final boolean doTickInGame(TickType tick, boolean tickEnd, Object minecraftInstance, Object... data)
|
||||
{
|
||||
if (tick==TickType.GAME && tickEnd) {
|
||||
return onTickInGame((MinecraftServer)minecraftInstance);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onCrafting(Object... craftingParameters)
|
||||
{
|
||||
takenFromCrafting((EntityHuman)craftingParameters[0], (ItemStack)craftingParameters[1], (IInventory)craftingParameters[2]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onSmelting(Object... smeltingParameters)
|
||||
{
|
||||
takenFromFurnace((EntityHuman)smeltingParameters[0], (ItemStack)smeltingParameters[1]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean dispense(double x, double y, double z, byte xVelocity, byte zVelocity, Object... data)
|
||||
{
|
||||
return dispenseEntity((World)data[0], x, y, z, xVelocity, zVelocity, (ItemStack)data[1]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean onChat(Object... data)
|
||||
{
|
||||
return onChatMessageReceived((EntityHuman)data[1], (Packet3Chat)data[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onServerLogin(Object handler) {
|
||||
// NOOP
|
||||
}
|
||||
|
||||
public final void onServerLogout() {
|
||||
// NOOP
|
||||
}
|
||||
@Override
|
||||
public final void onPlayerLogin(Object player)
|
||||
{
|
||||
onClientLogin((EntityHuman) player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onPlayerLogout(Object player)
|
||||
{
|
||||
onClientLogout((EntityHuman)player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onPlayerChangedDimension(Object player)
|
||||
{
|
||||
onClientDimensionChanged((EntityHuman)player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onPacket250Packet(Object... data)
|
||||
{
|
||||
onPacket250Received((EntityHuman)data[1], (Packet250CustomPayload)data[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void notifyPickup(Object... pickupData)
|
||||
{
|
||||
EntityItem item = (EntityItem) pickupData[0];
|
||||
EntityHuman player = (EntityHuman) pickupData[1];
|
||||
onItemPickup(player, item.itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void generate(Random random, int chunkX, int chunkZ, Object... additionalData)
|
||||
{
|
||||
World w = (World) additionalData[0];
|
||||
IChunkProvider cp = (IChunkProvider) additionalData[1];
|
||||
|
||||
if (cp instanceof ChunkProviderHell || cp instanceof NetherChunkGenerator)
|
||||
{
|
||||
generateNether(w, random, chunkX << 4, chunkZ << 4);
|
||||
}
|
||||
else if (cp instanceof ChunkProviderGenerate || cp instanceof NormalChunkGenerator)
|
||||
{
|
||||
generateSurface(w, random, chunkX << 4, chunkZ << 4);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* NO-OP on client side
|
||||
*/
|
||||
@Override
|
||||
public final boolean handleCommand(String command, Object... data)
|
||||
{
|
||||
return onServerCommand(command, (String)data[0], (ICommandListener)data[1]);
|
||||
}
|
||||
@Override
|
||||
public void onRegisterAnimations() {
|
||||
// NOOP on servers
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderHarvest(@SuppressWarnings("rawtypes") Map renderers) {
|
||||
// NOOP on servers
|
||||
}
|
||||
|
||||
// BASEMOD API
|
||||
/**
|
||||
* Override if you wish to provide a fuel item for the furnace and return the fuel value of the item
|
||||
*
|
||||
* @param id
|
||||
* @param metadata
|
||||
* @return
|
||||
*/
|
||||
public int addFuel(int id, int metadata)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void addRenderer(Map<Class<? extends Entity>, Object> renderers)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Override if you wish to perform some action other than just dispensing the item from the dispenser
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param xVel
|
||||
* @param zVel
|
||||
* @param item
|
||||
* @return
|
||||
*/
|
||||
public boolean dispenseEntity(World world, double x, double y, double z, int xVel, int zVel, ItemStack item)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override if you wish to generate Nether (Hell biome) blocks
|
||||
*
|
||||
* @param world
|
||||
* @param random
|
||||
* @param chunkX
|
||||
* @param chunkZ
|
||||
*/
|
||||
public void generateNether(World world, Random random, int chunkX, int chunkZ)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Override if you wish to generate Overworld (not hell or the end) blocks
|
||||
*
|
||||
* @param world
|
||||
* @param random
|
||||
* @param chunkX
|
||||
* @param chunkZ
|
||||
*/
|
||||
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of your mod. Defaults to the class name
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get your mod priorities
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getPriorities()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the version of your mod
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public abstract String getVersion();
|
||||
|
||||
public void keyboardEvent(Object event)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load your mod
|
||||
*/
|
||||
public abstract void load();
|
||||
|
||||
/**
|
||||
* Finish loading your mod
|
||||
*/
|
||||
public void modsLoaded()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle item pickup
|
||||
*
|
||||
* @param player
|
||||
* @param item
|
||||
*/
|
||||
public void onItemPickup(EntityHuman player, ItemStack item)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Ticked every game tick if you have subscribed to tick events through {@link ModLoader#setInGameHook(BaseMod, boolean, boolean)}
|
||||
*
|
||||
* @param minecraftServer the server
|
||||
* @return true to continue receiving ticks
|
||||
*/
|
||||
public boolean onTickInGame(MinecraftServer minecraftServer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onTickInGUI(float tick, Object game, Object gui)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only implemented on the client side
|
||||
* {@link #onChatMessageReceived(EntityPlayer, Packet3Chat)}
|
||||
*
|
||||
* @param text
|
||||
*/
|
||||
public void receiveChatPacket(String text)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Only called on the client side
|
||||
* {@link #onPacket250Received(EntityPlayer, Packet250CustomPayload)}
|
||||
*
|
||||
* @param packet
|
||||
*/
|
||||
public void receiveCustomPacket(Packet250CustomPayload packet)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void registerAnimation(Object game)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void renderInvBlock(Object renderer, Block block, int metadata, int modelID)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public boolean renderWorldBlock(Object renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID)
|
||||
{
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when someone crafts an item from a crafting table
|
||||
*
|
||||
* @param player
|
||||
* @param item
|
||||
* @param matrix
|
||||
*/
|
||||
public void takenFromCrafting(EntityHuman player, ItemStack item, IInventory matrix)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when someone takes a smelted item from a furnace
|
||||
*
|
||||
* @param player
|
||||
* @param item
|
||||
*/
|
||||
public void takenFromFurnace(EntityHuman player, ItemStack item)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* The identifier string for the mod- used in client<->server negotiation
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getName() + " " + getVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a 250 packet is received on a channel registered to this mod
|
||||
*
|
||||
* @param source
|
||||
* @param payload
|
||||
*/
|
||||
public void onPacket250Received(EntityHuman source, Packet250CustomPayload payload)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a chat message is received. Return true to stop further processing
|
||||
*
|
||||
* @param source
|
||||
* @param chat
|
||||
* @return true if you want to consume the message so it is not available for further processing
|
||||
*/
|
||||
public boolean onChatMessageReceived(EntityHuman source, Packet3Chat chat)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Called when a server command is received
|
||||
* @param command
|
||||
* @return true if you want to consume the message so it is not available for further processing
|
||||
*/
|
||||
public boolean onServerCommand(String command, String sender, ICommandListener listener)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a new client logs in.
|
||||
*
|
||||
* @param player
|
||||
*/
|
||||
public void onClientLogin(EntityHuman player)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a client logs out of the server.
|
||||
*
|
||||
* @param player
|
||||
*/
|
||||
public void onClientLogout(EntityHuman player)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Called when a client changes dimensions on the server.
|
||||
*
|
||||
* @param player
|
||||
*/
|
||||
public void onClientDimensionChanged(EntityHuman player)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Spare client junk
|
||||
// -------
|
||||
// void addRenderer(Map<Class<? extends Entity>, Render> renderers);
|
||||
// void registerAnimation(Minecraft game);
|
||||
// void renderInvBlock(RenderBlocks renderer, Block block, int metadata, int modelID);
|
||||
// boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID);
|
||||
// boolean onTickInGUI(float tick, Minecraft game, GuiScreen gui);
|
||||
// void keyboardEvent(KeyBinding event);
|
||||
|
||||
@Override
|
||||
public void keyBindingEvent(Object keybinding) {
|
||||
// NOOP on server
|
||||
}
|
||||
}
|
||||
@@ -1,164 +0,0 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.src.BiomeGenBase;
|
||||
|
||||
import cpw.mods.fml.common.registry.IMinecraftRegistry;
|
||||
import cpw.mods.fml.server.FMLBukkitHandler;
|
||||
|
||||
public class BukkitRegistry implements IMinecraftRegistry
|
||||
{
|
||||
|
||||
@Override
|
||||
public void addRecipe(net.minecraft.src.ItemStack output, Object... params)
|
||||
{
|
||||
CraftingManager.getInstance().registerShapedRecipe((ItemStack) output, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShapelessRecipe(net.minecraft.src.ItemStack output, Object... params)
|
||||
{
|
||||
CraftingManager.getInstance().registerShapelessRecipe((ItemStack) output, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addRecipe(net.minecraft.src.IRecipe recipe)
|
||||
{
|
||||
CraftingManager.getInstance().getRecipies().add(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSmelting(int input, net.minecraft.src.ItemStack output)
|
||||
{
|
||||
FurnaceRecipes.getInstance().registerRecipe(input, (ItemStack) output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlock(net.minecraft.src.Block block)
|
||||
{
|
||||
registerBlock(block, ItemBlock.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlock(net.minecraft.src.Block block, Class <? extends net.minecraft.src.ItemBlock > itemclass)
|
||||
{
|
||||
try
|
||||
{
|
||||
assert block != null : "registerBlock: block cannot be null";
|
||||
assert itemclass != null : "registerBlock: itemclass cannot be null";
|
||||
int blockItemId = ((Block)block).id - 256;
|
||||
itemclass.getConstructor(int.class).newInstance(blockItemId);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//HMMM
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void registerEntityID(Class <? extends net.minecraft.src.Entity > entityClass, String entityName, int id)
|
||||
{
|
||||
EntityTypes.addNewEntityListMapping((Class<? extends Entity>) entityClass, entityName, id);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void registerEntityID(Class <? extends net.minecraft.src.Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
|
||||
{
|
||||
EntityTypes.addNewEntityListMapping((Class<? extends Entity>) entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void registerTileEntity(Class <? extends net.minecraft.src.TileEntity > tileEntityClass, String id)
|
||||
{
|
||||
TileEntity.addNewTileEntityMapping((Class<? extends TileEntity>) tileEntityClass, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBiome(BiomeGenBase biome)
|
||||
{
|
||||
FMLBukkitHandler.instance().addBiomeToDefaultWorldGenerator((BiomeBase) biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSpawn(Class <? extends net.minecraft.src.EntityLiving > entityClass, int weightedProb, int min, int max, net.minecraft.src.EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
|
||||
{
|
||||
BiomeBase[] realBiomes=(BiomeBase[]) biomes;
|
||||
for (BiomeBase biome : realBiomes)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
List<BiomeMeta> spawns = ((BiomeBase)biome).getMobs((EnumCreatureType)typeOfCreature);
|
||||
|
||||
for (BiomeMeta entry : spawns)
|
||||
{
|
||||
//Adjusting an existing spawn entry
|
||||
if (entry.a == entityClass)
|
||||
{
|
||||
entry.d = weightedProb;
|
||||
entry.b = min;
|
||||
entry.c = max;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
spawns.add(new BiomeMeta(entityClass, weightedProb, min, max));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addSpawn(String entityName, int weightedProb, int min, int max, net.minecraft.src.EnumCreatureType spawnList, BiomeGenBase... biomes)
|
||||
{
|
||||
Class <? extends Entity > entityClazz = EntityTypes.getEntityToClassMapping().get(entityName);
|
||||
|
||||
if (EntityLiving.class.isAssignableFrom(entityClazz))
|
||||
{
|
||||
addSpawn((Class <? extends net.minecraft.src.EntityLiving >) entityClazz, weightedProb, min, max, spawnList, biomes);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBiome(BiomeGenBase biome)
|
||||
{
|
||||
FMLBukkitHandler.instance().removeBiomeFromDefaultWorldGenerator((BiomeBase)biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeSpawn(Class <? extends net.minecraft.src.EntityLiving > entityClass, net.minecraft.src.EnumCreatureType typeOfCreature, BiomeGenBase... biomesO)
|
||||
{
|
||||
BiomeBase[] biomes=(BiomeBase[]) biomesO;
|
||||
for (BiomeBase biome : biomes)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
List<BiomeMeta> spawns = ((BiomeBase)biome).getMobs((EnumCreatureType) typeOfCreature);
|
||||
|
||||
Iterator<BiomeMeta> entries = spawns.iterator();
|
||||
while (entries.hasNext())
|
||||
{
|
||||
BiomeMeta entry = entries.next();
|
||||
if (entry.a == entityClass)
|
||||
{
|
||||
entries.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void removeSpawn(String entityName, net.minecraft.src.EnumCreatureType spawnList, BiomeGenBase... biomes)
|
||||
{
|
||||
Class <? extends Entity > entityClazz = EntityTypes.getEntityToClassMapping().get(entityName);
|
||||
|
||||
if (EntityLiving.class.isAssignableFrom(entityClazz))
|
||||
{
|
||||
removeSpawn((Class <? extends net.minecraft.src.EntityLiving >) entityClazz, spawnList, biomes);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; either version 2.1 of the License, or any later version.
|
||||
*
|
||||
* This library 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
import static java.lang.annotation.RetentionPolicy.*;
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
|
||||
/**
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(value = RUNTIME)
|
||||
@Target(value = FIELD)
|
||||
public @interface MLProp
|
||||
{
|
||||
/**
|
||||
* Adds additional help to top of configuration file.
|
||||
*/
|
||||
String info() default "";
|
||||
|
||||
/**
|
||||
* Maximum value allowed if field is a number.
|
||||
*/
|
||||
double max() default Double.MAX_VALUE;
|
||||
|
||||
/**
|
||||
* Minimum value allowed if field is a number.
|
||||
*/
|
||||
double min() default Double.MIN_VALUE;
|
||||
|
||||
/**
|
||||
* Overrides the field name for property key.
|
||||
*/
|
||||
String name() default "";
|
||||
|
||||
}
|
||||
@@ -1,780 +0,0 @@
|
||||
/*
|
||||
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; either version 2.1 of the License, or any later version.
|
||||
*
|
||||
* This library 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.ReflectionHelper;
|
||||
import cpw.mods.fml.common.modloader.ModLoaderHelper;
|
||||
import cpw.mods.fml.common.modloader.ModLoaderModContainer;
|
||||
import cpw.mods.fml.common.registry.FMLRegistry;
|
||||
import cpw.mods.fml.server.FMLBukkitHandler;
|
||||
|
||||
public class ModLoader
|
||||
{
|
||||
/**
|
||||
* Not used on the server.
|
||||
*
|
||||
* @param achievement
|
||||
* @param name
|
||||
* @param description
|
||||
*/
|
||||
public static void addAchievementDesc(Achievement achievement, String name, String description)
|
||||
{
|
||||
String achName=achievement.getName();
|
||||
addLocalization(achName, name);
|
||||
addLocalization(achName+".desc", description);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is a call in hook from modified external code. Implemented elsewhere.
|
||||
*
|
||||
* {@link FMLCommonHandler#fuelLookup(int, int)}
|
||||
*
|
||||
* @param id
|
||||
* @param metadata
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public static int addAllFuel(int id, int metadata)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void addAllRenderers(Map<Class<? extends Entity>, Object> renderers)
|
||||
{
|
||||
}
|
||||
|
||||
public static void addAnimation(Object anim)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is unimplemented in server versions to date.
|
||||
*
|
||||
* @param armor
|
||||
* @return
|
||||
*/
|
||||
public static int addArmor(String armor)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method adds the supplied biome to the set of candidate biomes for the default world generator type.
|
||||
*
|
||||
* @param biome
|
||||
*/
|
||||
public static void addBiome(BiomeBase biome)
|
||||
{
|
||||
FMLRegistry.addBiome(biome);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add localization for the specified string
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
public static void addLocalization(String key, String value)
|
||||
{
|
||||
addLocalization(key, "en_US", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add localization for the specified string
|
||||
*
|
||||
* @param key
|
||||
* @param lang
|
||||
* @param value
|
||||
*/
|
||||
public static void addLocalization(String key, String lang, String value)
|
||||
{
|
||||
FMLCommonHandler.instance().addStringLocalization(key, lang, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name the specified minecraft object with the supplied name
|
||||
*
|
||||
* @param instance
|
||||
* @param name
|
||||
*/
|
||||
public static void addName(Object instance, String name)
|
||||
{
|
||||
addName(instance,"en_US",name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unimplemented on the server as it does not generate names
|
||||
*
|
||||
* @param instance
|
||||
* @param lang
|
||||
* @param name
|
||||
*/
|
||||
public static void addName(Object instance, String lang, String name)
|
||||
{
|
||||
FMLCommonHandler.instance().addNameForObject(instance, lang, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unimplemented on the server as it does not render textures
|
||||
*
|
||||
* @param fileToOverride
|
||||
* @param fileToAdd
|
||||
* @return
|
||||
*/
|
||||
public static int addOverride(String fileToOverride, String fileToAdd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unimplemented on the server as it does not render textures
|
||||
*
|
||||
* @param path
|
||||
* @param overlayPath
|
||||
* @param index
|
||||
*/
|
||||
public static void addOverride(String path, String overlayPath, int index)
|
||||
{
|
||||
// NOOP
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Shaped Recipe
|
||||
*
|
||||
* @param output
|
||||
* @param params
|
||||
*/
|
||||
public static void addRecipe(ItemStack output, Object... params)
|
||||
{
|
||||
FMLRegistry.addRecipe(output, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a shapeless recipe
|
||||
*
|
||||
* @param output
|
||||
* @param params
|
||||
*/
|
||||
public static void addShapelessRecipe(ItemStack output, Object... params)
|
||||
{
|
||||
FMLRegistry.addShapelessRecipe(output, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new product to be smelted
|
||||
*
|
||||
* @param input
|
||||
* @param output
|
||||
*/
|
||||
public static void addSmelting(int input, ItemStack output)
|
||||
{
|
||||
FMLRegistry.addSmelting(input, output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a mob to the spawn list
|
||||
*
|
||||
* @param entityClass
|
||||
* @param weightedProb
|
||||
* @param min
|
||||
* @param max
|
||||
* @param spawnList
|
||||
*/
|
||||
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList)
|
||||
{
|
||||
FMLRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes());
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a mob to the spawn list
|
||||
* @param entityClass
|
||||
* @param weightedProb
|
||||
* @param min
|
||||
* @param max
|
||||
* @param spawnList
|
||||
* @param biomes
|
||||
*/
|
||||
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeBase... biomes)
|
||||
{
|
||||
FMLRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, biomes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a mob to the spawn list
|
||||
*
|
||||
* @param entityName
|
||||
* @param weightedProb
|
||||
* @param min
|
||||
* @param max
|
||||
* @param spawnList
|
||||
*/
|
||||
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList)
|
||||
{
|
||||
FMLRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes());
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a mob to the spawn list
|
||||
* @param entityName
|
||||
* @param weightedProb
|
||||
* @param min
|
||||
* @param max
|
||||
* @param spawnList
|
||||
* @param biomes
|
||||
*/
|
||||
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeBase... biomes)
|
||||
{
|
||||
FMLRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, biomes);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is a call in hook from modified external code. Implemented elsewhere.
|
||||
* {@link FMLBukkitHandler#tryDispensingEntity(World, double, double, double, byte, byte, ItemStack)}
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param xVel
|
||||
* @param zVel
|
||||
* @param item
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean dispenseEntity(World world, double x, double y, double z, int xVel, int zVel, ItemStack item)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a container and drop all the items in it on the ground around
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public static void genericContainerRemoval(World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if (!(te instanceof IInventory))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IInventory inv = (IInventory)te;
|
||||
|
||||
for (int l = 0; l < inv.getSize(); l++)
|
||||
{
|
||||
ItemStack itemstack = inv.getItem(l);
|
||||
|
||||
if (itemstack == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
float f = world.random.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = world.random.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = world.random.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.count > 0)
|
||||
{
|
||||
int i1 = world.random.nextInt(21) + 10;
|
||||
|
||||
if (i1 > itemstack.count)
|
||||
{
|
||||
i1 = itemstack.count ;
|
||||
}
|
||||
|
||||
itemstack.count -= i1;
|
||||
EntityItem entityitem = new EntityItem(world, (float)te.x + f, (float)te.y + f1, (float)te.z + f2, new ItemStack(itemstack.id, i1, itemstack.getData()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motX = (float)world.random.nextGaussian() * f3;
|
||||
entityitem.motY = (float)world.random.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motZ = (float)world.random.nextGaussian() * f3;
|
||||
|
||||
if (itemstack.hasTag())
|
||||
{
|
||||
entityitem.itemStack.setTag((NBTTagCompound)itemstack.getTag().clone());
|
||||
}
|
||||
|
||||
world.addEntity(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all BaseMod loaded into the system
|
||||
* {@link ModLoaderModContainer#findAll}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static List<BaseMod> getLoadedMods()
|
||||
{
|
||||
return ModLoaderModContainer.findAll(BaseMod.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a logger instance {@link FMLCommonHandler#getFMLLogger()}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Logger getLogger()
|
||||
{
|
||||
return FMLCommonHandler.instance().getFMLLogger();
|
||||
}
|
||||
|
||||
public static Object getMinecraftInstance()
|
||||
{
|
||||
return getMinecraftServerInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the minecraft server instance
|
||||
* {@link FMLServerHandler#getServer()}
|
||||
* @return
|
||||
*/
|
||||
public static MinecraftServer getMinecraftServerInstance()
|
||||
{
|
||||
return FMLBukkitHandler.instance().getServer();
|
||||
}
|
||||
/**
|
||||
* Get a value from a field using reflection
|
||||
* {@link ReflectionHelper#getPrivateValue(Class, Object, int)}
|
||||
*
|
||||
* @param instanceclass
|
||||
* @param instance
|
||||
* @param fieldindex
|
||||
* @return
|
||||
*/
|
||||
public static <T, E> T getPrivateValue(Class <? super E > instanceclass, E instance, int fieldindex)
|
||||
{
|
||||
return ReflectionHelper.getPrivateValue(instanceclass, instance, fieldindex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a value from a field using reflection
|
||||
* {@link ReflectionHelper#getPrivateValue(Class, Object, String)}
|
||||
*
|
||||
* @param instanceclass
|
||||
* @param instance
|
||||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static <T, E> T getPrivateValue(Class <? super E > instanceclass, E instance, String field)
|
||||
{
|
||||
return ReflectionHelper.getPrivateValue(instanceclass, instance, field);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stubbed method on the server to return a unique model id
|
||||
*
|
||||
*/
|
||||
public static int getUniqueBlockModelID(BaseMod mod, boolean inventoryRenderer)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a new unique entity id
|
||||
* {@link Entity#getNextId()}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static int getUniqueEntityId()
|
||||
{
|
||||
return FMLCommonHandler.instance().nextUniqueEntityListId();
|
||||
}
|
||||
|
||||
public static int getUniqueSpriteIndex(String path)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* To properly implement packet 250 protocol you should always check your
|
||||
* channel is active prior to sending the packet
|
||||
*
|
||||
* @param player
|
||||
* @param channel
|
||||
* @return
|
||||
*/
|
||||
public static boolean isChannelActive(EntityPlayer player, String channel)
|
||||
{
|
||||
return FMLCommonHandler.instance().isChannelActive(channel, player);
|
||||
}
|
||||
|
||||
public static boolean isGUIOpen(Class<?> gui)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the named mod loaded?
|
||||
* {@link Loader#isModLoaded(String)}
|
||||
*
|
||||
* @param modname
|
||||
* @return
|
||||
*/
|
||||
public static boolean isModLoaded(String modname)
|
||||
{
|
||||
return Loader.isModLoaded(modname);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implemented elsewhere
|
||||
*/
|
||||
@Deprecated
|
||||
public static void loadConfig()
|
||||
{
|
||||
}
|
||||
|
||||
public static Object loadImage(Object renderEngine, String path) throws Exception
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call in from elsewhere. Unimplemented here.
|
||||
* @param player
|
||||
* @param item
|
||||
*/
|
||||
@Deprecated
|
||||
public static void onItemPickup(EntityPlayer player, ItemStack item)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* Call in from elsewhere. Unimplemented here.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void onTick(float tick, Object game)
|
||||
{
|
||||
}
|
||||
|
||||
public static void openGUI(EntityPlayer player, Object gui)
|
||||
{
|
||||
// NOOP
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void populateChunk(IChunkProvider generator, int chunkX, int chunkZ, World world)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is a call in hook from modified external code. Implemented elsewhere.
|
||||
* {@link FMLBukkitHandler#handlePacket250(Packet250CustomPayload, EntityHuman)}
|
||||
*
|
||||
* @param packet
|
||||
*/
|
||||
@Deprecated
|
||||
public static void receivePacket(Packet250CustomPayload packet)
|
||||
{
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static Object[] registerAllKeys(Object[] keys)
|
||||
{
|
||||
return keys;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void registerAllTextureOverrides(Object cache)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new block
|
||||
*
|
||||
* @param block
|
||||
*/
|
||||
public static void registerBlock(Block block)
|
||||
{
|
||||
FMLRegistry.registerBlock(block);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new block
|
||||
*
|
||||
* @param block
|
||||
* @param itemclass
|
||||
*/
|
||||
public static void registerBlock(Block block, Class <? extends ItemBlock > itemclass)
|
||||
{
|
||||
FMLRegistry.registerBlock(block, itemclass);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new entity ID
|
||||
*
|
||||
* @param entityClass
|
||||
* @param entityName
|
||||
* @param id
|
||||
*/
|
||||
public static void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id)
|
||||
{
|
||||
FMLRegistry.registerEntityID(entityClass, entityName, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new entity ID
|
||||
*
|
||||
* @param entityClass
|
||||
* @param entityName
|
||||
* @param id
|
||||
* @param background
|
||||
* @param foreground
|
||||
*/
|
||||
public static void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id, int background, int foreground)
|
||||
{
|
||||
FMLRegistry.registerEntityID(entityClass, entityName, id, background, foreground);
|
||||
}
|
||||
|
||||
public static void registerKey(BaseMod mod, Object keyHandler, boolean allowRepeat)
|
||||
{
|
||||
// NOOP
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the mod for packets on this channel. This only registers the
|
||||
* channel with Forge Mod Loader, not with clients connecting- use
|
||||
* BaseMod.onClientLogin to tell them about your custom channel
|
||||
* {@link FMLCommonHandler#registerChannel(cpw.mods.fml.common.ModContainer, String)}
|
||||
*
|
||||
* @param mod
|
||||
* @param channel
|
||||
*/
|
||||
public static void registerPacketChannel(BaseMod mod, String channel)
|
||||
{
|
||||
FMLCommonHandler.instance().registerChannel(ModLoaderModContainer.findContainerFor(mod), channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new tile entity class
|
||||
*
|
||||
* @param tileEntityClass
|
||||
* @param id
|
||||
*/
|
||||
public static void registerTileEntity(Class <? extends TileEntity > tileEntityClass, String id)
|
||||
{
|
||||
FMLRegistry.registerTileEntity(tileEntityClass, id);
|
||||
}
|
||||
|
||||
public static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id, Object renderer)
|
||||
{
|
||||
FMLRegistry.instance().registerTileEntity(tileEntityClass, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a biome from the list of generated biomes
|
||||
*
|
||||
* @param biome
|
||||
*/
|
||||
public static void removeBiome(BiomeBase biome)
|
||||
{
|
||||
FMLRegistry.removeBiome(biome);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a spawn
|
||||
*
|
||||
* @param entityClass
|
||||
* @param spawnList
|
||||
*/
|
||||
public static void removeSpawn(Class <? extends EntityLiving > entityClass, EnumCreatureType spawnList)
|
||||
{
|
||||
FMLRegistry.removeSpawn(entityClass, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes());
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a spawn
|
||||
*
|
||||
* @param entityClass
|
||||
* @param spawnList
|
||||
* @param biomes
|
||||
*/
|
||||
public static void removeSpawn(Class <? extends EntityLiving > entityClass, EnumCreatureType spawnList, BiomeBase... biomes)
|
||||
{
|
||||
FMLRegistry.removeSpawn(entityClass, spawnList, biomes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a spawn
|
||||
*
|
||||
* @param entityName
|
||||
* @param spawnList
|
||||
*/
|
||||
public static void removeSpawn(String entityName, EnumCreatureType spawnList)
|
||||
{
|
||||
FMLRegistry.removeSpawn(entityName, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes());
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a spawn
|
||||
*
|
||||
* @param entityName
|
||||
* @param spawnList
|
||||
* @param biomes
|
||||
*/
|
||||
public static void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeBase... biomes)
|
||||
{
|
||||
FMLRegistry.removeSpawn(entityName, spawnList, biomes);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean renderBlockIsItemFull3D(int modelID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void renderInvBlock(Object renderer, Block block, int metadata, int modelID)
|
||||
{
|
||||
// NOOP
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean renderWorldBlock(Object renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration is handled elsewhere
|
||||
* {@link ModLoaderModContainer}
|
||||
*/
|
||||
@Deprecated
|
||||
public static void saveConfig()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a chat message to the server
|
||||
* {@link FMLServerHandler#handleChatPacket(Packet3Chat, EntityPlayer)}
|
||||
*
|
||||
* @param text
|
||||
*/
|
||||
@Deprecated
|
||||
public static void serverChat(String text)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void serverLogin(Object handler, Packet1Login loginPacket)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that you want to receive ticks
|
||||
*
|
||||
* @param mod receiving the events
|
||||
* @param enable indicates whether you want to recieve them or not
|
||||
* @param useClock Not used in server side: all ticks are sent on the server side (no render subticks)
|
||||
*/
|
||||
public static void setInGameHook(BaseMod mod, boolean enable, boolean useClock)
|
||||
{
|
||||
ModLoaderHelper.updateStandardTicks(mod, enable, useClock);
|
||||
}
|
||||
|
||||
|
||||
public static void setInGUIHook(BaseMod mod, boolean enable, boolean useClock)
|
||||
{
|
||||
ModLoaderHelper.updateGUITicks(mod, enable, useClock);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a private field to a value using reflection
|
||||
* {@link ReflectionHelper#setPrivateValue(Class, Object, int, Object)}
|
||||
*
|
||||
* @param instanceclass
|
||||
* @param instance
|
||||
* @param fieldindex
|
||||
* @param value
|
||||
*/
|
||||
public static <T, E> void setPrivateValue(Class <? super T > instanceclass, T instance, int fieldindex, E value)
|
||||
{
|
||||
ReflectionHelper.setPrivateValue(instanceclass, instance, fieldindex, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a private field to a value using reflection
|
||||
* {@link ReflectionHelper#setPrivateValue(Class, Object, String, Object)}
|
||||
*
|
||||
* @param instanceclass
|
||||
* @param instance
|
||||
* @param field
|
||||
* @param value
|
||||
*/
|
||||
public static <T, E> void setPrivateValue(Class <? super T > instanceclass, T instance, String field, E value)
|
||||
{
|
||||
ReflectionHelper.setPrivateValue(instanceclass, instance, field, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is a call in hook from modified external code. Implemented elsewhere.
|
||||
* {@link FMLBukkitHandler#onItemCrafted(EntityHuman, ItemStack, IInventory)}
|
||||
*
|
||||
* @param player
|
||||
* @param item
|
||||
* @param matrix
|
||||
*/
|
||||
@Deprecated
|
||||
public static void takenFromCrafting(EntityHuman player, ItemStack item, IInventory matrix)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is a call in hook from modified external code. Implemented elsewhere.
|
||||
* {@link FMLBukkitHandler#onItemSmelted(EntityHuman, ItemStack)}
|
||||
*
|
||||
* @param player
|
||||
* @param item
|
||||
*/
|
||||
@Deprecated
|
||||
public static void takenFromFurnace(EntityHuman player, ItemStack item)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Throw the offered exception. Likely will stop the game.
|
||||
* {@link FMLBukkitHandler#raiseException(Throwable, String, boolean)}
|
||||
* @param message
|
||||
* @param e
|
||||
*/
|
||||
public static void throwException(String message, Throwable e)
|
||||
{
|
||||
FMLBukkitHandler.instance().raiseException(e, message, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* To properly implement packet 250 protocol you should always check your channel
|
||||
* is active prior to sending the packet
|
||||
*
|
||||
* @param player
|
||||
* @param channel
|
||||
* @return
|
||||
*/
|
||||
public static boolean isChannelActive(EntityHuman player, String channel)
|
||||
{
|
||||
return FMLCommonHandler.instance().isChannelActive(channel, player);
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* The FML Forge Mod Loader suite.
|
||||
* Copyright (C) 2012 cpw
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; either version 2.1 of the License, or any later version.
|
||||
*
|
||||
* This library 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface SidedProxy
|
||||
{
|
||||
/**
|
||||
* The name of the client side class to load and populate
|
||||
* @return
|
||||
*/
|
||||
String clientSide() default "";
|
||||
|
||||
/**
|
||||
* The name of the server side class to load and populate
|
||||
* @return
|
||||
*/
|
||||
String serverSide() default "";
|
||||
|
||||
/**
|
||||
* The name of the a special bukkit plugin class to load and populate
|
||||
*/
|
||||
String bukkitSide() default "";
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public interface BiomeGenBase {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public interface Block {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public interface Entity {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public interface EntityLiving {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public interface EnumCreatureType {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public interface IRecipe {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public interface ItemBlock {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public interface ItemStack {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public interface TileEntity {
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
import sys
|
||||
import os, os.path, shutil
|
||||
import fnmatch
|
||||
import re
|
||||
|
||||
def main():
|
||||
sys.stdout.flush()
|
||||
for x in range(1, len(sys.argv)):
|
||||
cleanup_source(sys.argv[x])
|
||||
|
||||
count = 0
|
||||
def cleanup_source(path):
|
||||
path = os.path.normpath(path)
|
||||
regex_cases_before = re.compile(r'((case|default).+\r?\n)\r?\n', re.MULTILINE) #Fixes newline after case before case body
|
||||
regex_cases_after = re.compile(r'\r?\n(\r?\n[ \t]+(case|default))', re.MULTILINE) #Fixes newline after case body before new case
|
||||
|
||||
def updatefile(src_file):
|
||||
global count
|
||||
tmp_file = src_file + '.tmp'
|
||||
count = 0
|
||||
with open(src_file, 'r') as fh:
|
||||
buf = fh.read()
|
||||
|
||||
def fix_cases(match):
|
||||
global count
|
||||
count += 1
|
||||
return match.group(1)
|
||||
|
||||
buf = regex_cases_before.sub(fix_cases, buf)
|
||||
buf = regex_cases_after.sub(fix_cases, buf)
|
||||
if count > 0:
|
||||
with open(tmp_file, 'w') as fh:
|
||||
fh.write(buf)
|
||||
shutil.move(tmp_file, src_file)
|
||||
|
||||
for path, _, filelist in os.walk(path, followlinks=True):
|
||||
sub_dir = os.path.relpath(path, path)
|
||||
for cur_file in fnmatch.filter(filelist, '*.java'):
|
||||
src_file = os.path.normpath(os.path.join(path, cur_file))
|
||||
updatefile(src_file)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,30 +0,0 @@
|
||||
package cpw.mods.fml.client;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.renderer.texture.Texture;
|
||||
import net.minecraft.client.renderer.texture.TextureStitched;
|
||||
|
||||
public class CopySubimageTextureHelper extends TextureHelper {
|
||||
@Override
|
||||
public void doTextureCopy(Texture atlas, Texture source, int atlasX, int atlasY)
|
||||
{
|
||||
if (atlas.func_94282_c() == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
atlas.func_94277_a(0);
|
||||
ByteBuffer buffer = source.func_94273_h();
|
||||
buffer.position(0);
|
||||
GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, atlasX, atlasY, source.func_94275_d(), source.func_94276_e(), GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doTextureUpload(TextureStitched source)
|
||||
{
|
||||
// NO OP for copysubimage
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.client;
|
||||
|
||||
import java.awt.Dimension;
|
||||
|
||||
import net.minecraft.client.renderer.RenderEngine;
|
||||
import net.minecraft.client.texturepacks.ITexturePack;
|
||||
|
||||
public interface ITextureFX
|
||||
{
|
||||
public void onTexturePackChanged(RenderEngine engine, ITexturePack texturepack, Dimension dimensions);
|
||||
|
||||
public void onTextureDimensionsUpdate(int width, int height);
|
||||
|
||||
public void setErrored(boolean errored);
|
||||
|
||||
public boolean getErrored();
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package cpw.mods.fml.client;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.renderer.texture.Texture;
|
||||
import net.minecraft.client.renderer.texture.TextureStitched;
|
||||
|
||||
public class OpenGL43TextureHelper extends TextureHelper {
|
||||
|
||||
public OpenGL43TextureHelper()
|
||||
{
|
||||
// GL43.
|
||||
// glCopyMethod = Class.forName("org.lwjgl.OpenGL")
|
||||
}
|
||||
@Override
|
||||
public void doTextureCopy(Texture atlas, Texture source, int atlasX, int atlasY)
|
||||
{
|
||||
// System.out.printf("Src: %d Targ: %d, Coords %d %d %d %d\n", source.func_94282_c(), atlas.func_94282_c(), atlasX, atlasY, source.func_94275_d(), source.func_94276_e());
|
||||
// GL43.glCopyImageSubData(source.func_94282_c(), GL11.GL_TEXTURE_2D, 0, 0, 0, 0, atlas.func_94282_c(), GL11.GL_TEXTURE_2D, 0, atlasX, atlasY, 0, source.func_94275_d(), source.func_94276_e(), 1);
|
||||
// System.out.printf("Err: %x\n", GL11.glGetError());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doTextureUpload(TextureStitched source)
|
||||
{
|
||||
// source.createAndUploadTextures();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package cpw.mods.fml.client;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.Texture;
|
||||
import net.minecraft.client.renderer.texture.TextureStitched;
|
||||
|
||||
public abstract class TextureHelper {
|
||||
|
||||
/**
|
||||
* Copy the texture from the source to the atlas at the specified position
|
||||
*
|
||||
* This will use the devised GL helper to do either GL-side copy or a subimage upload
|
||||
*
|
||||
* @param atlas The atlas texture we're copying into
|
||||
* @param source The source texture we're copying from (complete)
|
||||
* @param atlasX The X position on the atlas
|
||||
* @param atlasY The Y position on the atlas
|
||||
*/
|
||||
public abstract void doTextureCopy(Texture atlas, Texture source, int atlasX, int atlasY);
|
||||
|
||||
/**
|
||||
* Upload the texture to the GPU for GL side copying operations
|
||||
* This may be a no-op depending on the active implementation.
|
||||
*
|
||||
* @param source The texture to upload
|
||||
*/
|
||||
public abstract void doTextureUpload(TextureStitched source);
|
||||
|
||||
/**
|
||||
* Rotate the texture so that it doesn't need a rotational transform applied each tick
|
||||
*
|
||||
* @param texture The texture to rotate
|
||||
* @param buffer The buffer for the texture
|
||||
*/
|
||||
public void rotateTexture(Texture texture, ByteBuffer buffer)
|
||||
{
|
||||
ByteBuffer bytebuffer = buffer;
|
||||
buffer.position(0);
|
||||
ByteBuffer other = ByteBuffer.allocateDirect(buffer.capacity());
|
||||
other.position(0);
|
||||
|
||||
int texHeight = texture.func_94276_e();
|
||||
int texWidth = texture.func_94275_d();
|
||||
|
||||
for (int row = 0; row < texHeight; ++row)
|
||||
{
|
||||
int targCol = texHeight - row - 1;
|
||||
int srcRowOffset = row * texWidth;
|
||||
|
||||
for (int col = 0; col < texWidth; ++col)
|
||||
{
|
||||
int targIndex = col * texHeight + targCol;
|
||||
int srcIndex = srcRowOffset + col;
|
||||
|
||||
srcIndex <<=2;
|
||||
targIndex <<=2;
|
||||
|
||||
other.put(targIndex + 0, bytebuffer.get(srcIndex + 0));
|
||||
other.put(targIndex + 1, bytebuffer.get(srcIndex + 1));
|
||||
other.put(targIndex + 2, bytebuffer.get(srcIndex + 2));
|
||||
other.put(targIndex + 3, bytebuffer.get(srcIndex + 3));
|
||||
}
|
||||
}
|
||||
buffer.position(0);
|
||||
buffer.put(other);
|
||||
}
|
||||
|
||||
}
|
||||
-271
@@ -1,271 +0,0 @@
|
||||
--- commands.py
|
||||
+++ commands.py
|
||||
@@ -58,6 +58,8 @@
|
||||
|
||||
|
||||
def reallyrmtree(path):
|
||||
+ if os.path.isfile(os.path.join(path, 'asm-4.1.tar.gz')): #Check if asm exists, indicating the libs folder, if so, don't delete it
|
||||
+ return
|
||||
if not sys.platform.startswith('win'):
|
||||
if os.path.exists(path):
|
||||
shutil.rmtree(path)
|
||||
@@ -139,6 +141,8 @@
|
||||
fieldnames = csvreader.fieldnames
|
||||
return set(fieldnames)
|
||||
|
||||
+def commands_sanity_check():
|
||||
+ print 'Commands patch applied successfully'
|
||||
|
||||
class Commands(object):
|
||||
"""Contains the commands and initialisation for a full mcp run"""
|
||||
@@ -194,6 +198,7 @@
|
||||
sys.exit(1)
|
||||
|
||||
self.checkjava()
|
||||
+ self.checkscala()
|
||||
self.readcommands(verify, no_patch=no_patch)
|
||||
|
||||
def checkcommand(self, name, command, java=False, single_line=False, check_return=True, error=True):
|
||||
@@ -230,6 +235,8 @@
|
||||
self.checkcommand('java', '%s -version' % self.cmdjava)
|
||||
self.checkcommand('javac', '%s -version' % self.cmdjavac)
|
||||
self.checkcommand('javac runtime', '%s -J-version' % self.cmdjavac)
|
||||
+ if self.cmdscalac: self.checkcommand('scalac', '%s -version' % self.cmdscalac)
|
||||
+ if self.cmdscalac: self.checkcommand('scalac runtime', '%s -J-version' % self.cmdscalac)
|
||||
self.checkcommand('retroguard', '%s --version' % self.retroguard, java=True)
|
||||
|
||||
self.exceptor = os.path.normpath(self.config.get('COMMANDS', 'Exceptor'))
|
||||
@@ -350,6 +357,8 @@
|
||||
self.cmdfernflower = self.config.get('COMMANDS', 'CmdFernflower', raw=1) % (self.cmdjava, self.fernflower)
|
||||
self.cmdexceptor = self.config.get('COMMANDS', 'CmdExceptor', raw=1) % (self.cmdjava, self.exceptor)
|
||||
self.cmdrecomp = self.config.get('COMMANDS', 'CmdRecomp', raw=1) % self.cmdjavac
|
||||
+ if self.cmdscalac: self.cmdrecompscalac = self.config.get('COMMANDS', 'CmdRecompScalac', raw=1) % self.cmdscalac
|
||||
+ else: self.cmdrecompscalac = None
|
||||
self.cmdstartsrv = self.config.get('COMMANDS', 'CmdStartSrv', raw=1) % self.cmdjava
|
||||
self.cmdstartclt = self.config.get('COMMANDS', 'CmdStartClt', raw=1) % self.cmdjava
|
||||
|
||||
@@ -753,6 +762,36 @@
|
||||
self.cmdjavac = '"%s"' % os.path.join(results[0], 'javac')
|
||||
self.cmdjava = '"%s"' % os.path.join(results[0], 'java')
|
||||
|
||||
+ def checkscala(self):
|
||||
+ results = []
|
||||
+ if not results:
|
||||
+ try:
|
||||
+ # TODO: Verify at least version 2.10
|
||||
+ self.runcmd('scalac -version', quiet=True)
|
||||
+ results.append('')
|
||||
+ except (CalledProcessError, OSError):
|
||||
+ pass
|
||||
+ if not results: # Stupid windows...
|
||||
+ try:
|
||||
+ # TODO: Verify at least version 2.10
|
||||
+ self.runcmd('scalac.bat -version', quiet=True)
|
||||
+ results.append('')
|
||||
+ except (CalledProcessError, OSError):
|
||||
+ pass
|
||||
+ try:
|
||||
+ self.runcmd('scala -target:jvm-1.6 -version', quiet=True)
|
||||
+ results.append('')
|
||||
+ except (CalledProcessError, OSError):
|
||||
+ self.logger.info('"scala" does not support jvm-1.6 target, it is out of date. Ignoring')
|
||||
+ results = []
|
||||
+ self.cmdscalac = None
|
||||
+ else:
|
||||
+ if not results:
|
||||
+ self.logger.warning('"scalac" is not found on the PATH. Scala files will not be recompiled')
|
||||
+ self.cmdscalac = None
|
||||
+ else:
|
||||
+ self.cmdscalac = '"%s"' % os.path.join(results[0], 'scalac')
|
||||
+
|
||||
def checkjars(self, side):
|
||||
jarlk = {CLIENT: self.jarclient, SERVER: self.jarserver}
|
||||
md5jarlk = {CLIENT: self.md5jarclt, SERVER: self.md5jarsrv}
|
||||
@@ -798,6 +837,8 @@
|
||||
binlk = {CLIENT: self.binclient, SERVER: self.binserver}
|
||||
testlk = {CLIENT: self.testclient, SERVER: self.testserver}
|
||||
|
||||
+ if side == SERVER and not os.path.exists(os.path.join(binlk[side], os.path.normpath(testlk[side] + '.class'))):
|
||||
+ return self.checkbins(CLIENT)
|
||||
if not os.path.exists(os.path.join(binlk[side], os.path.normpath(testlk[side] + '.class'))):
|
||||
return False
|
||||
return True
|
||||
@@ -1038,6 +1079,9 @@
|
||||
pathbinlk = {CLIENT: self.binclient, SERVER: self.binserver}
|
||||
pathsrclk = {CLIENT: self.srcclient, SERVER: self.srcserver}
|
||||
pathlog = {CLIENT: self.clientrecomplog, SERVER: self.serverrecomplog}
|
||||
+
|
||||
+ if side == SERVER: #Warn about server because FML recombines it into client
|
||||
+ self.logger.info('Server side recompiling might be skipped, this is normal, do not complain to FML/Forge team about server side.')
|
||||
|
||||
if not os.path.exists(pathbinlk[side]):
|
||||
os.makedirs(pathbinlk[side])
|
||||
@@ -1051,6 +1095,29 @@
|
||||
all_files = True
|
||||
append_pattern = False
|
||||
pkglist = filterdirs(pathsrclk[side], '*.java', append_pattern=append_pattern, all_files=all_files)
|
||||
+ if self.cmdrecompscalac: # Compile scala before java as scala scans java files, but not vice-versa
|
||||
+ pkglistscala = pkglist[:]
|
||||
+ pkglistscala.extend(filterdirs(pathsrclk[side], '*.scala', append_pattern=append_pattern, all_files=all_files))
|
||||
+ dirs = ' '.join(pkglistscala)
|
||||
+ classpath = os.pathsep.join(cplk[side])
|
||||
+ forkcmd = self.cmdrecompscalac.format(classpath=classpath, sourcepath=pathsrclk[side], outpath=pathbinlk[side], pkgs=dirs)
|
||||
+ try:
|
||||
+ self.runcmd(forkcmd, log_file=pathlog[side])
|
||||
+ except CalledProcessError as ex:
|
||||
+ self.logger.error('')
|
||||
+ self.logger.error('== ERRORS FOUND in SCALA CODE ==')
|
||||
+ self.logger.error('')
|
||||
+ for line in ex.output.splitlines():
|
||||
+ if line.strip():
|
||||
+ if line.find("jvm-1.6") != -1:
|
||||
+ self.logger.error(' === Your scala version is out of date, update to at least 2.10.0 ===')
|
||||
+ if line[0] != '[' and line[0:4] != 'Note':
|
||||
+ self.logger.error(line)
|
||||
+ if '^' in line:
|
||||
+ self.logger.error('')
|
||||
+ self.logger.error('================================')
|
||||
+ self.logger.error('')
|
||||
+ raise
|
||||
dirs = ' '.join(pkglist)
|
||||
classpath = os.pathsep.join(cplk[side])
|
||||
forkcmd = self.cmdrecomp.format(classpath=classpath, sourcepath=pathsrclk[side], outpath=pathbinlk[side],
|
||||
@@ -1059,7 +1126,7 @@
|
||||
self.runcmd(forkcmd, log_file=pathlog[side])
|
||||
except CalledProcessError as ex:
|
||||
self.logger.error('')
|
||||
- self.logger.error('== ERRORS FOUND ==')
|
||||
+ self.logger.error('== ERRORS FOUND in JAVA CODE ==')
|
||||
self.logger.error('')
|
||||
for line in ex.output.splitlines():
|
||||
if line.strip():
|
||||
@@ -1072,7 +1139,7 @@
|
||||
raise
|
||||
|
||||
def startserver(self):
|
||||
- classpath = [self.binserver] + self.cpathserver
|
||||
+ classpath = [self.binclient, self.srcclient] + self.cpathserver
|
||||
classpath = [os.path.join('..', p) for p in classpath]
|
||||
classpath = os.pathsep.join(classpath)
|
||||
os.chdir(self.dirjars)
|
||||
@@ -1080,7 +1147,7 @@
|
||||
self.runmc(forkcmd)
|
||||
|
||||
def startclient(self):
|
||||
- classpath = [self.binclient] + self.cpathclient
|
||||
+ classpath = [self.binclient, self.srcclient] + self.cpathclient
|
||||
classpath = [os.path.join('..', p) for p in classpath]
|
||||
classpath = os.pathsep.join(classpath)
|
||||
natives = os.path.join('..', self.dirnatives)
|
||||
@@ -1207,20 +1274,20 @@
|
||||
with open(self.csvmethods, 'rb') as fh:
|
||||
methodsreader = csv.DictReader(fh)
|
||||
for row in methodsreader:
|
||||
- if int(row['side']) == side:
|
||||
+ if int(row['side']) == side or int(row['side']) == 2:
|
||||
if row['name'] != row['searge']:
|
||||
names['methods'][row['searge']] = row['name']
|
||||
with open(self.csvfields, 'rb') as fh:
|
||||
fieldsreader = csv.DictReader(fh)
|
||||
for row in fieldsreader:
|
||||
- if int(row['side']) == side:
|
||||
+ if int(row['side']) == side or int(row['side']) == 2:
|
||||
if row['name'] != row['searge']:
|
||||
names['fields'][row['searge']] = row['name']
|
||||
if self.has_param_csv:
|
||||
with open(self.csvparams, 'rb') as fh:
|
||||
paramsreader = csv.DictReader(fh)
|
||||
for row in paramsreader:
|
||||
- if int(row['side']) == side:
|
||||
+ if int(row['side']) == side or int(row['side']) == 2:
|
||||
names['params'][row['param']] = row['name']
|
||||
|
||||
regexps = {
|
||||
@@ -1354,13 +1421,13 @@
|
||||
methods = {}
|
||||
for row in methodsreader:
|
||||
#HINT: Only include methods that have a non-empty description
|
||||
- if int(row['side']) == side and row['desc']:
|
||||
+ if (int(row['side']) == side or int(row['side']) == 2) and row['desc']:
|
||||
methods[row['searge']] = row['desc'].replace('*/', '* /')
|
||||
|
||||
fields = {}
|
||||
for row in fieldsreader:
|
||||
#HINT: Only include fields that have a non-empty description
|
||||
- if int(row['side']) == side and row['desc']:
|
||||
+ if (int(row['side']) == side or int(row['side']) == 2) and row['desc']:
|
||||
fields[row['searge']] = row['desc'].replace('*/', '* /')
|
||||
|
||||
regexps = {
|
||||
@@ -1437,7 +1504,7 @@
|
||||
self.runcmd(forkcmd)
|
||||
return True
|
||||
|
||||
- def gathermd5s(self, side, reobf=False):
|
||||
+ def gathermd5s(self, side, reobf=False, skip_fml=False):
|
||||
if not reobf:
|
||||
md5lk = {CLIENT: self.md5client, SERVER: self.md5server}
|
||||
else:
|
||||
@@ -1452,6 +1519,9 @@
|
||||
class_path = ''
|
||||
else:
|
||||
class_path += '/'
|
||||
+ if skip_fml:
|
||||
+ if class_path.startswith('cpw/'):
|
||||
+ continue
|
||||
for class_file in fnmatch.filter(filelist, '*.class'):
|
||||
class_name = class_path + os.path.splitext(class_file)[0]
|
||||
bin_file = os.path.normpath(os.path.join(path, class_file))
|
||||
@@ -1548,6 +1618,8 @@
|
||||
if not os.path.exists(outpathlk[side]):
|
||||
os.makedirs(outpathlk[side])
|
||||
|
||||
+ reserved = ['CON', 'PRN', 'AUX', 'NUL', 'COM1', 'COM2', 'COM3', 'COM4', 'COM5', 'COM6', 'COM7', 'COM8', 'COM9', 'LPT1', 'LPT2', 'LPT3', 'LPT4', 'LPT5', 'LPT6', 'LPT7', 'LPT8', 'LPT9']
|
||||
+
|
||||
# HINT: We extract the modified class files
|
||||
with closing(zipfile.ZipFile(jarlk[side])) as zipjar:
|
||||
for in_class in trgclasses:
|
||||
@@ -1561,6 +1633,23 @@
|
||||
out_class = out_class.replace(self.nullpkg, '')
|
||||
if out_class[0] == '/':
|
||||
out_class = out_class[1:]
|
||||
+
|
||||
+ rename = False
|
||||
+ for res in reserved:
|
||||
+ if out_class.upper().startswith(res):
|
||||
+ rename = True
|
||||
+ break
|
||||
+
|
||||
+ if rename:
|
||||
+ try:
|
||||
+ f = open(os.path.join(outpathlk[side], '_' + out_class), 'wb')
|
||||
+ f.write(zipjar.read(out_class))
|
||||
+ f.close()
|
||||
+ self.logger.info('> Outputted %s to %s as %s', in_class.ljust(35), outpathlk[side], '_' + out_class)
|
||||
+ except IOError:
|
||||
+ self.logger.error('* File %s failed extracting for %s', out_class, in_class)
|
||||
+ continue
|
||||
+
|
||||
try:
|
||||
zipjar.extract(out_class, outpathlk[side])
|
||||
self.logger.info('> Outputted %s to %s as %s', in_class.ljust(35), outpathlk[side], out_class)
|
||||
@@ -1607,6 +1696,9 @@
|
||||
sys.exit(1)
|
||||
|
||||
for entry in newfiles:
|
||||
+ if 'commands.py' in entry[0]: #FML, Disable updating of Commands.py
|
||||
+ print 'Update to runtime/commands.py found, but disbled due to using fml'
|
||||
+ continue
|
||||
if entry[3] == 'U':
|
||||
self.logger.info('Retrieving file from server : %s', entry[0])
|
||||
cur_file = os.path.normpath(entry[0])
|
||||
@@ -1627,6 +1719,9 @@
|
||||
md5reoblk = {CLIENT: self.md5reobfclient, SERVER: self.md5reobfserver}
|
||||
outpathlk = {CLIENT: self.srcmodclient, SERVER: self.srcmodserver}
|
||||
src = {CLIENT: self.srcclient, SERVER: self.srcserver}
|
||||
+
|
||||
+ if side == SERVER: #Noop out server side stuff
|
||||
+ return
|
||||
|
||||
# HINT: We need a table for the old md5 and the new ones
|
||||
md5table = {}
|
||||
@@ -1,52 +0,0 @@
|
||||
package cpw.mods.fml.common;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public interface ILanguageAdapter {
|
||||
public Object getNewInstance(FMLModContainer container, Class<?> objectClass, ClassLoader classLoader) throws Exception;
|
||||
public boolean supportsStatics();
|
||||
public void setProxy(Field target, Class<?> proxyTarget, Object proxy) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException;
|
||||
|
||||
public static class ScalaAdapter implements ILanguageAdapter {
|
||||
@Override
|
||||
public Object getNewInstance(FMLModContainer container, Class<?> scalaObjectClass, ClassLoader classLoader) throws Exception
|
||||
{
|
||||
Class<?> sObjectClass = Class.forName(scalaObjectClass.getName()+"$",true,classLoader);
|
||||
return sObjectClass.getField("MODULE$").get(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsStatics()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProxy(Field target, Class<?> proxyTarget, Object proxy) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException
|
||||
{
|
||||
Field field = proxyTarget.getField("INSTANCE");
|
||||
Object scalaObject = field.get(null);
|
||||
target.set(scalaObject, proxy);
|
||||
}
|
||||
}
|
||||
public static class JavaAdapter implements ILanguageAdapter {
|
||||
@Override
|
||||
public Object getNewInstance(FMLModContainer container, Class<?> objectClass, ClassLoader classLoader) throws Exception
|
||||
{
|
||||
return objectClass.newInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsStatics()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProxy(Field target, Class<?> proxyTarget, Object proxy) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException,
|
||||
SecurityException
|
||||
{
|
||||
target.set(null, proxy);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.common;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface SidedProxy
|
||||
{
|
||||
/**
|
||||
* The name of the client side class to load and populate
|
||||
*/
|
||||
String clientSide() default "";
|
||||
|
||||
/**
|
||||
* The name of the server side class to load and populate
|
||||
*/
|
||||
String serverSide() default "";
|
||||
|
||||
/**
|
||||
* The name of a special bukkit plugin class to load and populate
|
||||
*/
|
||||
String bukkitSide() default "";
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.common.asm;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.ObjectInputStream.GetField;
|
||||
import java.io.StringReader;
|
||||
import java.net.JarURLConnection;
|
||||
import java.nio.charset.Charset;
|
||||
import java.security.CodeSource;
|
||||
import java.security.cert.CertPath;
|
||||
import java.security.cert.CertPathValidator;
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.security.cert.PKIXCertPathValidatorResult;
|
||||
import java.security.cert.PKIXParameters;
|
||||
import java.security.cert.TrustAnchor;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.FieldVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import cpw.mods.fml.common.CertificateHelper;
|
||||
import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
|
||||
import cpw.mods.fml.relauncher.FMLRelaunchLog;
|
||||
import cpw.mods.fml.relauncher.IFMLCallHook;
|
||||
import cpw.mods.fml.relauncher.RelaunchClassLoader;
|
||||
|
||||
public class FMLSanityChecker implements IFMLCallHook
|
||||
{
|
||||
private static final String FMLFINGERPRINT = "AE:F6:54:79:96:E9:1B:D1:59:70:6C:B4:6B:F5:4A:89:C5:CE:08:1D".toLowerCase().replace(":","");
|
||||
private static final String FORGEFINGERPRINT = "DE:4C:F8:A3:F3:BC:15:63:58:10:04:4C:39:24:0B:F9:68:04:EA:7D".toLowerCase().replace(":", "");
|
||||
static class MLDetectorClassVisitor extends ClassVisitor
|
||||
{
|
||||
private boolean foundMarker = false;
|
||||
private MLDetectorClassVisitor()
|
||||
{
|
||||
super(Opcodes.ASM4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldVisitor visitField(int arg0, String arg1, String arg2, String arg3, Object arg4)
|
||||
{
|
||||
if ("fmlMarker".equals(arg1))
|
||||
{
|
||||
foundMarker = true;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private RelaunchClassLoader cl;
|
||||
|
||||
@Override
|
||||
public Void call() throws Exception
|
||||
{
|
||||
CodeSource codeSource = getClass().getProtectionDomain().getCodeSource();
|
||||
boolean goodFML = false;
|
||||
if (codeSource.getLocation().getProtocol().equals("jar"))
|
||||
{
|
||||
Certificate[] certificates = codeSource.getCertificates();
|
||||
if (certificates!=null)
|
||||
{
|
||||
|
||||
for (Certificate cert : certificates)
|
||||
{
|
||||
String fingerprint = CertificateHelper.getFingerprint(cert);
|
||||
if (fingerprint.equals(FMLFINGERPRINT))
|
||||
{
|
||||
FMLRelaunchLog.info("Found valid fingerprint for FML. Certificate fingerprint %s", fingerprint);
|
||||
goodFML = true;
|
||||
}
|
||||
else if (fingerprint.equals(FORGEFINGERPRINT))
|
||||
{
|
||||
FMLRelaunchLog.info("Found valid fingerprint for Minecraft Forge. Certificate fingerprint %s", fingerprint);
|
||||
goodFML = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLRelaunchLog.severe("Found invalid fingerprint for FML: %s", fingerprint);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
goodFML = true;
|
||||
}
|
||||
if (!goodFML)
|
||||
{
|
||||
FMLRelaunchLog.severe("FML appears to be missing any signature data. This is not a good thing");
|
||||
}
|
||||
byte[] mlClass = cl.getClassBytes("ModLoader");
|
||||
// Only care in obfuscated env
|
||||
if (mlClass == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
MLDetectorClassVisitor mlTester = new MLDetectorClassVisitor();
|
||||
ClassReader cr = new ClassReader(mlClass);
|
||||
cr.accept(mlTester, ClassReader.SKIP_CODE);
|
||||
if (!mlTester.foundMarker)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "<html>CRITICAL ERROR<br/>" +
|
||||
"ModLoader was detected in this environment<br/>" +
|
||||
"ForgeModLoader cannot be installed alongside ModLoader<br/>" +
|
||||
"All mods should work without ModLoader being installed<br/>" +
|
||||
"Because ForgeModLoader is 100% compatible with ModLoader<br/>" +
|
||||
"Re-install Minecraft Forge or Forge ModLoader into a clean<br/>" +
|
||||
"jar and try again.",
|
||||
"ForgeModLoader critical error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
throw new RuntimeException("Invalid ModLoader class detected");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectData(Map<String, Object> data)
|
||||
{
|
||||
cl = (RelaunchClassLoader) data.get("classLoader");
|
||||
FMLDeobfuscatingRemapper.INSTANCE.setup((File)data.get("mcLocation"), cl, (String) data.get("deobfuscationFileName"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.relauncher;
|
||||
|
||||
public class ArgsWrapper
|
||||
{
|
||||
public ArgsWrapper(String[] args)
|
||||
{
|
||||
this.args=args;
|
||||
}
|
||||
|
||||
public String[] args;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.relauncher;
|
||||
|
||||
public class CoreFMLLibraries implements ILibrarySet
|
||||
{
|
||||
private static String[] libraries = { "argo-small-3.2.jar","guava-14.0-rc3.jar","asm-all-4.1.jar", "bcprov-jdk15on-148.jar", FMLInjectionData.debfuscationDataName(), "scala-library.jar" };
|
||||
private static String[] checksums = { "58912ea2858d168c50781f956fa5b59f0f7c6b51", "931ae21fa8014c3ce686aaa621eae565fefb1a6a", "054986e962b88d8660ae4566475658469595ef58", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65", FMLInjectionData.deobfuscationDataHash, "458d046151ad179c85429ed7420ffb1eaf6ddf85" };
|
||||
|
||||
@Override
|
||||
public String[] getLibraries()
|
||||
{
|
||||
return libraries;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getHashes()
|
||||
{
|
||||
return checksums;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRootURL()
|
||||
{
|
||||
return System.getProperty("fml.core.libraries.mirror", "http://files.minecraftforge.net/fmllibs/%s");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,152 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.relauncher;
|
||||
|
||||
import java.awt.Dialog.ModalityType;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JProgressBar;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
public class Downloader extends JOptionPane implements IDownloadDisplay
|
||||
{
|
||||
private JDialog container;
|
||||
private JLabel currentActivity;
|
||||
private JProgressBar progress;
|
||||
boolean stopIt;
|
||||
Thread pokeThread;
|
||||
|
||||
private Box makeProgressPanel()
|
||||
{
|
||||
Box box = Box.createVerticalBox();
|
||||
box.add(Box.createRigidArea(new Dimension(0,10)));
|
||||
JLabel welcomeLabel = new JLabel("<html><b><font size='+1'>FML is setting up your minecraft environment</font></b></html>");
|
||||
box.add(welcomeLabel);
|
||||
welcomeLabel.setAlignmentY(LEFT_ALIGNMENT);
|
||||
welcomeLabel = new JLabel("<html>Please wait, FML has some tasks to do before you can play</html>");
|
||||
welcomeLabel.setAlignmentY(LEFT_ALIGNMENT);
|
||||
box.add(welcomeLabel);
|
||||
box.add(Box.createRigidArea(new Dimension(0,10)));
|
||||
currentActivity = new JLabel("Currently doing ...");
|
||||
box.add(currentActivity);
|
||||
box.add(Box.createRigidArea(new Dimension(0,10)));
|
||||
progress = new JProgressBar(0, 100);
|
||||
progress.setStringPainted(true);
|
||||
box.add(progress);
|
||||
box.add(Box.createRigidArea(new Dimension(0,30)));
|
||||
return box;
|
||||
}
|
||||
|
||||
public JDialog makeDialog()
|
||||
{
|
||||
setMessageType(JOptionPane.INFORMATION_MESSAGE);
|
||||
setMessage(makeProgressPanel());
|
||||
setOptions(new Object[] { "Stop" });
|
||||
addPropertyChangeListener(new PropertyChangeListener()
|
||||
{
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt)
|
||||
{
|
||||
if (evt.getSource() == Downloader.this && evt.getPropertyName()==VALUE_PROPERTY)
|
||||
{
|
||||
requestClose("This will stop minecraft from launching\nAre you sure you want to do this?");
|
||||
}
|
||||
}
|
||||
});
|
||||
container = new JDialog(null, "Hello", ModalityType.MODELESS);
|
||||
container.setResizable(false);
|
||||
container.setLocationRelativeTo(null);
|
||||
container.add(this);
|
||||
this.updateUI();
|
||||
container.pack();
|
||||
container.setMinimumSize(container.getPreferredSize());
|
||||
container.setVisible(true);
|
||||
container.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||
container.addWindowListener(new WindowAdapter()
|
||||
{
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e)
|
||||
{
|
||||
requestClose("Closing this window will stop minecraft from launching\nAre you sure you wish to do this?");
|
||||
}
|
||||
});
|
||||
return container;
|
||||
}
|
||||
protected void requestClose(String message)
|
||||
{
|
||||
int shouldClose = JOptionPane.showConfirmDialog(container, message, "Are you sure you want to stop?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
|
||||
if (shouldClose == JOptionPane.YES_OPTION)
|
||||
{
|
||||
container.dispose();
|
||||
}
|
||||
stopIt = true;
|
||||
if (pokeThread != null)
|
||||
{
|
||||
pokeThread.interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateProgressString(String progressUpdate, Object... data)
|
||||
{
|
||||
FMLLog.finest(progressUpdate, data);
|
||||
if (currentActivity!=null)
|
||||
{
|
||||
currentActivity.setText(String.format(progressUpdate,data));
|
||||
}
|
||||
}
|
||||
|
||||
public void resetProgress(int sizeGuess)
|
||||
{
|
||||
if (progress!=null)
|
||||
{
|
||||
progress.getModel().setRangeProperties(0, 0, 0, sizeGuess, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateProgress(int fullLength)
|
||||
{
|
||||
if (progress!=null)
|
||||
{
|
||||
progress.getModel().setValue(fullLength);
|
||||
}
|
||||
}
|
||||
|
||||
public void makeHeadless()
|
||||
{
|
||||
container = null;
|
||||
progress = null;
|
||||
currentActivity = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPokeThread(Thread currentThread)
|
||||
{
|
||||
this.pokeThread = currentThread;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldStopIt()
|
||||
{
|
||||
return stopIt;
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.relauncher;
|
||||
|
||||
public class DummyDownloader implements IDownloadDisplay
|
||||
{
|
||||
|
||||
@Override
|
||||
public void resetProgress(int sizeGuess)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPokeThread(Thread currentThread)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgress(int fullLength)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldStopIt()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressString(String string, Object... data)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object makeDialog()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void makeHeadless()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,335 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.relauncher;
|
||||
|
||||
import java.applet.Applet;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URLClassLoader;
|
||||
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
public class FMLRelauncher
|
||||
{
|
||||
private static FMLRelauncher INSTANCE;
|
||||
public static String logFileNamePattern;
|
||||
private static String side;
|
||||
private RelaunchClassLoader classLoader;
|
||||
private Object newApplet;
|
||||
private Class<? super Object> appletClass;
|
||||
|
||||
JDialog popupWindow;
|
||||
|
||||
public static void handleClientRelaunch(ArgsWrapper wrap)
|
||||
{
|
||||
logFileNamePattern = "ForgeModLoader-client-%g.log";
|
||||
side = "CLIENT";
|
||||
instance().relaunchClient(wrap);
|
||||
}
|
||||
|
||||
public static void handleServerRelaunch(ArgsWrapper wrap)
|
||||
{
|
||||
logFileNamePattern = "ForgeModLoader-server-%g.log";
|
||||
side = "SERVER";
|
||||
instance().relaunchServer(wrap);
|
||||
}
|
||||
|
||||
static FMLRelauncher instance()
|
||||
{
|
||||
if (INSTANCE == null)
|
||||
{
|
||||
INSTANCE = new FMLRelauncher();
|
||||
}
|
||||
return INSTANCE;
|
||||
|
||||
}
|
||||
|
||||
private FMLRelauncher()
|
||||
{
|
||||
URLClassLoader ucl = (URLClassLoader) getClass().getClassLoader();
|
||||
|
||||
classLoader = new RelaunchClassLoader(ucl.getURLs());
|
||||
|
||||
}
|
||||
|
||||
private void showWindow(boolean showIt)
|
||||
{
|
||||
if (RelaunchLibraryManager.downloadMonitor != null) { return; }
|
||||
try
|
||||
{
|
||||
if (showIt)
|
||||
{
|
||||
RelaunchLibraryManager.downloadMonitor = new Downloader();
|
||||
popupWindow = (JDialog) RelaunchLibraryManager.downloadMonitor.makeDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
RelaunchLibraryManager.downloadMonitor = new DummyDownloader();
|
||||
}
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
if (RelaunchLibraryManager.downloadMonitor == null)
|
||||
{
|
||||
RelaunchLibraryManager.downloadMonitor = new DummyDownloader();
|
||||
e.printStackTrace();
|
||||
}
|
||||
else
|
||||
{
|
||||
RelaunchLibraryManager.downloadMonitor.makeHeadless();
|
||||
}
|
||||
popupWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void relaunchClient(ArgsWrapper wrap)
|
||||
{
|
||||
showWindow(true);
|
||||
// Now we re-inject the home into the "new" minecraft under our control
|
||||
Class<? super Object> client;
|
||||
try
|
||||
{
|
||||
File minecraftHome = computeExistingClientHome();
|
||||
setupHome(minecraftHome);
|
||||
|
||||
client = setupNewClientHome(minecraftHome);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (popupWindow != null)
|
||||
{
|
||||
popupWindow.setVisible(false);
|
||||
popupWindow.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
if (RelaunchLibraryManager.downloadMonitor.shouldStopIt())
|
||||
{
|
||||
System.exit(1);
|
||||
}
|
||||
try
|
||||
{
|
||||
ReflectionHelper.findMethod(client, null, new String[] { "fmlReentry" }, ArgsWrapper.class).invoke(null, wrap);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
// Hmmm
|
||||
}
|
||||
}
|
||||
|
||||
private Class<? super Object> setupNewClientHome(File minecraftHome)
|
||||
{
|
||||
Class<? super Object> client = ReflectionHelper.getClass(classLoader, "net.minecraft.client.Minecraft");
|
||||
ReflectionHelper.setPrivateValue(client, null, minecraftHome,
|
||||
"field_" + "71463_am" /*Separate that so that MCP's updatenames does not replace it*/,
|
||||
"an", "minecraftDir");
|
||||
return client;
|
||||
}
|
||||
|
||||
private void relaunchServer(ArgsWrapper wrap)
|
||||
{
|
||||
showWindow(false);
|
||||
// Now we re-inject the home into the "new" minecraft under our control
|
||||
Class<? super Object> server;
|
||||
File minecraftHome = new File(".");
|
||||
setupHome(minecraftHome);
|
||||
|
||||
server = ReflectionHelper.getClass(classLoader, "net.minecraft.server.MinecraftServer");
|
||||
try
|
||||
{
|
||||
ReflectionHelper.findMethod(server, null, new String[] { "fmlReentry" }, ArgsWrapper.class).invoke(null, wrap);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void setupHome(File minecraftHome)
|
||||
{
|
||||
FMLInjectionData.build(minecraftHome, classLoader);
|
||||
FMLRelaunchLog.minecraftHome = minecraftHome;
|
||||
FMLRelaunchLog.info("Forge Mod Loader version %s.%s.%s.%s for Minecraft %s loading", FMLInjectionData.major, FMLInjectionData.minor,
|
||||
FMLInjectionData.rev, FMLInjectionData.build, FMLInjectionData.mccversion, FMLInjectionData.mcpversion);
|
||||
FMLRelaunchLog.info("Java is %s, version %s, running on %s:%s:%s, installed at %s", System.getProperty("java.vm.name"), System.getProperty("java.version"), System.getProperty("os.name"), System.getProperty("os.arch"), System.getProperty("os.version"), System.getProperty("java.home"));
|
||||
FMLRelaunchLog.fine("Java classpath at launch is %s", System.getProperty("java.class.path"));
|
||||
FMLRelaunchLog.fine("Java library path at launch is %s", System.getProperty("java.library.path"));
|
||||
|
||||
try
|
||||
{
|
||||
RelaunchLibraryManager.handleLaunch(minecraftHome, classLoader);
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
if (popupWindow != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
String logFile = new File(minecraftHome, "ForgeModLoader-client-0.log").getCanonicalPath();
|
||||
JOptionPane.showMessageDialog(popupWindow, String.format(
|
||||
"<html><div align=\"center\"><font size=\"+1\">There was a fatal error starting up minecraft and FML</font></div><br/>"
|
||||
+ "Minecraft cannot launch in it's current configuration<br/>"
|
||||
+ "Please consult the file <i><a href=\"file:///%s\">%s</a></i> for further information</html>", logFile, logFile),
|
||||
"Fatal FML error", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// ah well, we tried
|
||||
}
|
||||
}
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the location of the client home
|
||||
*/
|
||||
private File computeExistingClientHome()
|
||||
{
|
||||
Class<? super Object> mcMaster = ReflectionHelper.getClass(getClass().getClassLoader(), "net.minecraft.client.Minecraft");
|
||||
// If we get the system property we inject into the old MC, setup the
|
||||
// dir, then pull the value
|
||||
String str = System.getProperty("minecraft.applet.TargetDirectory");
|
||||
if (str != null)
|
||||
{
|
||||
str = str.replace('/', File.separatorChar);
|
||||
ReflectionHelper.setPrivateValue(mcMaster, null, new File(str), "minecraftDir", "an", "minecraftDir");
|
||||
}
|
||||
// We force minecraft to setup it's homedir very early on so we can
|
||||
// inject stuff into it
|
||||
Method setupHome = ReflectionHelper.findMethod(mcMaster, null, new String[] { "func_71380_b", "getMinecraftDir", "b" });
|
||||
try
|
||||
{
|
||||
setupHome.invoke(null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// Hmmm
|
||||
}
|
||||
File minecraftHome = ReflectionHelper.getPrivateValue(mcMaster, null, "field_71463_am", "an", "minecraftDir");
|
||||
return minecraftHome;
|
||||
}
|
||||
|
||||
public static void appletEntry(Applet minecraftApplet)
|
||||
{
|
||||
side = "CLIENT";
|
||||
logFileNamePattern = "ForgeModLoader-client-%g.log";
|
||||
instance().relaunchApplet(minecraftApplet);
|
||||
}
|
||||
|
||||
private void relaunchApplet(Applet minecraftApplet)
|
||||
{
|
||||
showWindow(true);
|
||||
|
||||
if (minecraftApplet.getClass().getClassLoader() == classLoader)
|
||||
{
|
||||
if (popupWindow != null)
|
||||
{
|
||||
popupWindow.setVisible(false);
|
||||
popupWindow.dispose();
|
||||
}
|
||||
try
|
||||
{
|
||||
newApplet = minecraftApplet;
|
||||
appletClass = ReflectionHelper.getClass(classLoader, "net.minecraft.client.MinecraftApplet");
|
||||
ReflectionHelper.findMethod(appletClass, newApplet, new String[] { "fmlInitReentry" }).invoke(newApplet);
|
||||
return;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("FMLRelauncher.relaunchApplet");
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
File mcDir = computeExistingClientHome();
|
||||
setupHome(mcDir);
|
||||
setupNewClientHome(mcDir);
|
||||
|
||||
Class<? super Object> parentAppletClass = ReflectionHelper.getClass(getClass().getClassLoader(), "java.applet.Applet");
|
||||
|
||||
try
|
||||
{
|
||||
appletClass = ReflectionHelper.getClass(classLoader, "net.minecraft.client.MinecraftApplet");
|
||||
newApplet = appletClass.newInstance();
|
||||
Object appletContainer = ReflectionHelper.getPrivateValue(ReflectionHelper.getClass(getClass().getClassLoader(), "java.awt.Component"),
|
||||
minecraftApplet, "parent");
|
||||
|
||||
String launcherClassName = System.getProperty("minecraft.applet.WrapperClass", "net.minecraft.Launcher");
|
||||
Class<? super Object> launcherClass = ReflectionHelper.getClass(getClass().getClassLoader(), launcherClassName);
|
||||
if (launcherClass.isInstance(appletContainer))
|
||||
{
|
||||
ReflectionHelper.findMethod(ReflectionHelper.getClass(getClass().getClassLoader(), "java.awt.Container"), minecraftApplet,
|
||||
new String[] { "removeAll" }).invoke(appletContainer);
|
||||
ReflectionHelper.findMethod(launcherClass, appletContainer, new String[] { "replace" }, parentAppletClass).invoke(appletContainer, newApplet);
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLRelaunchLog.severe("Found unknown applet parent %s, unable to inject!\n", appletContainer.getClass().getName());
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (popupWindow != null)
|
||||
{
|
||||
popupWindow.setVisible(false);
|
||||
popupWindow.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void appletStart(Applet applet)
|
||||
{
|
||||
instance().startApplet(applet);
|
||||
}
|
||||
|
||||
private void startApplet(Applet applet)
|
||||
{
|
||||
if (applet.getClass().getClassLoader() == classLoader)
|
||||
{
|
||||
if (popupWindow != null)
|
||||
{
|
||||
popupWindow.setVisible(false);
|
||||
popupWindow.dispose();
|
||||
}
|
||||
if (RelaunchLibraryManager.downloadMonitor.shouldStopIt())
|
||||
{
|
||||
System.exit(1);
|
||||
}
|
||||
try
|
||||
{
|
||||
ReflectionHelper.findMethod(appletClass, newApplet, new String[] { "fmlStartReentry" }).invoke(newApplet);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("FMLRelauncher.startApplet");
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
public static String side()
|
||||
{
|
||||
return side;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.relauncher;
|
||||
|
||||
public interface IClassNameTransformer {
|
||||
public String remapClassName(String name);
|
||||
|
||||
public String unmapClassName(String name);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.relauncher;
|
||||
|
||||
public interface IClassTransformer
|
||||
{
|
||||
public byte[] transform(String name, String transformedName, byte[] bytes);
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.relauncher;
|
||||
|
||||
import javax.swing.JDialog;
|
||||
|
||||
public interface IDownloadDisplay
|
||||
{
|
||||
|
||||
void resetProgress(int sizeGuess);
|
||||
|
||||
void setPokeThread(Thread currentThread);
|
||||
|
||||
void updateProgress(int fullLength);
|
||||
|
||||
boolean shouldStopIt();
|
||||
|
||||
void updateProgressString(String string, Object ... data);
|
||||
|
||||
Object makeDialog();
|
||||
|
||||
void makeHeadless();
|
||||
|
||||
}
|
||||
@@ -1,471 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.relauncher;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.JarURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.net.URLConnection;
|
||||
import java.security.CodeSigner;
|
||||
import java.security.CodeSource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.jar.Attributes.Name;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.jar.Manifest;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
public class RelaunchClassLoader extends URLClassLoader
|
||||
{
|
||||
private List<URL> sources;
|
||||
private ClassLoader parent;
|
||||
|
||||
private List<IClassTransformer> transformers;
|
||||
private Map<String, Class> cachedClasses;
|
||||
private Set<String> invalidClasses;
|
||||
|
||||
private Set<String> classLoaderExceptions = new HashSet<String>();
|
||||
private Set<String> transformerExceptions = new HashSet<String>();
|
||||
private Map<Package,Manifest> packageManifests = new HashMap<Package,Manifest>();
|
||||
private IClassNameTransformer renameTransformer;
|
||||
|
||||
private static Manifest EMPTY = new Manifest();
|
||||
|
||||
private ThreadLocal<byte[]> loadBuffer = new ThreadLocal<byte[]>();
|
||||
|
||||
private static final String[] RESERVED = {"CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"};
|
||||
|
||||
private static final boolean DEBUG_CLASSLOADING = Boolean.parseBoolean(System.getProperty("fml.debugClassLoading", "false"));
|
||||
private static final boolean DEBUG_CLASSLOADING_FINER = DEBUG_CLASSLOADING && Boolean.parseBoolean(System.getProperty("fml.debugClassLoadingFiner", "false"));
|
||||
private static final boolean DEBUG_CLASSLOADING_SAVE = DEBUG_CLASSLOADING && Boolean.parseBoolean(System.getProperty("fml.debugClassLoadingSave", "false"));
|
||||
private static File temp_folder = null;
|
||||
|
||||
public RelaunchClassLoader(URL[] sources)
|
||||
{
|
||||
super(sources, null);
|
||||
this.sources = new ArrayList<URL>(Arrays.asList(sources));
|
||||
this.parent = getClass().getClassLoader();
|
||||
this.cachedClasses = new HashMap<String,Class>(1000);
|
||||
this.invalidClasses = new HashSet<String>(1000);
|
||||
this.transformers = new ArrayList<IClassTransformer>(2);
|
||||
// ReflectionHelper.setPrivateValue(ClassLoader.class, null, this, "scl");
|
||||
Thread.currentThread().setContextClassLoader(this);
|
||||
|
||||
// standard classloader exclusions
|
||||
addClassLoaderExclusion("java.");
|
||||
addClassLoaderExclusion("sun.");
|
||||
addClassLoaderExclusion("org.lwjgl.");
|
||||
addClassLoaderExclusion("cpw.mods.fml.relauncher.");
|
||||
addClassLoaderExclusion("net.minecraftforge.classloading.");
|
||||
|
||||
// standard transformer exclusions
|
||||
addTransformerExclusion("javax.");
|
||||
addTransformerExclusion("argo.");
|
||||
addTransformerExclusion("org.objectweb.asm.");
|
||||
addTransformerExclusion("com.google.common.");
|
||||
addTransformerExclusion("org.bouncycastle.");
|
||||
addTransformerExclusion("cpw.mods.fml.common.asm.transformers.deobf.");
|
||||
|
||||
if (DEBUG_CLASSLOADING_SAVE)
|
||||
{
|
||||
int x = 1;
|
||||
temp_folder = new File(FMLRelaunchLog.minecraftHome, "CLASSLOADER_TEMP");
|
||||
while(temp_folder.exists() && x <= 10)
|
||||
{
|
||||
temp_folder = new File(FMLRelaunchLog.minecraftHome, "CLASSLOADER_TEMP" + x++);
|
||||
}
|
||||
|
||||
if (temp_folder.exists())
|
||||
{
|
||||
FMLRelaunchLog.info("DEBUG_CLASSLOADING_SAVE enabled, but 10 temp directories already exist, clean them and try again.");
|
||||
temp_folder = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLRelaunchLog.info("DEBUG_CLASSLOADING_SAVE Enabled, saving all classes to \"%s\"", temp_folder.getAbsolutePath().replace('\\', '/'));
|
||||
temp_folder.mkdirs();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void registerTransformer(String transformerClassName)
|
||||
{
|
||||
try
|
||||
{
|
||||
IClassTransformer transformer = (IClassTransformer) loadClass(transformerClassName).newInstance();
|
||||
transformers.add(transformer);
|
||||
if (transformer instanceof IClassNameTransformer && renameTransformer == null)
|
||||
{
|
||||
renameTransformer = (IClassNameTransformer) transformer;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.SEVERE, e, "A critical problem occured registering the ASM transformer class %s", transformerClassName);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Class<?> findClass(String name) throws ClassNotFoundException
|
||||
{
|
||||
if (invalidClasses.contains(name))
|
||||
{
|
||||
throw new ClassNotFoundException(name);
|
||||
}
|
||||
for (String st : classLoaderExceptions)
|
||||
{
|
||||
if (name.startsWith(st))
|
||||
{
|
||||
return parent.loadClass(name);
|
||||
}
|
||||
}
|
||||
|
||||
if (cachedClasses.containsKey(name))
|
||||
{
|
||||
return cachedClasses.get(name);
|
||||
}
|
||||
|
||||
for (String st : transformerExceptions)
|
||||
{
|
||||
if (name.startsWith(st))
|
||||
{
|
||||
try
|
||||
{
|
||||
Class<?> cl = super.findClass(name);
|
||||
cachedClasses.put(name, cl);
|
||||
return cl;
|
||||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
invalidClasses.add(name);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
CodeSigner[] signers = null;
|
||||
String transformedName = transformName(name);
|
||||
String untransformedName = untransformName(name);
|
||||
int lastDot = untransformedName.lastIndexOf('.');
|
||||
String pkgname = lastDot == -1 ? "" : untransformedName.substring(0, lastDot);
|
||||
String fName = untransformedName.replace('.', '/').concat(".class");
|
||||
String pkgPath = pkgname.replace('.', '/');
|
||||
URLConnection urlConnection = findCodeSourceConnectionFor(fName);
|
||||
if (urlConnection instanceof JarURLConnection && lastDot > -1 && !untransformedName.startsWith("net.minecraft."))
|
||||
{
|
||||
JarURLConnection jarUrlConn = (JarURLConnection)urlConnection;
|
||||
JarFile jf = jarUrlConn.getJarFile();
|
||||
if (jf != null && jf.getManifest() != null)
|
||||
{
|
||||
Manifest mf = jf.getManifest();
|
||||
JarEntry ent = jf.getJarEntry(fName);
|
||||
Package pkg = getPackage(pkgname);
|
||||
getClassBytes(untransformedName);
|
||||
signers = ent.getCodeSigners();
|
||||
if (pkg == null)
|
||||
{
|
||||
pkg = definePackage(pkgname, mf, jarUrlConn.getJarFileURL());
|
||||
packageManifests.put(pkg, mf);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pkg.isSealed() && !pkg.isSealed(jarUrlConn.getJarFileURL()))
|
||||
{
|
||||
FMLLog.severe("The jar file %s is trying to seal already secured path %s", jf.getName(), pkgname);
|
||||
}
|
||||
else if (isSealed(pkgname, mf))
|
||||
{
|
||||
FMLLog.severe("The jar file %s has a security seal for path %s, but that path is defined and not secure", jf.getName(), pkgname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lastDot > -1 && !untransformedName.startsWith("net.minecraft."))
|
||||
{
|
||||
Package pkg = getPackage(pkgname);
|
||||
if (pkg == null)
|
||||
{
|
||||
pkg = definePackage(pkgname, null, null, null, null, null, null, null);
|
||||
packageManifests.put(pkg, EMPTY);
|
||||
}
|
||||
else if (pkg.isSealed())
|
||||
{
|
||||
FMLLog.severe("The URL %s is defining elements for sealed path %s", urlConnection.getURL(), pkgname);
|
||||
}
|
||||
}
|
||||
byte[] basicClass = getClassBytes(untransformedName);
|
||||
byte[] transformedClass = runTransformers(untransformedName, transformedName, basicClass);
|
||||
saveTransformedClass(transformedClass, transformedName);
|
||||
Class<?> cl = defineClass(transformedName, transformedClass, 0, transformedClass.length, (urlConnection == null ? null : new CodeSource(urlConnection.getURL(), signers)));
|
||||
cachedClasses.put(transformedName, cl);
|
||||
return cl;
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
invalidClasses.add(name);
|
||||
if (DEBUG_CLASSLOADING)
|
||||
{
|
||||
FMLLog.log(Level.FINEST, e, "Exception encountered attempting classloading of %s", name);
|
||||
}
|
||||
throw new ClassNotFoundException(name, e);
|
||||
}
|
||||
}
|
||||
|
||||
private void saveTransformedClass(byte[] data, String transformedName)
|
||||
{
|
||||
if (!DEBUG_CLASSLOADING_SAVE || temp_folder == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
File outFile = new File(temp_folder, transformedName.replace('.', File.separatorChar) + ".class");
|
||||
File outDir = outFile.getParentFile();
|
||||
|
||||
if (!outDir.exists())
|
||||
{
|
||||
outDir.mkdirs();
|
||||
}
|
||||
|
||||
if (outFile.exists())
|
||||
{
|
||||
outFile.delete();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
FMLRelaunchLog.fine("Saving transformed class \"%s\" to \"%s\"", transformedName, outFile.getAbsolutePath().replace('\\', '/'));
|
||||
OutputStream output = new FileOutputStream(outFile);
|
||||
output.write(data);
|
||||
output.close();
|
||||
}
|
||||
catch(IOException ex)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.WARNING, ex, "Could not save transformed class \"%s\"", transformedName);
|
||||
}
|
||||
}
|
||||
|
||||
private String untransformName(String name)
|
||||
{
|
||||
if (renameTransformer != null)
|
||||
{
|
||||
return renameTransformer.unmapClassName(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
private String transformName(String name)
|
||||
{
|
||||
if (renameTransformer != null)
|
||||
{
|
||||
return renameTransformer.remapClassName(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isSealed(String path, Manifest man)
|
||||
{
|
||||
Attributes attr = man.getAttributes(path);
|
||||
String sealed = null;
|
||||
if (attr != null) {
|
||||
sealed = attr.getValue(Name.SEALED);
|
||||
}
|
||||
if (sealed == null) {
|
||||
if ((attr = man.getMainAttributes()) != null) {
|
||||
sealed = attr.getValue(Name.SEALED);
|
||||
}
|
||||
}
|
||||
return "true".equalsIgnoreCase(sealed);
|
||||
}
|
||||
|
||||
private URLConnection findCodeSourceConnectionFor(String name)
|
||||
{
|
||||
URL res = findResource(name);
|
||||
if (res != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
return res.openConnection();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private byte[] runTransformers(String name, String transformedName, byte[] basicClass)
|
||||
{
|
||||
if (DEBUG_CLASSLOADING_FINER)
|
||||
{
|
||||
FMLRelaunchLog.finest("Beginning transform of %s (%s) Start Length: %d", name, transformedName, (basicClass == null ? 0 : basicClass.length));
|
||||
for (IClassTransformer transformer : transformers)
|
||||
{
|
||||
String transName = transformer.getClass().getName();
|
||||
FMLRelaunchLog.finest("Before Transformer %s: %d", transName, (basicClass == null ? 0 : basicClass.length));
|
||||
basicClass = transformer.transform(name, transformedName, basicClass);
|
||||
FMLRelaunchLog.finest("After Transformer %s: %d", transName, (basicClass == null ? 0 : basicClass.length));
|
||||
}
|
||||
FMLRelaunchLog.finest("Ending transform of %s (%s) Start Length: %d", name, transformedName, (basicClass == null ? 0 : basicClass.length));
|
||||
}
|
||||
else
|
||||
{
|
||||
for (IClassTransformer transformer : transformers)
|
||||
{
|
||||
basicClass = transformer.transform(name, transformedName, basicClass);
|
||||
}
|
||||
}
|
||||
return basicClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addURL(URL url)
|
||||
{
|
||||
super.addURL(url);
|
||||
sources.add(url);
|
||||
}
|
||||
|
||||
public List<URL> getSources()
|
||||
{
|
||||
return sources;
|
||||
}
|
||||
|
||||
|
||||
private byte[] readFully(InputStream stream)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] buf = loadBuffer.get();
|
||||
if (buf == null)
|
||||
{
|
||||
loadBuffer.set(new byte[1 << 12]);
|
||||
buf = loadBuffer.get();
|
||||
}
|
||||
|
||||
int r, totalLength = 0;
|
||||
while ((r = stream.read(buf, totalLength, buf.length - totalLength)) != -1)
|
||||
{
|
||||
totalLength += r;
|
||||
if (totalLength >= buf.length - 1)
|
||||
{
|
||||
byte[] oldbuf = buf;
|
||||
buf = new byte[ oldbuf.length + (1 << 12 )];
|
||||
System.arraycopy(oldbuf, 0, buf, 0, oldbuf.length);
|
||||
}
|
||||
}
|
||||
|
||||
byte[] result = new byte[totalLength];
|
||||
System.arraycopy(buf, 0, result, 0, totalLength);
|
||||
return result;
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.WARNING, t, "Problem loading class");
|
||||
return new byte[0];
|
||||
}
|
||||
}
|
||||
|
||||
public List<IClassTransformer> getTransformers()
|
||||
{
|
||||
return Collections.unmodifiableList(transformers);
|
||||
}
|
||||
|
||||
private void addClassLoaderExclusion(String toExclude)
|
||||
{
|
||||
classLoaderExceptions.add(toExclude);
|
||||
}
|
||||
|
||||
void addTransformerExclusion(String toExclude)
|
||||
{
|
||||
transformerExceptions.add(toExclude);
|
||||
}
|
||||
|
||||
public byte[] getClassBytes(String name) throws IOException
|
||||
{
|
||||
if (name.indexOf('.') == -1)
|
||||
{
|
||||
for (String res : RESERVED)
|
||||
{
|
||||
if (name.toUpperCase(Locale.ENGLISH).startsWith(res))
|
||||
{
|
||||
byte[] data = getClassBytes("_" + name);
|
||||
if (data != null)
|
||||
{
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InputStream classStream = null;
|
||||
try
|
||||
{
|
||||
URL classResource = findResource(name.replace('.', '/').concat(".class"));
|
||||
if (classResource == null)
|
||||
{
|
||||
if (DEBUG_CLASSLOADING)
|
||||
{
|
||||
FMLLog.finest("Failed to find class resource %s", name.replace('.', '/').concat(".class"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
classStream = classResource.openStream();
|
||||
if (DEBUG_CLASSLOADING)
|
||||
{
|
||||
FMLLog.finest("Loading class %s from resource %s", name, classResource.toString());
|
||||
}
|
||||
return readFully(classStream);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (classStream != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
classStream.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// Swallow the close exception
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,630 +0,0 @@
|
||||
/*
|
||||
* Forge Mod Loader
|
||||
* Copyright (c) 2012-2013 cpw.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
||||
package cpw.mods.fml.relauncher;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InterruptedIOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.MappedByteBuffer;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.FileChannel.MapMode;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import cpw.mods.fml.common.CertificateHelper;
|
||||
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion;
|
||||
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;
|
||||
|
||||
public class RelaunchLibraryManager
|
||||
{
|
||||
private static String[] rootPlugins = { "cpw.mods.fml.relauncher.FMLCorePlugin" , "net.minecraftforge.classloading.FMLForgePlugin" };
|
||||
private static List<String> loadedLibraries = new ArrayList<String>();
|
||||
private static Map<IFMLLoadingPlugin, File> pluginLocations;
|
||||
private static List<IFMLLoadingPlugin> loadPlugins;
|
||||
private static List<ILibrarySet> libraries;
|
||||
private static boolean deobfuscatedEnvironment;
|
||||
|
||||
public static void handleLaunch(File mcDir, RelaunchClassLoader actualClassLoader)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Are we in a 'decompiled' environment?
|
||||
byte[] bs = actualClassLoader.getClassBytes("net.minecraft.world.World");
|
||||
if (bs != null)
|
||||
{
|
||||
FMLRelaunchLog.info("Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation");
|
||||
deobfuscatedEnvironment = true;
|
||||
}
|
||||
}
|
||||
catch (IOException e1)
|
||||
{
|
||||
}
|
||||
|
||||
if (!deobfuscatedEnvironment)
|
||||
{
|
||||
FMLRelaunchLog.fine("Enabling runtime deobfuscation");
|
||||
}
|
||||
pluginLocations = new HashMap<IFMLLoadingPlugin, File>();
|
||||
loadPlugins = new ArrayList<IFMLLoadingPlugin>();
|
||||
libraries = new ArrayList<ILibrarySet>();
|
||||
for (String s : rootPlugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
IFMLLoadingPlugin plugin = (IFMLLoadingPlugin) Class.forName(s, true, actualClassLoader).newInstance();
|
||||
loadPlugins.add(plugin);
|
||||
for (String libName : plugin.getLibraryRequestClass())
|
||||
{
|
||||
libraries.add((ILibrarySet) Class.forName(libName, true, actualClassLoader).newInstance());
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// HMMM
|
||||
}
|
||||
}
|
||||
|
||||
if (loadPlugins.isEmpty())
|
||||
{
|
||||
throw new RuntimeException("A fatal error has occured - no valid fml load plugin was found - this is a completely corrupt FML installation.");
|
||||
}
|
||||
|
||||
downloadMonitor.updateProgressString("All core mods are successfully located");
|
||||
// Now that we have the root plugins loaded - lets see what else might be around
|
||||
String commandLineCoremods = System.getProperty("fml.coreMods.load","");
|
||||
for (String s : commandLineCoremods.split(","))
|
||||
{
|
||||
if (s.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
FMLRelaunchLog.info("Found a command line coremod : %s", s);
|
||||
try
|
||||
{
|
||||
actualClassLoader.addTransformerExclusion(s);
|
||||
Class<?> coreModClass = Class.forName(s, true, actualClassLoader);
|
||||
TransformerExclusions trExclusions = coreModClass.getAnnotation(IFMLLoadingPlugin.TransformerExclusions.class);
|
||||
if (trExclusions!=null)
|
||||
{
|
||||
for (String st : trExclusions.value())
|
||||
{
|
||||
actualClassLoader.addTransformerExclusion(st);
|
||||
}
|
||||
}
|
||||
IFMLLoadingPlugin plugin = (IFMLLoadingPlugin) coreModClass.newInstance();
|
||||
loadPlugins.add(plugin);
|
||||
if (plugin.getLibraryRequestClass()!=null)
|
||||
{
|
||||
for (String libName : plugin.getLibraryRequestClass())
|
||||
{
|
||||
libraries.add((ILibrarySet) Class.forName(libName, true, actualClassLoader).newInstance());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.SEVERE,e,"Exception occured trying to load coremod %s",s);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
discoverCoreMods(mcDir, actualClassLoader, loadPlugins, libraries);
|
||||
|
||||
List<Throwable> caughtErrors = new ArrayList<Throwable>();
|
||||
try
|
||||
{
|
||||
File libDir;
|
||||
try
|
||||
{
|
||||
libDir = setupLibDir(mcDir);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
caughtErrors.add(e);
|
||||
return;
|
||||
}
|
||||
|
||||
for (ILibrarySet lib : libraries)
|
||||
{
|
||||
for (int i=0; i<lib.getLibraries().length; i++)
|
||||
{
|
||||
boolean download = false;
|
||||
String libName = lib.getLibraries()[i];
|
||||
String targFileName = libName.lastIndexOf('/')>=0 ? libName.substring(libName.lastIndexOf('/')) : libName;
|
||||
String checksum = lib.getHashes()[i];
|
||||
File libFile = new File(libDir, targFileName);
|
||||
if (!libFile.exists())
|
||||
{
|
||||
try
|
||||
{
|
||||
downloadFile(libFile, lib.getRootURL(), libName, checksum);
|
||||
download = true;
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
caughtErrors.add(e);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (libFile.exists() && !libFile.isFile())
|
||||
{
|
||||
caughtErrors.add(new RuntimeException(String.format("Found a file %s that is not a normal file - you should clear this out of the way", libName)));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!download)
|
||||
{
|
||||
try
|
||||
{
|
||||
FileInputStream fis = new FileInputStream(libFile);
|
||||
FileChannel chan = fis.getChannel();
|
||||
MappedByteBuffer mappedFile = chan.map(MapMode.READ_ONLY, 0, libFile.length());
|
||||
String fileChecksum = generateChecksum(mappedFile);
|
||||
fis.close();
|
||||
// bad checksum and I did not download this file
|
||||
if (!checksum.equals(fileChecksum))
|
||||
{
|
||||
caughtErrors.add(new RuntimeException(String.format("The file %s was found in your lib directory and has an invalid checksum %s (expecting %s) - it is unlikely to be the correct download, please move it out of the way and try again.", libName, fileChecksum, checksum)));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.SEVERE, e, "The library file %s could not be validated", libFile.getName());
|
||||
caughtErrors.add(new RuntimeException(String.format("The library file %s could not be validated", libFile.getName()),e));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!download)
|
||||
{
|
||||
downloadMonitor.updateProgressString("Found library file %s present and correct in lib dir", libName);
|
||||
}
|
||||
else
|
||||
{
|
||||
downloadMonitor.updateProgressString("Library file %s was downloaded and verified successfully", libName);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
actualClassLoader.addURL(libFile.toURI().toURL());
|
||||
loadedLibraries.add(libName);
|
||||
}
|
||||
catch (MalformedURLException e)
|
||||
{
|
||||
caughtErrors.add(new RuntimeException(String.format("Should never happen - %s is broken - probably a somehow corrupted download. Delete it and try again.", libFile.getName()), e));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (downloadMonitor.shouldStopIt())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!caughtErrors.isEmpty())
|
||||
{
|
||||
FMLRelaunchLog.severe("There were errors during initial FML setup. " +
|
||||
"Some files failed to download or were otherwise corrupted. " +
|
||||
"You will need to manually obtain the following files from " +
|
||||
"these download links and ensure your lib directory is clean. ");
|
||||
for (ILibrarySet set : libraries)
|
||||
{
|
||||
for (String file : set.getLibraries())
|
||||
{
|
||||
FMLRelaunchLog.severe("*** Download "+set.getRootURL(), file);
|
||||
}
|
||||
}
|
||||
FMLRelaunchLog.severe("<===========>");
|
||||
FMLRelaunchLog.severe("The following is the errors that caused the setup to fail. " +
|
||||
"They may help you diagnose and resolve the issue");
|
||||
for (Throwable t : caughtErrors)
|
||||
{
|
||||
if (t.getMessage()!=null)
|
||||
{
|
||||
FMLRelaunchLog.severe(t.getMessage());
|
||||
}
|
||||
}
|
||||
FMLRelaunchLog.severe("<<< ==== >>>");
|
||||
FMLRelaunchLog.severe("The following is diagnostic information for developers to review.");
|
||||
for (Throwable t : caughtErrors)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.SEVERE, t, "Error details");
|
||||
}
|
||||
throw new RuntimeException("A fatal error occured and FML cannot continue");
|
||||
}
|
||||
}
|
||||
|
||||
for (IFMLLoadingPlugin plug : loadPlugins)
|
||||
{
|
||||
if (plug.getASMTransformerClass()!=null)
|
||||
{
|
||||
for (String xformClass : plug.getASMTransformerClass())
|
||||
{
|
||||
actualClassLoader.registerTransformer(xformClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Deobfuscation transformer, always last
|
||||
if (!deobfuscatedEnvironment)
|
||||
{
|
||||
actualClassLoader.registerTransformer("cpw.mods.fml.common.asm.transformers.DeobfuscationTransformer");
|
||||
}
|
||||
downloadMonitor.updateProgressString("Running coremod plugins");
|
||||
Map<String,Object> data = new HashMap<String,Object>();
|
||||
data.put("mcLocation", mcDir);
|
||||
data.put("coremodList", loadPlugins);
|
||||
data.put("runtimeDeobfuscationEnabled", !deobfuscatedEnvironment);
|
||||
for (IFMLLoadingPlugin plugin : loadPlugins)
|
||||
{
|
||||
downloadMonitor.updateProgressString("Running coremod plugin %s", plugin.getClass().getSimpleName());
|
||||
data.put("coremodLocation", pluginLocations.get(plugin));
|
||||
plugin.injectData(data);
|
||||
String setupClass = plugin.getSetupClass();
|
||||
if (setupClass != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
IFMLCallHook call = (IFMLCallHook) Class.forName(setupClass, true, actualClassLoader).newInstance();
|
||||
Map<String,Object> callData = new HashMap<String, Object>();
|
||||
callData.put("mcLocation", mcDir);
|
||||
callData.put("classLoader", actualClassLoader);
|
||||
callData.put("coremodLocation", pluginLocations.get(plugin));
|
||||
callData.put("deobfuscationFileName", FMLInjectionData.debfuscationDataName());
|
||||
call.injectData(callData);
|
||||
call.call();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
downloadMonitor.updateProgressString("Coremod plugin %s run successfully", plugin.getClass().getSimpleName());
|
||||
|
||||
String modContainer = plugin.getModContainerClass();
|
||||
if (modContainer != null)
|
||||
{
|
||||
FMLInjectionData.containers.add(modContainer);
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
downloadMonitor.updateProgressString("Validating minecraft");
|
||||
Class<?> loaderClazz = Class.forName("cpw.mods.fml.common.Loader", true, actualClassLoader);
|
||||
Method m = loaderClazz.getMethod("injectData", Object[].class);
|
||||
m.invoke(null, (Object)FMLInjectionData.data());
|
||||
m = loaderClazz.getMethod("instance");
|
||||
m.invoke(null);
|
||||
downloadMonitor.updateProgressString("Minecraft validated, launching...");
|
||||
downloadBuffer = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// Load in the Loader, make sure he's ready to roll - this will initialize most of the rest of minecraft here
|
||||
System.out.println("A CRITICAL PROBLEM OCCURED INITIALIZING MINECRAFT - LIKELY YOU HAVE AN INCORRECT VERSION FOR THIS FML");
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static void discoverCoreMods(File mcDir, RelaunchClassLoader classLoader, List<IFMLLoadingPlugin> loadPlugins, List<ILibrarySet> libraries)
|
||||
{
|
||||
downloadMonitor.updateProgressString("Discovering coremods");
|
||||
File coreMods = setupCoreModDir(mcDir);
|
||||
FilenameFilter ff = new FilenameFilter()
|
||||
{
|
||||
@Override
|
||||
public boolean accept(File dir, String name)
|
||||
{
|
||||
return name.endsWith(".jar");
|
||||
}
|
||||
};
|
||||
File[] coreModList = coreMods.listFiles(ff);
|
||||
Arrays.sort(coreModList);
|
||||
|
||||
for (File coreMod : coreModList)
|
||||
{
|
||||
downloadMonitor.updateProgressString("Found a candidate coremod %s", coreMod.getName());
|
||||
JarFile jar;
|
||||
Attributes mfAttributes;
|
||||
try
|
||||
{
|
||||
jar = new JarFile(coreMod);
|
||||
if (jar.getManifest() == null)
|
||||
{
|
||||
FMLRelaunchLog.warning("Found an un-manifested jar file in the coremods folder : %s, it will be ignored.", coreMod.getName());
|
||||
continue;
|
||||
}
|
||||
mfAttributes = jar.getManifest().getMainAttributes();
|
||||
}
|
||||
catch (IOException ioe)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.SEVERE, ioe, "Unable to read the coremod jar file %s - ignoring", coreMod.getName());
|
||||
continue;
|
||||
}
|
||||
|
||||
String fmlCorePlugin = mfAttributes.getValue("FMLCorePlugin");
|
||||
if (fmlCorePlugin == null)
|
||||
{
|
||||
FMLRelaunchLog.severe("The coremod %s does not contain a valid jar manifest- it will be ignored", coreMod.getName());
|
||||
continue;
|
||||
}
|
||||
|
||||
// String className = fmlCorePlugin.replace('.', '/').concat(".class");
|
||||
// JarEntry ent = jar.getJarEntry(className);
|
||||
// if (ent ==null)
|
||||
// {
|
||||
// FMLLog.severe("The coremod %s specified %s as it's loading class but it does not include it - it will be ignored", coreMod.getName(), fmlCorePlugin);
|
||||
// continue;
|
||||
// }
|
||||
// try
|
||||
// {
|
||||
// Class<?> coreModClass = Class.forName(fmlCorePlugin, false, classLoader);
|
||||
// FMLLog.severe("The coremods %s specified a class %s that is already present in the classpath - it will be ignored", coreMod.getName(), fmlCorePlugin);
|
||||
// continue;
|
||||
// }
|
||||
// catch (ClassNotFoundException cnfe)
|
||||
// {
|
||||
// // didn't find it, good
|
||||
// }
|
||||
try
|
||||
{
|
||||
classLoader.addURL(coreMod.toURI().toURL());
|
||||
}
|
||||
catch (MalformedURLException e)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.SEVERE, e, "Unable to convert file into a URL. weird");
|
||||
continue;
|
||||
}
|
||||
try
|
||||
{
|
||||
downloadMonitor.updateProgressString("Loading coremod %s", coreMod.getName());
|
||||
classLoader.addTransformerExclusion(fmlCorePlugin);
|
||||
Class<?> coreModClass = Class.forName(fmlCorePlugin, true, classLoader);
|
||||
MCVersion requiredMCVersion = coreModClass.getAnnotation(IFMLLoadingPlugin.MCVersion.class);
|
||||
String version = "";
|
||||
if (requiredMCVersion == null)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.WARNING, "The coremod %s does not have a MCVersion annotation, it may cause issues with this version of Minecraft", fmlCorePlugin);
|
||||
}
|
||||
else
|
||||
{
|
||||
version = requiredMCVersion.value();
|
||||
}
|
||||
if (!"".equals(version) && !FMLInjectionData.mccversion.equals(version))
|
||||
{
|
||||
FMLRelaunchLog.log(Level.SEVERE, "The coremod %s is requesting minecraft version %s and minecraft is %s. It will be ignored.", fmlCorePlugin, version, FMLInjectionData.mccversion);
|
||||
continue;
|
||||
}
|
||||
else if (!"".equals(version))
|
||||
{
|
||||
FMLRelaunchLog.log(Level.FINE, "The coremod %s requested minecraft version %s and minecraft is %s. It will be loaded.", fmlCorePlugin, version, FMLInjectionData.mccversion);
|
||||
}
|
||||
TransformerExclusions trExclusions = coreModClass.getAnnotation(IFMLLoadingPlugin.TransformerExclusions.class);
|
||||
if (trExclusions!=null)
|
||||
{
|
||||
for (String st : trExclusions.value())
|
||||
{
|
||||
classLoader.addTransformerExclusion(st);
|
||||
}
|
||||
}
|
||||
IFMLLoadingPlugin plugin = (IFMLLoadingPlugin) coreModClass.newInstance();
|
||||
loadPlugins.add(plugin);
|
||||
pluginLocations .put(plugin, coreMod);
|
||||
if (plugin.getLibraryRequestClass()!=null)
|
||||
{
|
||||
for (String libName : plugin.getLibraryRequestClass())
|
||||
{
|
||||
libraries.add((ILibrarySet) Class.forName(libName, true, classLoader).newInstance());
|
||||
}
|
||||
}
|
||||
downloadMonitor.updateProgressString("Loaded coremod %s", coreMod.getName());
|
||||
}
|
||||
catch (ClassNotFoundException cnfe)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.SEVERE, cnfe, "Coremod %s: Unable to class load the plugin %s", coreMod.getName(), fmlCorePlugin);
|
||||
}
|
||||
catch (ClassCastException cce)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.SEVERE, cce, "Coremod %s: The plugin %s is not an implementor of IFMLLoadingPlugin", coreMod.getName(), fmlCorePlugin);
|
||||
}
|
||||
catch (InstantiationException ie)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.SEVERE, ie, "Coremod %s: The plugin class %s was not instantiable", coreMod.getName(), fmlCorePlugin);
|
||||
}
|
||||
catch (IllegalAccessException iae)
|
||||
{
|
||||
FMLRelaunchLog.log(Level.SEVERE, iae, "Coremod %s: The plugin class %s was not accessible", coreMod.getName(), fmlCorePlugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mcDir the minecraft home directory
|
||||
* @return the lib directory
|
||||
*/
|
||||
private static File setupLibDir(File mcDir)
|
||||
{
|
||||
File libDir = new File(mcDir,"lib");
|
||||
try
|
||||
{
|
||||
libDir = libDir.getCanonicalFile();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException(String.format("Unable to canonicalize the lib dir at %s", mcDir.getName()),e);
|
||||
}
|
||||
if (!libDir.exists())
|
||||
{
|
||||
libDir.mkdir();
|
||||
}
|
||||
else if (libDir.exists() && !libDir.isDirectory())
|
||||
{
|
||||
throw new RuntimeException(String.format("Found a lib file in %s that's not a directory", mcDir.getName()));
|
||||
}
|
||||
return libDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mcDir the minecraft home directory
|
||||
* @return the coremod directory
|
||||
*/
|
||||
private static File setupCoreModDir(File mcDir)
|
||||
{
|
||||
File coreModDir = new File(mcDir,"coremods");
|
||||
try
|
||||
{
|
||||
coreModDir = coreModDir.getCanonicalFile();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException(String.format("Unable to canonicalize the coremod dir at %s", mcDir.getName()),e);
|
||||
}
|
||||
if (!coreModDir.exists())
|
||||
{
|
||||
coreModDir.mkdir();
|
||||
}
|
||||
else if (coreModDir.exists() && !coreModDir.isDirectory())
|
||||
{
|
||||
throw new RuntimeException(String.format("Found a coremod file in %s that's not a directory", mcDir.getName()));
|
||||
}
|
||||
return coreModDir;
|
||||
}
|
||||
|
||||
private static void downloadFile(File libFile, String rootUrl,String realFilePath, String hash)
|
||||
{
|
||||
try
|
||||
{
|
||||
URL libDownload = new URL(String.format(rootUrl,realFilePath));
|
||||
downloadMonitor.updateProgressString("Downloading file %s", libDownload.toString());
|
||||
FMLRelaunchLog.info("Downloading file %s", libDownload.toString());
|
||||
URLConnection connection = libDownload.openConnection();
|
||||
connection.setConnectTimeout(5000);
|
||||
connection.setReadTimeout(5000);
|
||||
connection.setRequestProperty("User-Agent", "FML Relaunch Downloader");
|
||||
int sizeGuess = connection.getContentLength();
|
||||
performDownload(connection.getInputStream(), sizeGuess, hash, libFile);
|
||||
downloadMonitor.updateProgressString("Download complete");
|
||||
FMLRelaunchLog.info("Download complete");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (downloadMonitor.shouldStopIt())
|
||||
{
|
||||
FMLRelaunchLog.warning("You have stopped the downloading operation before it could complete");
|
||||
return;
|
||||
}
|
||||
if (e instanceof RuntimeException) throw (RuntimeException)e;
|
||||
FMLRelaunchLog.severe("There was a problem downloading the file %s automatically. Perhaps you " +
|
||||
"have an environment without internet access. You will need to download " +
|
||||
"the file manually or restart and let it try again\n", libFile.getName());
|
||||
libFile.delete();
|
||||
throw new RuntimeException("A download error occured", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> getLibraries()
|
||||
{
|
||||
return loadedLibraries;
|
||||
}
|
||||
|
||||
private static ByteBuffer downloadBuffer = ByteBuffer.allocateDirect(1 << 23);
|
||||
static IDownloadDisplay downloadMonitor;
|
||||
|
||||
private static void performDownload(InputStream is, int sizeGuess, String validationHash, File target)
|
||||
{
|
||||
if (sizeGuess > downloadBuffer.capacity())
|
||||
{
|
||||
throw new RuntimeException(String.format("The file %s is too large to be downloaded by FML - the coremod is invalid", target.getName()));
|
||||
}
|
||||
downloadBuffer.clear();
|
||||
|
||||
int bytesRead, fullLength = 0;
|
||||
|
||||
downloadMonitor.resetProgress(sizeGuess);
|
||||
try
|
||||
{
|
||||
downloadMonitor.setPokeThread(Thread.currentThread());
|
||||
byte[] smallBuffer = new byte[1024];
|
||||
while ((bytesRead = is.read(smallBuffer)) >= 0) {
|
||||
downloadBuffer.put(smallBuffer, 0, bytesRead);
|
||||
fullLength += bytesRead;
|
||||
if (downloadMonitor.shouldStopIt())
|
||||
{
|
||||
break;
|
||||
}
|
||||
downloadMonitor.updateProgress(fullLength);
|
||||
}
|
||||
is.close();
|
||||
downloadMonitor.setPokeThread(null);
|
||||
downloadBuffer.limit(fullLength);
|
||||
downloadBuffer.position(0);
|
||||
}
|
||||
catch (InterruptedIOException e)
|
||||
{
|
||||
// We were interrupted by the stop button. We're stopping now.. clear interruption flag.
|
||||
Thread.interrupted();
|
||||
return;
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
String cksum = generateChecksum(downloadBuffer);
|
||||
if (cksum.equals(validationHash))
|
||||
{
|
||||
downloadBuffer.position(0);
|
||||
FileOutputStream fos = new FileOutputStream(target);
|
||||
fos.getChannel().write(downloadBuffer);
|
||||
fos.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RuntimeException(String.format("The downloaded file %s has an invalid checksum %s (expecting %s). The download did not succeed correctly and the file has been deleted. Please try launching again.", target.getName(), cksum, validationHash));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (e instanceof RuntimeException) throw (RuntimeException)e;
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static String generateChecksum(ByteBuffer buffer)
|
||||
{
|
||||
return CertificateHelper.getFingerprint(buffer);
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
#Main FML Access Transformer configuration file
|
||||
# TileEntity addMapping
|
||||
public aqp.a(Ljava/lang/Class;Ljava/lang/String;)V #MD:TileEntity/func_70306_a
|
||||
# EntityList addMappings
|
||||
public mv.a(Ljava/lang/Class;Ljava/lang/String;I)V #MD:EntityList/func_75618_a
|
||||
public mv.a(Ljava/lang/Class;Ljava/lang/String;III)V #MD:EntityList/func_75614_a
|
||||
public mv.b #FD:EntityList/field_75625_b #nameToClassMap
|
||||
public mv.c #FD:EntityList/field_75626_c #classToNameMap
|
||||
public mv.d #FD:EntityList/field_75623_d #idToClassMap
|
||||
# RenderEngine
|
||||
#public bba.h #FD:RenderEngine/field_78367_h #textureList # -- MISSING MAPPING # -- MISSING MAPPING
|
||||
public bge.g #FD:RenderEngine/field_78366_k #texturePack
|
||||
# RenderManager
|
||||
public bgy.q #FD:RenderManager/field_78729_o #renderers
|
||||
# RenderBlocks - everything
|
||||
public bgf.* #FD:RenderBlocks/*
|
||||
public bgf.*() #MD:RenderBlocks/*
|
||||
#RenderPlayer
|
||||
public-f bht.h #FD:RenderPlayer/field_77110_j #armorlist
|
||||
#RenderBiped
|
||||
public-f bhg.k #FD:RenderBiped/field_82424_k #armorlist
|
||||
#StringTranslate
|
||||
public bp.b #FD:StringTranslate/field_74815_b
|
||||
public bp.e #FD:StringTranslate/field_74813_d
|
||||
# TileEntityRenderer
|
||||
public bjd.m #FD:TileEntityRenderer/field_76966_m
|
||||
# CraftingManager - make the add recipe methods public
|
||||
public yk.a(Lwm;[Ljava/lang/Object;)Lyn; #MD:CraftingManager/func_92103_a
|
||||
public yk.b(Lwm;[Ljava/lang/Object;)V #MD:CraftingManager/func_77596_b
|
||||
# WeightedRandomItem
|
||||
public lo.a #FD:WeightedRandomItem/field_76292_a #probability
|
||||
# ItemStack
|
||||
#public+f tv.c #FD:ItemStack/field_77993_c #itemId
|
||||
# StatBase
|
||||
public ka.a #FD:StatBase/field_75978_a #statName
|
||||
# NetLoginHandler
|
||||
public jf.a(Ljf;Z)Z #MD:NetLoginHandler/func_72531_a #'complete connection'
|
||||
public jf.g #FD:NetLoginHandler/field_72543_h #userName
|
||||
# EntityPlayerMP getNextWindowId
|
||||
public jc.ct()V #MD:EntityPlayerMP/func_71117_bO
|
||||
public jc.cu #FD:EntityPlayerMP/field_71139_cq
|
||||
# EntityAITaskEntry
|
||||
public oo #CL:EntityAITaskEntry
|
||||
# EntityAITasks
|
||||
public on.a #FD:EntityAITasks/field_75782_a #taskList
|
||||
# BlockChest
|
||||
public aln.m(Laab;III)Z #MD:BlockChest/func_72292_n #isOcelotBlockingChest
|
||||
# EntityLiving
|
||||
public ng.aU #FD:EntityLiving/field_70736_aM #carryoverDamage
|
||||
public ng.bo #FD:EntityLiving/field_70714_bg #tasks
|
||||
public ng.bG #FD:EntityLiving/field_70703_bu #isJumping
|
||||
# EntityAIOcelotSit
|
||||
protected pa.a(Laab;III)Z #MD:EntityAIOcelotSit/func_75398_a #nearestSittableBlock
|
||||
protected pa.f()Z #MD:EntityAIOcelotSit/func_75399_f #isblocksittable
|
||||
# CallableMinecraftVersion - sanity check the MC version
|
||||
public c #CL:CallableMinecraftVersion
|
||||
public c.<init>(Lb;)V #MD:CallableMinecraftVersion/<init>(Lnet/minecraft/src/CrashReport;) #constructor
|
||||
# EntityAnimal
|
||||
public qh.d #FD:EntityAnimal/field_70881_d #inLove
|
||||
# WorldType
|
||||
public aal.<init>(ILjava/lang/String;)V #MD:WorldType/<init>(ILjava/lang/String;)
|
||||
public aal.<init>(ILjava/lang/String;I)V #MD:WorldType/<init>(ILjava/lang/String;I)
|
||||
# ComponentVillage
|
||||
public ahp #CL:ComponentVillage
|
||||
# EntityVillager - minmax lists
|
||||
public sm.a(Lzr;ILjava/util/Random;F)V #MD:EntityVillager/func_70948_a #addBuy
|
||||
public sm.b(Lzr;ILjava/util/Random;F)V #MD:EntityVillager/func_70949_b #addSell
|
||||
public sm.bP #FD:EntityVillager/field_70958_bB
|
||||
public sm.bQ #FD:EntityVillager/field_70960_bC
|
||||
# GuiButtonMerchant
|
||||
public azi #CL:GuiButtonMerchant
|
||||
|
||||
protected awk.a #FD:GuiYesNo/field_73942_a #guiScreen
|
||||
+1
-1
@@ -8,7 +8,7 @@ break-closing-brackets
|
||||
|
||||
indent-switches
|
||||
|
||||
max-instatement-indent=2
|
||||
max-instatement-indent=40
|
||||
|
||||
pad-oper
|
||||
pad-header
|
||||
|
||||
+1922
-1906
File diff suppressed because it is too large.
Load diff
+7383
-2273
File diff suppressed because it is too large.
Load diff
+18604
-17976
File diff suppressed because it is too large.
Load diff
+16
-11
@@ -38,8 +38,8 @@ DirNatives = %(DirJars)s/bin/natives
|
||||
Client = %(DirJars)s/bin/minecraft.jar
|
||||
Server = %(DirJars)s/minecraft_server.jar
|
||||
LWJGL = %(DirJars)s/bin/jinput.jar,%(DirJars)s/bin/lwjgl.jar,%(DirJars)s/bin/lwjgl_util.jar
|
||||
MD5Client = 6897c3287fb971c9f362eb3ab20f5ddd
|
||||
MD5Server = c4e1bf89e834bd3670c7bf8f13874bc6
|
||||
MD5Client = 2e5044f5359e82245551167a237f3167
|
||||
MD5Server = ba3145656b1480122bd8759cecd7b7a1
|
||||
|
||||
[RETROGUARD]
|
||||
Location = %(DirRuntime)s/bin/retroguard.jar
|
||||
@@ -71,13 +71,15 @@ ClsServerTemp = %(DirTempCls)s/minecraft_server
|
||||
SrcClientTemp = %(DirTempSrc)s/minecraft
|
||||
SrcServerTemp = %(DirTempSrc)s/minecraft_server
|
||||
FFSource = net
|
||||
FFClientIn = %(DirTemp)s/minecraft_ff_in.jar
|
||||
FFServerIn = %(DirTemp)s/minecraft_server_ff_in.jar
|
||||
|
||||
[OUTPUT]
|
||||
BinClientTemp = %(DirTempBin)s/minecraft
|
||||
BinServerTemp = %(DirTempBin)s/minecraft_server
|
||||
SrcClient = %(DirSrc)s/minecraft
|
||||
SrcServer = %(DirSrc)s/minecraft_server
|
||||
TestClient = net/minecraft/client/Minecraft
|
||||
TestClient = net/minecraft/client/main/Main
|
||||
TestServer = net/minecraft/server/MinecraftServer
|
||||
|
||||
[PATCHES]
|
||||
@@ -94,11 +96,11 @@ BinClient = %(DirBin)s/minecraft
|
||||
BinServer = %(DirBin)s/minecraft_server
|
||||
LogClient = %(DirLogs)s/client_compile.log
|
||||
LogServer = %(DirLogs)s/server_compile.log
|
||||
ClassPathClient = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/bin/minecraft.jar,%(DirJars)s/bin/jinput.jar,%(DirJars)s/bin/lwjgl.jar,%(DirJars)s/bin/lwjgl_util.jar
|
||||
ClassPathServer = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/minecraft_server.jar
|
||||
ClassPathClient =
|
||||
ClassPathServer =
|
||||
ClientFixes = %(DirConf)s/patches
|
||||
FixStart = Start
|
||||
IgnorePkg = paulscode,com/jcraft,isom,ibxm,de/matthiasmann/twl,org/xmlpull,javax/xml,com/fasterxml,javax/ws,org/bouncycastle,argo
|
||||
IgnorePkg = paulscode,com,isom,ibxm,de/matthiasmann/twl,org,javax/xml,javax/ws,argo
|
||||
|
||||
[REOBF]
|
||||
MD5Client = %(DirTemp)s/client.md5
|
||||
@@ -125,8 +127,8 @@ LogFile = %(DirLogs)s/mcp.log
|
||||
LogFileErr = %(DirLogs)s/mcperr.log
|
||||
UpdateUrl =
|
||||
IgnoreUpdate = %(DirBin)s,%(DirLib)s,%(DirLogs)s,%(DirModSrc)s,%(DirReobf)s,%(DirSrc)s,%(DirTemp)s,%(DirEclipse)s/Client/bin,%(DirEclipse)s/Server/bin,%(DirJars)s/world,%(DirJars)s/saves,%(DirJars)s/resources
|
||||
RGIndex = 104000
|
||||
ParamIndex = 23000
|
||||
RGIndex = 143000
|
||||
ParamIndex = 43000
|
||||
|
||||
[ASTYLE]
|
||||
AstyleConfig = %(DirConf)s/astyle.cfg
|
||||
@@ -144,15 +146,18 @@ AStyle_osx = %(DirRuntime)s/bin/astyle-osx
|
||||
JadRetro = %(DirRuntime)s/bin/jadretro.jar
|
||||
Fernflower = %(DirRuntime)s/bin/fernflower.jar
|
||||
Exceptor = %(DirRuntime)s/bin/mcinjector.jar
|
||||
SpecialSource = %(DirRuntime)s/bin/specialsource.jar
|
||||
CmdPatch = %s -p1 -u -i {patchfile} -d {srcdir}
|
||||
CmdJad = %s -b -d {outdir} -dead -o -r -s .java -stat -ff {classes}
|
||||
CmdAStyle = %s --suffix=none --quiet --options={conffile} {classes}
|
||||
CmdRG = %s -cp "{classpath}" RetroGuard -searge {conffile}
|
||||
CmdRGReobf = %s -cp "{classpath}" RetroGuard -notch {conffile}
|
||||
CmdSS = %s -cp "{classpath}" -jar %s -i {injar} -o {outjar} -m {mapfile} --kill-source
|
||||
CmdSSReobf = %s -cp "{classpath}" -jar %s -i {injar} -o {outjar} -r -m {mapfile} -d {identifier} -e %s
|
||||
CmdJadretro = %s -jar %s {targetdir}
|
||||
CmdFernflower = %s -Xmx512M -jar %s -din=0 -rbr=0 -dgs=1 -asc=1 -log=WARN {indir} {outdir}
|
||||
CmdExceptor = %s -jar %s {input} {output} {conf} {log}
|
||||
CmdRecomp = %s -encoding UTF-8 -Xlint:-options -deprecation -g -source 1.6 -target 1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs}
|
||||
CmdRecompScalac = %s -encoding UTF-8 -deprecation -target:jvm-1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs}
|
||||
CmdStartSrv = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" net.minecraft.server.MinecraftServer
|
||||
CmdStartClt = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" -Djava.library.path={natives} Start
|
||||
CmdRecompScala = %s -encoding UTF-8 -deprecation -target:jvm-1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs}
|
||||
CmdStartSrv = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" cpw.mods.fml.relauncher.ServerLaunchWrapper {extraargs}
|
||||
CmdStartClt = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" -Djava.library.path={natives} net.minecraft.launchwrapper.Launch --tweakClass cpw.mods.fml.common.launcher.FMLTweaker --version FML_DEV {extraargs}
|
||||
+1704
-1527
File diff suppressed because it is too large.
Load diff
-8820
File diff suppressed because it is too large.
Load diff
+168
-69
@@ -1,6 +1,4 @@
|
||||
class,package
|
||||
GuiScreenOnlineServersSubscreen,net/minecraft/client/gui
|
||||
RunnableTitleScreen,net/minecraft/client/gui
|
||||
Block,net/minecraft/block
|
||||
BlockAnvil,net/minecraft/block
|
||||
BlockBasePressurePlate,net/minecraft/block
|
||||
@@ -15,12 +13,13 @@ BlockButtonStone,net/minecraft/block
|
||||
BlockButtonWood,net/minecraft/block
|
||||
BlockCactus,net/minecraft/block
|
||||
BlockCake,net/minecraft/block
|
||||
BlockCarpet,net/minecraft/block
|
||||
BlockCarrot,net/minecraft/block
|
||||
BlockCauldron,net/minecraft/block
|
||||
BlockChest,net/minecraft/block
|
||||
BlockClay,net/minecraft/block
|
||||
BlockCloth,net/minecraft/block
|
||||
BlockCocoa,net/minecraft/block
|
||||
BlockColored,net/minecraft/block
|
||||
BlockCommandBlock,net/minecraft/block
|
||||
BlockComparator,net/minecraft/block
|
||||
BlockContainer,net/minecraft/block
|
||||
@@ -53,6 +52,7 @@ BlockGlowStone,net/minecraft/block
|
||||
BlockGrass,net/minecraft/block
|
||||
BlockGravel,net/minecraft/block
|
||||
BlockHalfSlab,net/minecraft/block
|
||||
BlockHay,net/minecraft/block
|
||||
BlockHopper,net/minecraft/block
|
||||
BlockIce,net/minecraft/block
|
||||
BlockJukeBox,net/minecraft/block
|
||||
@@ -95,6 +95,7 @@ BlockRedstoneRepeater,net/minecraft/block
|
||||
BlockRedstoneTorch,net/minecraft/block
|
||||
BlockRedstoneWire,net/minecraft/block
|
||||
BlockReed,net/minecraft/block
|
||||
BlockRotatedPillar,net/minecraft/block
|
||||
BlockSand,net/minecraft/block
|
||||
BlockSandStone,net/minecraft/block
|
||||
BlockSapling,net/minecraft/block
|
||||
@@ -143,32 +144,27 @@ CallableClientMemoryStats,net/minecraft/client
|
||||
CallableClientProfiler,net/minecraft/client
|
||||
CallableGLInfo,net/minecraft/client
|
||||
CallableLWJGLVersion,net/minecraft/client
|
||||
CallableLaunchedVersion,net/minecraft/client
|
||||
CallableModded,net/minecraft/client
|
||||
CallableParticleScreenName,net/minecraft/client
|
||||
CallableTexturePack,net/minecraft/client
|
||||
CallableTickingScreenName,net/minecraft/client
|
||||
CallableType2,net/minecraft/client
|
||||
CallableUpdatingScreenName,net/minecraft/client
|
||||
CanvasCrashReport,net/minecraft/client
|
||||
CanvasMinecraftApplet,net/minecraft/client
|
||||
CanvasMojangLogo,net/minecraft/client
|
||||
EnumOSHelper,net/minecraft/client
|
||||
GameWindowListener,net/minecraft/client
|
||||
MinecraftAppletImpl,net/minecraft/client
|
||||
MinecraftFakeLauncher,net/minecraft/client
|
||||
PanelCrashReport,net/minecraft/client
|
||||
Minecraft,net/minecraft/client
|
||||
MinecraftINNER13,net/minecraft/client
|
||||
StatStringFormatKeyInv,net/minecraft/client
|
||||
ThreadClientSleep,net/minecraft/client
|
||||
ThreadShutdown,net/minecraft/client
|
||||
CodecMus,net/minecraft/client/audio
|
||||
MusInputStream,net/minecraft/client/audio
|
||||
ScheduledSound,net/minecraft/client/audio
|
||||
SoundManager,net/minecraft/client/audio
|
||||
SoundManagerINNER1,net/minecraft/client/audio
|
||||
SoundPool,net/minecraft/client/audio
|
||||
SoundPoolEntry,net/minecraft/client/audio
|
||||
SoundPoolProtocolHandler,net/minecraft/client/audio
|
||||
SoundPoolURLConnection,net/minecraft/client/audio
|
||||
AbstractClientPlayer,net/minecraft/client/entity
|
||||
EntityClientPlayerMP,net/minecraft/client/entity
|
||||
EntityOtherPlayerMP,net/minecraft/client/entity
|
||||
EntityPlayerSP,net/minecraft/client/entity
|
||||
RenderMinecartMobSpawner,net/minecraft/client/entity/render
|
||||
ChatClickData,net/minecraft/client/gui
|
||||
ChatLine,net/minecraft/client/gui
|
||||
FontRenderer,net/minecraft/client/gui
|
||||
@@ -203,9 +199,7 @@ GuiMerchant,net/minecraft/client/gui
|
||||
GuiMultiplayer,net/minecraft/client/gui
|
||||
GuiNewChat,net/minecraft/client/gui
|
||||
GuiOptions,net/minecraft/client/gui
|
||||
GuiParticle,net/minecraft/client/gui
|
||||
GuiPlayerInfo,net/minecraft/client/gui
|
||||
GuiProgress,net/minecraft/client/gui
|
||||
GuiRenameWorld,net/minecraft/client/gui
|
||||
GuiRepair,net/minecraft/client/gui
|
||||
GuiScreen,net/minecraft/client/gui
|
||||
@@ -213,14 +207,13 @@ GuiScreenAddServer,net/minecraft/client/gui
|
||||
GuiScreenBook,net/minecraft/client/gui
|
||||
GuiScreenConfigureWorld,net/minecraft/client/gui
|
||||
GuiScreenConfirmation,net/minecraft/client/gui
|
||||
GuiScreenCreateOnlineWorld,net/minecraft/client/gui
|
||||
GuiScreenDemo,net/minecraft/client/gui
|
||||
GuiScreenDisconnectedOnline,net/minecraft/client/gui
|
||||
GuiScreenEditOnlineWorld,net/minecraft/client/gui
|
||||
GuiScreenInvite,net/minecraft/client/gui
|
||||
GuiScreenLongRunningTask,net/minecraft/client/gui
|
||||
GuiScreenOnlineServers,net/minecraft/client/gui
|
||||
GuiScreenResetWorld,net/minecraft/client/gui
|
||||
GuiScreenOnlineServersSubscreen,net/minecraft/client/gui
|
||||
GuiScreenSelectLocation,net/minecraft/client/gui
|
||||
GuiScreenServerList,net/minecraft/client/gui
|
||||
GuiScreenSubscription,net/minecraft/client/gui
|
||||
@@ -242,20 +235,17 @@ GuiWorldSlot,net/minecraft/client/gui
|
||||
GuiYesNo,net/minecraft/client/gui
|
||||
LoadingScreenRenderer,net/minecraft/client/gui
|
||||
MapItemRenderer,net/minecraft/client/gui
|
||||
Particle,net/minecraft/client/gui
|
||||
RunnableTitleScreen,net/minecraft/client/gui
|
||||
ScaledResolution,net/minecraft/client/gui
|
||||
ScreenChatOptions,net/minecraft/client/gui
|
||||
SelectionListBase,net/minecraft/client/gui
|
||||
SelectionListInvited,net/minecraft/client/gui
|
||||
TaskLongRunning,net/minecraft/client/gui
|
||||
TaskOnlineConnect,net/minecraft/client/gui
|
||||
TaskResetWorld,net/minecraft/client/gui
|
||||
TaskWorldCreation,net/minecraft/client/gui
|
||||
ThreadConnectToOnlineServer,net/minecraft/client/gui
|
||||
ThreadOnlineConnect,net/minecraft/client/gui
|
||||
ThreadOnlineScreen,net/minecraft/client/gui
|
||||
ThreadPollServers,net/minecraft/client/gui
|
||||
ThreadTitleScreen,net/minecraft/client/gui
|
||||
GuiAchievement,net/minecraft/client/gui/achievement
|
||||
GuiAchievements,net/minecraft/client/gui/achievement
|
||||
GuiSlotStats,net/minecraft/client/gui/achievement
|
||||
@@ -281,28 +271,52 @@ GuiDispenser,net/minecraft/client/gui/inventory
|
||||
GuiEditSign,net/minecraft/client/gui/inventory
|
||||
GuiFurnace,net/minecraft/client/gui/inventory
|
||||
GuiInventory,net/minecraft/client/gui/inventory
|
||||
GuiScreenHorseInventory,net/minecraft/client/gui/inventory
|
||||
SlotCreativeInventory,net/minecraft/client/gui/inventory
|
||||
GuiScreenBackup,net/minecraft/client/gui/mco
|
||||
GuiScreenBackupDownloadThread,net/minecraft/client/gui/mco
|
||||
GuiScreenBackupRestoreTask,net/minecraft/client/gui/mco
|
||||
GuiScreenBackupSelectionList,net/minecraft/client/gui/mco
|
||||
GuiScreenCreateOnlineWorld,net/minecraft/client/gui/mco
|
||||
GuiScreenMcoWorldTemplate,net/minecraft/client/gui/mco
|
||||
GuiScreenMcoWorldTemplateDownloadThread,net/minecraft/client/gui/mco
|
||||
GuiScreenMcoWorldTemplateSelectionList,net/minecraft/client/gui/mco
|
||||
GuiScreenPendingInvitation,net/minecraft/client/gui/mco
|
||||
GuiScreenPendingInvitationINNER1,net/minecraft/client/gui/mco
|
||||
GuiScreenPendingInvitationINNER2,net/minecraft/client/gui/mco
|
||||
GuiScreenPendingInvitationINNER3,net/minecraft/client/gui/mco
|
||||
GuiScreenPendingInvitationList,net/minecraft/client/gui/mco
|
||||
GuiScreenResetWorld,net/minecraft/client/gui/mco
|
||||
ScreenWithCallback,net/minecraft/client/gui/mco
|
||||
TaskResetWorld,net/minecraft/client/gui/mco
|
||||
TaskWorldCreation,net/minecraft/client/gui/mco
|
||||
MainProxyAuthenticator,net/minecraft/client/main
|
||||
MainShutdownHook,net/minecraft/client/main
|
||||
Backup,net/minecraft/client/mco
|
||||
BackupList,net/minecraft/client/mco
|
||||
ExceptionMcoHttp,net/minecraft/client/mco
|
||||
ExceptionMcoService,net/minecraft/client/mco
|
||||
ExceptionRetryCall,net/minecraft/client/mco
|
||||
GuiScreenClientOutdated,net/minecraft/client/mco
|
||||
GuiScreenConfirmationType,net/minecraft/client/mco
|
||||
McoClient,net/minecraft/client/mco
|
||||
McoOption,net/minecraft/client/mco
|
||||
McoOptionNone,net/minecraft/client/mco
|
||||
McoOptionSome,net/minecraft/client/mco
|
||||
McoPair,net/minecraft/client/mco
|
||||
McoServer,net/minecraft/client/mco
|
||||
McoServerAddress,net/minecraft/client/mco
|
||||
McoServerList,net/minecraft/client/mco
|
||||
McoServerListINNER1,net/minecraft/client/mco
|
||||
McoServerListEmptyAnon,net/minecraft/client/mco
|
||||
McoServerListUpdateTask,net/minecraft/client/mco
|
||||
McoServerListUpdateTaskComparator,net/minecraft/client/mco
|
||||
PendingInvite,net/minecraft/client/mco
|
||||
PendingInvitesList,net/minecraft/client/mco
|
||||
Request,net/minecraft/client/mco
|
||||
RequestDelete,net/minecraft/client/mco
|
||||
RequestGet,net/minecraft/client/mco
|
||||
RequestPost,net/minecraft/client/mco
|
||||
RequestPut,net/minecraft/client/mco
|
||||
TimerTaskMcoServerListUpdate,net/minecraft/client/mco
|
||||
TimerTaskMcoServerListUpdateComparator,net/minecraft/client/mco
|
||||
ValueObjectList,net/minecraft/client/mco
|
||||
ValueObjectSubscription,net/minecraft/client/mco
|
||||
WorldTemplate,net/minecraft/client/mco
|
||||
WorldTemplateList,net/minecraft/client/mco
|
||||
ModelBase,net/minecraft/client/model
|
||||
ModelBat,net/minecraft/client/model
|
||||
ModelBiped,net/minecraft/client/model
|
||||
@@ -318,8 +332,10 @@ ModelDragon,net/minecraft/client/model
|
||||
ModelEnderCrystal,net/minecraft/client/model
|
||||
ModelEnderman,net/minecraft/client/model
|
||||
ModelGhast,net/minecraft/client/model
|
||||
ModelHorse,net/minecraft/client/model
|
||||
ModelIronGolem,net/minecraft/client/model
|
||||
ModelLargeChest,net/minecraft/client/model
|
||||
ModelLeashKnot,net/minecraft/client/model
|
||||
ModelMagmaCube,net/minecraft/client/model
|
||||
ModelMinecart,net/minecraft/client/model
|
||||
ModelOcelot,net/minecraft/client/model
|
||||
@@ -352,7 +368,6 @@ GuiConnecting,net/minecraft/client/multiplayer
|
||||
LanServer,net/minecraft/client/multiplayer
|
||||
LanServerList,net/minecraft/client/multiplayer
|
||||
NetClientHandler,net/minecraft/client/multiplayer
|
||||
NetClientWebTextures,net/minecraft/client/multiplayer
|
||||
PlayerControllerMP,net/minecraft/client/multiplayer
|
||||
ServerAddress,net/minecraft/client/multiplayer
|
||||
ServerData,net/minecraft/client/multiplayer
|
||||
@@ -361,6 +376,8 @@ ThreadConnectToServer,net/minecraft/client/multiplayer
|
||||
ThreadLanServerFind,net/minecraft/client/multiplayer
|
||||
ThreadLanServerPing,net/minecraft/client/multiplayer
|
||||
WorldClient,net/minecraft/client/multiplayer
|
||||
WorldClientINNER3,net/minecraft/client/multiplayer
|
||||
WorldClientINNER4,net/minecraft/client/multiplayer
|
||||
EffectRenderer,net/minecraft/client/particle
|
||||
EntityAuraFX,net/minecraft/client/particle
|
||||
EntityBreakingFX,net/minecraft/client/particle
|
||||
@@ -395,7 +412,6 @@ EntitySuspendFX,net/minecraft/client/particle
|
||||
ActiveRenderInfo,net/minecraft/client/renderer
|
||||
CallableMouseLocation,net/minecraft/client/renderer
|
||||
CallableParticlePositionInfo,net/minecraft/client/renderer
|
||||
CallableParticleScreenName,net/minecraft/client/renderer
|
||||
CallableScreenName,net/minecraft/client/renderer
|
||||
CallableScreenSize,net/minecraft/client/renderer
|
||||
ChestItemRenderHelper,net/minecraft/client/renderer
|
||||
@@ -411,15 +427,14 @@ ItemRenderer,net/minecraft/client/renderer
|
||||
OpenGlCapsChecker,net/minecraft/client/renderer
|
||||
OpenGlHelper,net/minecraft/client/renderer
|
||||
RenderBlocks,net/minecraft/client/renderer
|
||||
RenderEngine,net/minecraft/client/renderer
|
||||
RenderGlobal,net/minecraft/client/renderer
|
||||
RenderHelper,net/minecraft/client/renderer
|
||||
RenderList,net/minecraft/client/renderer
|
||||
RenderSorter,net/minecraft/client/renderer
|
||||
StitcherException,net/minecraft/client/renderer
|
||||
Tessellator,net/minecraft/client/renderer
|
||||
ThreadDownloadImage,net/minecraft/client/renderer
|
||||
ThreadDownloadImageData,net/minecraft/client/renderer
|
||||
ThreadDownloadImageDataINNER1,net/minecraft/client/renderer
|
||||
WorldRenderer,net/minecraft/client/renderer
|
||||
ClippingHelper,net/minecraft/client/renderer/culling
|
||||
ClippingHelperImpl,net/minecraft/client/renderer/culling
|
||||
@@ -431,6 +446,7 @@ RenderBat,net/minecraft/client/renderer/entity
|
||||
RenderBiped,net/minecraft/client/renderer/entity
|
||||
RenderBlaze,net/minecraft/client/renderer/entity
|
||||
RenderBoat,net/minecraft/client/renderer/entity
|
||||
RenderCaveSpider,net/minecraft/client/renderer/entity
|
||||
RenderChicken,net/minecraft/client/renderer/entity
|
||||
RenderCow,net/minecraft/client/renderer/entity
|
||||
RenderCreeper,net/minecraft/client/renderer/entity
|
||||
@@ -443,13 +459,16 @@ RenderFireball,net/minecraft/client/renderer/entity
|
||||
RenderFish,net/minecraft/client/renderer/entity
|
||||
RenderGhast,net/minecraft/client/renderer/entity
|
||||
RenderGiantZombie,net/minecraft/client/renderer/entity
|
||||
RenderHorse,net/minecraft/client/renderer/entity
|
||||
RenderIronGolem,net/minecraft/client/renderer/entity
|
||||
RenderItem,net/minecraft/client/renderer/entity
|
||||
RenderLeashKnot,net/minecraft/client/renderer/entity
|
||||
RenderLightningBolt,net/minecraft/client/renderer/entity
|
||||
RenderLiving,net/minecraft/client/renderer/entity
|
||||
RenderMagmaCube,net/minecraft/client/renderer/entity
|
||||
RenderManager,net/minecraft/client/renderer/entity
|
||||
RenderMinecart,net/minecraft/client/renderer/entity
|
||||
RenderMinecartMobSpawner,net/minecraft/client/renderer/entity
|
||||
RenderMooshroom,net/minecraft/client/renderer/entity
|
||||
RenderOcelot,net/minecraft/client/renderer/entity
|
||||
RenderPainting,net/minecraft/client/renderer/entity
|
||||
@@ -471,17 +490,25 @@ RenderWither,net/minecraft/client/renderer/entity
|
||||
RenderWolf,net/minecraft/client/renderer/entity
|
||||
RenderXPOrb,net/minecraft/client/renderer/entity
|
||||
RenderZombie,net/minecraft/client/renderer/entity
|
||||
RendererLivingEntity,net/minecraft/client/renderer/entity
|
||||
AbstractTexture,net/minecraft/client/renderer/texture
|
||||
DynamicTexture,net/minecraft/client/renderer/texture
|
||||
IconRegister,net/minecraft/client/renderer/texture
|
||||
Rect2i,net/minecraft/client/renderer/texture
|
||||
LayeredTexture,net/minecraft/client/renderer/texture
|
||||
SimpleTexture,net/minecraft/client/renderer/texture
|
||||
StitchHolder,net/minecraft/client/renderer/texture
|
||||
StitchSlot,net/minecraft/client/renderer/texture
|
||||
Stitcher,net/minecraft/client/renderer/texture
|
||||
Texture,net/minecraft/client/renderer/texture
|
||||
TextureAtlasSprite,net/minecraft/client/renderer/texture
|
||||
TextureClock,net/minecraft/client/renderer/texture
|
||||
TextureCompass,net/minecraft/client/renderer/texture
|
||||
TextureManager,net/minecraft/client/renderer/texture
|
||||
TextureManagerINNER1,net/minecraft/client/renderer/texture
|
||||
TextureMap,net/minecraft/client/renderer/texture
|
||||
TextureStitched,net/minecraft/client/renderer/texture
|
||||
TextureObject,net/minecraft/client/renderer/texture
|
||||
TextureUtil,net/minecraft/client/renderer/texture
|
||||
Tickable,net/minecraft/client/renderer/texture
|
||||
TickableTextureObject,net/minecraft/client/renderer/texture
|
||||
RenderEndPortal,net/minecraft/client/renderer/tileentity
|
||||
RenderEnderCrystal,net/minecraft/client/renderer/tileentity
|
||||
RenderItemFrame,net/minecraft/client/renderer/tileentity
|
||||
@@ -495,20 +522,53 @@ TileEntityRendererPiston,net/minecraft/client/renderer/tileentity
|
||||
TileEntitySignRenderer,net/minecraft/client/renderer/tileentity
|
||||
TileEntitySkullRenderer,net/minecraft/client/renderer/tileentity
|
||||
TileEntitySpecialRenderer,net/minecraft/client/renderer/tileentity
|
||||
AbstractResourcePack,net/minecraft/client/resources
|
||||
DefaultResourcePack,net/minecraft/client/resources
|
||||
FallbackResourceManager,net/minecraft/client/resources
|
||||
FileResourcePack,net/minecraft/client/resources
|
||||
FolderResourcePack,net/minecraft/client/resources
|
||||
FoliageColorReloadListener,net/minecraft/client/resources
|
||||
GrassColorReloadListener,net/minecraft/client/resources
|
||||
GuiScreenTemporaryResourcePackSelect,net/minecraft/client/resources
|
||||
GuiScreenTemporaryResourcePackSelectSelectionList,net/minecraft/client/resources
|
||||
I18n,net/minecraft/client/resources
|
||||
Language,net/minecraft/client/resources
|
||||
LanguageManager,net/minecraft/client/resources
|
||||
Locale,net/minecraft/client/resources
|
||||
ReloadableResourceManager,net/minecraft/client/resources
|
||||
Resource,net/minecraft/client/resources
|
||||
ResourceManager,net/minecraft/client/resources
|
||||
ResourceManagerReloadListener,net/minecraft/client/resources
|
||||
ResourcePack,net/minecraft/client/resources
|
||||
ResourcePackFileNotFoundException,net/minecraft/client/resources
|
||||
ResourcePackRepository,net/minecraft/client/resources
|
||||
ResourcePackRepositoryEntry,net/minecraft/client/resources
|
||||
ResourcePackRepositoryFilter,net/minecraft/client/resources
|
||||
SimpleReloadableResourceManager,net/minecraft/client/resources
|
||||
SimpleReloadableResourceManagerINNER1,net/minecraft/client/resources
|
||||
SimpleResource,net/minecraft/client/resources
|
||||
AnimationFrame,net/minecraft/client/resources/data
|
||||
AnimationMetadataSection,net/minecraft/client/resources/data
|
||||
AnimationMetadataSectionSerializer,net/minecraft/client/resources/data
|
||||
BaseMetadataSectionSerializer,net/minecraft/client/resources/data
|
||||
FontMetadataSection,net/minecraft/client/resources/data
|
||||
FontMetadataSectionSerializer,net/minecraft/client/resources/data
|
||||
LanguageMetadataSection,net/minecraft/client/resources/data
|
||||
LanguageMetadataSectionSerializer,net/minecraft/client/resources/data
|
||||
MetadataSection,net/minecraft/client/resources/data
|
||||
MetadataSectionSerializer,net/minecraft/client/resources/data
|
||||
MetadataSerializer,net/minecraft/client/resources/data
|
||||
MetadataSerializerEmptyAnon,net/minecraft/client/resources/data
|
||||
MetadataSerializerRegistration,net/minecraft/client/resources/data
|
||||
PackMetadataSection,net/minecraft/client/resources/data
|
||||
PackMetadataSectionSerializer,net/minecraft/client/resources/data
|
||||
TextureMetadataSection,net/minecraft/client/resources/data
|
||||
TextureMetadataSectionSerializer,net/minecraft/client/resources/data
|
||||
EnumOptions,net/minecraft/client/settings
|
||||
EnumOptionsHelper,net/minecraft/client/settings
|
||||
GameSettings,net/minecraft/client/settings
|
||||
KeyBinding,net/minecraft/client/settings
|
||||
StatPlaceholder,net/minecraft/client/stats
|
||||
GuiTexturePackSlot,net/minecraft/client/texturepacks
|
||||
GuiTexturePacks,net/minecraft/client/texturepacks
|
||||
ITexturePack,net/minecraft/client/texturepacks
|
||||
TexturePackCustom,net/minecraft/client/texturepacks
|
||||
TexturePackDefault,net/minecraft/client/texturepacks
|
||||
TexturePackDownloadSuccess,net/minecraft/client/texturepacks
|
||||
TexturePackFolder,net/minecraft/client/texturepacks
|
||||
TexturePackImplementation,net/minecraft/client/texturepacks
|
||||
TexturePackList,net/minecraft/client/texturepacks
|
||||
CommandBase,net/minecraft/command
|
||||
CommandClearInventory,net/minecraft/command
|
||||
CommandDebug,net/minecraft/command
|
||||
@@ -524,6 +584,7 @@ CommandHandler,net/minecraft/command
|
||||
CommandHelp,net/minecraft/command
|
||||
CommandKill,net/minecraft/command
|
||||
CommandNotFoundException,net/minecraft/command
|
||||
CommandPlaySound,net/minecraft/command
|
||||
CommandServerBan,net/minecraft/command
|
||||
CommandServerBanIp,net/minecraft/command
|
||||
CommandServerBanlist,net/minecraft/command
|
||||
@@ -543,8 +604,11 @@ CommandServerSay,net/minecraft/command
|
||||
CommandServerStop,net/minecraft/command
|
||||
CommandServerTp,net/minecraft/command
|
||||
CommandServerWhitelist,net/minecraft/command
|
||||
CommandSetPlayerTimeout,net/minecraft/command
|
||||
CommandSetSpawnpoint,net/minecraft/command
|
||||
CommandShowSeed,net/minecraft/command
|
||||
CommandSpreadPlayers,net/minecraft/command
|
||||
CommandSpreadPlayersPosition,net/minecraft/command
|
||||
CommandTime,net/minecraft/command
|
||||
CommandToggleDownfall,net/minecraft/command
|
||||
CommandWeather,net/minecraft/command
|
||||
@@ -643,12 +707,6 @@ EnchantmentUntouching,net/minecraft/enchantment
|
||||
EnchantmentWaterWorker,net/minecraft/enchantment
|
||||
EnumEnchantmentType,net/minecraft/enchantment
|
||||
IEnchantmentModifier,net/minecraft/enchantment
|
||||
CallableEffectAmplifier,net/minecraft/entity
|
||||
CallableEffectDuration,net/minecraft/entity
|
||||
CallableEffectID,net/minecraft/entity
|
||||
CallableEffectIsAmbient,net/minecraft/entity
|
||||
CallableEffectIsSplash,net/minecraft/entity
|
||||
CallableEffectName,net/minecraft/entity
|
||||
CallableEntityName,net/minecraft/entity
|
||||
CallableEntityTracker,net/minecraft/entity
|
||||
CallableEntityType,net/minecraft/entity
|
||||
@@ -660,8 +718,12 @@ EntityCreature,net/minecraft/entity
|
||||
EntityEggInfo,net/minecraft/entity
|
||||
EntityFlying,net/minecraft/entity
|
||||
EntityHanging,net/minecraft/entity
|
||||
EntityLeashKnot,net/minecraft/entity
|
||||
EntityList,net/minecraft/entity
|
||||
EntityLiving,net/minecraft/entity
|
||||
EntityLivingBase,net/minecraft/entity
|
||||
EntityLivingData,net/minecraft/entity
|
||||
EntityOwnable,net/minecraft/entity
|
||||
EntitySelectorArmoredMob,net/minecraft/entity
|
||||
EntityTracker,net/minecraft/entity
|
||||
EntityTrackerEntry,net/minecraft/entity
|
||||
@@ -675,6 +737,8 @@ INpc,net/minecraft/entity
|
||||
IProjectile,net/minecraft/entity
|
||||
IRangedAttackMob,net/minecraft/entity
|
||||
NpcMerchant,net/minecraft/entity
|
||||
SharedMonsterAttributes,net/minecraft/entity
|
||||
SpiderEffectsGroupData,net/minecraft/entity
|
||||
WatchableObject,net/minecraft/entity
|
||||
EntityAIArrowAttack,net/minecraft/entity/ai
|
||||
EntityAIAttackOnCollide,net/minecraft/entity/ai
|
||||
@@ -700,9 +764,10 @@ EntityAILookIdle,net/minecraft/entity/ai
|
||||
EntityAIMate,net/minecraft/entity/ai
|
||||
EntityAIMoveIndoors,net/minecraft/entity/ai
|
||||
EntityAIMoveThroughVillage,net/minecraft/entity/ai
|
||||
EntityAIMoveTowardsRestriction,net/minecraft/entity/ai
|
||||
EntityAIMoveTowardsTarget,net/minecraft/entity/ai
|
||||
EntityAIMoveTwardsRestriction,net/minecraft/entity/ai
|
||||
EntityAINearestAttackableTarget,net/minecraft/entity/ai
|
||||
EntityAINearestAttackableTargetSelector,net/minecraft/entity/ai
|
||||
EntityAINearestAttackableTargetSorter,net/minecraft/entity/ai
|
||||
EntityAIOcelotAttack,net/minecraft/entity/ai
|
||||
EntityAIOcelotSit,net/minecraft/entity/ai
|
||||
@@ -713,6 +778,7 @@ EntityAIPanic,net/minecraft/entity/ai
|
||||
EntityAIPlay,net/minecraft/entity/ai
|
||||
EntityAIRestrictOpenDoor,net/minecraft/entity/ai
|
||||
EntityAIRestrictSun,net/minecraft/entity/ai
|
||||
EntityAIRunAroundLikeCrazy,net/minecraft/entity/ai
|
||||
EntityAISit,net/minecraft/entity/ai
|
||||
EntityAISwimming,net/minecraft/entity/ai
|
||||
EntityAITarget,net/minecraft/entity/ai
|
||||
@@ -732,6 +798,14 @@ EntityMinecartMobSpawnerLogic,net/minecraft/entity/ai
|
||||
EntityMoveHelper,net/minecraft/entity/ai
|
||||
EntitySenses,net/minecraft/entity/ai
|
||||
RandomPositionGenerator,net/minecraft/entity/ai
|
||||
Attribute,net/minecraft/entity/ai/attributes
|
||||
AttributeInstance,net/minecraft/entity/ai/attributes
|
||||
AttributeModifier,net/minecraft/entity/ai/attributes
|
||||
BaseAttribute,net/minecraft/entity/ai/attributes
|
||||
BaseAttributeMap,net/minecraft/entity/ai/attributes
|
||||
ModifiableAttributeInstance,net/minecraft/entity/ai/attributes
|
||||
RangedAttribute,net/minecraft/entity/ai/attributes
|
||||
ServersideAttributeMap,net/minecraft/entity/ai/attributes
|
||||
BossStatus,net/minecraft/entity/boss
|
||||
EntityDragon,net/minecraft/entity/boss
|
||||
EntityDragonPart,net/minecraft/entity/boss
|
||||
@@ -778,6 +852,8 @@ EntitySnowman,net/minecraft/entity/monster
|
||||
EntitySpider,net/minecraft/entity/monster
|
||||
EntityWitch,net/minecraft/entity/monster
|
||||
EntityZombie,net/minecraft/entity/monster
|
||||
EntityZombieGroupData,net/minecraft/entity/monster
|
||||
EntityZombieINNER1,net/minecraft/entity/monster
|
||||
FilterIMob,net/minecraft/entity/monster
|
||||
IMob,net/minecraft/entity/monster
|
||||
ContainerSheep,net/minecraft/entity/passive
|
||||
@@ -786,6 +862,9 @@ EntityAnimal,net/minecraft/entity/passive
|
||||
EntityBat,net/minecraft/entity/passive
|
||||
EntityChicken,net/minecraft/entity/passive
|
||||
EntityCow,net/minecraft/entity/passive
|
||||
EntityHorse,net/minecraft/entity/passive
|
||||
EntityHorseBredSelector,net/minecraft/entity/passive
|
||||
EntityHorseGroupData,net/minecraft/entity/passive
|
||||
EntityMooshroom,net/minecraft/entity/passive
|
||||
EntityOcelot,net/minecraft/entity/passive
|
||||
EntityPig,net/minecraft/entity/passive
|
||||
@@ -812,6 +891,7 @@ EntitySmallFireball,net/minecraft/entity/projectile
|
||||
EntitySnowball,net/minecraft/entity/projectile
|
||||
EntityThrowable,net/minecraft/entity/projectile
|
||||
EntityWitherSkull,net/minecraft/entity/projectile
|
||||
AnimalChest,net/minecraft/inventory
|
||||
Container,net/minecraft/inventory
|
||||
ContainerBeacon,net/minecraft/inventory
|
||||
ContainerBrewingStand,net/minecraft/inventory
|
||||
@@ -820,9 +900,14 @@ ContainerDispenser,net/minecraft/inventory
|
||||
ContainerEnchantment,net/minecraft/inventory
|
||||
ContainerFurnace,net/minecraft/inventory
|
||||
ContainerHopper,net/minecraft/inventory
|
||||
ContainerHorseInventory,net/minecraft/inventory
|
||||
ContainerHorseInventorySlotArmor,net/minecraft/inventory
|
||||
ContainerHorseInventorySlotSaddle,net/minecraft/inventory
|
||||
ContainerMerchant,net/minecraft/inventory
|
||||
ContainerPlayer,net/minecraft/inventory
|
||||
ContainerRepair,net/minecraft/inventory
|
||||
ContainerRepairINNER1,net/minecraft/inventory
|
||||
ContainerRepairINNER2,net/minecraft/inventory
|
||||
ContainerWorkbench,net/minecraft/inventory
|
||||
ICrafting,net/minecraft/inventory
|
||||
IInvBasic,net/minecraft/inventory
|
||||
@@ -834,7 +919,6 @@ InventoryCrafting,net/minecraft/inventory
|
||||
InventoryEnderChest,net/minecraft/inventory
|
||||
InventoryLargeChest,net/minecraft/inventory
|
||||
InventoryMerchant,net/minecraft/inventory
|
||||
InventoryRepair,net/minecraft/inventory
|
||||
Slot,net/minecraft/inventory
|
||||
SlotArmor,net/minecraft/inventory
|
||||
SlotBeacon,net/minecraft/inventory
|
||||
@@ -845,7 +929,6 @@ SlotEnchantment,net/minecraft/inventory
|
||||
SlotEnchantmentTable,net/minecraft/inventory
|
||||
SlotFurnace,net/minecraft/inventory
|
||||
SlotMerchantResult,net/minecraft/inventory
|
||||
SlotRepair,net/minecraft/inventory
|
||||
BehaviorDispenseArmor,net/minecraft/item
|
||||
BehaviorDispenseMinecart,net/minecraft/item
|
||||
EnumAction,net/minecraft/item
|
||||
@@ -888,6 +971,7 @@ ItemGlassBottle,net/minecraft/item
|
||||
ItemHangingEntity,net/minecraft/item
|
||||
ItemHoe,net/minecraft/item
|
||||
ItemInWorldManager,net/minecraft/item
|
||||
ItemLeash,net/minecraft/item
|
||||
ItemLeaves,net/minecraft/item
|
||||
ItemLilyPad,net/minecraft/item
|
||||
ItemMap,net/minecraft/item
|
||||
@@ -895,6 +979,7 @@ ItemMapBase,net/minecraft/item
|
||||
ItemMinecart,net/minecraft/item
|
||||
ItemMonsterPlacer,net/minecraft/item
|
||||
ItemMultiTextureTile,net/minecraft/item
|
||||
ItemNameTag,net/minecraft/item
|
||||
ItemPickaxe,net/minecraft/item
|
||||
ItemPiston,net/minecraft/item
|
||||
ItemPotion,net/minecraft/item
|
||||
@@ -936,7 +1021,7 @@ ShapedRecipes,net/minecraft/item/crafting
|
||||
ShapelessRecipes,net/minecraft/item/crafting
|
||||
ILogAgent,net/minecraft/logging
|
||||
LogAgent,net/minecraft/logging
|
||||
LogAgentINNER1,net/minecraft/logging
|
||||
LogAgentEmptyAnon,net/minecraft/logging
|
||||
LogFormatter,net/minecraft/logging
|
||||
CallableTagCompound1,net/minecraft/nbt
|
||||
CallableTagCompound2,net/minecraft/nbt
|
||||
@@ -954,6 +1039,7 @@ NBTTagList,net/minecraft/nbt
|
||||
NBTTagLong,net/minecraft/nbt
|
||||
NBTTagShort,net/minecraft/nbt
|
||||
NBTTagString,net/minecraft/nbt
|
||||
CallableConnectionName,net/minecraft/network
|
||||
CallablePacketClass,net/minecraft/network
|
||||
CallablePacketID,net/minecraft/network
|
||||
INetworkManager,net/minecraft/network
|
||||
@@ -985,6 +1071,7 @@ Packet12PlayerLook,net/minecraft/network/packet
|
||||
Packet130UpdateSign,net/minecraft/network/packet
|
||||
Packet131MapData,net/minecraft/network/packet
|
||||
Packet132TileEntityData,net/minecraft/network/packet
|
||||
Packet133TileEditorOpen,net/minecraft/network/packet
|
||||
Packet13PlayerLookMove,net/minecraft/network/packet
|
||||
Packet14BlockDig,net/minecraft/network/packet
|
||||
Packet15Place,net/minecraft/network/packet
|
||||
@@ -1014,6 +1101,7 @@ Packet254ServerPing,net/minecraft/network/packet
|
||||
Packet255KickDisconnect,net/minecraft/network/packet
|
||||
Packet25EntityPainting,net/minecraft/network/packet
|
||||
Packet26EntityExpOrb,net/minecraft/network/packet
|
||||
Packet27PlayerInput,net/minecraft/network/packet
|
||||
Packet28EntityVelocity,net/minecraft/network/packet
|
||||
Packet29DestroyEntity,net/minecraft/network/packet
|
||||
Packet2ClientProtocol,net/minecraft/network/packet
|
||||
@@ -1030,6 +1118,8 @@ Packet40EntityMetadata,net/minecraft/network/packet
|
||||
Packet41EntityEffect,net/minecraft/network/packet
|
||||
Packet42RemoveEntityEffect,net/minecraft/network/packet
|
||||
Packet43Experience,net/minecraft/network/packet
|
||||
Packet44UpdateAttributes,net/minecraft/network/packet
|
||||
Packet44UpdateAttributesSnapshot,net/minecraft/network/packet
|
||||
Packet4UpdateTime,net/minecraft/network/packet
|
||||
Packet51MapChunk,net/minecraft/network/packet
|
||||
Packet51MapChunkData,net/minecraft/network/packet
|
||||
@@ -1065,8 +1155,11 @@ PathFinder,net/minecraft/pathfinding
|
||||
PathNavigate,net/minecraft/pathfinding
|
||||
PathPoint,net/minecraft/pathfinding
|
||||
Potion,net/minecraft/potion
|
||||
PotionAbsoption,net/minecraft/potion
|
||||
PotionAttackDamage,net/minecraft/potion
|
||||
PotionEffect,net/minecraft/potion
|
||||
PotionHealth,net/minecraft/potion
|
||||
PotionHealthBoost,net/minecraft/potion
|
||||
PotionHelper,net/minecraft/potion
|
||||
IPlayerUsage,net/minecraft/profiler
|
||||
PlayerUsageSnooper,net/minecraft/profiler
|
||||
@@ -1085,6 +1178,7 @@ ScoreboardSaveData,net/minecraft/scoreboard
|
||||
ServerCommandScoreboard,net/minecraft/scoreboard
|
||||
ServerCommandTestFor,net/minecraft/scoreboard
|
||||
ServerScoreboard,net/minecraft/scoreboard
|
||||
Team,net/minecraft/scoreboard
|
||||
CallableIsServerModded,net/minecraft/server
|
||||
CallableServerMemoryStats,net/minecraft/server
|
||||
CallableServerProfiler,net/minecraft/server
|
||||
@@ -1100,16 +1194,16 @@ DedicatedServerCommandThread,net/minecraft/server/dedicated
|
||||
DedicatedServerListenThread,net/minecraft/server/dedicated
|
||||
DedicatedServerSleepThread,net/minecraft/server/dedicated
|
||||
PropertyManager,net/minecraft/server/dedicated
|
||||
GuiLogFormatter,net/minecraft/server/gui
|
||||
GuiLogOutputHandler,net/minecraft/server/gui
|
||||
GuiStatsComponent,net/minecraft/server/gui
|
||||
GuiStatsListener,net/minecraft/server/gui
|
||||
IUpdatePlayerListBox,net/minecraft/server/gui
|
||||
PlayerListBox,net/minecraft/server/gui
|
||||
ServerGUI,net/minecraft/server/gui
|
||||
ServerGuiCommandListener,net/minecraft/server/gui
|
||||
ServerGuiFocusAdapter,net/minecraft/server/gui
|
||||
ServerWindowAdapter,net/minecraft/server/gui
|
||||
MinecraftServerGui,net/minecraft/server/gui
|
||||
MinecraftServerGuiINNER1,net/minecraft/server/gui
|
||||
MinecraftServerGuiINNER2,net/minecraft/server/gui
|
||||
MinecraftServerGuiINNER3,net/minecraft/server/gui
|
||||
PlayerListComponent,net/minecraft/server/gui
|
||||
StatsComponent,net/minecraft/server/gui
|
||||
StatsComponentINNER1,net/minecraft/server/gui
|
||||
TextAreaLogHandler,net/minecraft/server/gui
|
||||
TextAreaLogHandlerINNER1,net/minecraft/server/gui
|
||||
CallableIsModded,net/minecraft/server/integrated
|
||||
CallableType3,net/minecraft/server/integrated
|
||||
IntegratedPlayerList,net/minecraft/server/integrated
|
||||
@@ -1133,6 +1227,7 @@ StatCrafting,net/minecraft/stats
|
||||
StatFileWriter,net/minecraft/stats
|
||||
StatList,net/minecraft/stats
|
||||
StatTypeDistance,net/minecraft/stats
|
||||
StatTypeFloat,net/minecraft/stats
|
||||
StatTypeSimple,net/minecraft/stats
|
||||
StatTypeTime,net/minecraft/stats
|
||||
StatsSyncher,net/minecraft/stats
|
||||
@@ -1169,6 +1264,7 @@ AABBLocalPool,net/minecraft/util
|
||||
AABBPool,net/minecraft/util
|
||||
AxisAlignedBB,net/minecraft/util
|
||||
ChatAllowedCharacters,net/minecraft/util
|
||||
ChatMessageComponent,net/minecraft/util
|
||||
ChunkCoordinates,net/minecraft/util
|
||||
CombatEntry,net/minecraft/util
|
||||
CombatTracker,net/minecraft/util
|
||||
@@ -1186,8 +1282,6 @@ EnumOS,net/minecraft/util
|
||||
Facing,net/minecraft/util
|
||||
FoodStats,net/minecraft/util
|
||||
HttpUtil,net/minecraft/util
|
||||
HttpUtilRunnable,net/minecraft/util
|
||||
IDownloadSuccess,net/minecraft/util
|
||||
IProgressUpdate,net/minecraft/util
|
||||
Icon,net/minecraft/util
|
||||
IntHashMap,net/minecraft/util
|
||||
@@ -1196,6 +1290,7 @@ LongHashMap,net/minecraft/util
|
||||
LongHashMapEntry,net/minecraft/util
|
||||
MD5String,net/minecraft/util
|
||||
MathHelper,net/minecraft/util
|
||||
MessageComponentSerializer,net/minecraft/util
|
||||
MinecraftError,net/minecraft/util
|
||||
MouseFilter,net/minecraft/util
|
||||
MouseHelper,net/minecraft/util
|
||||
@@ -1203,14 +1298,15 @@ MovementInput,net/minecraft/util
|
||||
MovementInputFromOptions,net/minecraft/util
|
||||
MovingObjectPosition,net/minecraft/util
|
||||
ReportedException,net/minecraft/util
|
||||
ResourceLocation,net/minecraft/util
|
||||
ScreenShotHelper,net/minecraft/util
|
||||
Session,net/minecraft/util
|
||||
StatCollector,net/minecraft/util
|
||||
StringTranslate,net/minecraft/util
|
||||
StringUtils,net/minecraft/util
|
||||
ThreadDownloadResources,net/minecraft/util
|
||||
Timer,net/minecraft/util
|
||||
Tuple,net/minecraft/util
|
||||
Util,net/minecraft/util
|
||||
ValueObject,net/minecraft/util
|
||||
Vec3,net/minecraft/util
|
||||
Vec3Pool,net/minecraft/util
|
||||
@@ -1387,6 +1483,7 @@ ComponentNetherBridgeThrone,net/minecraft/world/gen/structure
|
||||
ComponentScatteredFeature,net/minecraft/world/gen/structure
|
||||
ComponentScatteredFeatureDesertPyramid,net/minecraft/world/gen/structure
|
||||
ComponentScatteredFeatureJunglePyramid,net/minecraft/world/gen/structure
|
||||
ComponentScatteredFeaturePieces,net/minecraft/world/gen/structure
|
||||
ComponentScatteredFeaturePieces2,net/minecraft/world/gen/structure
|
||||
ComponentScatteredFeatureSwampHut,net/minecraft/world/gen/structure
|
||||
ComponentStronghold,net/minecraft/world/gen/structure
|
||||
@@ -1424,6 +1521,8 @@ MapGenMineshaft,net/minecraft/world/gen/structure
|
||||
MapGenNetherBridge,net/minecraft/world/gen/structure
|
||||
MapGenStronghold,net/minecraft/world/gen/structure
|
||||
MapGenStructure,net/minecraft/world/gen/structure
|
||||
MapGenStructureData,net/minecraft/world/gen/structure
|
||||
MapGenStructureIO,net/minecraft/world/gen/structure
|
||||
MapGenVillage,net/minecraft/world/gen/structure
|
||||
StructureBoundingBox,net/minecraft/world/gen/structure
|
||||
StructureComponent,net/minecraft/world/gen/structure
|
||||
|
||||
|
+4170
-3738
File diff suppressed because it is too large.
Load diff
+84
-49
@@ -5,75 +5,110 @@ import java.lang.reflect.Field;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Arrays;
|
||||
|
||||
import joptsimple.ArgumentAcceptingOptionSpec;
|
||||
import joptsimple.OptionParser;
|
||||
import joptsimple.OptionSet;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.main.Main;
|
||||
|
||||
public class Start
|
||||
{
|
||||
public static void main(String[] args)
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
int userIndex = -1;
|
||||
int passIndex = -1;
|
||||
int sessIndex = -1;
|
||||
int versIndex = -1;
|
||||
|
||||
for( int x = 0; x < args.length; x++)
|
||||
{
|
||||
if (args[x].equals("--username")) userIndex = x + 1;
|
||||
else if (args[x].equals("--password")) passIndex = x + 1;
|
||||
else if (args[x].equals("--session")) sessIndex = x + 1;
|
||||
else if (args[x].equals("--version")) versIndex = x + 1;
|
||||
}
|
||||
|
||||
if (userIndex != 0-1 && passIndex != -1 && sessIndex == -1)
|
||||
{
|
||||
String[] session = getSession(args[userIndex], args[passIndex]);
|
||||
if (session != null)
|
||||
{
|
||||
args[userIndex] = session[0];
|
||||
args = concat(args, new String[]{"--session", session[1]});
|
||||
}
|
||||
}
|
||||
|
||||
//Kill the password if its there so it isn't printed to the console.
|
||||
if (passIndex != -1)
|
||||
{
|
||||
args[passIndex-1] = "no_password_for_joo";
|
||||
args[passIndex] = "no_password_for_joo";
|
||||
}
|
||||
|
||||
if (versIndex == -1)
|
||||
{
|
||||
args = concat(args, new String[]{ "--version", "fml_mcp" });
|
||||
}
|
||||
|
||||
Main.main(args);
|
||||
}
|
||||
|
||||
private static String[] getSession(String username, String password) throws UnsupportedEncodingException
|
||||
{
|
||||
String parameters = "http://login.minecraft.net/?user=" + URLEncoder.encode(username, "UTF-8") +
|
||||
"&password=" + URLEncoder.encode(password, "UTF-8") +
|
||||
"&version=" + 13;
|
||||
String result = openUrl(parameters);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
System.out.println("Can't connect to minecraft.net");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!result.contains(":"))
|
||||
{
|
||||
System.out.println("Login Failed: " + result);
|
||||
return null;
|
||||
}
|
||||
String[] values = result.split(":");
|
||||
return new String[]{ values[2].trim(), values[3].trim() };
|
||||
}
|
||||
|
||||
private static String openUrl(String addr)
|
||||
{
|
||||
try
|
||||
{
|
||||
Field f = Minecraft.class.getDeclaredField("field_71463_am");
|
||||
Field.setAccessible(new Field[] { f }, true);
|
||||
f.set(null, new File("."));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
if (args.length != 2)
|
||||
{
|
||||
Minecraft.main(args);
|
||||
}
|
||||
else
|
||||
{
|
||||
try {
|
||||
String parameters = "http://login.minecraft.net/?user=" + URLEncoder.encode(args[0], "UTF-8") +
|
||||
"&password=" + URLEncoder.encode(args[1], "UTF-8") +
|
||||
"&version=" + 13;
|
||||
String result = openUrl(parameters);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
System.out.println("Can't connect to minecraft.net");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!result.contains(":"))
|
||||
{
|
||||
System.out.println("Login Failed: " + result);
|
||||
return;
|
||||
}
|
||||
//latestVersion, downloadTicket, userName, sessionId
|
||||
String[] values = result.split(":");
|
||||
Minecraft.main(new String[]{values[2].trim(), values[3].trim()});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static String openUrl(String addr)
|
||||
{
|
||||
try {
|
||||
URL url = new URL(addr);
|
||||
java.io.InputStream is;
|
||||
is = url.openConnection().getInputStream();
|
||||
|
||||
java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(is));
|
||||
String buf = "";
|
||||
String line = null;
|
||||
while((line = reader.readLine() ) != null)
|
||||
|
||||
while ((line = reader.readLine()) != null)
|
||||
{
|
||||
buf += "\n" + line;
|
||||
buf += "\n" + line;
|
||||
}
|
||||
|
||||
reader.close();
|
||||
return buf;
|
||||
} catch (IOException e) {
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static <T> T[] concat(T[] first, T[] second)
|
||||
{
|
||||
T[] result = Arrays.copyOf(first, first.length + second.length);
|
||||
System.arraycopy(second, 0, result, first.length, second.length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+164
-111
@@ -1,95 +1,51 @@
|
||||
diff -r -U 3 minecraft\net\minecraft\client\Minecraft.java minecraft_patched\net\minecraft\client\Minecraft.java
|
||||
--- minecraft\net\minecraft\client\Minecraft.java Sat Apr 27 01:53:03 2013
|
||||
+++ minecraft_patched\net\minecraft\client\Minecraft.java Sat Apr 27 01:55:19 2013
|
||||
@@ -532,9 +532,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- while(true) {
|
||||
try {
|
||||
- if(this.field_71425_J) {
|
||||
+ while(this.field_71425_J) {
|
||||
if(this.field_71434_R && this.field_71433_S != null) {
|
||||
this.func_71377_b(this.field_71433_S);
|
||||
return;
|
||||
@@ -552,7 +551,6 @@
|
||||
this.func_71373_a(new GuiMemoryErrorScreen());
|
||||
System.gc();
|
||||
}
|
||||
- continue;
|
||||
}
|
||||
} catch (MinecraftError var12) {
|
||||
;
|
||||
@@ -570,8 +568,6 @@
|
||||
this.func_71405_e();
|
||||
}
|
||||
|
||||
- return;
|
||||
- }
|
||||
}
|
||||
|
||||
private void func_71411_J() {
|
||||
diff -r -U 3 minecraft\net\minecraft\src\CallableSuspiciousClasses.java minecraft_patched\net\minecraft\src\CallableSuspiciousClasses.java
|
||||
--- minecraft\net\minecraft\src\CallableSuspiciousClasses.java Sat Apr 27 01:53:04 2013
|
||||
+++ minecraft_patched\net\minecraft\src\CallableSuspiciousClasses.java Sat Apr 27 01:55:19 2013
|
||||
--- minecraft\net\minecraft\src\CallableSuspiciousClasses.java Tue Sep 17 13:58:48 2013
|
||||
+++ minecraft_patched\net\minecraft\src\CallableSuspiciousClasses.java Tue Sep 17 14:01:01 2013
|
||||
@@ -21,9 +21,14 @@
|
||||
|
||||
public String func_85085_a() {
|
||||
public String func_85085_a() throws SecurityException, NoSuchFieldException, IllegalAccessException, IllegalArgumentException {
|
||||
StringBuilder var1 = new StringBuilder();
|
||||
- Field var2 = ClassLoader.class.getDeclaredField("classes");
|
||||
- var2.setAccessible(true);
|
||||
+ ArrayList var3;
|
||||
+ try {
|
||||
Field var2 = ClassLoader.class.getDeclaredField("classes");
|
||||
var2.setAccessible(true);
|
||||
- ArrayList var3 = new ArrayList((Vector)var2.get(CrashReport.class.getClassLoader()));
|
||||
+ ArrayList var3;
|
||||
+ try {
|
||||
+ Field var2 = ClassLoader.class.getDeclaredField("classes");
|
||||
+ var2.setAccessible(true);
|
||||
+ var3 = new ArrayList((Vector)var2.get(CrashReport.class.getClassLoader()));
|
||||
+ } catch(Exception ex) {
|
||||
+ return "";
|
||||
+ }
|
||||
+ var3 = new ArrayList((Vector)var2.get(CrashReport.class.getClassLoader()));
|
||||
+ } catch(Exception ex) {
|
||||
+ return "";
|
||||
+ }
|
||||
boolean var4 = true;
|
||||
boolean var5 = !CrashReport.class.getCanonicalName().equals("net.minecraft.CrashReport");
|
||||
HashMap var6 = new HashMap();
|
||||
diff -r -U 3 minecraft\net\minecraft\src\CodecMus.java minecraft_patched\net\minecraft\src\CodecMus.java
|
||||
--- minecraft\net\minecraft\src\CodecMus.java Sat Apr 27 01:53:04 2013
|
||||
+++ minecraft_patched\net\minecraft\src\CodecMus.java Sat Apr 27 01:55:19 2013
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.src;
|
||||
@@ -98,6 +103,10 @@
|
||||
|
||||
+import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import net.minecraft.src.MusInputStream;
|
||||
import paulscode.sound.codecs.CodecJOrbis;
|
||||
@@ -7,6 +8,10 @@
|
||||
public class CodecMus extends CodecJOrbis {
|
||||
|
||||
protected InputStream openInputStream() {
|
||||
- return new MusInputStream(this, this.url, this.urlConnection.getInputStream());
|
||||
+ try {
|
||||
+ return new MusInputStream(this, this.url, this.urlConnection.getInputStream());
|
||||
+ } catch (IOException e) {
|
||||
+ return null;
|
||||
+ }
|
||||
// $FF: synthetic method
|
||||
public Object call() {
|
||||
+ try {
|
||||
return this.func_85085_a();
|
||||
+ } catch(Exception ex) {
|
||||
+ return null;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
diff -r -U 3 minecraft\net\minecraft\src\ComponentStrongholdRightTurn.java minecraft_patched\net\minecraft\src\ComponentStrongholdRightTurn.java
|
||||
--- minecraft\net\minecraft\src\ComponentStrongholdRightTurn.java Sat Apr 27 01:53:04 2013
|
||||
+++ minecraft_patched\net\minecraft\src\ComponentStrongholdRightTurn.java Sat Apr 27 01:55:19 2013
|
||||
--- minecraft\net\minecraft\src\ComponentStrongholdRightTurn.java Tue Sep 17 13:58:48 2013
|
||||
+++ minecraft_patched\net\minecraft\src\ComponentStrongholdRightTurn.java Tue Sep 17 14:01:01 2013
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
public class ComponentStrongholdRightTurn extends ComponentStrongholdLeftTurn {
|
||||
|
||||
+ public ComponentStrongholdRightTurn(int p_i3843_1_, Random p_i3843_2_, StructureBoundingBox p_i3843_3_, int p_i3843_4_) {
|
||||
+ super(p_i3843_1_, p_i3843_2_, p_i3843_3_, p_i3843_4_);
|
||||
+ public ComponentStrongholdRightTurn(int p_i2074_1_, Random p_i2074_2_, StructureBoundingBox p_i2074_3_, int p_i2074_4_) {
|
||||
+ super(p_i2074_1_, p_i2074_2_, p_i2074_3_, p_i2074_4_);
|
||||
+ }
|
||||
+
|
||||
public void func_74861_a(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) {
|
||||
if(this.field_74885_f != 2 && this.field_74885_f != 3) {
|
||||
this.func_74989_b((ComponentStrongholdStairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1);
|
||||
diff -r -U 3 minecraft\net\minecraft\src\DedicatedServer.java minecraft_patched\net\minecraft\src\DedicatedServer.java
|
||||
--- minecraft\net\minecraft\src\DedicatedServer.java Sat Apr 27 01:53:04 2013
|
||||
+++ minecraft_patched\net\minecraft\src\DedicatedServer.java Sat Apr 27 01:55:19 2013
|
||||
@@ -207,7 +207,7 @@
|
||||
--- minecraft\net\minecraft\src\DedicatedServer.java Tue Sep 17 13:58:48 2013
|
||||
+++ minecraft_patched\net\minecraft\src\DedicatedServer.java Tue Sep 17 14:01:01 2013
|
||||
@@ -208,7 +208,7 @@
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@@ -99,21 +55,55 @@ diff -r -U 3 minecraft\net\minecraft\src\DedicatedServer.java minecraft_patched\
|
||||
this.func_71333_ah();
|
||||
}
|
||||
diff -r -U 3 minecraft\net\minecraft\src\EnumChatFormatting.java minecraft_patched\net\minecraft\src\EnumChatFormatting.java
|
||||
--- minecraft\net\minecraft\src\EnumChatFormatting.java Sat Apr 27 01:53:05 2013
|
||||
+++ minecraft_patched\net\minecraft\src\EnumChatFormatting.java Sat Apr 27 01:55:19 2013
|
||||
--- minecraft\net\minecraft\src\EnumChatFormatting.java Tue Sep 17 13:58:49 2013
|
||||
+++ minecraft_patched\net\minecraft\src\EnumChatFormatting.java Tue Sep 17 14:01:01 2013
|
||||
@@ -38,7 +38,7 @@
|
||||
private final String field_96304_B;
|
||||
|
||||
private EnumChatFormatting(char p_i10000_3_) {
|
||||
- this(p_i10000_1_, p_i10000_2_, p_i10000_3_, false);
|
||||
+ this(p_i10000_3_, false);
|
||||
private EnumChatFormatting(char p_i1336_3_) {
|
||||
- this(p_i1336_1_, p_i1336_2_, p_i1336_3_, false);
|
||||
+ this(p_i1336_3_, false);
|
||||
}
|
||||
|
||||
private EnumChatFormatting(char p_i10001_3_, boolean p_i10001_4_) {
|
||||
private EnumChatFormatting(char p_i1337_3_, boolean p_i1337_4_) {
|
||||
diff -r -U 3 minecraft\net\minecraft\src\FileResourcePack.java minecraft_patched\net\minecraft\src\FileResourcePack.java
|
||||
--- minecraft\net\minecraft\src\FileResourcePack.java Tue Sep 17 13:58:49 2013
|
||||
+++ minecraft_patched\net\minecraft\src\FileResourcePack.java Tue Sep 17 14:01:01 2013
|
||||
@@ -84,12 +84,18 @@
|
||||
|
||||
protected void finalize() {
|
||||
this.close();
|
||||
+ try {
|
||||
super.finalize();
|
||||
+ } catch(Throwable t) {
|
||||
+ }
|
||||
}
|
||||
|
||||
public void close() {
|
||||
if(this.field_110600_d != null) {
|
||||
+ try {
|
||||
this.field_110600_d.close();
|
||||
+ } catch(Exception ex) {
|
||||
+ }
|
||||
this.field_110600_d = null;
|
||||
}
|
||||
|
||||
diff -r -U 3 minecraft\net\minecraft\src\FolderResourcePack.java minecraft_patched\net\minecraft\src\FolderResourcePack.java
|
||||
--- minecraft\net\minecraft\src\FolderResourcePack.java Tue Sep 17 13:58:49 2013
|
||||
+++ minecraft_patched\net\minecraft\src\FolderResourcePack.java Tue Sep 17 14:01:01 2013
|
||||
@@ -29,7 +29,7 @@
|
||||
HashSet var1 = Sets.newHashSet();
|
||||
File var2 = new File(this.field_110597_b, "assets/");
|
||||
if(var2.isDirectory()) {
|
||||
- File[] var3 = var2.listFiles(DirectoryFileFilter.DIRECTORY);
|
||||
+ File[] var3 = var2.listFiles((java.io.FileFilter)DirectoryFileFilter.DIRECTORY);
|
||||
int var4 = var3.length;
|
||||
|
||||
for(int var5 = 0; var5 < var4; ++var5) {
|
||||
diff -r -U 3 minecraft\net\minecraft\src\FontRenderer.java minecraft_patched\net\minecraft\src\FontRenderer.java
|
||||
--- minecraft\net\minecraft\src\FontRenderer.java Sat Apr 27 01:53:05 2013
|
||||
+++ minecraft_patched\net\minecraft\src\FontRenderer.java Sat Apr 27 01:55:19 2013
|
||||
@@ -621,8 +621,6 @@
|
||||
--- minecraft\net\minecraft\src\FontRenderer.java Tue Sep 17 13:58:49 2013
|
||||
+++ minecraft_patched\net\minecraft\src\FontRenderer.java Tue Sep 17 14:01:01 2013
|
||||
@@ -630,8 +630,6 @@
|
||||
case 10:
|
||||
--var5;
|
||||
break;
|
||||
@@ -122,19 +112,19 @@ diff -r -U 3 minecraft\net\minecraft\src\FontRenderer.java minecraft_patched\net
|
||||
case 167:
|
||||
if(var5 < var3 - 1) {
|
||||
++var5;
|
||||
@@ -636,6 +634,8 @@
|
||||
@@ -645,6 +643,8 @@
|
||||
}
|
||||
}
|
||||
break;
|
||||
+ case 32:
|
||||
+ var6 = var5;
|
||||
+ var6 = var5;
|
||||
default:
|
||||
var4 += this.func_78263_a(var8);
|
||||
if(var7) {
|
||||
diff -r -U 3 minecraft\net\minecraft\src\IntegratedServer.java minecraft_patched\net\minecraft\src\IntegratedServer.java
|
||||
--- minecraft\net\minecraft\src\IntegratedServer.java Sat Apr 27 01:53:05 2013
|
||||
+++ minecraft_patched\net\minecraft\src\IntegratedServer.java Sat Apr 27 01:55:19 2013
|
||||
@@ -101,7 +101,7 @@
|
||||
--- minecraft\net\minecraft\src\IntegratedServer.java Tue Sep 17 13:58:50 2013
|
||||
+++ minecraft_patched\net\minecraft\src\IntegratedServer.java Tue Sep 17 14:01:01 2013
|
||||
@@ -103,7 +103,7 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -143,9 +133,60 @@ diff -r -U 3 minecraft\net\minecraft\src\IntegratedServer.java minecraft_patched
|
||||
boolean var1 = this.field_71348_o;
|
||||
this.field_71348_o = this.field_71347_n.func_71752_f();
|
||||
if(!var1 && this.field_71348_o) {
|
||||
diff -r -U 3 minecraft\net\minecraft\src\Minecraft.java minecraft_patched\net\minecraft\src\Minecraft.java
|
||||
--- minecraft\net\minecraft\src\Minecraft.java Tue Sep 17 13:58:50 2013
|
||||
+++ minecraft_patched\net\minecraft\src\Minecraft.java Tue Sep 17 14:01:01 2013
|
||||
@@ -604,8 +604,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- while(true) {
|
||||
- try {
|
||||
+ try {
|
||||
+ while(this.field_71425_J) {
|
||||
if(this.field_71425_J) {
|
||||
if(this.field_71434_R && this.field_71433_S != null) {
|
||||
this.func_71377_b(this.field_71433_S);
|
||||
@@ -626,23 +626,20 @@
|
||||
}
|
||||
continue;
|
||||
}
|
||||
- } catch (MinecraftError var12) {
|
||||
- ;
|
||||
- } catch (ReportedException var13) {
|
||||
- this.func_71396_d(var13.func_71575_a());
|
||||
- this.func_71398_f();
|
||||
- var13.printStackTrace();
|
||||
- this.func_71377_b(var13.func_71575_a());
|
||||
- } catch (Throwable var14) {
|
||||
- var2 = this.func_71396_d(new CrashReport("Unexpected error", var14));
|
||||
- this.func_71398_f();
|
||||
- var14.printStackTrace();
|
||||
- this.func_71377_b(var2);
|
||||
- } finally {
|
||||
- this.func_71405_e();
|
||||
}
|
||||
-
|
||||
- return;
|
||||
+ } catch (MinecraftError var12) {
|
||||
+ } catch (ReportedException var13) {
|
||||
+ this.func_71396_d(var13.func_71575_a());
|
||||
+ this.func_71398_f();
|
||||
+ var13.printStackTrace();
|
||||
+ this.func_71377_b(var13.func_71575_a());
|
||||
+ } catch (Throwable var14) {
|
||||
+ var2 = this.func_71396_d(new CrashReport("Unexpected error", var14));
|
||||
+ this.func_71398_f();
|
||||
+ var14.printStackTrace();
|
||||
+ this.func_71377_b(var2);
|
||||
+ } finally {
|
||||
+ this.func_71405_e();
|
||||
}
|
||||
}
|
||||
|
||||
diff -r -U 3 minecraft\net\minecraft\src\RConThreadClient.java minecraft_patched\net\minecraft\src\RConThreadClient.java
|
||||
--- minecraft\net\minecraft\src\RConThreadClient.java Sat Apr 27 01:53:07 2013
|
||||
+++ minecraft_patched\net\minecraft\src\RConThreadClient.java Sat Apr 27 01:55:19 2013
|
||||
--- minecraft\net\minecraft\src\RConThreadClient.java Tue Sep 17 13:58:51 2013
|
||||
+++ minecraft_patched\net\minecraft\src\RConThreadClient.java Tue Sep 17 14:01:01 2013
|
||||
@@ -32,8 +32,8 @@
|
||||
}
|
||||
|
||||
@@ -173,22 +214,21 @@ diff -r -U 3 minecraft\net\minecraft\src\RConThreadClient.java minecraft_patched
|
||||
}
|
||||
-
|
||||
- return;
|
||||
- }
|
||||
+ } catch (SocketTimeoutException var17) {
|
||||
+ } catch (IOException var18) {
|
||||
+ } catch (Exception var19) {
|
||||
+ System.out.println(var19);
|
||||
+ } finally {
|
||||
+ this.func_72653_g();
|
||||
}
|
||||
-
|
||||
+ } catch (SocketTimeoutException var17) {
|
||||
+ } catch (IOException var18) {
|
||||
+ } catch (Exception var19) {
|
||||
+ System.out.println(var19);
|
||||
+ } finally {
|
||||
+ this.func_72653_g();
|
||||
+ }
|
||||
}
|
||||
|
||||
private void func_72654_a(int p_72654_1_, int p_72654_2_, String p_72654_3_) throws IOException {
|
||||
diff -r -U 3 minecraft\net\minecraft\src\RenderBlocks.java minecraft_patched\net\minecraft\src\RenderBlocks.java
|
||||
--- minecraft\net\minecraft\src\RenderBlocks.java Sat Apr 27 01:53:07 2013
|
||||
+++ minecraft_patched\net\minecraft\src\RenderBlocks.java Sat Apr 27 01:55:19 2013
|
||||
@@ -1951,16 +1951,16 @@
|
||||
--- minecraft\net\minecraft\src\RenderBlocks.java Tue Sep 17 13:58:51 2013
|
||||
+++ minecraft_patched\net\minecraft\src\RenderBlocks.java Tue Sep 17 14:01:01 2013
|
||||
@@ -1960,16 +1960,16 @@
|
||||
float var25 = (float)(p_78589_2_ + 1);
|
||||
float var26 = (float)(p_78589_4_ + 0);
|
||||
float var27 = (float)(p_78589_4_ + 1);
|
||||
@@ -209,7 +249,7 @@ diff -r -U 3 minecraft\net\minecraft\src\RenderBlocks.java minecraft_patched\net
|
||||
int var29 = 0;
|
||||
int var30 = 0;
|
||||
int var31 = 16;
|
||||
@@ -2006,7 +2006,7 @@
|
||||
@@ -2016,7 +2016,7 @@
|
||||
var5.func_78374_a((double)var25, (double)p_78589_3_ + 0.015625D, (double)var26, (double)var9.func_94214_a((double)var31), (double)var9.func_94207_b((double)var30));
|
||||
var5.func_78374_a((double)var24, (double)p_78589_3_ + 0.015625D, (double)var26, (double)var9.func_94214_a((double)var29), (double)var9.func_94207_b((double)var30));
|
||||
var5.func_78374_a((double)var24, (double)p_78589_3_ + 0.015625D, (double)var27, (double)var9.func_94214_a((double)var29), (double)var9.func_94207_b((double)var32));
|
||||
@@ -219,9 +259,9 @@ diff -r -U 3 minecraft\net\minecraft\src\RenderBlocks.java minecraft_patched\net
|
||||
var5.func_78374_a((double)var25, (double)p_78589_3_ + 0.015625D, (double)var26, (double)var8.func_94212_f(), (double)var8.func_94206_g());
|
||||
var5.func_78374_a((double)var24, (double)p_78589_3_ + 0.015625D, (double)var26, (double)var8.func_94209_e(), (double)var8.func_94206_g());
|
||||
diff -r -U 3 minecraft\net\minecraft\src\RenderGlobal.java minecraft_patched\net\minecraft\src\RenderGlobal.java
|
||||
--- minecraft\net\minecraft\src\RenderGlobal.java Sat Apr 27 01:53:07 2013
|
||||
+++ minecraft_patched\net\minecraft\src\RenderGlobal.java Sat Apr 27 01:55:19 2013
|
||||
@@ -1449,7 +1449,7 @@
|
||||
--- minecraft\net\minecraft\src\RenderGlobal.java Tue Sep 17 13:58:51 2013
|
||||
+++ minecraft_patched\net\minecraft\src\RenderGlobal.java Tue Sep 17 14:01:01 2013
|
||||
@@ -1445,7 +1445,7 @@
|
||||
double var15 = this.field_72777_q.field_71451_h.field_70165_t - p_72726_2_;
|
||||
double var17 = this.field_72777_q.field_71451_h.field_70163_u - p_72726_4_;
|
||||
double var19 = this.field_72777_q.field_71451_h.field_70161_v - p_72726_6_;
|
||||
@@ -230,11 +270,26 @@ diff -r -U 3 minecraft\net\minecraft\src\RenderGlobal.java minecraft_patched\net
|
||||
if(p_72726_1_.equals("hugeexplosion")) {
|
||||
this.field_72777_q.field_71452_i.func_78873_a(var21 = new EntityHugeExplodeFX(this.field_72769_h, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_));
|
||||
} else if(p_72726_1_.equals("largeexplode")) {
|
||||
diff -r -U 3 minecraft\net\minecraft\src\SoundPoolURLConnection.java minecraft_patched\net\minecraft\src\SoundPoolURLConnection.java
|
||||
--- minecraft\net\minecraft\src\SoundPoolURLConnection.java Tue Sep 17 13:58:51 2013
|
||||
+++ minecraft_patched\net\minecraft\src\SoundPoolURLConnection.java Tue Sep 17 14:01:01 2013
|
||||
@@ -22,7 +22,11 @@
|
||||
public void connect() {}
|
||||
|
||||
public InputStream getInputStream() {
|
||||
+ try {
|
||||
return SoundPool.func_110655_a(this.field_110660_a).func_110536_a(this.field_110659_b).func_110527_b();
|
||||
+ } catch(Exception ex) {
|
||||
+ return null;
|
||||
+ }
|
||||
}
|
||||
|
||||
// $FF: synthetic method
|
||||
diff -r -U 3 minecraft\net\minecraft\src\TcpMasterThread.java minecraft_patched\net\minecraft\src\TcpMasterThread.java
|
||||
--- minecraft\net\minecraft\src\TcpMasterThread.java Sat Apr 27 01:53:07 2013
|
||||
+++ minecraft_patched\net\minecraft\src\TcpMasterThread.java Sat Apr 27 01:55:19 2013
|
||||
--- minecraft\net\minecraft\src\TcpMasterThread.java Tue Sep 17 13:58:51 2013
|
||||
+++ minecraft_patched\net\minecraft\src\TcpMasterThread.java Tue Sep 17 14:01:01 2013
|
||||
@@ -11,6 +11,7 @@
|
||||
this.field_74504_a = p_i3285_1_;
|
||||
this.field_74504_a = p_i1395_1_;
|
||||
}
|
||||
|
||||
+ @SuppressWarnings("deprecation")
|
||||
@@ -242,15 +297,13 @@ diff -r -U 3 minecraft\net\minecraft\src\TcpMasterThread.java minecraft_patched\
|
||||
try {
|
||||
Thread.sleep(5000L);
|
||||
diff -r -U 3 minecraft\net\minecraft\src\ThreadedFileIOBase.java minecraft_patched\net\minecraft\src\ThreadedFileIOBase.java
|
||||
--- minecraft\net\minecraft\src\ThreadedFileIOBase.java Sat Apr 27 01:53:07 2013
|
||||
+++ minecraft_patched\net\minecraft\src\ThreadedFileIOBase.java Sat Apr 27 01:55:19 2013
|
||||
@@ -20,7 +20,8 @@
|
||||
--- minecraft\net\minecraft\src\ThreadedFileIOBase.java Tue Sep 17 13:58:52 2013
|
||||
+++ minecraft_patched\net\minecraft\src\ThreadedFileIOBase.java Tue Sep 17 14:01:01 2013
|
||||
@@ -20,6 +20,7 @@
|
||||
}
|
||||
|
||||
public void run() {
|
||||
- this.func_75736_b();
|
||||
+ while(true)
|
||||
+ this.func_75736_b();
|
||||
+ while(true)
|
||||
this.func_75736_b();
|
||||
}
|
||||
|
||||
private void func_75736_b() {
|
||||
@@ -1,42 +1,52 @@
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\CallableSuspiciousClasses.java minecraft_server_patched\net\minecraft\src\CallableSuspiciousClasses.java
|
||||
--- minecraft_server\net\minecraft\src\CallableSuspiciousClasses.java Sat Apr 27 01:54:18 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\CallableSuspiciousClasses.java Sat Apr 27 01:56:15 2013
|
||||
--- minecraft_server\net\minecraft\src\CallableSuspiciousClasses.java Tue Sep 17 14:00:13 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\CallableSuspiciousClasses.java Tue Sep 17 14:01:07 2013
|
||||
@@ -21,9 +21,14 @@
|
||||
|
||||
public String func_85085_a() {
|
||||
public String func_85085_a() throws SecurityException, NoSuchFieldException, IllegalAccessException, IllegalArgumentException {
|
||||
StringBuilder var1 = new StringBuilder();
|
||||
- Field var2 = ClassLoader.class.getDeclaredField("classes");
|
||||
- var2.setAccessible(true);
|
||||
+ ArrayList var3;
|
||||
+ try {
|
||||
Field var2 = ClassLoader.class.getDeclaredField("classes");
|
||||
var2.setAccessible(true);
|
||||
- ArrayList var3 = new ArrayList((Vector)var2.get(CrashReport.class.getClassLoader()));
|
||||
+ ArrayList var3;
|
||||
+ try {
|
||||
+ Field var2 = ClassLoader.class.getDeclaredField("classes");
|
||||
+ var2.setAccessible(true);
|
||||
+ var3 = new ArrayList((Vector)var2.get(CrashReport.class.getClassLoader()));
|
||||
+ } catch(Exception ex) {
|
||||
+ return "";
|
||||
+ }
|
||||
+ var3 = new ArrayList((Vector)var2.get(CrashReport.class.getClassLoader()));
|
||||
+ } catch(Exception ex) {
|
||||
+ return "";
|
||||
+ }
|
||||
boolean var4 = true;
|
||||
boolean var5 = !CrashReport.class.getCanonicalName().equals("net.minecraft.CrashReport");
|
||||
HashMap var6 = new HashMap();
|
||||
@@ -98,6 +103,10 @@
|
||||
|
||||
// $FF: synthetic method
|
||||
public Object call() {
|
||||
- return this.func_85085_a();
|
||||
+ try {
|
||||
+ return this.func_85085_a();
|
||||
+ } catch(Exception ex) {
|
||||
+ return null;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\ComponentStrongholdRightTurn.java minecraft_server_patched\net\minecraft\src\ComponentStrongholdRightTurn.java
|
||||
--- minecraft_server\net\minecraft\src\ComponentStrongholdRightTurn.java Sat Apr 27 01:54:19 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\ComponentStrongholdRightTurn.java Sat Apr 27 01:56:15 2013
|
||||
--- minecraft_server\net\minecraft\src\ComponentStrongholdRightTurn.java Tue Sep 17 14:00:14 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\ComponentStrongholdRightTurn.java Tue Sep 17 14:01:07 2013
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
public class ComponentStrongholdRightTurn extends ComponentStrongholdLeftTurn {
|
||||
|
||||
+ public ComponentStrongholdRightTurn(int p_i3843_1_, Random p_i3843_2_, StructureBoundingBox p_i3843_3_, int p_i3843_4_) {
|
||||
+ super(p_i3843_1_, p_i3843_2_, p_i3843_3_, p_i3843_4_);
|
||||
+ public ComponentStrongholdRightTurn(int p_i2074_1_, Random p_i2074_2_, StructureBoundingBox p_i2074_3_, int p_i2074_4_) {
|
||||
+ super(p_i2074_1_, p_i2074_2_, p_i2074_3_, p_i2074_4_);
|
||||
+ }
|
||||
+
|
||||
public void func_74861_a(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) {
|
||||
if(this.field_74885_f != 2 && this.field_74885_f != 3) {
|
||||
this.func_74989_b((ComponentStrongholdStairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1);
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\DedicatedServer.java minecraft_server_patched\net\minecraft\src\DedicatedServer.java
|
||||
--- minecraft_server\net\minecraft\src\DedicatedServer.java Sat Apr 27 01:54:19 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\DedicatedServer.java Sat Apr 27 01:56:15 2013
|
||||
@@ -208,7 +208,7 @@
|
||||
--- minecraft_server\net\minecraft\src\DedicatedServer.java Tue Sep 17 14:00:14 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\DedicatedServer.java Tue Sep 17 14:01:07 2013
|
||||
@@ -209,7 +209,7 @@
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@@ -46,53 +56,43 @@ diff -r -U 3 minecraft_server\net\minecraft\src\DedicatedServer.java minecraft_s
|
||||
this.func_71333_ah();
|
||||
}
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\EnumChatFormatting.java minecraft_server_patched\net\minecraft\src\EnumChatFormatting.java
|
||||
--- minecraft_server\net\minecraft\src\EnumChatFormatting.java Sat Apr 27 01:54:20 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\EnumChatFormatting.java Sat Apr 27 01:56:15 2013
|
||||
--- minecraft_server\net\minecraft\src\EnumChatFormatting.java Tue Sep 17 14:00:14 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\EnumChatFormatting.java Tue Sep 17 14:01:07 2013
|
||||
@@ -38,7 +38,7 @@
|
||||
private final String field_96304_B;
|
||||
|
||||
private EnumChatFormatting(char p_i10000_3_) {
|
||||
- this(p_i10000_1_, p_i10000_2_, p_i10000_3_, false);
|
||||
+ this(p_i10000_3_, false);
|
||||
private EnumChatFormatting(char p_i1336_3_) {
|
||||
- this(p_i1336_1_, p_i1336_2_, p_i1336_3_, false);
|
||||
+ this(p_i1336_3_, false);
|
||||
}
|
||||
|
||||
private EnumChatFormatting(char p_i10001_3_, boolean p_i10001_4_) {
|
||||
private EnumChatFormatting(char p_i1337_3_, boolean p_i1337_4_) {
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\MemoryConnection.java minecraft_server_patched\net\minecraft\src\MemoryConnection.java
|
||||
--- minecraft_server\net\minecraft\src\MemoryConnection.java Sat Apr 27 01:54:20 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\MemoryConnection.java Sat Apr 27 01:56:15 2013
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.minecraft.src.ILogAgent;
|
||||
import net.minecraft.src.INetworkManager;
|
||||
@@ -11,7 +13,7 @@
|
||||
--- minecraft_server\net\minecraft\src\MemoryConnection.java Tue Sep 17 14:00:15 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\MemoryConnection.java Tue Sep 17 14:01:07 2013
|
||||
@@ -11,13 +11,18 @@
|
||||
public class MemoryConnection implements INetworkManager {
|
||||
|
||||
private static final SocketAddress field_74444_a = new InetSocketAddress("127.0.0.1", 0);
|
||||
- private final List field_74442_b;
|
||||
+ private final List field_74442_b = Collections.synchronizedList(new ArrayList());
|
||||
+ private final List field_74442_b = java.util.Collections.synchronizedList(new java.util.ArrayList());
|
||||
private final ILogAgent field_98214_c;
|
||||
private MemoryConnection field_74443_c;
|
||||
private NetHandler field_74440_d;
|
||||
@@ -19,6 +21,11 @@
|
||||
private boolean field_74441_e;
|
||||
private String field_74438_f;
|
||||
private Object[] field_74439_g;
|
||||
|
||||
+ public MemoryConnection(ILogAgent p_i11025_1_, NetHandler p_i11025_2_) {
|
||||
+ this.field_74440_d = p_i11025_2_;
|
||||
+ this.field_98214_c = p_i11025_1_;
|
||||
+
|
||||
+ public MemoryConnection(ILogAgent p_i1392_1_, NetHandler p_i1392_2_) {
|
||||
+ this.field_74440_d = p_i1392_2_;
|
||||
+ this.field_98214_c = p_i1392_1_;
|
||||
+ }
|
||||
+
|
||||
|
||||
public void func_74425_a(NetHandler p_74425_1_) {
|
||||
this.field_74440_d = p_74425_1_;
|
||||
}
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\RConThreadClient.java minecraft_server_patched\net\minecraft\src\RConThreadClient.java
|
||||
--- minecraft_server\net\minecraft\src\RConThreadClient.java Sat Apr 27 01:54:20 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\RConThreadClient.java Sat Apr 27 01:56:15 2013
|
||||
--- minecraft_server\net\minecraft\src\RConThreadClient.java Tue Sep 17 14:00:15 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\RConThreadClient.java Tue Sep 17 14:01:07 2013
|
||||
@@ -32,8 +32,8 @@
|
||||
}
|
||||
|
||||
@@ -120,23 +120,22 @@ diff -r -U 3 minecraft_server\net\minecraft\src\RConThreadClient.java minecraft_
|
||||
}
|
||||
-
|
||||
- return;
|
||||
- }
|
||||
+ } catch (SocketTimeoutException var17) {
|
||||
+ } catch (IOException var18) {
|
||||
+ } catch (Exception var19) {
|
||||
+ System.out.println(var19);
|
||||
+ } finally {
|
||||
+ this.func_72653_g();
|
||||
}
|
||||
-
|
||||
+ } catch (SocketTimeoutException var17) {
|
||||
+ } catch (IOException var18) {
|
||||
+ } catch (Exception var19) {
|
||||
+ System.out.println(var19);
|
||||
+ } finally {
|
||||
+ this.func_72653_g();
|
||||
+ }
|
||||
}
|
||||
|
||||
private void func_72654_a(int p_72654_1_, int p_72654_2_, String p_72654_3_) throws IOException {
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\TcpMasterThread.java minecraft_server_patched\net\minecraft\src\TcpMasterThread.java
|
||||
--- minecraft_server\net\minecraft\src\TcpMasterThread.java Sat Apr 27 01:54:21 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\TcpMasterThread.java Sat Apr 27 01:56:15 2013
|
||||
--- minecraft_server\net\minecraft\src\TcpMasterThread.java Tue Sep 17 14:00:16 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\TcpMasterThread.java Tue Sep 17 14:01:07 2013
|
||||
@@ -11,6 +11,7 @@
|
||||
this.field_74504_a = p_i3285_1_;
|
||||
this.field_74504_a = p_i1395_1_;
|
||||
}
|
||||
|
||||
+ @SuppressWarnings("deprecation")
|
||||
@@ -144,15 +143,13 @@ diff -r -U 3 minecraft_server\net\minecraft\src\TcpMasterThread.java minecraft_s
|
||||
try {
|
||||
Thread.sleep(5000L);
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\ThreadedFileIOBase.java minecraft_server_patched\net\minecraft\src\ThreadedFileIOBase.java
|
||||
--- minecraft_server\net\minecraft\src\ThreadedFileIOBase.java Sat Apr 27 01:54:21 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\ThreadedFileIOBase.java Sat Apr 27 01:56:15 2013
|
||||
@@ -20,7 +20,8 @@
|
||||
--- minecraft_server\net\minecraft\src\ThreadedFileIOBase.java Tue Sep 17 14:00:16 2013
|
||||
+++ minecraft_server_patched\net\minecraft\src\ThreadedFileIOBase.java Tue Sep 17 14:01:07 2013
|
||||
@@ -20,6 +20,7 @@
|
||||
}
|
||||
|
||||
public void run() {
|
||||
- this.func_75736_b();
|
||||
+ while(true)
|
||||
+ this.func_75736_b();
|
||||
+ while(true)
|
||||
this.func_75736_b();
|
||||
}
|
||||
|
||||
private void func_75736_b() {
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
[VERSION]
|
||||
MCPVersion = 7.51
|
||||
ClientVersion = 1.5.2
|
||||
ServerVersion = 1.5.2
|
||||
MCPVersion = 8.11
|
||||
ClientVersion = 1.6.4
|
||||
ServerVersion = 1.6.4
|
||||
@@ -1,20 +0,0 @@
|
||||
import urllib
|
||||
import zipfile
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if not len(sys.argv) >= 3:
|
||||
print 'Invalid arguments, must supply mcp folder and fml folder: decompile.py <MCPFolder> <FMLFolder>'
|
||||
else:
|
||||
mcp_dir = os.path.abspath(sys.argv[1])
|
||||
fml_dir = os.path.abspath(sys.argv[2])
|
||||
dont_gen_conf = '-no_gen_conf' in sys.argv
|
||||
|
||||
sys.path.append(os.path.join(fml_dir, 'install'))
|
||||
|
||||
from fml import setup_fml, setup_mcp
|
||||
|
||||
setup_mcp(fml_dir, mcp_dir, dont_gen_conf)
|
||||
setup_fml(fml_dir, mcp_dir)
|
||||
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
default.dev.home=/home/cpw/projects/mcworkspace
|
||||
default.mcp.home=${default.dev.home}/vanillamcp
|
||||
@@ -1,43 +0,0 @@
|
||||
import sys
|
||||
import os
|
||||
import subprocess, shlex
|
||||
|
||||
mcp_root = os.path.abspath(sys.argv[1])
|
||||
sys.path.append(os.path.join(mcp_root,"runtime"))
|
||||
from filehandling.srgshandler import parse_srg
|
||||
|
||||
def cmdsplit(args):
|
||||
if os.sep == '\\':
|
||||
args = args.replace('\\', '\\\\')
|
||||
return shlex.split(args)
|
||||
|
||||
def main():
|
||||
list_file = os.path.abspath(sys.argv[2])
|
||||
with open(list_file, 'w') as fh:
|
||||
write_changed(fh, os.path.join(mcp_root,"temp","client.md5"), os.path.join(mcp_root,"temp","client_reobf.md5"), 'minecraft')
|
||||
write_changed(fh, os.path.join(mcp_root,"temp","server.md5"), os.path.join(mcp_root,"temp","server_reobf.md5"), 'minecraft_server')
|
||||
|
||||
def write_changed(fh, pre, post, name):
|
||||
if not os.path.isfile(pre) or not os.path.isfile(post):
|
||||
print 'MD5s Missing! Can not extract %s changed files' % name
|
||||
return
|
||||
|
||||
cmd = 'diff --unchanged-group-format='' --old-group-format='' --new-group-format=\'%%>\' --changed-group-format=\'%%>\' %s %s' % (pre, post)
|
||||
process = subprocess.Popen(cmdsplit(cmd), stdout=subprocess.PIPE, bufsize=-1)
|
||||
difflist,_= process.communicate()
|
||||
srg_data = parse_srg(os.path.join(mcp_root,"temp","client_rg.srg"))
|
||||
classes = {}
|
||||
for row in srg_data['CL']:
|
||||
classes[row['deobf_name']] = row['obf_name']
|
||||
|
||||
for diff in difflist.splitlines():
|
||||
diffrow=diff.strip().split()
|
||||
clazz=diffrow[0]
|
||||
if clazz in classes:
|
||||
clazz=classes[clazz]
|
||||
if clazz.startswith("net/minecraft/src/"):
|
||||
clazz=clazz[len("net/minecraft/src/"):]
|
||||
fh.write("%s/%s.class\n" %(name,clazz))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,76 +0,0 @@
|
||||
import sys
|
||||
import os
|
||||
import commands
|
||||
import fnmatch
|
||||
import re
|
||||
import subprocess, shlex
|
||||
|
||||
mcp_home = sys.argv[1]
|
||||
mcp_dir = os.path.abspath(mcp_home)
|
||||
|
||||
print(mcp_dir)
|
||||
sys.path.append(mcp_dir)
|
||||
|
||||
from runtime.commands import Commands
|
||||
Commands._version_config = os.path.join(mcp_dir,Commands._version_config)
|
||||
|
||||
def cmdsplit(args):
|
||||
if os.sep == '\\':
|
||||
args = args.replace('\\', '\\\\')
|
||||
return shlex.split(args)
|
||||
|
||||
def cleanDirs(path):
|
||||
if not os.path.isdir(path):
|
||||
return
|
||||
|
||||
files = os.listdir(path)
|
||||
if len(files):
|
||||
for f in files:
|
||||
fullpath = os.path.join(path, f)
|
||||
if os.path.isdir(fullpath):
|
||||
cleanDirs(fullpath)
|
||||
|
||||
files = os.listdir(path)
|
||||
if len(files) == 0:
|
||||
os.rmdir(path)
|
||||
|
||||
def main():
|
||||
print("Obtaining version information from git")
|
||||
cmd = "git describe --long --match='[^(jenkins)]*'"
|
||||
try:
|
||||
process = subprocess.Popen(cmdsplit(cmd), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=-1)
|
||||
vers, _ = process.communicate()
|
||||
except OSError:
|
||||
print("Git not found")
|
||||
vers="v1.0-0-deadbeef"
|
||||
(major,minor,rev,githash)=re.match("v(\d+).(\d+)-(\d+)-(.*)",vers).groups()
|
||||
|
||||
(mcpversion,mcclientversion,mcserverversion) = re.match("[.\w]+ \(data: ([.\w]+), client: ([.\w.]+), server: ([.\w.]+)\)",Commands.fullversion()).groups()
|
||||
|
||||
if os.getenv("GIT_BRANCH") is None:
|
||||
cmd = "git rev-parse --abbrev-ref HEAD"
|
||||
try:
|
||||
process = subprocess.Popen(cmdsplit(cmd), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=-1)
|
||||
branch, _ = process.communicate()
|
||||
branch = branch.strip()
|
||||
except OSError:
|
||||
print("Git not found")
|
||||
branch="master"
|
||||
else:
|
||||
branch=os.getenv("GIT_BRANCH").rpartition('/')[2]
|
||||
if branch == 'HEAD':
|
||||
branch = "master"
|
||||
|
||||
with open("fmlversion.properties","w") as f:
|
||||
f.write("%s=%s\n" %("fmlbuild.major.number",major))
|
||||
f.write("%s=%s\n" %("fmlbuild.minor.number",minor))
|
||||
f.write("%s=%s\n" %("fmlbuild.revision.number",rev))
|
||||
f.write("%s=%s\n" %("fmlbuild.githash",githash))
|
||||
f.write("%s=%s\n" %("fmlbuild.mcpversion",mcpversion))
|
||||
f.write("%s=%s\n" %("fmlbuild.mcversion",mcclientversion))
|
||||
f.write("%s=%s\n" %("fmlbuild.branch",branch))
|
||||
|
||||
print("Version information: FML %s.%s.%s (%s) using MCP %s for minecraft %s" % (major, minor, rev, branch, mcpversion, mcclientversion))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Vendored
BIN
Binary file not shown.
+6
@@ -0,0 +1,6 @@
|
||||
#Tue Oct 29 18:00:54 CDT 2013
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
|
||||
@@ -0,0 +1,164 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
Vendored
+90
@@ -0,0 +1,90 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
git update-index --assume-unchanged eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/0.tree
|
||||
@@ -1 +0,0 @@
|
||||
/*.pyc
|
||||
@@ -0,0 +1,22 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: '${name}'
|
||||
|
||||
version = "1.0"
|
||||
group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "modid"
|
||||
|
||||
minecraft {
|
||||
version = "${version}"
|
||||
}
|
||||
File renamed without changes.
@@ -1,12 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/Minecraft/src/Start.java"/>
|
||||
<listEntry value="/Minecraft/lib/net/minecraft/launchwrapper/1.3/launchwrapper-1.3.jar"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="Start"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.minecraft.launchwrapper.Launch"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--version 1.6 --tweakClass cpw.mods.fml.common.launcher.FMLTweaker"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Minecraft"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xincgc -Xmx1024M -Xms1024M"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:Minecraft/jars}"/>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/Minecraft/common/net/minecraft/server/MinecraftServer.java"/>
|
||||
<listEntry value="/Minecraft/src/net/minecraft/server/MinecraftServer.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.minecraft.server.MinecraftServer"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="cpw.mods.fml.relauncher.ServerLaunchWrapper"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Minecraft"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xincgc -Xmx1024M -Xms1024M"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:Minecraft/jars}"/>
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="lib" path="jars/bin/jinput.jar">
|
||||
<attributes>
|
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Minecraft/jars/bin/natives"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="jars/bin/lwjgl_util.jar">
|
||||
<attributes>
|
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Minecraft/jars/bin/natives"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="jars/bin/lwjgl.jar">
|
||||
<attributes>
|
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Minecraft/jars/bin/natives"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="jars/bin/minecraft.jar"/>
|
||||
<classpathentry kind="lib" path="lib/argo-3.2-src.jar" sourcepath="lib/argo-3.2-src.jar"/>
|
||||
<classpathentry kind="lib" path="lib/bcprov-debug-jdk15on-148.jar" sourcepath="lib/bcprov-jdk15on-148-src.zip"/>
|
||||
<classpathentry kind="lib" path="lib/asm-debug-all-4.1.jar" sourcepath="lib/asm-4.1-bin.zip"/>
|
||||
<classpathentry kind="lib" path="lib/guava-14.0-rc3.jar" sourcepath="lib/guava-14.0-rc3-sources.jar"/>
|
||||
<classpathentry kind="lib" path="lib/scala-library.jar" sourcepath="lib/scala-library.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Minecraft</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>jars</name>
|
||||
<type>2</type>
|
||||
<locationURI>MCP_LOC/jars</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src</name>
|
||||
<type>2</type>
|
||||
<locationURI>MCP_LOC/src/minecraft</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>lib</name>
|
||||
<type>2</type>
|
||||
<locationURI>MCP_LOC/lib</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1307293455427</id>
|
||||
<name>jars</name>
|
||||
<type>13</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||
<arguments>1.0-name-matches-false-false-bin</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
<filter>
|
||||
<id>1307293504507</id>
|
||||
<name>jars/bin</name>
|
||||
<type>5</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||
<arguments>1.0-name-matches-false-false-*.jar</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
<filter>
|
||||
<id>1307293480435</id>
|
||||
<name>jars/bin/natives</name>
|
||||
<type>6</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||
<arguments>1.0-name-matches-false-false-*</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
<variableList>
|
||||
<variable>
|
||||
<name>MCP_LOC</name>
|
||||
<value>$%7BPARENT-1-WORKSPACE_LOC%7D</value>
|
||||
</variable>
|
||||
</variableList>
|
||||
</projectDescription>
|
||||
-990
@@ -1,990 +0,0 @@
|
||||
import os, os.path, sys
|
||||
import urllib, zipfile
|
||||
import shutil, glob, fnmatch
|
||||
import subprocess, logging, re, shlex
|
||||
import csv, ConfigParser
|
||||
from hashlib import md5 # pylint: disable-msg=E0611
|
||||
from pprint import pprint
|
||||
from zipfile import ZipFile
|
||||
from pprint import pprint
|
||||
|
||||
mcp_version = '7.42'
|
||||
|
||||
def download_deps(mcp_path):
|
||||
ret = True
|
||||
for lib in ['argo-3.2-src.jar','guava-14.0-rc3.jar','asm-4.1.tar.gz','asm-debug-all-4.1.jar','bcprov-debug-jdk15on-148.jar','bcprov-jdk15on-148-src.zip','guava-14.0-rc3-sources.jar', 'scala-library.jar']:
|
||||
libF = os.path.join(mcp_path, 'lib')
|
||||
if not os.path.isdir(libF):
|
||||
os.makedirs(libF)
|
||||
|
||||
target = os.path.normpath(os.path.join(libF, lib))
|
||||
|
||||
if not os.path.isfile(target):
|
||||
try:
|
||||
urllib.urlretrieve('http://files.minecraftforge.net/fmllibs/' + lib, target)
|
||||
print 'Downloaded %s' % lib
|
||||
except:
|
||||
print 'Download %s failed, download manually from http://files.minecraftforge.net/fmllibs/%s or http://files.minecraftforge.net/fmllibs/fml_libs_dev15.zip and place in mcp/lib' % (lib, lib)
|
||||
ret = False
|
||||
|
||||
return ret
|
||||
|
||||
def config_get_section(config, section):
|
||||
dict = {}
|
||||
options = config.options(section)
|
||||
for option in options:
|
||||
try:
|
||||
dict[option] = config.get(section, option)
|
||||
except:
|
||||
dict[option] = None
|
||||
return dict
|
||||
|
||||
def download_file(url, target, md5=None):
|
||||
name = os.path.basename(target)
|
||||
if os.path.isfile(target) and not md5 == None:
|
||||
if not get_md5(target) == md5:
|
||||
print 'Modified %s detected, removing' % name
|
||||
os.remove(target)
|
||||
|
||||
if not os.path.isfile(target):
|
||||
try:
|
||||
urllib.urlretrieve(url, target)
|
||||
if not md5 == None:
|
||||
if not get_md5(target) == md5:
|
||||
print 'Download of %s failed md5 check, deleting' % name
|
||||
os.remove(target)
|
||||
return False
|
||||
print 'Downloaded %s' % name
|
||||
except Exception as e:
|
||||
print e
|
||||
print 'Download of %s failed, download it manually from \'%s\' to \'%s\'' % (target, url, target)
|
||||
return False
|
||||
else:
|
||||
print 'File Exists: %s' % os.path.basename(target)
|
||||
return True
|
||||
|
||||
def download_native(url, folder, name):
|
||||
if not os.path.exists(folder):
|
||||
os.makedirs(folder)
|
||||
|
||||
target = os.path.join(folder, name)
|
||||
if not download_file(url + name, target):
|
||||
return False
|
||||
|
||||
zip = ZipFile(target)
|
||||
for name in zip.namelist():
|
||||
if not name.startswith('META-INF') and not name.endswith('/'):
|
||||
out_file = os.path.join(folder, name)
|
||||
if not os.path.isfile(out_file):
|
||||
print ' Extracting %s' % name
|
||||
out = open(out_file, 'wb')
|
||||
out.write(zip.read(name))
|
||||
out.flush()
|
||||
out.close()
|
||||
zip.close()
|
||||
return True
|
||||
|
||||
def download_minecraft(mcp_dir, fml_dir, version=None):
|
||||
versions_file = os.path.join(fml_dir, 'mc_versions.cfg')
|
||||
if not os.path.isfile(versions_file):
|
||||
print 'Could not find mc_versions.cfg in FML directory.'
|
||||
sys.exit(1)
|
||||
|
||||
config = ConfigParser.ConfigParser()
|
||||
config.read(versions_file)
|
||||
|
||||
default = config_get_section(config, 'default')
|
||||
if version is None:
|
||||
version = default['current_ver']
|
||||
|
||||
bin_folder = os.path.join(mcp_dir, 'jars', 'bin')
|
||||
if not os.path.exists(bin_folder):
|
||||
os.makedirs(bin_folder)
|
||||
|
||||
failed = False
|
||||
|
||||
for lib in default['libraries'].split(' '):
|
||||
failed = not download_file(default['base_url'] + lib, os.path.join(bin_folder, lib)) or failed
|
||||
for native in default['natives'].split(' '):
|
||||
failed = not download_native(default['base_url'], os.path.join(bin_folder, 'natives'), native) or failed
|
||||
|
||||
if not config.has_section(version):
|
||||
print 'Error: Invalid minecraft version, could not find \'%s\' in mc_versions.cfg' % version
|
||||
sys.exit(1)
|
||||
|
||||
mc_info = config_get_section(config, version)
|
||||
|
||||
client_jar = os.path.join(bin_folder, 'minecraft.jar')
|
||||
server_jar = os.path.join(mcp_dir, 'jars', 'minecraft_server.jar')
|
||||
|
||||
# Remove any invalid files
|
||||
file_backup(os.path.join(mcp_dir, 'jars', 'bin'), 'minecraft.jar', mc_info['client_md5'])
|
||||
file_backup(os.path.join(mcp_dir, 'jars'), 'minecraft_server.jar', mc_info['server_md5'])
|
||||
|
||||
failed = not download_file(mc_info['client_url'], client_jar, mc_info['client_md5']) or failed
|
||||
failed = not download_file(mc_info['server_url'], server_jar, mc_info['server_md5']) or failed
|
||||
|
||||
# Backup clean jars, or delete if corrupted
|
||||
file_backup(os.path.join(mcp_dir, 'jars', 'bin'), 'minecraft.jar', mc_info['client_md5'])
|
||||
file_backup(os.path.join(mcp_dir, 'jars'), 'minecraft_server.jar', mc_info['server_md5'])
|
||||
|
||||
if failed:
|
||||
print 'Something failed verifying minecraft files, see log for details.'
|
||||
sys.exit(1)
|
||||
|
||||
def get_md5(file):
|
||||
if not os.path.isfile(file):
|
||||
return ""
|
||||
with open(file, 'rb') as fh:
|
||||
return md5(fh.read()).hexdigest()
|
||||
|
||||
def pre_decompile(mcp_dir, fml_dir):
|
||||
download_minecraft(mcp_dir, fml_dir)
|
||||
|
||||
def file_backup(base, file, md5):
|
||||
bck_jar = os.path.join(base, file + '.backup')
|
||||
src_jar = os.path.join(base, file)
|
||||
|
||||
if not os.path.isfile(src_jar) and not os.path.isfile(bck_jar):
|
||||
return
|
||||
|
||||
if os.path.isfile(bck_jar):
|
||||
if get_md5(bck_jar) == md5:
|
||||
if os.path.isfile(src_jar):
|
||||
os.remove(src_jar)
|
||||
shutil.move(bck_jar, src_jar)
|
||||
else:
|
||||
os.remove(bck_jar)
|
||||
|
||||
if os.path.isfile(src_jar):
|
||||
if not get_md5(src_jar) == md5:
|
||||
print 'Modified %s detected, removing' % os.path.basename(src_jar)
|
||||
os.remove(src_jar)
|
||||
else:
|
||||
shutil.copy(src_jar, bck_jar)
|
||||
|
||||
def post_decompile(mcp_dir, fml_dir):
|
||||
bin_dir = os.path.join(mcp_dir, 'jars', 'bin')
|
||||
back_jar = os.path.join(bin_dir, 'minecraft.jar.backup')
|
||||
src_jar = os.path.join(bin_dir, 'minecraft.jar')
|
||||
|
||||
if not os.path.isfile(src_jar):
|
||||
return
|
||||
|
||||
print 'Stripping META-INF from minecraft.jar'
|
||||
|
||||
zip_in = zipfile.ZipFile(back_jar, mode='a')
|
||||
zip_out = zipfile.ZipFile(src_jar, 'w', zipfile.ZIP_DEFLATED)
|
||||
for i in zip_in.filelist:
|
||||
if not i.filename.startswith('META-INF'):
|
||||
c = zip_in.read(i.filename)
|
||||
zip_out.writestr(i.filename, c)
|
||||
else:
|
||||
print 'Skipping: %s' % i.filename
|
||||
zip_out.close()
|
||||
|
||||
def reset_logger():
|
||||
log = logging.getLogger()
|
||||
while len(log.handlers) > 0:
|
||||
log.removeHandler(log.handlers[0])
|
||||
|
||||
count = 0
|
||||
def cleanup_source(path):
|
||||
from rename_vars import rename_class
|
||||
path = os.path.normpath(path)
|
||||
regex_cases_before = re.compile(r'((case|default).+\r?\n)\r?\n', re.MULTILINE) #Fixes newline after case before case body
|
||||
regex_cases_after = re.compile(r'\r?\n(\r?\n[ \t]+(case|default))', re.MULTILINE) #Fixes newline after case body before new case
|
||||
|
||||
def updatefile(src_file):
|
||||
global count
|
||||
tmp_file = src_file + '.tmp'
|
||||
count = 0
|
||||
with open(src_file, 'r') as fh:
|
||||
buf = fh.read()
|
||||
|
||||
def fix_cases(match):
|
||||
global count
|
||||
count += 1
|
||||
return match.group(1)
|
||||
|
||||
buf = regex_cases_before.sub(fix_cases, buf)
|
||||
buf = regex_cases_after.sub(fix_cases, buf)
|
||||
old = buf.replace('\r', '')
|
||||
buf = rename_class(old, MCP=True)
|
||||
|
||||
if count > 0 or buf != old:
|
||||
with open(tmp_file, 'w') as fh:
|
||||
fh.write(buf)
|
||||
shutil.move(tmp_file, src_file)
|
||||
|
||||
for path, _, filelist in os.walk(path, followlinks=True):
|
||||
sub_dir = os.path.relpath(path, path)
|
||||
for cur_file in fnmatch.filter(filelist, '*.java'):
|
||||
src_file = os.path.normpath(os.path.join(path, cur_file))
|
||||
updatefile(src_file)
|
||||
|
||||
compile_tools = True
|
||||
def setup_fml(fml_dir, mcp_dir, disable_at=False, disable_merge=False, enable_server=False, disable_client=False):
|
||||
global compile_tools
|
||||
sys.path.append(mcp_dir)
|
||||
from runtime.decompile import decompile
|
||||
from runtime.cleanup import cleanup
|
||||
from runtime.commands import Commands, CLIENT, SERVER
|
||||
|
||||
src_dir = os.path.join(mcp_dir, 'src')
|
||||
|
||||
if os.path.isdir(src_dir):
|
||||
os.chdir(mcp_dir)
|
||||
cleanup(None, False)
|
||||
reset_logger()
|
||||
os.chdir(fml_dir)
|
||||
|
||||
if os.path.isdir(src_dir):
|
||||
print 'Please make sure to backup your modified files, and say yes when it asks you to do cleanup.'
|
||||
sys.exit(1)
|
||||
|
||||
#download fernflower/argo/asm/guava
|
||||
if not download_deps(mcp_dir):
|
||||
sys.exit(1)
|
||||
|
||||
compile_tools = True
|
||||
|
||||
def applyrg_shunt(self, side, reobf=False, applyrg_real = Commands.applyrg):
|
||||
global compile_tools
|
||||
if not self.has_wine and not self.has_astyle:
|
||||
self.logger.error('!! Please install either wine or astyle for source cleanup !!')
|
||||
self.logger.error('!! This is REQUIRED by FML/Forge Cannot proceed !!')
|
||||
sys.exit(1)
|
||||
jars = {CLIENT: self.jarclient, SERVER: self.jarserver}
|
||||
|
||||
dir_bin = os.path.join(fml_dir, 'bin')
|
||||
if not os.path.isdir(dir_bin):
|
||||
os.makedirs(dir_bin)
|
||||
|
||||
class_path = os.pathsep.join(['.', os.path.join(mcp_dir, 'lib', '*'), dir_bin])
|
||||
dir_common = os.path.join(fml_dir, 'common')
|
||||
dir_trans = os.path.join(dir_common, 'cpw', 'mods', 'fml', 'common', 'asm', 'transformers')
|
||||
java = self.cmdjava.translate(None, '"')
|
||||
javac = self.cmdjavac.translate(None, '"')
|
||||
cmd_compile = '"%s" -Xlint:-options -deprecation -g -source 1.6 -target 1.6 -classpath "{classpath}" -sourcepath "{sourcepath}" -d "{outpath}" "{target}"' % javac
|
||||
cmd_compile = cmd_compile.format(classpath=class_path, sourcepath=dir_common, outpath=dir_bin, target="{target}")
|
||||
|
||||
if compile_tools:
|
||||
self.logger.info('> Compiling AccessTransformer')
|
||||
if not runcmd(self, cmd_compile.format(target=os.path.join(dir_trans, 'AccessTransformer.java')), echo=False):
|
||||
sys.exit(1)
|
||||
|
||||
self.logger.info('> Compiling MCPMerger')
|
||||
if not runcmd(self, cmd_compile.format(target=os.path.join(dir_trans, 'MCPMerger.java')), echo=False):
|
||||
sys.exit(1)
|
||||
|
||||
compile_tools = False
|
||||
|
||||
if side == CLIENT:
|
||||
if not disable_merge:
|
||||
self.logger.info('> Running MCPMerger')
|
||||
forkcmd = ('"%s" -classpath "{classpath}" cpw.mods.fml.common.asm.transformers.MCPMerger "{mergecfg}" "{client}" "{server}"' % java).format(
|
||||
classpath=class_path, mergecfg=os.path.join(fml_dir, 'mcp_merge.cfg'), client=jars[CLIENT], server=jars[SERVER])
|
||||
|
||||
if not runcmd(self, forkcmd):
|
||||
sys.exit(1)
|
||||
else:
|
||||
self.logger.info('> MCPMerge disabled')
|
||||
|
||||
if not disable_at:
|
||||
self.logger.info('> Running AccessTransformer')
|
||||
forkcmd = ('"%s" -classpath "{classpath}" cpw.mods.fml.common.asm.transformers.AccessTransformer "{jar}" "{fmlconfig}"' % java).format(
|
||||
classpath=class_path, jar=jars[side], fmlconfig=os.path.join(fml_dir, 'common', 'fml_at.cfg'))
|
||||
|
||||
forge_cfg = os.path.join(fml_dir, '..', 'common', 'forge_at.cfg')
|
||||
if os.path.isfile(forge_cfg):
|
||||
self.logger.info(' Forge config detected')
|
||||
forkcmd += ' "%s"' % forge_cfg
|
||||
|
||||
for dirname, dirnames, filenames in os.walk(os.path.join(fml_dir, '..', 'accesstransformers')):
|
||||
for filename in filenames:
|
||||
accesstransformer = os.path.join(dirname, filename)
|
||||
if os.path.isfile(accesstransformer):
|
||||
self.logger.info(' Access Transformer "%s" detected' % filename)
|
||||
forkcmd += ' "%s"' % accesstransformer
|
||||
|
||||
if not runcmd(self, forkcmd):
|
||||
sys.exit(1)
|
||||
else:
|
||||
self.logger.info('> Access Transformer disabled')
|
||||
|
||||
self.logger.info('> Really Applying Retroguard')
|
||||
applyrg_real(self, side, reobf)
|
||||
|
||||
#Check the original jars not the transformed jars
|
||||
def checkjars_shunt(self, side, checkjars_real = Commands.checkjars):
|
||||
self.jarclient = self.jarclient + '.backup'
|
||||
self.jarserver = self.jarserver + '.backup'
|
||||
#print 'Jar Check %s %s %s' % (side, self.jarclient, self.jarserver)
|
||||
ret = checkjars_real(self, side)
|
||||
self.jarclient = self.jarclient[:-7]
|
||||
self.jarserver = self.jarserver[:-7]
|
||||
#print 'Jar Check out %s %s %s' % (side, self.jarclient, self.jarserver)
|
||||
return ret
|
||||
|
||||
try:
|
||||
pre_decompile(mcp_dir, fml_dir)
|
||||
|
||||
os.chdir(mcp_dir)
|
||||
Commands.applyrg = applyrg_shunt
|
||||
Commands.checkjars = checkjars_shunt
|
||||
#decompile -d -n -r
|
||||
# Conf JAD CSV -r -d -a -n -p -o -l -g -c -s
|
||||
decompile(None, False, False, True, True, False, True, False, False, False, False, not disable_client, enable_server)
|
||||
reset_logger()
|
||||
os.chdir(fml_dir)
|
||||
|
||||
post_decompile(mcp_dir, fml_dir)
|
||||
|
||||
except SystemExit, e:
|
||||
print 'Decompile Exception: %d ' % e.code
|
||||
raise e
|
||||
|
||||
if not os.path.isdir(src_dir):
|
||||
print 'Something went wrong, src folder not found at: %s' % src_dir
|
||||
sys.exit(1)
|
||||
|
||||
#cleanup_source
|
||||
cleanup_source(src_dir)
|
||||
|
||||
os.chdir(mcp_dir)
|
||||
commands = Commands(verify=True)
|
||||
|
||||
if not disable_client:
|
||||
updatemd5_side(mcp_dir, commands, CLIENT)
|
||||
reset_logger()
|
||||
|
||||
if enable_server:
|
||||
updatemd5_side(mcp_dir, commands, CLIENT)
|
||||
reset_logger()
|
||||
|
||||
os.chdir(fml_dir)
|
||||
|
||||
def updatemd5_side(mcp_dir, commands, side):
|
||||
sys.path.append(mcp_dir)
|
||||
from runtime.mcp import recompile_side, updatemd5_side
|
||||
from runtime.commands import SIDE_NAME
|
||||
|
||||
recomp = recompile_side(commands, side)
|
||||
if recomp:
|
||||
commands.logger.info('> Generating %s md5s', SIDE_NAME[side])
|
||||
commands.gathermd5s(side, skip_fml=True)
|
||||
|
||||
def cmdsplit(args):
|
||||
if os.sep == '\\':
|
||||
args = args.replace('\\', '\\\\')
|
||||
return shlex.split(args)
|
||||
|
||||
def runcmd(commands, command, echo=True):
|
||||
forklist = cmdsplit(command)
|
||||
process = subprocess.Popen(forklist, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=-1)
|
||||
output, _ = process.communicate()
|
||||
|
||||
if echo:
|
||||
for line in output.splitlines():
|
||||
commands.logger.info(line)
|
||||
|
||||
if process.returncode:
|
||||
if not echo:
|
||||
for line in output.splitlines():
|
||||
commands.logger.info(line)
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_joined_srg(mcp_dir):
|
||||
joined = os.path.join(mcp_dir, 'conf', 'joined.srg')
|
||||
values = {'PK:': {}, 'CL:': {}, 'FD:': {}, 'MD:': {}}
|
||||
|
||||
if not os.path.isfile(joined):
|
||||
print 'Could not read joined.srg, file not found'
|
||||
sys.exit(1)
|
||||
else:
|
||||
with open(joined, 'r') as fh:
|
||||
for line in fh:
|
||||
pts = line.rstrip('\r\n').split(' ')
|
||||
if pts[0] == 'MD:':
|
||||
values[pts[0]][pts[1] + ' ' + pts[2]] = pts[3] + ' ' + pts[4]
|
||||
else:
|
||||
values[pts[0]][pts[1]] = pts[2]
|
||||
|
||||
return values
|
||||
|
||||
def apply_fml_patches(fml_dir, mcp_dir, src_dir, copy_files=True):
|
||||
#Delete /minecraft/cpw to get rid of the Side/SideOnly classes used in decompilation
|
||||
cpw_mc_dir = os.path.join(src_dir, 'minecraft', 'cpw')
|
||||
if os.path.isdir(cpw_mc_dir):
|
||||
shutil.rmtree(cpw_mc_dir)
|
||||
|
||||
#patch files
|
||||
print 'Applying Forge ModLoader patches'
|
||||
sys.stdout.flush()
|
||||
|
||||
if os.path.isdir(os.path.join(fml_dir, 'patches', 'minecraft')):
|
||||
apply_patches(mcp_dir, os.path.join(fml_dir, 'patches', 'minecraft'), src_dir)
|
||||
if copy_files and os.path.isdir(os.path.join(fml_dir, 'client')):
|
||||
copytree(os.path.join(fml_dir, 'client'), os.path.join(src_dir, 'minecraft'))
|
||||
if copy_files and os.path.isdir(os.path.join(fml_dir, 'common')):
|
||||
copytree(os.path.join(fml_dir, 'common'), os.path.join(src_dir, 'minecraft'))
|
||||
|
||||
#delete argo
|
||||
if os.path.isdir(os.path.join(src_dir, 'minecraft', 'argo')):
|
||||
shutil.rmtree(os.path.join(src_dir, 'minecraft', 'argo'))
|
||||
|
||||
def finish_setup_fml(fml_dir, mcp_dir, enable_server=False, disable_client=False, disable_rename=False):
|
||||
sys.path.append(mcp_dir)
|
||||
from runtime.updatenames import updatenames
|
||||
from runtime.updatemd5 import updatemd5
|
||||
from runtime.updatemcp import updatemcp
|
||||
|
||||
os.chdir(mcp_dir)
|
||||
if not disable_rename:
|
||||
updatenames(None, True, not disable_client, enable_server)
|
||||
reset_logger()
|
||||
updatemd5(None, True, not disable_client, enable_server)
|
||||
reset_logger()
|
||||
os.chdir(fml_dir)
|
||||
|
||||
def apply_patches(mcp_dir, patch_dir, target_dir, find=None, rep=None):
|
||||
sys.path.append(mcp_dir)
|
||||
from runtime.commands import cmdsplit
|
||||
|
||||
temp = os.path.abspath('temp.patch')
|
||||
cmd = cmdsplit('patch -p2 -i "%s" ' % temp)
|
||||
|
||||
if os.name == 'nt':
|
||||
applydiff = os.path.abspath(os.path.join(mcp_dir, 'runtime', 'bin', 'applydiff.exe'))
|
||||
cmd = cmdsplit('"%s" -uf -p2 -i "%s"' % (applydiff, temp))
|
||||
|
||||
for path, _, filelist in os.walk(patch_dir, followlinks=True):
|
||||
for cur_file in fnmatch.filter(filelist, '*.patch'):
|
||||
patch_file = os.path.normpath(os.path.join(patch_dir, path[len(patch_dir)+1:], cur_file))
|
||||
target_file = os.path.join(target_dir, fix_patch(patch_file, temp, find, rep))
|
||||
process = subprocess.Popen(cmd, cwd=target_dir, bufsize=-1)
|
||||
process.communicate()
|
||||
|
||||
if os.path.isfile(temp):
|
||||
os.remove(temp)
|
||||
|
||||
def fix_patch(in_file, out_file, find=None, rep=None):
|
||||
in_file = os.path.normpath(in_file)
|
||||
if out_file is None:
|
||||
tmp_filename = in_file + '.tmp'
|
||||
else:
|
||||
out_file = os.path.normpath(out_file)
|
||||
tmp_file = out_file
|
||||
dir_name = os.path.dirname(out_file)
|
||||
if dir_name:
|
||||
if not os.path.exists(dir_name):
|
||||
os.makedirs(dir_name)
|
||||
file = 'not found'
|
||||
with open(in_file, 'rb') as inpatch:
|
||||
with open(tmp_file, 'wb') as outpatch:
|
||||
for line in inpatch:
|
||||
line = line.rstrip('\r\n')
|
||||
if line[:3] in ['+++', '---', 'Onl', 'dif']:
|
||||
if not find == None and not rep == None:
|
||||
line = line.replace('\\', '/').replace(find, rep).replace('/', os.sep)
|
||||
else:
|
||||
line = line.replace('\\', '/').replace('/', os.sep)
|
||||
outpatch.write(line + os.linesep)
|
||||
else:
|
||||
outpatch.write(line + os.linesep)
|
||||
if line[:3] == '---':
|
||||
file = line[line.find(os.sep, line.find(os.sep)+1)+1:]
|
||||
|
||||
if out_file is None:
|
||||
shutil.move(tmp_file, in_file)
|
||||
return file
|
||||
|
||||
#Taken from: http://stackoverflow.com/questions/7545299/distutil-shutil-copytree
|
||||
def _mkdir(newdir):
|
||||
"""works the way a good mkdir should :)
|
||||
- already exists, silently complete
|
||||
- regular file in the way, raise an exception
|
||||
- parent directory(ies) does not exist, make them as well
|
||||
"""
|
||||
if os.path.isdir(newdir):
|
||||
pass
|
||||
elif os.path.isfile(newdir):
|
||||
raise OSError("a file with the same name as the desired " \
|
||||
"dir, '%s', already exists." % newdir)
|
||||
else:
|
||||
head, tail = os.path.split(newdir)
|
||||
if head and not os.path.isdir(head):
|
||||
_mkdir(head)
|
||||
#print "_mkdir %s" % repr(newdir)
|
||||
if tail:
|
||||
os.mkdir(newdir)
|
||||
|
||||
#Taken from: http://stackoverflow.com/questions/7545299/distutil-shutil-copytree
|
||||
def copytree(src, dst, verbose=0, symlinks=False):
|
||||
"""Recursively copy a directory tree using copy2().
|
||||
|
||||
The destination directory must not already exist.
|
||||
If exception(s) occur, an Error is raised with a list of reasons.
|
||||
|
||||
If the optional symlinks flag is true, symbolic links in the
|
||||
source tree result in symbolic links in the destination tree; if
|
||||
it is false, the contents of the files pointed to by symbolic
|
||||
links are copied.
|
||||
|
||||
XXX Consider this example code rather than the ultimate tool.
|
||||
|
||||
"""
|
||||
|
||||
if verbose == -1:
|
||||
verbose = len(os.path.abspath(dst)) + 1
|
||||
names = os.listdir(src)
|
||||
# os.makedirs(dst)
|
||||
_mkdir(dst) # XXX
|
||||
errors = []
|
||||
for name in names:
|
||||
srcname = os.path.join(src, name)
|
||||
dstname = os.path.join(dst, name)
|
||||
try:
|
||||
if symlinks and os.path.islink(srcname):
|
||||
linkto = os.readlink(srcname)
|
||||
os.symlink(linkto, dstname)
|
||||
elif os.path.isdir(srcname):
|
||||
copytree(srcname, dstname, verbose, symlinks)
|
||||
else:
|
||||
shutil.copy2(srcname, dstname)
|
||||
if verbose > 0:
|
||||
print os.path.abspath(dstname)[verbose:]
|
||||
# XXX What about devices, sockets etc.?
|
||||
except (IOError, os.error), why:
|
||||
errors.append((srcname, dstname, str(why)))
|
||||
# catch the Error from the recursive copytree so that we can
|
||||
# continue with other files
|
||||
except Exception, err:
|
||||
errors.extend(err.args[0])
|
||||
try:
|
||||
shutil.copystat(src, dst)
|
||||
except WindowsError:
|
||||
# can't copy file access times on Windows
|
||||
pass
|
||||
|
||||
def cleanDirs(path):
|
||||
if not os.path.isdir(path):
|
||||
return
|
||||
|
||||
files = os.listdir(path)
|
||||
if len(files):
|
||||
for f in files:
|
||||
fullpath = os.path.join(path, f)
|
||||
if os.path.isdir(fullpath):
|
||||
cleanDirs(fullpath)
|
||||
|
||||
files = os.listdir(path)
|
||||
if len(files) == 0:
|
||||
os.rmdir(path)
|
||||
|
||||
def merge_tree(root_src_dir, root_dst_dir):
|
||||
for src_dir, dirs, files in os.walk(root_src_dir):
|
||||
dst_dir = src_dir.replace(root_src_dir, root_dst_dir)
|
||||
if not os.path.exists(dst_dir):
|
||||
os.mkdir(dst_dir)
|
||||
for file_ in files:
|
||||
src_file = os.path.join(src_dir, file_)
|
||||
dst_file = os.path.join(dst_dir, file_)
|
||||
if os.path.exists(dst_file):
|
||||
os.remove(dst_file)
|
||||
shutil.copy(src_file, dst_dir)
|
||||
|
||||
def download_mcp(mcp_dir, fml_dir, version=None):
|
||||
if os.path.isfile(os.path.join(mcp_dir, 'runtime', 'commands.py')):
|
||||
print 'MCP Detected already, not downloading'
|
||||
return True
|
||||
|
||||
if os.path.isdir(mcp_dir):
|
||||
print 'Old MCP Directory exists, but MCP was not detected, please delete MCP directory at \'%s\'' % mcp_dir
|
||||
sys.exit(1)
|
||||
|
||||
versions_file = os.path.join(fml_dir, 'mc_versions.cfg')
|
||||
if not os.path.isfile(versions_file):
|
||||
print 'Could not find mc_versions.cfg in FML directory.'
|
||||
sys.exit(1)
|
||||
|
||||
config = ConfigParser.ConfigParser()
|
||||
config.read(versions_file)
|
||||
|
||||
default = config_get_section(config, 'default')
|
||||
if version is None:
|
||||
version = default['current_ver']
|
||||
|
||||
if not config.has_section(version):
|
||||
print 'Error: Invalid minecraft version, could not find \'%s\' in mc_versions.cfg' % version
|
||||
sys.exit(1)
|
||||
|
||||
mc_info = config_get_section(config, version)
|
||||
mcp_zip = os.path.join(fml_dir, 'mcp%s.zip' % mc_info['mcp_ver'])
|
||||
|
||||
if not download_file(mc_info['mcp_url'], mcp_zip, mc_info['mcp_md5']):
|
||||
sys.exit(1)
|
||||
|
||||
if not os.path.isdir(mcp_dir):
|
||||
_mkdir(mcp_dir)
|
||||
|
||||
print 'Extracting MCP to \'%s\'' % mcp_dir
|
||||
zf = ZipFile(mcp_zip)
|
||||
#OS X's python 2.6.1 extractall has a bug in zipfile that makes it unzip directories as regular files.
|
||||
for path in zf.namelist():
|
||||
if not path.endswith('/'):
|
||||
zf.extract(path, mcp_dir)
|
||||
zf.close()
|
||||
|
||||
eclipse_dir = os.path.join(mcp_dir, 'eclipse')
|
||||
if os.path.isdir(eclipse_dir):
|
||||
shutil.rmtree(eclipse_dir)
|
||||
|
||||
if os.name != 'nt':
|
||||
for path, _, filelist in os.walk(mcp_dir):
|
||||
for cur_file in fnmatch.filter(filelist, '*.sh'):
|
||||
file_name = os.path.join(path, cur_file)
|
||||
process = subprocess.Popen(cmdsplit('chmod +x "%s"' % file_name), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=-1)
|
||||
output, _ = process.communicate()
|
||||
|
||||
process = subprocess.Popen(cmdsplit('chmod +x "%s/runtime/bin/astyle-osx"' % mcp_dir), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=-1)
|
||||
output, _ = process.communicate()
|
||||
|
||||
return True
|
||||
|
||||
def setup_mcp(fml_dir, mcp_dir, dont_gen_conf=True):
|
||||
global mcp_version
|
||||
|
||||
if not download_mcp(mcp_dir, fml_dir):
|
||||
sys.exit(1)
|
||||
|
||||
backup = os.path.join(mcp_dir, 'runtime', 'commands.py.bck')
|
||||
runtime = os.path.join(mcp_dir, 'runtime', 'commands.py')
|
||||
patch = os.path.join(fml_dir, 'commands.patch')
|
||||
|
||||
print 'Setting up MCP'
|
||||
if os.path.isfile(backup):
|
||||
print 'Restoring commands.py backup'
|
||||
if os.path.exists(runtime):
|
||||
os.remove(runtime)
|
||||
shutil.copy(backup, runtime)
|
||||
else:
|
||||
print 'Backing up commands.py'
|
||||
shutil.copy(runtime, backup)
|
||||
|
||||
if not os.path.isfile(patch):
|
||||
raise Exception('Commands.py patch not found %s' % patch)
|
||||
return
|
||||
|
||||
temp = os.path.abspath('temp.patch')
|
||||
cmd = 'patch -i "%s" ' % temp
|
||||
|
||||
if os.name == 'nt':
|
||||
applydiff = os.path.abspath(os.path.join(mcp_dir, 'runtime', 'bin', 'applydiff.exe'))
|
||||
cmd = '"%s" -uf -i "%s"' % (applydiff, temp)
|
||||
|
||||
if os.sep == '\\':
|
||||
cmd = cmd.replace('\\', '\\\\')
|
||||
cmd = shlex.split(cmd)
|
||||
|
||||
fix_patch(patch, temp)
|
||||
process = subprocess.Popen(cmd, cwd=os.path.join(mcp_dir, 'runtime'), bufsize=-1)
|
||||
process.communicate()
|
||||
|
||||
if os.path.isfile(temp):
|
||||
os.remove(temp)
|
||||
|
||||
try:
|
||||
sys.path.append(mcp_dir)
|
||||
from runtime.commands import commands_sanity_check
|
||||
commands_sanity_check()
|
||||
except ImportError as ex:
|
||||
print 'Could not verify commands.py patch integrity, this typically means that you are not in a clean MCP environment.'
|
||||
print 'Download a clean version of MCP %s and try again' % mcp_version
|
||||
print ex
|
||||
sys.exit(1)
|
||||
|
||||
mcp_conf = os.path.join(mcp_dir, 'conf')
|
||||
mcp_conf_bak = os.path.join(mcp_dir, 'conf.bak')
|
||||
fml_conf = os.path.join(fml_dir, 'conf')
|
||||
|
||||
if not dont_gen_conf:
|
||||
if os.path.isdir(mcp_conf_bak):
|
||||
print 'Reverting old conf backup folder'
|
||||
shutil.rmtree(mcp_conf)
|
||||
os.rename(mcp_conf_bak, mcp_conf)
|
||||
|
||||
get_conf_copy(mcp_dir, fml_dir)
|
||||
|
||||
print 'Backing up MCP Conf'
|
||||
os.rename(mcp_conf, mcp_conf_bak)
|
||||
else:
|
||||
shutil.rmtree(mcp_conf)
|
||||
|
||||
print 'Copying FML conf'
|
||||
shutil.copytree(fml_conf, mcp_conf)
|
||||
|
||||
gen_renamed_conf(mcp_dir, fml_dir)
|
||||
|
||||
#update workspace
|
||||
if not os.path.isfile(os.path.join(fml_dir, 'fmlbuild.properties-sample')):
|
||||
mcp_eclipse = os.path.join(mcp_dir, 'eclipse')
|
||||
|
||||
if os.path.isdir(os.path.join(mcp_eclipse, 'Client')) and os.path.isdir(os.path.join(mcp_eclipse, 'Server')):
|
||||
shutil.rmtree(mcp_eclipse)
|
||||
|
||||
if not os.path.isdir(mcp_eclipse) and os.path.isdir(os.path.join(fml_dir, 'eclipse')):
|
||||
print 'Fixing MCP Workspace'
|
||||
copytree(os.path.join(fml_dir, 'eclipse'), mcp_eclipse)
|
||||
|
||||
def normaliselines(in_filename):
|
||||
in_filename = os.path.normpath(in_filename)
|
||||
tmp_filename = in_filename + '.tmp'
|
||||
|
||||
with open(in_filename, 'rb') as in_file:
|
||||
with open(tmp_filename, 'wb') as out_file:
|
||||
out_file.write(in_file.read().replace('\r\n', '\n'))
|
||||
|
||||
shutil.move(tmp_filename, in_filename)
|
||||
|
||||
def get_conf_copy(mcp_dir, fml_dir):
|
||||
#Lets grab the files we dont work on
|
||||
for file in ['astyle.cfg', 'version.cfg', 'newids.csv']:
|
||||
dst_file = os.path.normpath(os.path.join(fml_dir, 'conf', file))
|
||||
src_file = os.path.normpath(os.path.join(mcp_dir, 'conf', file))
|
||||
if not os.path.isdir(os.path.dirname(dst_file)):
|
||||
os.makedirs(os.path.dirname(dst_file))
|
||||
if os.path.exists(dst_file):
|
||||
os.remove(dst_file)
|
||||
shutil.copy(src_file, dst_file)
|
||||
normaliselines(dst_file)
|
||||
print 'Grabbing: ' + src_file
|
||||
|
||||
common_srg = gen_merged_srg(mcp_dir, fml_dir)
|
||||
common_exc = gen_merged_exc(mcp_dir, fml_dir)
|
||||
common_map = gen_shared_searge_names(common_srg, common_exc)
|
||||
|
||||
gen_merged_csv(common_map, os.path.join(mcp_dir, 'conf', 'fields.csv'), os.path.join(fml_dir, 'conf', 'fields.csv'))
|
||||
gen_merged_csv(common_map, os.path.join(mcp_dir, 'conf', 'methods.csv'), os.path.join(fml_dir, 'conf', 'methods.csv'))
|
||||
gen_merged_csv(common_map, os.path.join(mcp_dir, 'conf', 'params.csv'), os.path.join(fml_dir, 'conf', 'params.csv'), main_key='param')
|
||||
|
||||
def gen_merged_srg(mcp_dir, fml_dir):
|
||||
print 'Generating merged Retroguard data'
|
||||
srg_client = os.path.join(mcp_dir, 'conf', 'client.srg')
|
||||
srg_server = os.path.join(mcp_dir, 'conf', 'server.srg')
|
||||
|
||||
if not os.path.isfile(srg_client) or not os.path.isfile(srg_server):
|
||||
print 'Could not find client and server srg files in "%s"' % mcp_dir
|
||||
return False
|
||||
|
||||
client = {'PK:': {}, 'CL:': {}, 'FD:': {}, 'MD:': {}}
|
||||
with open(srg_client, 'r') as fh:
|
||||
for line in fh:
|
||||
pts = line.rstrip('\r\n').split(' ')
|
||||
if pts[0] == 'MD:':
|
||||
client[pts[0]][pts[1] + ' ' + pts[2]] = pts[3] + ' ' + pts[4]
|
||||
else:
|
||||
client[pts[0]][pts[1]] = pts[2]
|
||||
|
||||
server = {'PK:': {}, 'CL:': {}, 'FD:': {}, 'MD:': {}}
|
||||
with open(srg_server, 'r') as fh:
|
||||
for line in fh:
|
||||
pts = line.rstrip('\r\n').split(' ')
|
||||
if pts[0] == 'MD:':
|
||||
server[pts[0]][pts[1] + ' ' + pts[2]] = pts[3] + ' ' + pts[4]
|
||||
else:
|
||||
server[pts[0]][pts[1]] = pts[2]
|
||||
|
||||
common = {'PK:': {}, 'CL:': {}, 'FD:': {}, 'MD:': {}}
|
||||
for type in common:
|
||||
for key, value in client[type].items():
|
||||
if key in server[type]:
|
||||
if value == server[type][key]:
|
||||
client[type].pop(key)
|
||||
server[type].pop(key)
|
||||
common[type][key] = value
|
||||
|
||||
for type in common:
|
||||
for key, value in client[type].items():
|
||||
common[type][key] = value #+ ' #C'
|
||||
|
||||
for type in common:
|
||||
for key, value in server[type].items():
|
||||
common[type][key] = value #+ ' #S'
|
||||
|
||||
#Print joined retroguard files
|
||||
if fml_dir is None:
|
||||
return common
|
||||
|
||||
with open(os.path.join(fml_dir, 'conf', 'joined.srg'), 'wb') as f:
|
||||
for type in ['PK:', 'CL:', 'FD:', 'MD:']:
|
||||
for key in sorted(common[type]):
|
||||
f.write('%s %s %s\n' % (type, key, common[type][key]))
|
||||
|
||||
return common
|
||||
|
||||
def gen_merged_exc(mcp_dir, fml_dir):
|
||||
print 'Reading merged MCInjector config'
|
||||
exc_joined = os.path.join(mcp_dir, 'conf', 'joined.exc')
|
||||
|
||||
joined = {}
|
||||
with open(exc_joined, 'r') as fh:
|
||||
for line in fh:
|
||||
if not line.startswith('#'):
|
||||
pts = line.rstrip('\r\n').split('=')
|
||||
joined[pts[0]] = pts[1]
|
||||
|
||||
return joined
|
||||
|
||||
def gen_shared_searge_names(common_srg, common_exc):
|
||||
field = re.compile(r'field_[0-9]+_[a-zA-Z_]+$')
|
||||
method = re.compile(r'func_[0-9]+_[a-zA-Z_]+')
|
||||
param = re.compile(r'p_[\w]+_\d+_')
|
||||
|
||||
print 'Gathering list of common searge names'
|
||||
|
||||
searge = []
|
||||
|
||||
for key, value in common_srg['FD:'].items():
|
||||
m = field.search(value)
|
||||
if not m is None:
|
||||
if not m.group(0) in searge:
|
||||
searge.append(m.group(0))
|
||||
|
||||
for key, value in common_srg['MD:'].items():
|
||||
m = method.search(value)
|
||||
if not m is None and not '#' in value:
|
||||
if not m.group(0) in searge:
|
||||
searge.append(m.group(0))
|
||||
|
||||
for key, value in common_exc.items():
|
||||
m = param.findall(value)
|
||||
if not m is None:
|
||||
for p in m:
|
||||
if not p in searge:
|
||||
searge.append(p)
|
||||
|
||||
return searge
|
||||
|
||||
def gen_merged_csv(common_map, in_file, out_file, main_key='searge'):
|
||||
reader = csv.DictReader(open(in_file, 'r'))
|
||||
print 'Generating merged csv for %s' % os.path.basename(in_file)
|
||||
common = []
|
||||
added = []
|
||||
for row in reader:
|
||||
if not row[main_key] in added:
|
||||
row['side'] = '2'
|
||||
common.append(row)
|
||||
added.append(row[main_key])
|
||||
writer = csv.DictWriter(open(out_file, 'wb'), fieldnames=reader.fieldnames, lineterminator='\n')
|
||||
writer.writeheader()
|
||||
for row in sorted(common, key=lambda row: row[main_key]):
|
||||
writer.writerow(row)
|
||||
|
||||
def repackage_class(pkgs, cls):
|
||||
if cls.startswith('net/minecraft/src/'):
|
||||
tmp = cls[18:]
|
||||
if tmp in pkgs.keys():
|
||||
return '%s/%s' % (pkgs[tmp], tmp)
|
||||
return cls
|
||||
|
||||
typere = re.compile('([\[ZBCSIJFDV]|L([\w\/]+);)')
|
||||
def repackage_signature(pkgs, sig):
|
||||
global typere
|
||||
sig1 = sig
|
||||
params = sig.rsplit(')', 1)[0][1:]
|
||||
ret = sig.rsplit(')', 1)[1]
|
||||
|
||||
sig = '('
|
||||
for arg in typere.findall(params):
|
||||
if len(arg[1]) > 0:
|
||||
sig += 'L%s;' % repackage_class(pkgs, arg[1])
|
||||
else:
|
||||
sig += arg[0]
|
||||
sig += ')'
|
||||
for tmp in typere.findall(ret):
|
||||
if len(tmp[1]) > 0:
|
||||
sig += 'L%s;' % repackage_class(pkgs, tmp[1])
|
||||
else:
|
||||
sig += tmp[0]
|
||||
return sig
|
||||
|
||||
def gen_renamed_conf(mcp_dir, fml_dir):
|
||||
pkg_file = os.path.join(fml_dir, 'conf', 'packages.csv')
|
||||
srg_in = os.path.join(mcp_dir, 'conf', 'joined.srg')
|
||||
srg_out = os.path.join(mcp_dir, 'conf', 'packaged.srg')
|
||||
exc_in = os.path.join(mcp_dir, 'conf', 'joined.exc')
|
||||
exc_out = os.path.join(mcp_dir, 'conf', 'packaged.exc')
|
||||
|
||||
pkgs = {}
|
||||
if os.path.isfile(pkg_file):
|
||||
with open(pkg_file) as fh:
|
||||
reader = csv.DictReader(fh)
|
||||
for line in reader:
|
||||
pkgs[line['class']] = line['package']
|
||||
|
||||
print 'Creating re-packaged srg'
|
||||
with open(srg_in, 'r') as inf:
|
||||
with open(srg_out, 'wb') as outf:
|
||||
for line in inf:
|
||||
pts = line.rstrip('\r\n').split(' ')
|
||||
if pts[0] == 'PK:':
|
||||
outf.write(' '.join(pts) + '\n')
|
||||
elif pts[0] == 'CL:':
|
||||
pts[2] = repackage_class(pkgs, pts[2])
|
||||
outf.write('CL: %s %s\n' % (pts[1], pts[2]))
|
||||
elif pts[0] == 'FD:':
|
||||
tmp = pts[2].rsplit('/', 1)
|
||||
tmp[0] = repackage_class(pkgs, tmp[0])
|
||||
outf.write('FD: %s %s/%s\n' % (pts[1], tmp[0], tmp[1]))
|
||||
elif pts[0] == 'MD:':
|
||||
tmp = pts[3].rsplit('/', 1)
|
||||
pts[3] = '%s/%s' % (repackage_class(pkgs, tmp[0]), tmp[1])
|
||||
pts[4] = repackage_signature(pkgs, pts[4])
|
||||
outf.write('MD: %s %s %s %s\n' % (pts[1], pts[2], pts[3], pts[4]))
|
||||
else:
|
||||
print 'Line unknown in SRG: ' + line
|
||||
outf.write(line)
|
||||
|
||||
excre = re.compile('([\[ZBCSIJFDV]|L([\w\/]+);)')
|
||||
print 'Creating re-packaged exc'
|
||||
with open(exc_in, 'r') as inf:
|
||||
with open(exc_out, 'wb') as outf:
|
||||
for line in inf:
|
||||
line = line.rstrip('\r\n')
|
||||
cls = line.split('.')[0]
|
||||
named = line.rsplit('=', 1)[1]
|
||||
line = line[len(cls)+1:-1*len(named)-1]
|
||||
func = line.split('(')[0]
|
||||
|
||||
tmp = named.split('|', 1)
|
||||
if len(tmp[0]) > 0:
|
||||
excs = tmp[0].split(',')
|
||||
for x in range(len(excs)):
|
||||
excs[x] = repackage_class(pkgs, excs[x])
|
||||
named = '%s|%s' % (','.join(excs), tmp[1])
|
||||
|
||||
sig = repackage_signature(pkgs, line[len(func):])
|
||||
cls = repackage_class(pkgs, cls)
|
||||
outf.write('%s.%s%s=%s\n' % (cls, func, sig, named))
|
||||
|
||||
print 'Creating re-packaged MCP patches'
|
||||
|
||||
def fix_patches(patch_in, patch_tmp):
|
||||
regnms = re.compile(r'net\\minecraft\\src\\(\w+)')
|
||||
with open(patch_in, 'r') as fh:
|
||||
buf = fh.read()
|
||||
def mapname(match):
|
||||
return repackage_class(pkgs, match.group(0).replace('\\', '/')).replace('/', '\\')
|
||||
buf = regnms.sub(mapname, buf)
|
||||
|
||||
with open(patch_tmp, 'w') as fh:
|
||||
fh.write(buf)
|
||||
|
||||
shutil.move(patch_tmp, patch_in)
|
||||
|
||||
patch_dir = os.path.join(mcp_dir, 'conf', 'patches')
|
||||
fix_patches(os.path.join(patch_dir, 'minecraft_ff.patch' ), os.path.join(patch_dir, 'tmp.patch'))
|
||||
fix_patches(os.path.join(patch_dir, 'minecraft_server_ff.patch'), os.path.join(patch_dir, 'tmp.patch'))
|
||||
@@ -1,4 +0,0 @@
|
||||
echo off
|
||||
@set PATH=%PATH%;%SystemDir%\system32;%SystemRoot%\System32;.\python\
|
||||
python_fml install.py %*
|
||||
pause
|
||||
@@ -1,46 +0,0 @@
|
||||
import os, os.path, sys
|
||||
from optparse import OptionParser
|
||||
|
||||
from fml import setup_fml, finish_setup_fml, apply_fml_patches, setup_mcp
|
||||
|
||||
def fml_main(fml_dir, mcp_dir, dont_gen_conf=True, disable_patches=False, disable_at=False, disable_merge=False, enable_server=False, disable_client=False,
|
||||
disable_rename=False):
|
||||
print '================ Forge ModLoader Setup Start ==================='
|
||||
setup_mcp(fml_dir, mcp_dir, dont_gen_conf)
|
||||
setup_fml(fml_dir, mcp_dir, disable_at=disable_at, disable_merge=disable_merge, enable_server=enable_server, disable_client=disable_client)
|
||||
if disable_patches:
|
||||
print 'Patching disabled'
|
||||
else:
|
||||
apply_fml_patches(fml_dir, mcp_dir, os.path.join(mcp_dir, 'src'))
|
||||
finish_setup_fml(fml_dir, mcp_dir, enable_server=enable_server, disable_client=disable_client, disable_rename=disable_rename)
|
||||
print '================ Forge ModLoader Setup End ==================='
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = OptionParser()
|
||||
parser.add_option('-m', '--mcp-dir', action='store', dest='mcp_dir', help='Path to download/extract MCP to', default=None )
|
||||
parser.add_option('-p', '--no-patch', action="store_true", dest='no_patch', help='Disable application of FML patches', default=False)
|
||||
parser.add_option('-a', '--no-access', action="store_true", dest='no_access', help='Disable access transformers', default=False)
|
||||
parser.add_option('-s', '--server', action="store_true", dest='enable_server', help='Enable decompilation of server', default=False)
|
||||
parser.add_option('-c', '--no-client', action="store_true", dest='no_client', help='Disable decompilation of server', default=False)
|
||||
parser.add_option('-e', '--no-merge', action="store_true", dest='no_merge', help='Disable merging server code into client', default=False)
|
||||
parser.add_option('-n', '--no-rename', action="store_true", dest='no_rename', help='Disable running updatenames', default=False)
|
||||
options, _ = parser.parse_args()
|
||||
|
||||
fml_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
mcp_dir = os.path.abspath('mcp')
|
||||
|
||||
if not options.mcp_dir is None:
|
||||
mcp_dir = os.path.abspath(options.mcp_dir)
|
||||
elif os.path.isfile(os.path.join('..', 'runtime', 'commands.py')):
|
||||
mcp_dir = os.path.abspath('..')
|
||||
|
||||
if options.no_client:
|
||||
options.no_patch = True
|
||||
|
||||
if options.no_merge:
|
||||
options.no_patch = True
|
||||
|
||||
fml_main(fml_dir, mcp_dir, disable_patches=options.no_patch,
|
||||
disable_at=options.no_access, disable_merge=options.no_merge,
|
||||
enable_server=options.enable_server, disable_client=options.no_client,
|
||||
disable_rename=options.no_rename)
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/bash
|
||||
python install.py
|
||||
@@ -1,170 +0,0 @@
|
||||
import os, os.path, sys, csv, re, fnmatch, shutil, zipfile, pprint
|
||||
from optparse import OptionParser
|
||||
from pprint import pprint
|
||||
|
||||
#This script attempts to rename local variables in a Fernflower decompiled Java source file to jad style names.
|
||||
#Script originally written by Grum in perl, Converted to Python by monoxide, and bug fixes/cleanup by LexManos
|
||||
|
||||
class VarNamer:
|
||||
# Seems this is needed to keep these variables confined to the instance
|
||||
def __init__(self):
|
||||
self.last = {
|
||||
'byte': [0, 0, ['b']],
|
||||
'char': [0, 0, ['c']],
|
||||
'short': [1, 0, ['short']],
|
||||
'int': [0, 1, ['i', 'j', 'k', 'l']],
|
||||
'boolean': [0, 1, ['flag']],
|
||||
'double': [0, 0, ['d']],
|
||||
'float': [0, 1, ['f']],
|
||||
'File': [1, 1, ['file']],
|
||||
'String': [0, 1, ['s']],
|
||||
'Class': [0, 1, ['oclass']],
|
||||
'Long': [0, 1, ['olong']],
|
||||
'Byte': [0, 1, ['obyte']],
|
||||
'Short': [0, 1, ['oshort']],
|
||||
'Boolean': [0, 1, ['obool']],
|
||||
'Package': [0, 1, ['opackage']]
|
||||
}
|
||||
self.remap = {
|
||||
'long': 'int',
|
||||
}
|
||||
|
||||
def get_name(self, type, var):
|
||||
index = type if self.last.has_key(type) else (self.remap[type] if self.remap.has_key(type) else None)
|
||||
if (not index) and (re.search('^[A-Z]', type) or re.search(r'(\[|\.\.\.)', type)):
|
||||
type = type.replace('...', '[]')
|
||||
while type.find('[][]') != -1:
|
||||
type = type.replace('[][]', '[]')
|
||||
|
||||
name = type.lower()
|
||||
skip = 1
|
||||
|
||||
if re.search(r'\[', type):
|
||||
skip = 1
|
||||
name = "a" + name
|
||||
name = name.replace('[', '').replace(']', '').replace('...', '')
|
||||
|
||||
self.last[type] = [0, skip, [name]]
|
||||
index = type
|
||||
|
||||
if not index:
|
||||
print "No data for type: %s '%s'\n" % (type, var)
|
||||
return type
|
||||
|
||||
id = self.last[index][0]
|
||||
skip_zero = self.last[index][1]
|
||||
data = self.last[index][2]
|
||||
self.last[index][0] += 1
|
||||
|
||||
amount = len(data)
|
||||
|
||||
if amount == 1:
|
||||
return data[0] + ('' if ((not id) and skip_zero) else ('%d' % id))
|
||||
else:
|
||||
num = id / amount
|
||||
return data[id % amount] + ('' if ((not num) and skip_zero) else ('%d' % num))
|
||||
|
||||
def rename_file(file, indent='3', MCP=False):
|
||||
tmp = file + '.tmp'
|
||||
with open(file, 'rb') as in_file:
|
||||
data = rename_class(in_file.read().replace('\r', ''), indent, MCP)
|
||||
with open(tmp, 'wb') as out_file:
|
||||
out_file.write(data)
|
||||
shutil.move(tmp, file)
|
||||
|
||||
def rename_class(data, indent='3', MCP=False):
|
||||
METHOD_REG = r'^ {%s}(\w+\s+\S.*\.*(|static )(?:\{|\);|})$' % indent
|
||||
CATCH_REG = r'catch \((.*)\) {'
|
||||
if MCP:
|
||||
if indent == '3':
|
||||
indent = '4'
|
||||
METHOD_REG = r'^ {%s}(\w+\s+\S.*\(.*|static)$' % indent
|
||||
CATCH_REG = r'catch \((.*)\)$'
|
||||
|
||||
lines = data.split('\n')
|
||||
output = ''
|
||||
|
||||
inside_method = False
|
||||
method = ''
|
||||
method_variables = []
|
||||
skip = False
|
||||
|
||||
for line in lines:
|
||||
line += '\n'
|
||||
if re.search(METHOD_REG, line) and not re.search('=', line) and not re.search(r'\(.*\(', line):
|
||||
if re.search(r'\(.+\)', line):
|
||||
method_variables += [s.strip() for s in re.search(r'\((.+)\)', line).group(1).split(',')]
|
||||
|
||||
method += line
|
||||
|
||||
# Could be a single-line method
|
||||
skip = True
|
||||
if not re.search(r'(}|\);|throws .+?;)$', line):
|
||||
inside_method = True
|
||||
|
||||
elif re.search(r'^ {%s}}$' % indent, line):
|
||||
inside_method = False
|
||||
|
||||
if inside_method:
|
||||
if skip:
|
||||
skip = False
|
||||
continue
|
||||
|
||||
method += line
|
||||
|
||||
m = re.search(CATCH_REG, line)
|
||||
if m:
|
||||
method_variables += [m.group(1)]
|
||||
else:
|
||||
method_variables += map(lambda x: x.group(0), filter(
|
||||
lambda x: not re.match(r'^(return)', x.group(0)) and not re.match(r'^(throw)', x.group(0)),
|
||||
re.finditer(r'([a-z_$][a-z0-9_\[\]]+ var\d+)', line, re.I)))
|
||||
|
||||
else:
|
||||
if method:
|
||||
namer = VarNamer()
|
||||
todo = map(lambda x: [x, namer.get_name(x.split(' ')[0], x)], method_variables)
|
||||
|
||||
replace = {}
|
||||
for mapping in todo:
|
||||
if not ' ' in mapping[0]:
|
||||
continue
|
||||
replace[mapping[0].split(' ')[1]] = mapping[1]
|
||||
|
||||
for k in sorted(replace, key=len, reverse=True):
|
||||
original = k
|
||||
to = replace[k]
|
||||
|
||||
#Don't rename already renamed things.
|
||||
if not re.match('var\d+', original):
|
||||
continue
|
||||
|
||||
method = method.replace(original, to)
|
||||
|
||||
output += method
|
||||
|
||||
method = ''
|
||||
method_variables = []
|
||||
|
||||
if skip:
|
||||
skip = False
|
||||
continue
|
||||
|
||||
output += line
|
||||
|
||||
return output[:-1]
|
||||
|
||||
def main(options, args):
|
||||
for arg in args:
|
||||
for path, _, filelist in os.walk(arg, followlinks=True):
|
||||
for cur_file in fnmatch.filter(filelist, '*.java'):
|
||||
file = os.path.normpath(os.path.join(path, cur_file))
|
||||
rename_file(file, options.indent, options.mcp)
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = OptionParser()
|
||||
parser.add_option('-m', '--mcp', action='store_true', dest='mcp', help='Use MCP regexs', default=False)
|
||||
parser.add_option('-i', '--indent', action='store', dest='indent', help='Custom indent to use', default='3')
|
||||
options, args = parser.parse_args()
|
||||
|
||||
main(options, args)
|
||||
@@ -1,90 +0,0 @@
|
||||
import os, os.path, sys, csv, re, fnmatch, shutil, zipfile, pprint
|
||||
from optparse import OptionParser
|
||||
from zipfile import ZipFile
|
||||
from subprocess import Popen, PIPE, STDOUT
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = OptionParser()
|
||||
parser.add_option('-j', '--jar', action='store', dest='jar', help='Jar to sign', default=None)
|
||||
parser.add_option('-c', '--command', action='store', dest='command', help='Path to jar signer command, will be invoked on temp jar to sign', default=None)
|
||||
parser.add_option('-a', '--alias', action='store', dest='alias', help='Optional: The keystore alias to use when siging the jar, it will be passed in as para 2 to the command', default='')
|
||||
#This is kept as a seperate file so that if you integrate this into a build system, you are not publically displaying any private passwords
|
||||
#Typically the format of this file will be:
|
||||
#
|
||||
#jarsigner -keystore my_key_store -storepass key_store_pass -keypass key_pass %1 alias
|
||||
|
||||
#The rest of the parameters are used as regxs to determine what parts of the file will be signed, a file will be signed if it matches ANY of the regexs
|
||||
options, args = parser.parse_args()
|
||||
|
||||
if options.jar is None:
|
||||
print 'You must supply the jar to sign using --jar <jar>'
|
||||
sys.exit(1)
|
||||
|
||||
if options.command is None:
|
||||
print 'You must supply a command to be called using --command <command>, See the comments in the python for details on this'
|
||||
sys.exit(1)
|
||||
|
||||
if not os.path.isfile(options.jar):
|
||||
print 'The specified jar "%s" could not be found' % options.jar
|
||||
sys.exit(1)
|
||||
|
||||
regs = []
|
||||
for reg in args:
|
||||
regs.append(re.compile(reg))
|
||||
|
||||
shutil.copy(options.jar, options.jar + '.bak')
|
||||
tmp_1 = options.jar + '.tmp1'
|
||||
tmp_2 = options.jar + '.tmp2'
|
||||
|
||||
zip_in = ZipFile(options.jar, mode='r')
|
||||
zip_tmp_1 = ZipFile(tmp_1, mode='w')
|
||||
zip_tmp_2 = ZipFile(tmp_2, mode='w')
|
||||
for i in zip_in.filelist:
|
||||
matched = False
|
||||
for reg in regs:
|
||||
if not reg.match(i.filename) is None:
|
||||
matched = True
|
||||
break
|
||||
|
||||
data = zip_in.read(i.filename)
|
||||
if matched:
|
||||
print 'Matched: ' + i.filename
|
||||
zip_tmp_1.writestr(i, data)
|
||||
else:
|
||||
if i.filename.startswith('META-INF'):
|
||||
print 'Detected skipped META-INF File, it will not be copied to new jar, if you wish to keep this data, include it in the signed info: %s' % i.filename
|
||||
else:
|
||||
print 'Skipped: ' + i.filename
|
||||
zip_tmp_2.writestr(i, data)
|
||||
|
||||
zip_in.close()
|
||||
zip_tmp_1.close()
|
||||
zip_tmp_2.close()
|
||||
|
||||
try:
|
||||
process = Popen([options.command, os.path.abspath(tmp_1), options.alias], stdout=PIPE, stderr=STDOUT, bufsize=-1)
|
||||
out, _ = process.communicate()
|
||||
print out
|
||||
except OSError as e:
|
||||
print "Error creating signed tmp jar: %s" % e.strerror
|
||||
sys.exit(1)
|
||||
|
||||
os.remove(options.jar)
|
||||
|
||||
zip_out = ZipFile(options.jar, mode='w')
|
||||
|
||||
for tmp in [tmp_1, tmp_2]:
|
||||
zip_in = ZipFile(tmp, mode='r')
|
||||
|
||||
for i in zip_in.filelist:
|
||||
zip_out.writestr(i, zip_in.read(i.filename))
|
||||
|
||||
zip_in.close()
|
||||
|
||||
zip_out.close()
|
||||
|
||||
os.remove(tmp_1)
|
||||
os.remove(tmp_2)
|
||||
|
||||
print 'Signing jar complete'
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
import os, os.path, sys, csv, re, fnmatch, shutil
|
||||
from optparse import OptionParser
|
||||
|
||||
replaced = 0
|
||||
|
||||
def main(mcp_dir, targets):
|
||||
global replaced
|
||||
packages_csv = os.path.join(mcp_dir, 'conf', 'packages.csv')
|
||||
|
||||
if not os.path.isfile(packages_csv):
|
||||
print 'Could not find Packages.csv, please specify a location of a MCP directory setup with FML using --mcp-dir <path>'
|
||||
sys.exit(1)
|
||||
|
||||
pkgs = {}
|
||||
with open(packages_csv) as fh:
|
||||
reader = csv.DictReader(fh)
|
||||
for line in reader:
|
||||
pkgs[line['class']] = line['package']
|
||||
|
||||
if len(targets) == 0:
|
||||
print 'You must specify atleast one target directory to repackage'
|
||||
sys.exit(1)
|
||||
|
||||
regnms = re.compile(r'net.minecraft.src.(\w+)')
|
||||
total_r = 0
|
||||
total_f = 0
|
||||
|
||||
for target in targets:
|
||||
for path, _, filelist in os.walk(target, followlinks=True):
|
||||
for cur_file in fnmatch.filter(filelist, '*.java'):
|
||||
file_name = os.path.join(path, cur_file)
|
||||
buf = ''
|
||||
replaced = 0
|
||||
|
||||
with open(file_name, 'rb') as fh:
|
||||
data = fh.read()
|
||||
def mapname(match):
|
||||
global replaced
|
||||
cls = match.group(0)
|
||||
tmp = cls[18:]
|
||||
if tmp in pkgs.keys():
|
||||
replaced += 1
|
||||
return ('%s/%s' % (pkgs[tmp], tmp)).replace('/', '.')
|
||||
return cls
|
||||
data = regnms.sub(mapname, data)
|
||||
|
||||
if replaced > 0:
|
||||
total_r += replaced
|
||||
total_f += 1
|
||||
|
||||
print '%s: %d' % (os.path.relpath(file_name), replaced)
|
||||
|
||||
with open(file_name + '.tmp', 'wb') as fh:
|
||||
fh.write(data)
|
||||
shutil.move(file_name + '.tmp', file_name)
|
||||
|
||||
print 'Fixed %d references in %d files' % (total_r, total_f)
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = OptionParser()
|
||||
parser.add_option('-m', '--mcp-dir', action='store', dest='mcp_dir', help='MCP Directory', default='mcp')
|
||||
options, args = parser.parse_args()
|
||||
|
||||
main(os.path.abspath(options.mcp_dir), args)
|
||||
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"id": "FML{version}",
|
||||
"time": "{timestamp}",
|
||||
"releaseTime": "{timestamp}",
|
||||
"type": "release",
|
||||
"processArguments": "username_session_version",
|
||||
"minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets} --tweakClass cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"minimumLauncherVersion": 2,
|
||||
"libraries": [
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.3",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.ow2.asm:asm-all:4.1",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "net.sf.jopt-simple:jopt-simple:4.5",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "lzma:lzma:0.0.1"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecjorbis:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecwav:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:libraryjavasound:20101123"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:librarylwjglopenal:20100824"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:soundsystem:20120107"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "argo:argo:2.25_fixed"
|
||||
},
|
||||
{
|
||||
"name": "net.sourceforge.argo:argo:2.25",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "grumble grumble grumble, y u no use proper version/artifact id grumble"
|
||||
},
|
||||
{
|
||||
"name": "org.bouncycastle:bcprov-jdk15on:1.47",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "com.google.guava:guava:14.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.apache.commons:commons-lang3:3.1",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "commons-io:commons-io:2.4",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput:2.0.5",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jutils:jutils:1.0.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "com.google.code.gson:gson:2.2.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput-platform:2.0.5",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.client.main.Main"
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"id": "FML{version}",
|
||||
"time": "{timestamp}",
|
||||
"releaseTime": "{timestamp}",
|
||||
"type": "release",
|
||||
"processArguments": "username_session_version",
|
||||
"minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets} --tweakClass cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"minimumLauncherVersion": 2,
|
||||
"libraries": [
|
||||
{
|
||||
"name": "cpw.mods:fml:{version}",
|
||||
"devdl" : "false"
|
||||
},
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.3"
|
||||
},
|
||||
{
|
||||
"name": "net.sf.jopt-simple:jopt-simple:4.5"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecjorbis:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecwav:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:libraryjavasound:20101123"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:librarylwjglopenal:20100824"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:soundsystem:20120107"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0"
|
||||
},
|
||||
{
|
||||
"name": "argo:argo:2.25_fixed"
|
||||
},
|
||||
{
|
||||
"name": "org.bouncycastle:bcprov-jdk15on:1.47"
|
||||
},
|
||||
{
|
||||
"name": "com.google.guava:guava:14.0"
|
||||
},
|
||||
{
|
||||
"name": "org.apache.commons:commons-lang3:3.1"
|
||||
},
|
||||
{
|
||||
"name": "commons-io:commons-io:2.4"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput:2.0.5"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jutils:jutils:1.0.0"
|
||||
},
|
||||
{
|
||||
"name": "com.google.code.gson:gson:2.2.2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput-platform:2.0.5",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.client.main.Main"
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"id": "FML{version}",
|
||||
"time": "{timestamp}",
|
||||
"releaseTime": "{timestamp}",
|
||||
"type": "release",
|
||||
"processArguments": "username_session_version",
|
||||
"minecraftArguments": "--version FML_DEV --tweakClass cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"minimumLauncherVersion": 2,
|
||||
"libraries": [
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.3",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.ow2.asm:asm-all:4.1",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-library:2.10.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-compiler:2.10.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "net.sf.jopt-simple:jopt-simple:4.5",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "lzma:lzma:0.0.1"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecjorbis:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecwav:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:libraryjavasound:20101123"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:librarylwjglopenal:20100824"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:soundsystem:20120107"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "argo:argo:2.25_fixed"
|
||||
},
|
||||
{
|
||||
"name": "net.sourceforge.argo:argo:2.25",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "grumble grumble grumble, y u no use proper version/artifact id grumble"
|
||||
},
|
||||
{
|
||||
"name": "org.bouncycastle:bcprov-jdk15on:1.47",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "com.google.guava:guava:14.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.apache.commons:commons-lang3:3.1",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "commons-io:commons-io:2.4",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput:2.0.5",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jutils:jutils:1.0.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "com.google.code.gson:gson:2.2.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput-platform:2.0.5",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch"
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"install": {
|
||||
"profileName": "FML",
|
||||
"target":"FML@version@",
|
||||
"path":"cpw.mods:fml:@version@",
|
||||
"version":"FML @version@",
|
||||
"filePath":"@universal_jar@",
|
||||
"welcome":"Welcome to the simple FML installer.",
|
||||
"minecraft":"@minecraft_version@",
|
||||
"logo":"/big_logo.png"
|
||||
},
|
||||
"versionInfo": {
|
||||
"id": "FML@version@",
|
||||
"time": "@timestamp@",
|
||||
"releaseTime": "1960-01-01T00:00:00-0700",
|
||||
"type": "release",
|
||||
"processArguments": "username_session_version",
|
||||
"minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets} --tweakClass cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"minimumLauncherVersion": 2,
|
||||
"libraries": [
|
||||
{
|
||||
"name": "cpw.mods:fml:@version@",
|
||||
"url": "http://files.minecraftforge.net/maven/"
|
||||
},
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.3",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-library:2.10.2",
|
||||
"url" : "http://repo.maven.apache.org/maven2/",
|
||||
"comment" : "Important for FML, we add this",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-compiler:2.10.2",
|
||||
"url" : "http://repo.maven.apache.org/maven2/",
|
||||
"comment" : "Important for FML, we add this",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "org.ow2.asm:asm-all:4.1",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "net.sf.jopt-simple:jopt-simple:4.5",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "lzma:lzma:0.0.1",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecjorbis:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecwav:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:libraryjavasound:20101123"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:librarylwjglopenal:20100824"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:soundsystem:20120107"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0"
|
||||
},
|
||||
{
|
||||
"name": "argo:argo:2.25_fixed"
|
||||
},
|
||||
{
|
||||
"name": "org.bouncycastle:bcprov-jdk15on:1.47"
|
||||
},
|
||||
{
|
||||
"name": "com.google.guava:guava:14.0"
|
||||
},
|
||||
{
|
||||
"name": "org.apache.commons:commons-lang3:3.1"
|
||||
},
|
||||
{
|
||||
"name": "commons-io:commons-io:2.4"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput:2.0.5"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jutils:jutils:1.0.0"
|
||||
},
|
||||
{
|
||||
"name": "com.google.code.gson:gson:2.2.2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput-platform:2.0.5",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"id": "FML{version}",
|
||||
"time": "{timestamp}",
|
||||
"releaseTime": "{timestamp}",
|
||||
"type": "release",
|
||||
"processArguments": "username_session_version",
|
||||
"minecraftArguments": "--version FML_DEV --tweakClass cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"minimumLauncherVersion": 2,
|
||||
"libraries": [
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.3",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.ow2.asm:asm-debug-all:4.1",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-library:2.10.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-compiler:2.10.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "net.sf.jopt-simple:jopt-simple:4.5",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "lzma:lzma:0.0.1"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecjorbis:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecwav:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:libraryjavasound:20101123"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:librarylwjglopenal:20100824"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:soundsystem:20120107"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "argo:argo:2.25_fixed"
|
||||
},
|
||||
{
|
||||
"name": "net.sourceforge.argo:argo:2.25",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "grumble grumble grumble, y u no use proper version/artifact id grumble"
|
||||
},
|
||||
{
|
||||
"name": "org.bouncycastle:bcprov-jdk15on:1.47",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "com.google.guava:guava:14.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.apache.commons:commons-lang3:3.1",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "commons-io:commons-io:2.4",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput:2.0.5",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jutils:jutils:1.0.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "com.google.code.gson:gson:2.2.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput-platform:2.0.5",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch"
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
{
|
||||
"install": {
|
||||
"profileName": "FML",
|
||||
"target":"@minecraft_version@-FML@version@",
|
||||
"path":"cpw.mods:fml:@version@",
|
||||
"version":"FML @version@",
|
||||
"filePath":"@universal_jar@",
|
||||
"welcome":"Welcome to the simple FML installer.",
|
||||
"minecraft":"@minecraft_version@",
|
||||
"mirrorList" : "http://files.minecraftforge.net/mirror-brand.list",
|
||||
"logo":"/big_logo.png"
|
||||
},
|
||||
"versionInfo": {
|
||||
"id": "@minecraft_version@-FML@version@",
|
||||
"time": "@timestamp@",
|
||||
"releaseTime": "1960-01-01T00:00:00-0700",
|
||||
"type": "release",
|
||||
"processArguments": "username_session_version",
|
||||
"minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets} --tweakClass cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"minimumLauncherVersion": 4,
|
||||
"libraries": [
|
||||
{
|
||||
"name": "cpw.mods:fml:@version@",
|
||||
"url": "http://files.minecraftforge.net/maven/"
|
||||
},
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.3",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "org.ow2.asm:asm-all:4.1",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-library:2.10.2",
|
||||
"url" : "http://files.minecraftforge.net/maven/",
|
||||
"checksums" : [ "6ba65d12cd09d441083262d6f73d2257fec7c663", "dffc88e804861c9eaba39283757000b6558ea573" ],
|
||||
"comment" : "Important for FML, we add this",
|
||||
"serverreq":true,
|
||||
"clientreq":true
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-compiler:2.10.2",
|
||||
"url" : "http://files.minecraftforge.net/maven/",
|
||||
"checksums" : [ "64c8b1380cc53d6850823d6e4e7ae984aa44ef9c", "40281b3ffc69fb385953522c843363ccaf71ba89" ],
|
||||
"comment" : "Important for FML, we add this",
|
||||
"serverreq":true,
|
||||
"clientreq":true
|
||||
},
|
||||
{
|
||||
"name": "net.sf.jopt-simple:jopt-simple:4.5",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "lzma:lzma:0.0.1",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecjorbis:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecwav:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:libraryjavasound:20101123"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:librarylwjglopenal:20100824"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:soundsystem:20120107"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0"
|
||||
},
|
||||
{
|
||||
"name": "argo:argo:2.25_fixed"
|
||||
},
|
||||
{
|
||||
"name": "org.bouncycastle:bcprov-jdk15on:1.47"
|
||||
},
|
||||
{
|
||||
"name": "com.google.guava:guava:14.0"
|
||||
},
|
||||
{
|
||||
"name": "org.apache.commons:commons-lang3:3.1"
|
||||
},
|
||||
{
|
||||
"name": "commons-io:commons-io:2.4"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput:2.0.5"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jutils:jutils:1.0.0"
|
||||
},
|
||||
{
|
||||
"name": "com.google.code.gson:gson:2.2.2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow"
|
||||
},
|
||||
{
|
||||
"action": "disallow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow"
|
||||
},
|
||||
{
|
||||
"action": "disallow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow"
|
||||
},
|
||||
{
|
||||
"action": "disallow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
],
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.1-nightly-20130708-debug3",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.1-nightly-20130708-debug3",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1-nightly-20130708-debug3",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
],
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput-platform:2.0.5",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"id": "FML{version}",
|
||||
"time": "{timestamp}",
|
||||
"releaseTime": "{timestamp}",
|
||||
"type": "release",
|
||||
"processArguments": "username_session_version",
|
||||
"minecraftArguments": "--version FML_DEV --tweakClass cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"minimumLauncherVersion": 4,
|
||||
"libraries": [
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.7",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.ow2.asm:asm-debug-all:4.1",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-library:2.10.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-compiler:2.10.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "net.sf.jopt-simple:jopt-simple:4.5",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "lzma:lzma:0.0.1"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecjorbis:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecwav:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:libraryjavasound:20101123"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:librarylwjglopenal:20100824"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:soundsystem:20120107"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "argo:argo:2.25_fixed"
|
||||
},
|
||||
{
|
||||
"name": "net.sourceforge.argo:argo:2.25",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "grumble grumble grumble, y u no use proper version/artifact id grumble"
|
||||
},
|
||||
{
|
||||
"name": "org.bouncycastle:bcprov-jdk15on:1.47",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "com.google.guava:guava:14.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.apache.commons:commons-lang3:3.1",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "commons-io:commons-io:2.4",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput:2.0.5",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jutils:jutils:1.0.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "com.google.code.gson:gson:2.2.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput-platform:2.0.5",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch"
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
{
|
||||
"install": {
|
||||
"profileName": "FML",
|
||||
"target":"@minecraft_version@-FML@version@",
|
||||
"path":"cpw.mods:fml:@version@",
|
||||
"version":"FML @version@",
|
||||
"filePath":"@universal_jar@",
|
||||
"welcome":"Welcome to the simple FML installer.",
|
||||
"minecraft":"@minecraft_version@",
|
||||
"mirrorList" : "http://files.minecraftforge.net/mirror-brand.list",
|
||||
"logo":"/big_logo.png"
|
||||
},
|
||||
"versionInfo": {
|
||||
"id": "@minecraft_version@-FML@version@",
|
||||
"time": "@timestamp@",
|
||||
"releaseTime": "1960-01-01T00:00:00-0700",
|
||||
"type": "release",
|
||||
"processArguments": "username_session_version",
|
||||
"minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets} --tweakClass cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"minimumLauncherVersion": 4,
|
||||
"libraries": [
|
||||
{
|
||||
"name": "cpw.mods:fml:@version@",
|
||||
"url": "http://files.minecraftforge.net/maven/"
|
||||
},
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.7",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "org.ow2.asm:asm-all:4.1",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-library:2.10.2",
|
||||
"url" : "http://files.minecraftforge.net/maven/",
|
||||
"checksums" : [ "6ba65d12cd09d441083262d6f73d2257fec7c663", "dffc88e804861c9eaba39283757000b6558ea573" ],
|
||||
"comment" : "Important for FML, we add this",
|
||||
"serverreq":true,
|
||||
"clientreq":true
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-compiler:2.10.2",
|
||||
"url" : "http://files.minecraftforge.net/maven/",
|
||||
"checksums" : [ "64c8b1380cc53d6850823d6e4e7ae984aa44ef9c", "40281b3ffc69fb385953522c843363ccaf71ba89" ],
|
||||
"comment" : "Important for FML, we add this",
|
||||
"serverreq":true,
|
||||
"clientreq":true
|
||||
},
|
||||
{
|
||||
"name": "lzma:lzma:0.0.1",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "net.sf.jopt-simple:jopt-simple:4.5",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecjorbis:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecwav:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:libraryjavasound:20101123"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:librarylwjglopenal:20100824"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:soundsystem:20120107"
|
||||
},
|
||||
{
|
||||
"name": "argo:argo:2.25_fixed"
|
||||
},
|
||||
{
|
||||
"name": "org.bouncycastle:bcprov-jdk15on:1.47"
|
||||
},
|
||||
{
|
||||
"name": "com.google.guava:guava:14.0"
|
||||
},
|
||||
{
|
||||
"name": "org.apache.commons:commons-lang3:3.1"
|
||||
},
|
||||
{
|
||||
"name": "commons-io:commons-io:2.4"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput:2.0.5"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jutils:jutils:1.0.0"
|
||||
},
|
||||
{
|
||||
"name": "com.google.code.gson:gson:2.2.2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow"
|
||||
},
|
||||
{
|
||||
"action": "disallow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow"
|
||||
},
|
||||
{
|
||||
"action": "disallow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow"
|
||||
},
|
||||
{
|
||||
"action": "disallow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
],
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.1-nightly-20130708-debug3",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.1-nightly-20130708-debug3",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1-nightly-20130708-debug3",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
],
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput-platform:2.0.5",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"id": "FML{version}",
|
||||
"time": "{timestamp}",
|
||||
"releaseTime": "{timestamp}",
|
||||
"type": "release",
|
||||
"processArguments": "username_session_version",
|
||||
"minecraftArguments": "--version FML_DEV --tweakClass cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"minimumLauncherVersion": 4,
|
||||
"libraries": [
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.8",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.ow2.asm:asm-debug-all:4.1",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-library:2.10.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-compiler:2.10.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "Important for FML, we add this"
|
||||
},
|
||||
{
|
||||
"name": "net.sf.jopt-simple:jopt-simple:4.5",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "lzma:lzma:0.0.1"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecjorbis:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecwav:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:libraryjavasound:20101123"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:librarylwjglopenal:20100824"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:soundsystem:20120107"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "argo:argo:2.25_fixed"
|
||||
},
|
||||
{
|
||||
"name": "net.sourceforge.argo:argo:2.25",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2",
|
||||
"comment" : "grumble grumble grumble, y u no use proper version/artifact id grumble"
|
||||
},
|
||||
{
|
||||
"name": "org.bouncycastle:bcprov-jdk15on:1.47",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "com.google.guava:guava:14.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.apache.commons:commons-lang3:3.1",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "commons-io:commons-io:2.4",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput:2.0.5",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jutils:jutils:1.0.0",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "com.google.code.gson:gson:2.2.2",
|
||||
"children" : ["sources"],
|
||||
"url" : "http://repo.maven.apache.org/maven2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput-platform:2.0.5",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch"
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
{
|
||||
"install": {
|
||||
"profileName": "FML",
|
||||
"target":"@minecraft_version@-FML@version@",
|
||||
"path":"cpw.mods:fml:@version@",
|
||||
"version":"FML @version@",
|
||||
"filePath":"@universal_jar@",
|
||||
"welcome":"Welcome to the simple FML installer.",
|
||||
"minecraft":"@minecraft_version@",
|
||||
"mirrorList" : "http://files.minecraftforge.net/mirror-brand.list",
|
||||
"logo":"/big_logo.png"
|
||||
},
|
||||
"versionInfo": {
|
||||
"id": "@minecraft_version@-FML@version@",
|
||||
"time": "@timestamp@",
|
||||
"releaseTime": "1960-01-01T00:00:00-0700",
|
||||
"type": "release",
|
||||
"processArguments": "username_session_version",
|
||||
"minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets} --tweakClass cpw.mods.fml.common.launcher.FMLTweaker",
|
||||
"minimumLauncherVersion": 4,
|
||||
"libraries": [
|
||||
{
|
||||
"name": "cpw.mods:fml:@version@",
|
||||
"url": "http://files.minecraftforge.net/maven/"
|
||||
},
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.8",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "org.ow2.asm:asm-all:4.1",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-library:2.10.2",
|
||||
"url" : "http://files.minecraftforge.net/maven/",
|
||||
"checksums" : [ "6ba65d12cd09d441083262d6f73d2257fec7c663", "65de4339eaed1c3675485fb03a3532fecfd8e8cd" ],
|
||||
"comment" : "Important for FML, we add this",
|
||||
"serverreq":true,
|
||||
"clientreq":true
|
||||
},
|
||||
{
|
||||
"name": "org.scala-lang:scala-compiler:2.10.2",
|
||||
"url" : "http://files.minecraftforge.net/maven/",
|
||||
"checksums" : [ "64c8b1380cc53d6850823d6e4e7ae984aa44ef9c", "99fd0ffb66f3088b0cd1071315fd5eb2b2b070ff" ],
|
||||
"comment" : "Important for FML, we add this",
|
||||
"serverreq":true,
|
||||
"clientreq":true
|
||||
},
|
||||
{
|
||||
"name": "lzma:lzma:0.0.1",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "net.sf.jopt-simple:jopt-simple:4.5",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecjorbis:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:codecwav:20101023"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:libraryjavasound:20101123"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:librarylwjglopenal:20100824"
|
||||
},
|
||||
{
|
||||
"name": "com.paulscode:soundsystem:20120107"
|
||||
},
|
||||
{
|
||||
"name": "argo:argo:2.25_fixed"
|
||||
},
|
||||
{
|
||||
"name": "org.bouncycastle:bcprov-jdk15on:1.47"
|
||||
},
|
||||
{
|
||||
"name": "com.google.guava:guava:14.0"
|
||||
},
|
||||
{
|
||||
"name": "org.apache.commons:commons-lang3:3.1"
|
||||
},
|
||||
{
|
||||
"name": "commons-io:commons-io:2.4"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput:2.0.5"
|
||||
},
|
||||
{
|
||||
"name": "net.java.jutils:jutils:1.0.0"
|
||||
},
|
||||
{
|
||||
"name": "com.google.code.gson:gson:2.2.2"
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.0",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow"
|
||||
},
|
||||
{
|
||||
"action": "disallow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow"
|
||||
},
|
||||
{
|
||||
"action": "disallow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow"
|
||||
},
|
||||
{
|
||||
"action": "disallow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
],
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl:2.9.1-nightly-20130708-debug3",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl_util:2.9.1-nightly-20130708-debug3",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1-nightly-20130708-debug3",
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow",
|
||||
"os": {
|
||||
"name": "osx",
|
||||
"version": "^10\\.5\\.\\d$"
|
||||
}
|
||||
}
|
||||
],
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "net.java.jinput:jinput-platform:2.0.5",
|
||||
"natives": {
|
||||
"linux": "natives-linux",
|
||||
"windows": "natives-windows",
|
||||
"osx": "natives-osx"
|
||||
},
|
||||
"extract": {
|
||||
"exclude": [
|
||||
"META-INF/"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
@@ -1,96 +0,0 @@
|
||||
[default]
|
||||
current_ver = 1.5.2
|
||||
base_url = http://s3.amazonaws.com/MinecraftDownload/
|
||||
libraries = lwjgl.jar lwjgl_util.jar jinput.jar
|
||||
natives = windows_natives.jar macosx_natives.jar linux_natives.jar
|
||||
|
||||
[1.4.4]
|
||||
client_url = http://assets.minecraft.net/1_4_4/minecraft.jar
|
||||
server_url = http://assets.minecraft.net/1_4_4/minecraft_server.jar
|
||||
client_md5 = 7aa46c8058cba2f38e9d2ddddcc77c72
|
||||
server_md5 = b5feed15df1db87c9aaf78dcefad513d
|
||||
mcp_ver = 7.21
|
||||
mcp_url = http://mcp.ocean-labs.de/files/archive/mcp721.zip
|
||||
mcp_md5 = 772ecfdac7e4c9491bfb131cee3bbb36
|
||||
|
||||
[1.4.5]
|
||||
client_url = http://assets.minecraft.net/1_4_5/minecraft.jar
|
||||
server_url = http://assets.minecraft.net/1_4_5/minecraft_server.jar
|
||||
client_md5 = b15e2b2b6b4629f0d99a95b6b44412a0
|
||||
server_md5 = 250654ceae7a26ba955a30095d90a475
|
||||
mcp_ver = 7.23
|
||||
mcp_url = http://mcp.ocean-labs.de/files/archive/mcp723.zip
|
||||
mcp_md5 = 9fbb5835b437b64bc5ce618fa5a53d1d
|
||||
|
||||
[1.4.6]
|
||||
client_url = http://assets.minecraft.net/1_4_6/minecraft.jar
|
||||
server_url = http://assets.minecraft.net/1_4_6/minecraft_server.jar
|
||||
client_md5 = 48677dc4c2b98c29918722b5ab27b4fd
|
||||
server_md5 = b0700fa969dbf0ff085082cde87384d2
|
||||
mcp_ver = 7.25
|
||||
mcp_url = http://mcp.ocean-labs.de/files/archive/mcp725.zip
|
||||
mcp_md5 = a7276589fca4974d40eb4e27ba41ba16
|
||||
|
||||
[1.4.7]
|
||||
client_url = http://assets.minecraft.net/1_4_7/minecraft.jar
|
||||
server_url = http://assets.minecraft.net/1_4_7/minecraft_server.jar
|
||||
client_md5 = 8e80fb01b321c6b3c7efca397a3eea35
|
||||
server_md5 = f69ac4bfce2dfbce03fe872518f75a05
|
||||
mcp_ver = 7.26a
|
||||
mcp_url = http://mcp.ocean-labs.de/files/archive/mcp726a.zip
|
||||
mcp_md5 = 5f11fbccd857b43a0f54117253b3e4dd
|
||||
|
||||
[s13w02b]
|
||||
client_url = http://assets.minecraft.net/13w02b/minecraft.jar
|
||||
server_url = http://assets.minecraft.net/13w02b/minecraft_server.jar
|
||||
client_md5 = 13891f6610b6739ac79f40147cca31d5
|
||||
server_md5 = b2200cfa5d6535f177d291066d2ed3a8
|
||||
mcp_ver = 7.30c
|
||||
mcp_url = http://mcp.ocean-labs.de/files/archive/mcp730c.zip
|
||||
mcp_md5 = b25479ba38ca583bb8223c0a0553defe
|
||||
|
||||
[s13w05b]
|
||||
client_url = http://assets.minecraft.net/13w05b/minecraft.jar
|
||||
server_url = http://assets.minecraft.net/13w05b/minecraft_server.jar
|
||||
client_md5 = 496002660846f2eb455cba407cd26818
|
||||
server_md5 = e317f8f4f62d0603a8eacbfb2e33549c
|
||||
mcp_ver = 7.34
|
||||
mcp_url = http://files.minecraftforge.net/mcpmirror/mcp734.zip
|
||||
mcp_md5 = 522dc1a7b66f8265291e1cc2f8f5d247
|
||||
|
||||
[s13w09c]
|
||||
client_url = http://assets.minecraft.net/13w09c/minecraft.jar
|
||||
server_url = http://assets.minecraft.net/13w09c/minecraft_server.jar
|
||||
client_md5 = d2534381656da5069b96cc89e28158ef
|
||||
server_md5 = 92f4fd715191c596745c7bbfad9c1aad
|
||||
mcp_ver = 7.39
|
||||
mcp_url = http://mcp.ocean-labs.de/files/archive/mcp739.zip
|
||||
mcp_md5 = cd4f6f5e6dd7032301aa98a9046201dd
|
||||
|
||||
[1.5]
|
||||
client_url = http://assets.minecraft.net/1_5/minecraft.jar
|
||||
server_url = http://assets.minecraft.net/1_5/minecraft_server.jar
|
||||
client_md5 = fd11cbc5b01aae1d62cff0145171f3d9
|
||||
server_md5 = 00035b7842554bdbff95a48169420525
|
||||
mcp_ver = 7.42
|
||||
mcp_url = http://mcp.ocean-labs.de/files/archive/mcp742.zip
|
||||
mcp_md5 = ad1a2b86916dd5f71e832181e01bd91a
|
||||
|
||||
[1.5.1]
|
||||
client_url = http://assets.minecraft.net/1_5_1/minecraft.jar
|
||||
server_url = http://assets.minecraft.net/1_5_1/minecraft_server.jar
|
||||
client_md5 = 5c1219d869b87d233de3033688ec7567
|
||||
server_md5 = 9d31b969c3f197a1d40381d5620717ea
|
||||
mcp_ver = 7.44
|
||||
mcp_url = http://mcp.ocean-labs.de/files/archive/mcp744.zip
|
||||
mcp_md5 = 0b9047820bbcb7da32c5e18f60212832
|
||||
|
||||
[1.5.2]
|
||||
client_url = http://s3.amazonaws.com/Minecraft.Download/versions/1.5.2/1.5.2.jar
|
||||
server_url = http://s3.amazonaws.com/Minecraft.Download/versions/1.5.2/minecraft_server.1.5.2.jar
|
||||
client_md5 = 6897c3287fb971c9f362eb3ab20f5ddd
|
||||
server_md5 = c4e1bf89e834bd3670c7bf8f13874bc6
|
||||
mcp_ver = 7.44
|
||||
mcp_url = http://mcp.ocean-labs.de/files/archive/mcp751.zip
|
||||
mcp_md5 = 593238c1cc71f76c94738ff6a014d1a2
|
||||
|
||||
+4
-1
@@ -1 +1,4 @@
|
||||
!bjy #net/minecraft/src/CodecMus
|
||||
^org/bouncycastle
|
||||
^org/apache
|
||||
^com/google
|
||||
^argo
|
||||
@@ -1,66 +1,76 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
|
||||
@@ -1,5 +1,11 @@
|
||||
@@ -1,6 +1,11 @@
|
||||
package net.minecraft.client;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
+
|
||||
+import cpw.mods.fml.client.FMLClientHandler;
|
||||
+import cpw.mods.fml.common.FMLCommonHandler;
|
||||
+import cpw.mods.fml.common.registry.GameData;
|
||||
+import cpw.mods.fml.common.registry.ItemData;
|
||||
+import cpw.mods.fml.relauncher.ArgsWrapper;
|
||||
+import cpw.mods.fml.relauncher.FMLRelauncher;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.awt.BorderLayout;
|
||||
@@ -115,6 +121,8 @@
|
||||
import java.awt.image.BufferedImage;
|
||||
@@ -130,6 +135,8 @@
|
||||
import org.lwjgl.opengl.PixelFormat;
|
||||
import org.lwjgl.util.glu.GLU;
|
||||
|
||||
+import com.google.common.collect.MapDifference;
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract class Minecraft implements Runnable, IPlayerUsage
|
||||
public class Minecraft implements IPlayerUsage
|
||||
{
|
||||
@@ -299,6 +307,8 @@
|
||||
this.field_71466_p = new FontRenderer(this.field_71474_y, "/font/default.png", this.field_71446_o, false);
|
||||
this.field_71464_q = new FontRenderer(this.field_71474_y, "/font/alternate.png", this.field_71446_o, false);
|
||||
|
||||
+ FMLClientHandler.instance().beginMinecraftLoading(this);
|
||||
@@ -362,9 +369,12 @@
|
||||
this.field_71446_o = new TextureManager(this.field_110451_am);
|
||||
this.field_110451_am.func_110542_a(this.field_71446_o);
|
||||
this.field_71416_A = new SoundManager(this.field_110451_am, this.field_71474_y, this.field_110446_Y);
|
||||
+ this.field_71416_A.LOAD_SOUND_SYSTEM = false;
|
||||
this.field_110451_am.func_110542_a(this.field_71416_A);
|
||||
this.func_71357_I();
|
||||
this.field_71466_p = new FontRenderer(this.field_71474_y, new ResourceLocation("textures/font/ascii.png"), this.field_71446_o, false);
|
||||
+
|
||||
+ FMLClientHandler.instance().beginMinecraftLoading(this, this.field_110449_ao, this.field_110451_am);
|
||||
|
||||
if (this.field_71474_y.field_74363_ab != null)
|
||||
{
|
||||
StringTranslate.func_74808_a().func_74810_a(this.field_71474_y.field_74363_ab, false);
|
||||
@@ -334,6 +344,8 @@
|
||||
@@ -400,6 +410,7 @@
|
||||
this.field_71446_o.func_130088_a(TextureMap.field_110576_c, new TextureMap(1, "textures/items"));
|
||||
GL11.glViewport(0, 0, this.field_71443_c, this.field_71440_d);
|
||||
this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o);
|
||||
|
||||
+ FMLClientHandler.instance().finishMinecraftLoading();
|
||||
+
|
||||
try
|
||||
{
|
||||
this.field_71430_V = new ThreadDownloadResources(this.field_71412_D, this);
|
||||
@@ -362,6 +374,8 @@
|
||||
this.func_71361_d("Post startup");
|
||||
this.field_71456_v = new GuiIngame(this);
|
||||
|
||||
@@ -418,6 +429,7 @@
|
||||
{
|
||||
this.func_71352_k();
|
||||
}
|
||||
+
|
||||
+ FMLClientHandler.instance().onInitializationComplete();
|
||||
}
|
||||
|
||||
private void func_71357_I() throws LWJGLException
|
||||
@@ -723,9 +737,11 @@
|
||||
public void func_110436_a()
|
||||
@@ -733,6 +745,7 @@
|
||||
{
|
||||
this.func_71405_e();
|
||||
}
|
||||
+
|
||||
}
|
||||
|
||||
if (!this.field_71454_w)
|
||||
{
|
||||
private void func_71411_J()
|
||||
@@ -801,9 +814,11 @@
|
||||
|
||||
if (!this.field_71454_w)
|
||||
{
|
||||
+ FMLCommonHandler.instance().onRenderTickStart(this.field_71428_T.field_74281_c);
|
||||
this.field_71424_I.func_76318_c("gameRenderer");
|
||||
this.field_71460_t.func_78480_b(this.field_71428_T.field_74281_c);
|
||||
this.field_71424_I.func_76319_b();
|
||||
this.field_71424_I.func_76318_c("gameRenderer");
|
||||
this.field_71460_t.func_78480_b(this.field_71428_T.field_74281_c);
|
||||
this.field_71424_I.func_76319_b();
|
||||
+ FMLCommonHandler.instance().onRenderTickEnd(this.field_71428_T.field_74281_c);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glFlush();
|
||||
@@ -1255,10 +1271,14 @@
|
||||
GL11.glFlush();
|
||||
@@ -1325,10 +1340,14 @@
|
||||
|
||||
public void func_71407_l()
|
||||
{
|
||||
@@ -75,7 +85,7 @@
|
||||
|
||||
this.field_71424_I.func_76320_a("stats");
|
||||
this.field_71413_E.func_77449_e();
|
||||
@@ -1716,6 +1736,8 @@
|
||||
@@ -1785,6 +1804,8 @@
|
||||
this.field_71453_ak.func_74428_b();
|
||||
}
|
||||
|
||||
@@ -84,7 +94,7 @@
|
||||
this.field_71424_I.func_76319_b();
|
||||
this.field_71423_H = func_71386_F();
|
||||
}
|
||||
@@ -1754,8 +1776,27 @@
|
||||
@@ -1808,8 +1829,27 @@
|
||||
}
|
||||
|
||||
this.field_71413_E.func_77450_a(StatList.field_75936_f, 1);
|
||||
@@ -110,18 +120,5 @@
|
||||
+ public void continueWorldLoading()
|
||||
+ {
|
||||
this.field_71455_al = true;
|
||||
this.field_71461_s.func_73720_a(StatCollector.func_74838_a("menu.loadingLevel"));
|
||||
this.field_71461_s.func_73720_a(I18n.func_135053_a("menu.loadingLevel"));
|
||||
|
||||
@@ -1977,6 +2018,12 @@
|
||||
|
||||
public static void main(String[] p_main_0_)
|
||||
{
|
||||
+ FMLRelauncher.handleClientRelaunch(new ArgsWrapper(p_main_0_));
|
||||
+ }
|
||||
+
|
||||
+ public static void fmlReentry(ArgsWrapper wrapper)
|
||||
+ {
|
||||
+ String[] p_main_0_ = wrapper.args;
|
||||
HashMap hashmap = new HashMap();
|
||||
boolean flag = false;
|
||||
boolean flag1 = true;
|
||||
@@ -1,33 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/MinecraftApplet.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/MinecraftApplet.java
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.client;
|
||||
|
||||
+import cpw.mods.fml.relauncher.FMLRelauncher;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.applet.Applet;
|
||||
@@ -15,6 +16,11 @@
|
||||
private Thread field_71482_c = null;
|
||||
|
||||
public void init()
|
||||
+ {
|
||||
+ FMLRelauncher.appletEntry(this);
|
||||
+ }
|
||||
+
|
||||
+ public void fmlInitReentry()
|
||||
{
|
||||
this.field_71483_a = new CanvasMinecraftApplet(this);
|
||||
boolean flag = "true".equalsIgnoreCase(this.getParameter("fullscreen"));
|
||||
@@ -63,6 +69,11 @@
|
||||
|
||||
public void start()
|
||||
{
|
||||
+ FMLRelauncher.appletStart(this);
|
||||
+ }
|
||||
+
|
||||
+ public void fmlStartReentry()
|
||||
+ {
|
||||
if (this.field_71481_b != null)
|
||||
{
|
||||
this.field_71481_b.field_71445_n = false;
|
||||
@@ -0,0 +1,18 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java
|
||||
@@ -27,6 +27,7 @@
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class SoundManager implements ResourceManagerReloadListener
|
||||
{
|
||||
+ public boolean LOAD_SOUND_SYSTEM = true;
|
||||
private static final String[] field_130084_a = new String[] {"ogg"};
|
||||
private SoundSystem field_77381_a;
|
||||
private boolean field_77376_g;
|
||||
@@ -67,6 +68,7 @@
|
||||
|
||||
public void func_110549_a(ResourceManager p_110549_1_)
|
||||
{
|
||||
+ if (!this.LOAD_SOUND_SYSTEM) return; //Stop the sound system from initializing three times at startup. Causing race conditions on some machines.
|
||||
this.func_82464_d();
|
||||
this.func_77370_b();
|
||||
this.func_77363_d();
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
@@ -214,6 +214,8 @@
|
||||
@@ -212,6 +212,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiErrorScreen.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiErrorScreen.java
|
||||
@@ -22,6 +22,8 @@
|
||||
this.field_73887_h.add(new GuiButton(0, this.field_73880_f / 2 - 100, 140, StatCollector.func_74838_a("gui.cancel")));
|
||||
}
|
||||
|
||||
+ public GuiErrorScreen(){}
|
||||
+
|
||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||
{
|
||||
this.func_73733_a(0, 0, this.field_73880_f, this.field_73881_g, -12574688, -11530224);
|
||||
@@ -7,53 +7,59 @@
|
||||
+import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.awt.image.BufferedImage;
|
||||
@@ -24,6 +26,9 @@
|
||||
import java.io.BufferedReader;
|
||||
@@ -9,6 +11,7 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
+import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.mco.ExceptionMcoService;
|
||||
@@ -26,6 +29,9 @@
|
||||
import org.apache.commons.io.Charsets;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.util.glu.GLU;
|
||||
|
||||
import org.lwjgl.util.glu.Project;
|
||||
+
|
||||
+import com.google.common.base.Strings;
|
||||
+import com.google.common.collect.Lists;
|
||||
+
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiMainMenu extends GuiScreen
|
||||
{
|
||||
@@ -48,6 +53,8 @@
|
||||
private int field_92020_v;
|
||||
private int field_92019_w;
|
||||
@@ -55,6 +61,8 @@
|
||||
private ResourceLocation field_110351_G;
|
||||
private GuiButton field_130023_H;
|
||||
|
||||
+ private GuiButton fmlModButton = null;
|
||||
+
|
||||
public GuiMainMenu()
|
||||
{
|
||||
BufferedReader bufferedreader = null;
|
||||
@@ -165,6 +172,9 @@
|
||||
{
|
||||
this.func_73969_a(i, 24, stringtranslate);
|
||||
}
|
||||
+
|
||||
+ fmlModButton = new GuiButton(6, this.field_73880_f / 2 - 100, i + 48, "Mods");
|
||||
+ this.field_73887_h.add(fmlModButton);
|
||||
|
||||
this.func_96137_a(stringtranslate, i, 24);
|
||||
|
||||
@@ -211,7 +221,14 @@
|
||||
|
||||
private void func_98060_b(StringTranslate p_98060_1_, int p_98060_2_, int p_98060_3_)
|
||||
@@ -206,13 +214,22 @@
|
||||
private void func_130022_h()
|
||||
{
|
||||
- this.field_73887_h.add(new GuiButton(3, this.field_73880_f / 2 - 100, p_98060_2_ + p_98060_3_ * 2, p_98060_1_.func_74805_b("menu.online")));
|
||||
+ //If Minecraft Realms is enabled, halve the size of both buttons and set them next to eachother.
|
||||
this.field_130023_H.field_73748_h = true;
|
||||
+ fmlModButton.field_73747_a = 98;
|
||||
+ fmlModButton.field_73746_c = this.field_73880_f / 2 + 2;
|
||||
+
|
||||
+ GuiButton realmButton = new GuiButton(3, this.field_73880_f / 2 - 100, p_98060_2_ + p_98060_3_ * 2, p_98060_1_.func_74805_b("menu.online"));
|
||||
+ realmButton.field_73747_a = 98;
|
||||
+ realmButton.field_73746_c = this.field_73880_f / 2 - 100;
|
||||
+ this.field_73887_h.add(realmButton);
|
||||
}
|
||||
|
||||
private void func_73969_a(int p_73969_1_, int p_73969_2_, StringTranslate p_73969_3_)
|
||||
@@ -263,6 +280,11 @@
|
||||
private void func_73969_a(int p_73969_1_, int p_73969_2_)
|
||||
{
|
||||
this.field_73887_h.add(new GuiButton(1, this.field_73880_f / 2 - 100, p_73969_1_, I18n.func_135053_a("menu.singleplayer")));
|
||||
this.field_73887_h.add(new GuiButton(2, this.field_73880_f / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.func_135053_a("menu.multiplayer")));
|
||||
- this.field_73887_h.add(this.field_130023_H = new GuiButton(14, this.field_73880_f / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.func_135053_a("menu.online")));
|
||||
+ //If Minecraft Realms is enabled, halve the size of both buttons and set them next to eachother.
|
||||
+ fmlModButton = new GuiButton(6, this.field_73880_f / 2 - 100, p_73969_1_ + p_73969_2_ * 2, "Mods");
|
||||
+ this.field_73887_h.add(fmlModButton);
|
||||
+
|
||||
+ field_130023_H = new GuiButton(14, this.field_73880_f / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.func_135053_a("menu.online"));
|
||||
+ field_130023_H.field_73747_a = 98;
|
||||
+ field_130023_H.field_73746_c = this.field_73880_f / 2 - 100;
|
||||
+ this.field_73887_h.add(field_130023_H);
|
||||
this.field_130023_H.field_73748_h = false;
|
||||
}
|
||||
|
||||
@@ -259,6 +276,11 @@
|
||||
if (p_73875_1_.field_73741_f == 4)
|
||||
{
|
||||
this.field_73882_e.func_71400_g();
|
||||
@@ -65,7 +71,7 @@
|
||||
}
|
||||
|
||||
if (p_73875_1_.field_73741_f == 11)
|
||||
@@ -501,7 +523,16 @@
|
||||
@@ -520,7 +542,16 @@
|
||||
s = s + " Demo";
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 392 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user