Merge pull request #859 from AbrarSyed/master

Gradlization
This commit is contained in:
LexManos 2013-11-19 14:13:56 -08:00
commit 6ff7584f96
437 changed files with 1659 additions and 2516 deletions

9
.gitattributes vendored
View file

@ -1,7 +1,14 @@
* text eol=lf * text eol=lf
*.bat text eol=crlf *.bat text eol=crlf
*.patch text *.patch text eol=lf
*.java text eol=lf
*.gradle text eol=crlf
*.png binary *.png binary
*.exe binary *.exe binary
*.dll binary *.dll binary
*.jar binary
*.lzma binary
*.zip binary *.zip binary
*.pyd binary
*.cfg text eol=lf
*.py text eol=lf

24
.gitignore vendored
View file

@ -1,9 +1,17 @@
*.DS_Store #eclipse
/logs/ /bin
/*.pyc /.settings
/forge-*/ /.classpath
/patches-old/
/mcp/ #idea
/.idea
*.iml
#gradle
/build
/.gradle
#occupational hazards
/eclipse/ /eclipse/
/target/ /repo/
/temp/ /buildSrc

View file

@ -1,95 +0,0 @@
import os
import sys
import fnmatch
import shlex
import difflib
import time, subprocess
from optparse import OptionParser
def cmdsplit(args):
if os.sep == '\\':
args = args.replace('\\', '\\\\')
return shlex.split(args)
def main():
print("Applying patches")
parser = OptionParser()
parser.add_option('-m', '--mcp-dir', action='store', dest='mcp_dir', help='Path to MCP', default=None)
parser.add_option('-p', '--patch-dir', action='store', dest='patch_dir', help='Patches Directory', default=None)
parser.add_option('-t', '--target-dir', action='store', dest='target_dir', help='Target Directory', default=None)
options, _ = parser.parse_args()
if options.mcp_dir is None:
print 'Must supply MCP directory with --mcp-dir'
return
elif options.patch_dir is None:
print 'Must supply patches directory with --patch-dir'
return
elif options.target_dir is None:
print 'Must supplt target directory with --target-dir'
return
print "Applying patches from '%s' to '%s'" % (options.patch_dir, options.target_dir)
apply_patches(options.mcp_dir, options.patch_dir, options.target_dir)
def apply_patches(mcp_dir, patch_dir, target_dir, find=None, rep=None):
# Attempts to apply a directory full of patch files onto a target directory.
sys.path.append(mcp_dir)
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):
#Fixes the following issues in the patch file if they exist:
# Normalizes the path seperators for the current OS
# Normalizes the line endings
# Returns the path that the file wants to apply to
in_file = os.path.normpath(in_file)
if out_file is None:
tmp_file = 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
if __name__ == '__main__':
main()

117
build.gradle Normal file
View file

@ -0,0 +1,117 @@
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
}
}
import static net.minecraftforge.gradle.dev.ForgeDevPlugin.*
apply plugin: 'maven'
apply plugin: 'forgedev'
repositories {
mavenLocal()
flatDir {
name "fileRepo"
dirs "repo"
}
}
minecraft {
version = '1.6.4'
mcpVersion = '8.11'
fmlDir = projectDir.getAbsolutePath() + "/fml";
mainClass = 'cpw.mods.fml.relauncher.ServerLaunchWrapper'
installerVersion = "1.4"
}
group = 'net.minecraftforge'
version = getVersionFromJava(getProject(), 'src/main/java/net/minecraftforge/common/ForgeVersion.java')
jenkins {
job = 'minecraftforge'
}
launch4j {
jreMinVersion = '1.6.0'
}
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 'Minecraft Forge API'
url 'https://github.com/MinecraftForge/MinecraftForge'
scm {
url 'https://github.com/MinecraftForge/MinecraftForge'
connection 'scm:git:git://github.com/MinecraftForge/MinecraftForge.git'
developerConnection 'scm:git:git@github.com:MinecraftForge/MinecraftForge.git'
}
issueManagement {
system 'github'
url 'https://github.com/MinecraftForge/MinecraftForge/issues'
}
licenses {
license {
name 'Forge Public License'
url 'https://raw.github.com/MinecraftForge/MinecraftForge/master/MinecraftForge-License.txt'
distribution 'repo'
}
}
developers {
developer {
id 'cpw'
name 'cpw'
roles { role 'developer' }
}
developer {
id 'LexManos'
name 'Lex Manos'
roles { role 'developer' }
}
developer {
id 'AbrarSyed'
name 'Abrar Syed'
roles { role 'contributor' }
}
}
}
}
}
} else {
logger.info('Publishing to repo folder')
add project.repositories.mavenLocal()
mavenDeployer {
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
}
}
}
}

View file

@ -1,34 +0,0 @@
import os, os.path, sys
from optparse import OptionParser
forge_dir = os.path.dirname(os.path.abspath(__file__))
mcp_dir = os.path.abspath('..')
from forge import build_forge_dev
def main():
parser = OptionParser()
parser.add_option('-m', '--mcp-dir', action='store', dest='mcp_dir', help='MCP Path', default=None)
parser.add_option('-b', '--build', action='store', dest='build', help='Build number', default=None)
options, _ = parser.parse_args()
build_num = 0
if not options.build is None:
try:
build_num = int(options.build)
except:
pass
fml_dir = os.path.join(forge_dir, 'fml')
mcp_dir = os.path.join(forge_dir, '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('..')
sys.exit(build_forge_dev(mcp_dir, forge_dir, fml_dir, build_num))
if __name__ == '__main__':
main()

View file

@ -1,113 +0,0 @@
import os, os.path, sys, re
import json, urllib2
from pprint import pprint
from urlparse import urlparse
import base64
import optparse, ast
class PreemptiveBasicAuthHandler(urllib2.BaseHandler):
def __init__(self, password_mgr=None):
if password_mgr is None:
password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
self.passwd = password_mgr
self.add_password = self.passwd.add_password
def http_request(self,req):
uri = req.get_full_url()
user, pw = self.passwd.find_user_password(None,uri)
if pw is None: return req
raw = "%s:%s" % (user, pw)
auth = 'Basic %s' % base64.b64encode(raw).strip()
req.add_unredirected_header('Authorization', auth)
return req
def https_request(self,req):
return self.http_request(req)
def read_url(url):
handler = PreemptiveBasicAuthHandler()
handler.add_password(None, 'ci.jenkins.minecraftforge.net', 'console_script', 'dc6d48ca20a474beeac280a9a16a926e')
file = urllib2.build_opener(handler).open(url)
data = file.read()
file.close()
return data
def getBuildInfo(url, current_version=None):
data = read_url(url)
data = ast.literal_eval(data)['allBuilds']
data = sorted(data, key=lambda key: key['number'], reverse=False)
items = []
output = []
for build in data:
build['actions'] = filter(lambda act: act is not None, build['actions'])
build['actions'] = filter(lambda act: 'text' in act, build['actions'])
build['actions'] = filter(lambda act: not ' ' in act['text'], build['actions'])
if len(build['actions']) == 0:
build['version'] = current_version
current_version = None
else:
build['version'] = build['actions'][0]['text']
build['items'] = build['changeSet']['items']
for item in build['items']:
item['author'] = item['author']['fullName']
if build['result'] != 'SUCCESS':
items += build['items']
else:
build['items'] = items + build['items']
items = []
output += [build]
build.pop('changeSet')
build.pop('actions')
return sorted(output, key=lambda key: key['number'], reverse=True)
def add_latest_build(url, builds, current_version=None):
data = read_url(url)
data = ast.literal_eval(data)
number = data['number']
if builds[0]['number'] == data['number']:
return builds
for item in data['changeSet']['items']:
item['author'] = item['author']['fullName']
build = {
'number' : data['number'],
'result' : 'SUCCESS', #Currently build should always be success... Else things derp after words
'version' : current_version,
'items' : data['changeSet']['items']
}
return [build] + builds
def make_changelog(job_path, target_build, change_file, current_version=None):
builds = getBuildInfo('%s/api/python?tree=allBuilds[result,number,actions[text],changeSet[items[author[fullName],comment]]]&pretty=true' % job_path, current_version)
builds = add_latest_build('%s/lastBuild/api/python?pretty=true&tree=number,changeSet[items[author[fullName],comment]]' % job_path, builds, current_version)
log = [ "Changelog:" ]
for build in builds:
if int(build['number']) > target_build: continue
if len(build['items']) == 0: continue
log.append('')
if build['version'] is None:
log.append('Build %s' % build['number'])
else:
log.append('Build %s' % build['version'])
for change in build['items']:
comments = filter(lambda cmt: len(cmt) > 0, change['comment'].split('\n'))
if len(comments) > 1:
log.append('\t' + change['author'])
for comment in comments:
log.append('\t\t' + comment)
elif len(comments) == 1:
log.append('\t%s: %s' % (change['author'], comments[0]))
file = open(change_file, 'wb')
for line in log:
file.write('%s\n' % line)
file.close()
if __name__ == '__main__':
make_changelog("http://ci.jenkins.minecraftforge.net/job/minecraftforge/", 70000, 'changelog.txt', 'pinecone')

Binary file not shown.

2
fml

@ -1 +1 @@
Subproject commit 23baf3a8ce58cb8306189401a60647957ccbb4c2 Subproject commit c4b8a393f90b00ad7ee4992ea4341ffb6d676abb

139
forge.py
View file

@ -1,139 +0,0 @@
import os, os.path, sys
import urllib, zipfile
import shutil, glob, fnmatch
import subprocess, logging, re
import csv, shutil
import pprint
forge_dir = os.path.dirname(os.path.abspath(__file__))
def reset_logger():
log = logging.getLogger()
while len(log.handlers) > 0:
log.removeHandler(log.handlers[0])
version_reg = re.compile(r'(([a-z]+)Version[\s]+=[\s]+)(\d+);')
def load_version(build=0):
info = {'major' : -1,
'minor' : -1,
'revision' : -1,
'build' : -1
}
hook_file = os.path.join(forge_dir, 'common/net/minecraftforge/common/ForgeVersion.java'.replace('/', os.sep))
with open(hook_file, 'r') as fh:
buf = fh.read()
def proc(match):
try:
info[match.group(2)] = int(match.group(3))
except:
pass
return match.group(0)
buf = version_reg.sub(proc, buf)
info['build'] = build
return info
def inject_version(src_file, build=0):
version = load_version(build)
tmp_file = src_file + '.tmp'
with open(src_file, 'r') as fh:
buf = fh.read()
def mapname(match):
try:
return '%s%s;' % (match.group(1), version[match.group(2)])
except KeyError:
pass
return match.group(0)
buf = version_reg.sub(mapname, buf).replace('\r\n', '\n')
with open(tmp_file, 'wb') as fh:
fh.write(buf)
shutil.move(tmp_file, src_file)
def zip_folder(path, key, zip):
import pprint
files = os.listdir(path)
for file in files:
file_path = os.path.join(path, file)
file_key = os.path.join(key, file)
if os.path.isdir(file_path):
zip_folder(file_path, file_key, zip)
else:
if not file_key.replace(os.sep, '/') in zip.NameToInfo:
print ' ' + file_key
zip.write(file_path, file_key)
def zip_create(path, key, zip_name):
zip = zipfile.ZipFile(zip_name, 'w', zipfile.ZIP_DEFLATED)
if os.path.isdir(path):
zip_folder(path, key, zip)
else:
zip.write(path, key)
zip.close()
def apply_forge_patches(fml_dir, mcp_dir, forge_dir, src_dir, copy_files=True):
sys.path.append(fml_dir)
sys.path.append(os.path.join(fml_dir, 'install'))
from fml import copytree, apply_patches
#patch files
print 'Applying Minecraft Forge patches'
sys.stdout.flush()
if os.path.isdir(os.path.join(forge_dir, 'patches', 'minecraft')):
apply_patches(mcp_dir, os.path.join(forge_dir, 'patches', 'minecraft'), src_dir)
if copy_files and os.path.isdir(os.path.join(forge_dir, 'client')):
copytree(os.path.join(forge_dir, 'client'), os.path.join(src_dir, 'minecraft'))
if copy_files and os.path.isdir(os.path.join(forge_dir, 'common')):
copytree(os.path.join(forge_dir, 'common'), os.path.join(src_dir, 'minecraft'))
def build_forge_dev(mcp_dir, forge_dir, fml_dir, build_num=0):
version = load_version(build_num)
print '=================================== Build %d.%d.%d.%d Start =================================' % (version['major'], version['minor'], version['revision'], version['build'])
src_dir = os.path.join(mcp_dir, 'src')
if os.path.isdir(src_dir):
shutil.rmtree(src_dir)
sys.path.append(fml_dir)
sys.path.append(os.path.join(fml_dir, 'install'))
from fml import copytree
print 'src_work -> src'
copytree(os.path.join(mcp_dir, 'src_work'), src_dir)
print '\nCopying Client Code'
copytree(os.path.join(forge_dir, 'client'), os.path.join(src_dir, 'minecraft'), -1)
print '\nCopying Common Code'
copytree(os.path.join(forge_dir, 'common'), os.path.join(src_dir, 'minecraft'), -1)
print
inject_version(os.path.join(src_dir, 'minecraft/net/minecraftforge/common/ForgeVersion.java'.replace('/', os.sep)), build_num)
error_level = 0
try:
sys.path.append(mcp_dir)
from runtime.commands import Commands, CLIENT, SERVER, CalledProcessError
from runtime.mcp import recompile_side
os.chdir(mcp_dir)
reset_logger()
commands = Commands(None, verify=True)
try:
recompile_side(commands, CLIENT)
except CalledProcessError as e:
error_level = 1
pass
reset_logger()
os.chdir(forge_dir)
except SystemExit, e:
if not e.code == 0:
print 'Recompile Exception: %d ' % e.code
error_level = e.code
print '=================================== Build Finished %d =================================' % error_level
return error_level

164
gradlew vendored Normal file
View file

@ -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/fml/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 "$@"

90
gradlew.bat vendored Normal file
View file

@ -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%\fml\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

View file

@ -1,3 +0,0 @@
@echo off
.\fml\python\python_fml install.py %*
pause

View file

@ -1,78 +0,0 @@
import os, os.path, sys
import urllib, zipfile
import shutil, glob, fnmatch
import subprocess, logging
from optparse import OptionParser
def fml_main(fml_dir, mcp_dir, gen_conf=True, disable_patches=False, disable_at=False, disable_merge=False, enable_server=False,
disable_client=False, disable_rename=False, disable_assets=False, decompile=False):
sys.path.append(fml_dir)
from fml import download_mcp, setup_mcp, decompile_minecraft, apply_fml_patches, finish_setup_fml
print '================ Forge ModLoader Setup Start ==================='
download_mcp(fml_dir, mcp_dir)
setup_mcp(fml_dir, mcp_dir, gen_conf)
if decompile:
decompile_minecraft(fml_dir, mcp_dir, disable_at=disable_at, disable_merge=disable_merge,
enable_server=enable_server, disable_client=disable_client,
disable_assets=disable_assets)
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)
else:
print 'Decompile free install is on the to-do!'
print '================ Forge ModLoader Setup End ==================='
def forge_main(forge_dir, fml_dir, mcp_dir):
sys.path.append(mcp_dir)
sys.path.append(fml_dir)
from runtime.updatenames import updatenames
from runtime.updatemd5 import updatemd5
from forge import apply_forge_patches
from fml import reset_logger
print '=============================== Minecraft Forge Setup Start ====================================='
print 'Applying forge patches'
apply_forge_patches(fml_dir, mcp_dir, forge_dir, os.path.join(mcp_dir, 'src'), True)
os.chdir(mcp_dir)
updatenames(None, True, True, False)
reset_logger()
updatemd5(None, True, True, False)
reset_logger()
os.chdir(forge_dir)
print '=============================== Minecraft Forge Setup Finished ================================='
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)
parser.add_option( '--no-assets', action="store_true", dest='no_assets', help='Disable downloading of assets folder', default=False)
parser.add_option('-d', '--decompile', action="store_true", dest='decompile', help='Decompile minecraft and apply patches', default=True)
options, _ = parser.parse_args()
forge_dir = os.path.dirname(os.path.abspath(__file__))
fml_dir = os.path.abspath('fml')
mcp_dir = os.path.abspath('mcp')
if not options.mcp_dir is None:
mcp_dir = os.path.abspath(options.mcp_dir)
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, disable_assets=options.no_assets,
decompile=options.decompile, gen_conf=False)
forge_main(forge_dir, fml_dir, mcp_dir)

View file

@ -1,2 +0,0 @@
#!/bin/bash
python install.py "$@"

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/Block.java --- ../src-base/minecraft/net/minecraft/block/Block.java
+++ ../src_work/minecraft/net/minecraft/block/Block.java +++ ../src-work/minecraft/net/minecraft/block/Block.java
@@ -1,15 +1,22 @@ @@ -1,15 +1,22 @@
package net.minecraft.block; package net.minecraft.block;
@ -158,9 +158,8 @@
par2EntityPlayer.addExhaustion(0.025F); par2EntityPlayer.addExhaustion(0.025F);
- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) - if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer))
- {
+ if (this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) + if (this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer))
+ { {
+ ArrayList<ItemStack> items = new ArrayList<ItemStack>(); + ArrayList<ItemStack> items = new ArrayList<ItemStack>();
ItemStack itemstack = this.createStackedBlock(par6); ItemStack itemstack = this.createStackedBlock(par6);
@ -180,13 +179,10 @@
+ harvesters.set(par2EntityPlayer); + harvesters.set(par2EntityPlayer);
int i1 = EnchantmentHelper.getFortuneModifier(par2EntityPlayer); int i1 = EnchantmentHelper.getFortuneModifier(par2EntityPlayer);
this.dropBlockAsItem(par1World, par3, par4, par5, par6, i1); this.dropBlockAsItem(par1World, par3, par4, par5, par6, i1);
- }
- }
-
+ harvesters.set(null); + harvesters.set(null);
+ } }
+ } }
+
+ private int silk_check_meta = -1; //Dirty hack to stop us from needing to special case the silk check hook. + private int silk_check_meta = -1; //Dirty hack to stop us from needing to special case the silk check hook.
/** /**
* Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops.

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockBaseRailLogic.java --- ../src-base/minecraft/net/minecraft/block/BlockBaseRailLogic.java
+++ ../src_work/minecraft/net/minecraft/block/BlockBaseRailLogic.java +++ ../src-work/minecraft/net/minecraft/block/BlockBaseRailLogic.java
@@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
/** The chunk position the rail is at. */ /** The chunk position the rail is at. */
private List railChunkPosition; private List railChunkPosition;
@ -14,7 +14,7 @@
this.railZ = par5; this.railZ = par5;
int l = par2World.getBlockId(par3, par4, par5); int l = par2World.getBlockId(par3, par4, par5);
- int i1 = par2World.getBlockMetadata(par3, par4, par5); - int i1 = par2World.getBlockMetadata(par3, par4, par5);
-
- if (((BlockRailBase)Block.blocksList[l]).isPowered) - if (((BlockRailBase)Block.blocksList[l]).isPowered)
- { - {
- this.isStraightRail = true; - this.isStraightRail = true;
@ -24,7 +24,6 @@
- { - {
- this.isStraightRail = false; - this.isStraightRail = false;
- } - }
+
+ BlockRailBase target = (BlockRailBase)Block.blocksList[l]; + BlockRailBase target = (BlockRailBase)Block.blocksList[l];
+ int i1 = target.getBasicRailMetadata(par2World, null, par3, par4, par5); + int i1 = target.getBasicRailMetadata(par2World, null, par3, par4, par5);
+ isStraightRail = !target.isFlexibleRail(par2World, par3, par4, par5); + isStraightRail = !target.isFlexibleRail(par2World, par3, par4, par5);

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockButton.java --- ../src-base/minecraft/net/minecraft/block/BlockButton.java
+++ ../src_work/minecraft/net/minecraft/block/BlockButton.java +++ ../src-work/minecraft/net/minecraft/block/BlockButton.java
@@ -14,6 +14,9 @@ @@ -14,6 +14,9 @@
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockCactus.java --- ../src-base/minecraft/net/minecraft/block/BlockCactus.java
+++ ../src_work/minecraft/net/minecraft/block/BlockCactus.java +++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java
@@ -12,7 +12,11 @@ @@ -12,7 +12,11 @@
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.world.World; import net.minecraft.world.World;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockChest.java --- ../src-base/minecraft/net/minecraft/block/BlockChest.java
+++ ../src_work/minecraft/net/minecraft/block/BlockChest.java +++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
@@ -23,6 +23,8 @@ @@ -23,6 +23,8 @@
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -23,30 +23,21 @@
return null; return null;
} }
- else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 - 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4))) - else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 - 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4)))
- {
- return null;
- }
- else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 + 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4)))
- {
- return null;
- }
- else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 - 1) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1)))
- {
- return null;
- }
- else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 + 1) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1)))
+ else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 - 1, par3 + 1, par4, DOWN) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4))) + else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 - 1, par3 + 1, par4, DOWN) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4)))
+ { {
+ return null; return null;
+ } }
- else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 + 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4)))
+ else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 + 1, par3 + 1, par4, DOWN) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4))) + else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockSolidOnSide(par2 + 1, par3 + 1, par4, DOWN) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4)))
+ { {
+ return null; return null;
+ } }
- else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 - 1) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1)))
+ else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockSolidOnSide(par2, par3 + 1, par4 - 1, DOWN) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1))) + else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockSolidOnSide(par2, par3 + 1, par4 - 1, DOWN) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1)))
+ { {
+ return null; return null;
+ } }
- else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 + 1) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1)))
+ else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockSolidOnSide(par2, par3 + 1, par4 + 1, DOWN) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1))) + else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockSolidOnSide(par2, par3 + 1, par4 + 1, DOWN) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1)))
{ {
return null; return null;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockCocoa.java --- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java
+++ ../src_work/minecraft/net/minecraft/block/BlockCocoa.java +++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@ -30,9 +30,8 @@
for (int k1 = 0; k1 < b0; ++k1) for (int k1 = 0; k1 < b0; ++k1)
{ {
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.dyePowder, 1, 3)); - this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.dyePowder, 1, 3));
- }
+ dropped.add(new ItemStack(Item.dyePowder, 1, 3)); + dropped.add(new ItemStack(Item.dyePowder, 1, 3));
+ } }
+ return dropped; + return dropped;
} }

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockComparator.java --- ../src-base/minecraft/net/minecraft/block/BlockComparator.java
+++ ../src_work/minecraft/net/minecraft/block/BlockComparator.java +++ ../src-work/minecraft/net/minecraft/block/BlockComparator.java
@@ -268,4 +268,17 @@ @@ -268,4 +268,17 @@
{ {
return new TileEntityComparator(); return new TileEntityComparator();

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockCrops.java --- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
+++ ../src_work/minecraft/net/minecraft/block/BlockCrops.java +++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@ -34,31 +34,28 @@
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{ {
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
-
- if (!par1World.isRemote)
- {
- if (par5 >= 7)
+ } + }
+
- if (!par1World.isRemote)
+ @Override + @Override
+ public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) + public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
+ { + {
+ ArrayList<ItemStack> ret = super.getBlockDropped(world, x, y, z, metadata, fortune); + ArrayList<ItemStack> ret = super.getBlockDropped(world, x, y, z, metadata, fortune);
+ +
+ if (metadata >= 7) + if (metadata >= 7)
+ { {
- if (par5 >= 7)
+ for (int n = 0; n < 3 + fortune; n++) + for (int n = 0; n < 3 + fortune; n++)
{ {
- int j1 = 3 + par7; - int j1 = 3 + par7;
- -
- for (int k1 = 0; k1 < j1; ++k1) - for (int k1 = 0; k1 < j1; ++k1)
- { + if (world.rand.nextInt(15) <= metadata)
{
- if (par1World.rand.nextInt(15) <= par5) - if (par1World.rand.nextInt(15) <= par5)
- { - {
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(this.getSeedItem(), 1, 0)); - this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(this.getSeedItem(), 1, 0));
- } - }
+ if (world.rand.nextInt(15) <= metadata)
+ {
+ ret.add(new ItemStack(this.getSeedItem(), 1, 0)); + ret.add(new ItemStack(this.getSeedItem(), 1, 0));
} }
} }

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockDoor.java --- ../src-base/minecraft/net/minecraft/block/BlockDoor.java
+++ ../src_work/minecraft/net/minecraft/block/BlockDoor.java +++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java
@@ -290,7 +290,7 @@ @@ -290,7 +290,7 @@
{ {
if (this.blockMaterial == Material.iron) if (this.blockMaterial == Material.iron)

View file

@ -1,15 +1,15 @@
--- ../src_base/minecraft/net/minecraft/block/BlockFarmland.java --- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java
+++ ../src_work/minecraft/net/minecraft/block/BlockFarmland.java +++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java
@@ -10,6 +10,9 @@ @@ -11,6 +11,9 @@
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.world.World; import net.minecraft.world.World;
+
+import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.ForgeDirection;
+import net.minecraftforge.common.IPlantable; +import net.minecraftforge.common.IPlantable;
+
public class BlockFarmland extends Block public class BlockFarmland extends Block
{ {
@SideOnly(Side.CLIENT)
@@ -115,7 +118,8 @@ @@ -115,7 +118,8 @@
{ {
int j1 = par1World.getBlockId(l, par3 + 1, i1); int j1 = par1World.getBlockId(l, par3 + 1, i1);

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockFire.java --- ../src-base/minecraft/net/minecraft/block/BlockFire.java
+++ ../src_work/minecraft/net/minecraft/block/BlockFire.java +++ ../src-work/minecraft/net/minecraft/block/BlockFire.java
@@ -11,6 +11,9 @@ @@ -11,6 +11,9 @@
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.WorldProviderEnd; import net.minecraft.world.WorldProviderEnd;
@ -29,21 +29,22 @@
} }
/** /**
@@ -123,12 +127,8 @@ @@ -123,13 +127,9 @@
{ {
if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick"))
{ {
- boolean flag = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID; - boolean flag = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID;
- + Block base = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
+ boolean flag = (base != null && base.isFireSource(par1World, par2, par3 - 1, par4, par1World.getBlockMetadata(par2, par3 - 1, par4), UP));
- if (par1World.provider instanceof WorldProviderEnd && par1World.getBlockId(par2, par3 - 1, par4) == Block.bedrock.blockID) - if (par1World.provider instanceof WorldProviderEnd && par1World.getBlockId(par2, par3 - 1, par4) == Block.bedrock.blockID)
- { - {
- flag = true; - flag = true;
- } - }
+ Block base = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)]; -
+ boolean flag = (base != null && base.isFireSource(par1World, par2, par3 - 1, par4, par1World.getBlockMetadata(par2, par3 - 1, par4), UP));
if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) if (!this.canPlaceBlockAt(par1World, par2, par3, par4))
{ {
par1World.setBlockToAir(par2, par3, par4);
@@ -157,7 +157,7 @@ @@ -157,7 +157,7 @@
par1World.setBlockToAir(par2, par3, par4); par1World.setBlockToAir(par2, par3, par4);
} }
@ -72,7 +73,7 @@
for (int i1 = par2 - 1; i1 <= par2 + 1; ++i1) for (int i1 = par2 - 1; i1 <= par2 + 1; ++i1)
{ {
@@ -230,9 +230,20 @@ @@ -230,10 +230,21 @@
return false; return false;
} }
@ -82,7 +83,7 @@
- int j1 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)]; - int j1 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)];
+ tryToCatchBlockOnFire(par1World, par2, par3, par4, par5, par6Random, par7, UP); + tryToCatchBlockOnFire(par1World, par2, par3, par4, par5, par6Random, par7, UP);
+ } + }
+
+ private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7, ForgeDirection face) + private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7, ForgeDirection face)
+ { + {
+ int j1 = 0; + int j1 = 0;
@ -91,9 +92,10 @@
+ { + {
+ j1 = block.getFlammability(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), face); + j1 = block.getFlammability(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), face);
+ } + }
+
if (par6Random.nextInt(par5) < j1) if (par6Random.nextInt(par5) < j1)
{ {
boolean flag = par1World.getBlockId(par2, par3, par4) == Block.tnt.blockID;
@@ -266,7 +277,12 @@ @@ -266,7 +277,12 @@
*/ */
private boolean canNeighborBurn(World par1World, int par2, int par3, int par4) private boolean canNeighborBurn(World par1World, int par2, int par3, int par4)
@ -131,9 +133,8 @@
/** /**
* Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z * Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z
- */
+ * Deprecated for a side-sensitive version + * Deprecated for a side-sensitive version
+ */ */
+ @Deprecated + @Deprecated
public boolean canBlockCatchFire(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) public boolean canBlockCatchFire(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{ {
@ -145,9 +146,8 @@
* Retrieves a specified block's chance to encourage their neighbors to burn and if the number is greater than the * Retrieves a specified block's chance to encourage their neighbors to burn and if the number is greater than the
* current number passed in it will return its number instead of the passed in one. Args: world, x, y, z, * current number passed in it will return its number instead of the passed in one. Args: world, x, y, z,
* curChanceToEncourageFire * curChanceToEncourageFire
- */
+ * Deprecated for a side-sensitive version + * Deprecated for a side-sensitive version
+ */ */
+ @Deprecated + @Deprecated
public int getChanceToEncourageFire(World par1World, int par2, int par3, int par4, int par5) public int getChanceToEncourageFire(World par1World, int par2, int par3, int par4, int par5)
{ {
@ -162,10 +162,9 @@
float f2; float f2;
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4)) - if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4))
- {
- if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4))
+ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4, UP)) + if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4, UP))
+ { {
- if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4))
+ if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4, EAST)) + if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4, EAST))
{ {
for (l = 0; l < 2; ++l) for (l = 0; l < 2; ++l)

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockFlower.java --- ../src-base/minecraft/net/minecraft/block/BlockFlower.java
+++ ../src_work/minecraft/net/minecraft/block/BlockFlower.java +++ ../src-work/minecraft/net/minecraft/block/BlockFlower.java
@@ -6,7 +6,12 @@ @@ -6,7 +6,12 @@
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockFlowing.java --- ../src-base/minecraft/net/minecraft/block/BlockFlowing.java
+++ ../src_work/minecraft/net/minecraft/block/BlockFlowing.java +++ ../src-work/minecraft/net/minecraft/block/BlockFlowing.java
@@ -206,7 +206,7 @@ @@ -206,7 +206,7 @@
{ {
this.triggerLavaMixEffects(par1World, par2, par3, par4); this.triggerLavaMixEffects(par1World, par2, par3, par4);

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockFluid.java --- ../src-base/minecraft/net/minecraft/block/BlockFluid.java
+++ ../src_work/minecraft/net/minecraft/block/BlockFluid.java +++ ../src-work/minecraft/net/minecraft/block/BlockFluid.java
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
{ {
for (int l1 = -1; l1 <= 1; ++l1) for (int l1 = -1; l1 <= 1; ++l1)
@ -9,17 +9,17 @@
l += (i2 & 16711680) >> 16; l += (i2 & 16711680) >> 16;
i1 += (i2 & 65280) >> 8; i1 += (i2 & 65280) >> 8;
j1 += i2 & 255; j1 += i2 & 255;
@@ -81,6 +81,13 @@ @@ -83,6 +83,13 @@
return (float)(par0 + 1) / 9.0F;
} }
return (float)(par0 + 1) / 9.0F;
+ }
+
+ +
+ @Deprecated //Implemented here for compatibility, need to change this when we make vanilla fluids use our fluid methods. + @Deprecated //Implemented here for compatibility, need to change this when we make vanilla fluids use our fluid methods.
+ public float getFilledPercentage(IBlockAccess world, int x, int y, int z) + public float getFilledPercentage(IBlockAccess world, int x, int y, int z)
+ { + {
+ return 1 - BlockFluid.getFluidHeightPercent(world.getBlockMetadata(x, y, z)); + return 1 - BlockFluid.getFluidHeightPercent(world.getBlockMetadata(x, y, z));
} + }
+
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
/**

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockGrass.java --- ../src-base/minecraft/net/minecraft/block/BlockGrass.java
+++ ../src_work/minecraft/net/minecraft/block/BlockGrass.java +++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
{ {
if (!par1World.isRemote) if (!par1World.isRemote)

View file

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/block/BlockLadder.java --- ../src-base/minecraft/net/minecraft/block/BlockLadder.java
+++ ../src_work/minecraft/net/minecraft/block/BlockLadder.java +++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java
@@ -5,9 +5,13 @@ @@ -5,10 +5,14 @@
import java.util.Random; import java.util.Random;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@ -8,12 +8,13 @@
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
+
+import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.ForgeDirection;
+import static net.minecraftforge.common.ForgeDirection.*; +import static net.minecraftforge.common.ForgeDirection.*;
+
public class BlockLadder extends Block public class BlockLadder extends Block
{ {
protected BlockLadder(int par1)
@@ -104,7 +108,10 @@ @@ -104,7 +108,10 @@
*/ */
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockLeaves.java --- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java
+++ ../src_work/minecraft/net/minecraft/block/BlockLeaves.java +++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockLever.java --- ../src-base/minecraft/net/minecraft/block/BlockLever.java
+++ ../src_work/minecraft/net/minecraft/block/BlockLever.java +++ ../src-work/minecraft/net/minecraft/block/BlockLever.java
@@ -10,6 +10,9 @@ @@ -10,6 +10,9 @@
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -83,76 +83,48 @@
boolean flag = false; boolean flag = false;
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && i1 == 1) - if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && i1 == 1)
- {
- flag = true;
- }
-
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && i1 == 2)
- {
- flag = true;
- }
-
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && i1 == 3)
- {
- flag = true;
- }
-
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && i1 == 4)
- {
- flag = true;
- }
-
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && i1 == 5)
- {
- flag = true;
- }
-
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && i1 == 6)
- {
- flag = true;
- }
-
- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && i1 == 0)
- {
- flag = true;
- }
-
- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && i1 == 7)
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && i1 == 1) + if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && i1 == 1)
+ { {
+ flag = true; flag = true;
+ } }
+
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && i1 == 2)
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && i1 == 2) + if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && i1 == 2)
+ { {
+ flag = true; flag = true;
+ } }
+
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && i1 == 3)
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && i1 == 3) + if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && i1 == 3)
+ { {
+ flag = true; flag = true;
+ } }
+
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && i1 == 4)
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && i1 == 4) + if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && i1 == 4)
+ { {
+ flag = true; flag = true;
+ } }
+
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && i1 == 5)
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && i1 == 5) + if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && i1 == 5)
+ { {
+ flag = true; flag = true;
+ } }
+
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && i1 == 6)
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && i1 == 6) + if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && i1 == 6)
+ { {
+ flag = true; flag = true;
+ } }
+
- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && i1 == 0)
+ if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && i1 == 0) + if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && i1 == 0)
+ { {
+ flag = true; flag = true;
+ } }
+
- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && i1 == 7)
+ if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && i1 == 7) + if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && i1 == 7)
{ {
flag = true; flag = true;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockLog.java --- ../src-base/minecraft/net/minecraft/block/BlockLog.java
+++ ../src_work/minecraft/net/minecraft/block/BlockLog.java +++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
@@ -62,14 +62,9 @@ @@ -62,14 +62,9 @@
{ {
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2); int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);

View file

@ -1,17 +1,18 @@
--- ../src_base/minecraft/net/minecraft/block/BlockMobSpawner.java --- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java
+++ ../src_work/minecraft/net/minecraft/block/BlockMobSpawner.java +++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java
@@ -45,8 +45,12 @@ @@ -45,9 +45,13 @@
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{ {
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);
- int j1 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15); - int j1 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15);
- this.dropXpOnBlockBreak(par1World, par2, par3, par4, j1); - this.dropXpOnBlockBreak(par1World, par2, par3, par4, j1);
+ } }
+ +
+ @Override + @Override
+ public int getExpDrop(World world, int data, int enchantmentLevel) + public int getExpDrop(World world, int data, int enchantmentLevel)
+ { + {
+ return 15 + world.rand.nextInt(15) + world.rand.nextInt(15); + return 15 + world.rand.nextInt(15) + world.rand.nextInt(15);
} + }
/** /**
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two

View file

@ -1,14 +1,14 @@
--- ../src_base/minecraft/net/minecraft/block/BlockMushroom.java --- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java
+++ ../src_work/minecraft/net/minecraft/block/BlockMushroom.java +++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java
@@ -3,6 +3,8 @@ @@ -4,6 +4,8 @@
import java.util.Random;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenBigMushroom; import net.minecraft.world.gen.feature.WorldGenBigMushroom;
+
+import net.minecraftforge.common.ForgeDirection;
+import net.minecraftforge.common.ForgeDirection;
+
public class BlockMushroom extends BlockFlower public class BlockMushroom extends BlockFlower
{ {
protected BlockMushroom(int par1)
@@ -96,7 +98,9 @@ @@ -96,7 +98,9 @@
if (par3 >= 0 && par3 < 256) if (par3 >= 0 && par3 < 256)
{ {

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockMycelium.java --- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java
+++ ../src_work/minecraft/net/minecraft/block/BlockMycelium.java +++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
{ {
if (!par1World.isRemote) if (!par1World.isRemote)

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockNetherStalk.java --- ../src-base/minecraft/net/minecraft/block/BlockNetherStalk.java
+++ ../src_work/minecraft/net/minecraft/block/BlockNetherStalk.java +++ ../src-work/minecraft/net/minecraft/block/BlockNetherStalk.java
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockOre.java --- ../src-base/minecraft/net/minecraft/block/BlockOre.java
+++ ../src_work/minecraft/net/minecraft/block/BlockOre.java +++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
@@ -60,6 +60,11 @@ @@ -60,6 +60,11 @@
{ {
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);
@ -16,11 +16,11 @@
{ {
j1 = MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5); j1 = MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5);
} }
+ return j1; -
+ }
- this.dropXpOnBlockBreak(par1World, par2, par3, par4, j1); - this.dropXpOnBlockBreak(par1World, par2, par3, par4, j1);
- } + return j1;
}
+
+ return 0; + return 0;
} }

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockPane.java --- ../src-base/minecraft/net/minecraft/block/BlockPane.java
+++ ../src_work/minecraft/net/minecraft/block/BlockPane.java +++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockPistonBase.java --- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java
+++ ../src_work/minecraft/net/minecraft/block/BlockPistonBase.java +++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java
@@ -439,7 +439,7 @@ @@ -439,7 +439,7 @@
return false; return false;
} }

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockPortal.java --- ../src-base/minecraft/net/minecraft/block/BlockPortal.java
+++ ../src_work/minecraft/net/minecraft/block/BlockPortal.java +++ ../src-work/minecraft/net/minecraft/block/BlockPortal.java
@@ -118,7 +118,7 @@ @@ -118,7 +118,7 @@
} }
else else

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockPumpkin.java --- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java
+++ ../src_work/minecraft/net/minecraft/block/BlockPumpkin.java +++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java
@@ -123,7 +123,8 @@ @@ -123,7 +123,8 @@
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{ {

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockRailBase.java --- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
+++ ../src_work/minecraft/net/minecraft/block/BlockRailBase.java +++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
import java.util.Random; import java.util.Random;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockRedstoneOre.java --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java
+++ ../src_work/minecraft/net/minecraft/block/BlockRedstoneOre.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java
@@ -116,11 +116,17 @@ @@ -116,11 +116,17 @@
{ {
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);
@ -13,9 +13,8 @@
{ {
int j1 = 1 + par1World.rand.nextInt(5); int j1 = 1 + par1World.rand.nextInt(5);
- this.dropXpOnBlockBreak(par1World, par2, par3, par4, j1); - this.dropXpOnBlockBreak(par1World, par2, par3, par4, j1);
- }
+ return j1; + return j1;
+ } }
+ return 0; + return 0;
} }

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockRedstoneWire.java --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java
+++ ../src_work/minecraft/net/minecraft/block/BlockRedstoneWire.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java
@@ -475,7 +475,7 @@ @@ -475,7 +475,7 @@
} }
else if (!Block.redstoneRepeaterIdle.func_94487_f(i1)) else if (!Block.redstoneRepeaterIdle.func_94487_f(i1))

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockReed.java --- ../src-base/minecraft/net/minecraft/block/BlockReed.java
+++ ../src_work/minecraft/net/minecraft/block/BlockReed.java +++ ../src-work/minecraft/net/minecraft/block/BlockReed.java
@@ -8,7 +8,11 @@ @@ -8,7 +8,11 @@
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockSand.java --- ../src-base/minecraft/net/minecraft/block/BlockSand.java
+++ ../src_work/minecraft/net/minecraft/block/BlockSand.java +++ ../src-work/minecraft/net/minecraft/block/BlockSand.java
@@ -105,7 +105,7 @@ @@ -105,7 +105,7 @@
{ {
int l = par0World.getBlockId(par1, par2, par3); int l = par0World.getBlockId(par1, par2, par3);

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockSapling.java --- ../src-base/minecraft/net/minecraft/block/BlockSapling.java
+++ ../src_work/minecraft/net/minecraft/block/BlockSapling.java +++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java
@@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraft.world.gen.feature.WorldGenTrees;
import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraft.world.gen.feature.WorldGenerator;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockSkull.java --- ../src-base/minecraft/net/minecraft/block/BlockSkull.java
+++ ../src_work/minecraft/net/minecraft/block/BlockSkull.java +++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@ -21,22 +21,20 @@
* Called when the block is attempted to be harvested * Called when the block is attempted to be harvested
*/ */
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer)
@@ -149,6 +146,8 @@ @@ -150,6 +147,8 @@
par5 |= 8;
par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 4); par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 4);
} }
+
+ dropBlockAsItem(par1World, par2, par3, par4, par5, 0);
+ dropBlockAsItem(par1World, par2, par3, par4, par5, 0);
+
super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer);
} }
@@ -160,24 +159,30 @@ @@ -160,24 +159,30 @@
*/ */
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
{ {
- if (!par1World.isRemote) - if (!par1World.isRemote)
- {
- if ((par6 & 8) == 0)
+ super.breakBlock(par1World, par2, par3, par4, par5, par6); + super.breakBlock(par1World, par2, par3, par4, par5, par6);
+ } + }
+ +
@ -45,15 +43,14 @@
+ { + {
+ ArrayList<ItemStack> drops = new ArrayList<ItemStack>(); + ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
+ if ((metadata & 8) == 0) + if ((metadata & 8) == 0)
+ {
+ ItemStack itemstack = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(world, x, y, z));
+ TileEntitySkull tileentityskull = (TileEntitySkull)world.getBlockTileEntity(x, y, z);
+
+ if (tileentityskull == null)
{ {
- if ((par6 & 8) == 0)
- {
- ItemStack itemstack = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(par1World, par2, par3, par4)); - ItemStack itemstack = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(par1World, par2, par3, par4));
- TileEntitySkull tileentityskull = (TileEntitySkull)par1World.getBlockTileEntity(par2, par3, par4); - TileEntitySkull tileentityskull = (TileEntitySkull)par1World.getBlockTileEntity(par2, par3, par4);
- + ItemStack itemstack = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(world, x, y, z));
+ TileEntitySkull tileentityskull = (TileEntitySkull)world.getBlockTileEntity(x, y, z);
- if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0) - if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0)
- { - {
- itemstack.setTagCompound(new NBTTagCompound()); - itemstack.setTagCompound(new NBTTagCompound());
@ -61,18 +58,19 @@
- } - }
- -
- this.dropBlockAsItem_do(par1World, par2, par3, par4, itemstack); - this.dropBlockAsItem_do(par1World, par2, par3, par4, itemstack);
+ if (tileentityskull == null)
+ {
+ return drops; + return drops;
} }
- -
- super.breakBlock(par1World, par2, par3, par4, par5, par6); - super.breakBlock(par1World, par2, par3, par4, par5, par6);
- }
+ if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0) + if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0)
+ { + {
+ itemstack.setTagCompound(new NBTTagCompound()); + itemstack.setTagCompound(new NBTTagCompound());
+ itemstack.getTagCompound().setString("SkullOwner", tileentityskull.getExtraType()); + itemstack.getTagCompound().setString("SkullOwner", tileentityskull.getExtraType());
+ } + }
+ drops.add(itemstack); + drops.add(itemstack);
+ } }
+ return drops; + return drops;
} }

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockSnow.java --- ../src-base/minecraft/net/minecraft/block/BlockSnow.java
+++ ../src_work/minecraft/net/minecraft/block/BlockSnow.java +++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java
@@ -96,8 +96,12 @@ @@ -96,8 +96,12 @@
*/ */
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockStem.java --- ../src-base/minecraft/net/minecraft/block/BlockStem.java
+++ ../src_work/minecraft/net/minecraft/block/BlockStem.java +++ ../src-work/minecraft/net/minecraft/block/BlockStem.java
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@ -46,19 +46,17 @@
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{ {
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);
- + }
- if (!par1World.isRemote) - if (!par1World.isRemote)
- { - {
- Item item = null; - Item item = null;
-
- if (this.fruitType == Block.pumpkin)
+ }
+
+ @Override + @Override
+ public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) + public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
+ { + {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); + ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+
- if (this.fruitType == Block.pumpkin)
+ for (int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++)
+ { + {
+ if (world.rand.nextInt(15) <= metadata) + if (world.rand.nextInt(15) <= metadata)
@ -79,8 +77,7 @@
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(item)); - this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(item));
- } - }
- } - }
- } }
+ }
+ +
+ return ret; + return ret;
} }

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockTallGrass.java --- ../src-base/minecraft/net/minecraft/block/BlockTallGrass.java
+++ ../src_work/minecraft/net/minecraft/block/BlockTallGrass.java +++ ../src-work/minecraft/net/minecraft/block/BlockTallGrass.java
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockTorch.java --- ../src-base/minecraft/net/minecraft/block/BlockTorch.java
+++ ../src_work/minecraft/net/minecraft/block/BlockTorch.java +++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java
@@ -10,6 +10,9 @@ @@ -10,6 +10,9 @@
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -88,36 +88,24 @@
boolean flag = false; boolean flag = false;
- if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && i1 == 1) - if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && i1 == 1)
- {
- flag = true;
- }
-
- if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && i1 == 2)
- {
- flag = true;
- }
-
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && i1 == 3)
- {
- flag = true;
- }
-
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && i1 == 4)
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) && i1 == 1) + if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) && i1 == 1)
+ { {
+ flag = true; flag = true;
+ } }
+
- if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && i1 == 2)
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) && i1 == 2) + if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) && i1 == 2)
+ { {
+ flag = true; flag = true;
+ } }
+
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && i1 == 3)
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) && i1 == 3) + if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) && i1 == 3)
+ { {
+ flag = true; flag = true;
+ } }
+
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && i1 == 4)
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) && i1 == 4) + if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) && i1 == 4)
{ {
flag = true; flag = true;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockTrapDoor.java --- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java
+++ ../src_work/minecraft/net/minecraft/block/BlockTrapDoor.java +++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java
@@ -11,8 +11,13 @@ @@ -11,8 +11,13 @@
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockTripWireSource.java --- ../src-base/minecraft/net/minecraft/block/BlockTripWireSource.java
+++ ../src_work/minecraft/net/minecraft/block/BlockTripWireSource.java +++ ../src-work/minecraft/net/minecraft/block/BlockTripWireSource.java
@@ -8,6 +8,9 @@ @@ -8,6 +8,9 @@
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/block/BlockVine.java --- ../src-base/minecraft/net/minecraft/block/BlockVine.java
+++ ../src_work/minecraft/net/minecraft/block/BlockVine.java +++ ../src-work/minecraft/net/minecraft/block/BlockVine.java
@@ -2,9 +2,12 @@ @@ -2,9 +2,12 @@
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@ -38,7 +38,7 @@
- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
- } - }
+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); + super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
+ } }
+ +
+ @Override + @Override
+ public boolean isShearable(ItemStack item, World world, int x, int y, int z) + public boolean isShearable(ItemStack item, World world, int x, int y, int z)
@ -58,5 +58,5 @@
+ public boolean isLadder(World world, int x, int y, int z, EntityLivingBase entity) + public boolean isLadder(World world, int x, int y, int z, EntityLivingBase entity)
+ { + {
+ return true; + return true;
} + }
} }

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/Minecraft.java --- ../src-base/minecraft/net/minecraft/client/Minecraft.java
+++ ../src_work/minecraft/net/minecraft/client/Minecraft.java +++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
@@ -137,6 +137,16 @@ @@ -137,6 +137,16 @@
import com.google.common.collect.MapDifference; import com.google.common.collect.MapDifference;
@ -56,12 +56,10 @@
this.statFileWriter.syncStats(); this.statFileWriter.syncStats();
if (par1GuiScreen == null && this.theWorld == null) if (par1GuiScreen == null && this.theWorld == null)
@@ -694,6 +699,20 @@ @@ -696,6 +701,20 @@
else if (par1GuiScreen == null && this.thePlayer.getHealth() <= 0.0F)
{
par1GuiScreen = new GuiGameOver(); par1GuiScreen = new GuiGameOver();
+ } }
+
+ GuiScreen old = this.currentScreen; + GuiScreen old = this.currentScreen;
+ GuiOpenEvent event = new GuiOpenEvent(par1GuiScreen); + GuiOpenEvent event = new GuiOpenEvent(par1GuiScreen);
+ +
@ -74,9 +72,11 @@
+ if (old != null && par1GuiScreen != old) + if (old != null && par1GuiScreen != old)
+ { + {
+ old.onGuiClosed(); + old.onGuiClosed();
} + }
+
if (par1GuiScreen instanceof GuiMainMenu) if (par1GuiScreen instanceof GuiMainMenu)
{
this.gameSettings.showDebugInfo = false;
@@ -1301,7 +1320,7 @@ @@ -1301,7 +1320,7 @@
if (this.thePlayer.isCurrentToolAdventureModeExempt(j, k, l)) if (this.thePlayer.isCurrentToolAdventureModeExempt(j, k, l))
@ -155,7 +155,7 @@
} }
/** /**
@@ -2237,107 +2277,12 @@ @@ -2237,108 +2277,13 @@
if (this.objectMouseOver != null) if (this.objectMouseOver != null)
{ {
boolean flag = this.thePlayer.capabilities.isCreativeMode; boolean flag = this.thePlayer.capabilities.isCreativeMode;
@ -165,7 +165,8 @@
int k; int k;
- if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) - if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE)
- { + if (!ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld))
{
- k = this.objectMouseOver.blockX; - k = this.objectMouseOver.blockX;
- int l = this.objectMouseOver.blockY; - int l = this.objectMouseOver.blockY;
- int i1 = this.objectMouseOver.blockZ; - int i1 = this.objectMouseOver.blockZ;
@ -186,14 +187,15 @@
- flag1 = Item.itemsList[j].getHasSubtypes(); - flag1 = Item.itemsList[j].getHasSubtypes();
- int j1 = j < 256 && !Block.blocksList[block.blockID].isFlowerPot() ? j : block.blockID; - int j1 = j < 256 && !Block.blocksList[block.blockID].isFlowerPot() ? j : block.blockID;
- i = Block.blocksList[j1].getDamageValue(this.theWorld, k, l, i1); - i = Block.blocksList[j1].getDamageValue(this.theWorld, k, l, i1);
- } + return;
}
- else - else
- { - {
- if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag) - if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag)
- { - {
- return; - return;
- } - }
-
- if (this.objectMouseOver.entityHit instanceof EntityPainting) - if (this.objectMouseOver.entityHit instanceof EntityPainting)
- { - {
- j = Item.painting.itemID; - j = Item.painting.itemID;
@ -260,13 +262,10 @@
- } - }
- -
- this.thePlayer.inventory.setCurrentItem(j, i, flag1, flag); - this.thePlayer.inventory.setCurrentItem(j, i, flag1, flag);
+ if (!ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld)) -
+ {
+ return;
+ }
if (flag) if (flag)
{ {
k = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + this.thePlayer.inventory.currentItem;
@@ -2420,11 +2365,18 @@ @@ -2420,11 +2365,18 @@
par1PlayerUsageSnooper.addData("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize())); par1PlayerUsageSnooper.addData("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize()));
} }

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/audio/SoundManager.java --- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java
+++ ../src_work/minecraft/net/minecraft/client/audio/SoundManager.java +++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java
@@ -1,5 +1,9 @@ @@ -1,5 +1,9 @@
package net.minecraft.client.audio; package net.minecraft.client.audio;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java --- ../src-base/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java
+++ ../src_work/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java +++ ../src-work/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java
@@ -170,7 +170,8 @@ @@ -170,7 +170,8 @@
} }
} }

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java --- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
+++ ../src_work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java +++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
@@ -49,6 +49,9 @@ @@ -49,6 +49,9 @@
import net.minecraft.util.MovementInput; import net.minecraft.util.MovementInput;
import net.minecraft.util.Session; import net.minecraft.util.Session;
@ -34,17 +34,16 @@
double d4 = par5 - (double)k; double d4 = par5 - (double)k;
- if (this.isBlockTranslucent(i, j, k) || this.isBlockTranslucent(i, j + 1, k)) - if (this.isBlockTranslucent(i, j, k) || this.isBlockTranslucent(i, j + 1, k))
- {
- boolean flag = !this.isBlockTranslucent(i - 1, j, k) && !this.isBlockTranslucent(i - 1, j + 1, k);
- boolean flag1 = !this.isBlockTranslucent(i + 1, j, k) && !this.isBlockTranslucent(i + 1, j + 1, k);
- boolean flag2 = !this.isBlockTranslucent(i, j, k - 1) && !this.isBlockTranslucent(i, j + 1, k - 1);
- boolean flag3 = !this.isBlockTranslucent(i, j, k + 1) && !this.isBlockTranslucent(i, j + 1, k + 1);
+ int entHeight = Math.max(Math.round(this.height), 1); + int entHeight = Math.max(Math.round(this.height), 1);
+ +
+ boolean inTranslucentBlock = true; + boolean inTranslucentBlock = true;
+ +
+ for (int i1 = 0; i1 < entHeight; i1++) + for (int i1 = 0; i1 < entHeight; i1++)
+ { {
- boolean flag = !this.isBlockTranslucent(i - 1, j, k) && !this.isBlockTranslucent(i - 1, j + 1, k);
- boolean flag1 = !this.isBlockTranslucent(i + 1, j, k) && !this.isBlockTranslucent(i + 1, j + 1, k);
- boolean flag2 = !this.isBlockTranslucent(i, j, k - 1) && !this.isBlockTranslucent(i, j + 1, k - 1);
- boolean flag3 = !this.isBlockTranslucent(i, j, k + 1) && !this.isBlockTranslucent(i, j + 1, k + 1);
+ if (!this.isBlockTranslucent(i, j + i1, k)) + if (!this.isBlockTranslucent(i, j + i1, k))
+ { + {
+ inTranslucentBlock = false; + inTranslucentBlock = false;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/gui/GuiChat.java --- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java
+++ ../src_work/minecraft/net/minecraft/client/gui/GuiChat.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java
@@ -7,8 +7,11 @@ @@ -7,8 +7,11 @@
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;

View file

@ -1,23 +1,23 @@
--- ../src_base/minecraft/net/minecraft/client/gui/GuiControls.java --- ../src-base/minecraft/net/minecraft/client/gui/GuiControls.java
+++ ../src_work/minecraft/net/minecraft/client/gui/GuiControls.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiControls.java
@@ -6,6 +6,8 @@ @@ -7,6 +7,8 @@
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding; import net.minecraft.client.settings.KeyBinding;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
+
+import net.minecraftforge.client.GuiControlsScrollPanel;
+import net.minecraftforge.client.GuiControlsScrollPanel;
+
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiControls extends GuiScreen public class GuiControls extends GuiScreen
@@ -23,6 +25,8 @@ {
@@ -24,6 +26,8 @@
/** The ID of the button that has been pressed. */ /** The ID of the button that has been pressed. */
private int buttonId = -1; private int buttonId = -1;
+
+ private GuiControlsScrollPanel scrollPane;
+ private GuiControlsScrollPanel scrollPane;
+
public GuiControls(GuiScreen par1GuiScreen, GameSettings par2GameSettings) public GuiControls(GuiScreen par1GuiScreen, GameSettings par2GameSettings)
{ {
this.parentScreen = par1GuiScreen;
@@ -43,14 +47,9 @@ @@ -43,14 +47,9 @@
*/ */
public void initGui() public void initGui()
@ -36,7 +36,7 @@
this.screenTitle = I18n.getString("controls.title"); this.screenTitle = I18n.getString("controls.title");
} }
@@ -59,19 +58,9 @@ @@ -59,20 +58,10 @@
*/ */
protected void actionPerformed(GuiButton par1GuiButton) protected void actionPerformed(GuiButton par1GuiButton)
{ {
@ -48,14 +48,15 @@
if (par1GuiButton.id == 200) if (par1GuiButton.id == 200)
{ {
this.mc.displayGuiScreen(this.parentScreen); this.mc.displayGuiScreen(this.parentScreen);
- } }
- else - else
- { - {
- this.buttonId = par1GuiButton.id; - this.buttonId = par1GuiButton.id;
- par1GuiButton.displayString = "> " + this.options.getOptionDisplayString(par1GuiButton.id) + " <"; - par1GuiButton.displayString = "> " + this.options.getOptionDisplayString(par1GuiButton.id) + " <";
} - }
} }
/**
@@ -80,17 +69,7 @@ @@ -80,17 +69,7 @@
*/ */
protected void mouseClicked(int par1, int par2, int par3) protected void mouseClicked(int par1, int par2, int par3)
@ -75,22 +76,23 @@
} }
/** /**
@@ -98,14 +77,7 @@ @@ -98,15 +77,8 @@
*/ */
protected void keyTyped(char par1, int par2) protected void keyTyped(char par1, int par2)
{ {
- if (this.buttonId >= 0) - if (this.buttonId >= 0)
- { + if (scrollPane.keyTyped(par1, par2))
{
- this.options.setKeyBinding(this.buttonId, par2); - this.options.setKeyBinding(this.buttonId, par2);
- ((GuiButton)this.buttonList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId); - ((GuiButton)this.buttonList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId);
- this.buttonId = -1; - this.buttonId = -1;
- KeyBinding.resetKeyBindingArrayAndHash(); - KeyBinding.resetKeyBindingArrayAndHash();
- } - }
- else - else
+ if (scrollPane.keyTyped(par1, par2)) - {
{
super.keyTyped(par1, par2); super.keyTyped(par1, par2);
} }
}
@@ -117,6 +89,7 @@ @@ -117,6 +89,7 @@
public void drawScreen(int par1, int par2, float par3) public void drawScreen(int par1, int par2, float par3)
{ {

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java --- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
+++ ../src_work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
@@ -376,7 +376,7 @@ @@ -376,7 +376,7 @@
} }
else if (par1GuiButton.id == 8) else if (par1GuiButton.id == 8)

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/gui/GuiIngame.java --- ../src-base/minecraft/net/minecraft/client/gui/GuiIngame.java
+++ ../src_work/minecraft/net/minecraft/client/gui/GuiIngame.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngame.java
@@ -40,6 +40,8 @@ @@ -40,6 +40,8 @@
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
@ -14,10 +14,9 @@
ItemStack itemstack = this.mc.thePlayer.inventory.armorItemInSlot(3); ItemStack itemstack = this.mc.thePlayer.inventory.armorItemInSlot(3);
- if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.itemID == Block.pumpkin.blockID) - if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.itemID == Block.pumpkin.blockID)
- {
- this.renderPumpkinBlur(k, l);
+ if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.getItem() != null) + if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.getItem() != null)
+ { {
- this.renderPumpkinBlur(k, l);
+ if (itemstack.itemID == Block.pumpkin.blockID) + if (itemstack.itemID == Block.pumpkin.blockID)
+ { + {
+ this.renderPumpkinBlur(k, l); + this.renderPumpkinBlur(k, l);

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/gui/GuiSlot.java --- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java
+++ ../src_work/minecraft/net/minecraft/client/gui/GuiSlot.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java
@@ -331,16 +331,7 @@ @@ -331,16 +331,7 @@
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG); GL11.glDisable(GL11.GL_FOG);

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java --- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java
+++ ../src_work/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java +++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java
@@ -2,6 +2,9 @@ @@ -2,6 +2,9 @@
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@ -53,12 +53,10 @@
} }
/** /**
@@ -87,6 +105,16 @@ @@ -89,6 +107,16 @@
{
this.mc.displayGuiScreen((GuiScreen)null);
this.mc.setIngameFocus(); this.mc.setIngameFocus();
+ } }
+
+ if (par1GuiButton.id == 2) + if (par1GuiButton.id == 2)
+ { + {
+ currentPage++; + currentPage++;
@ -67,23 +65,23 @@
+ currentPage = -1; + currentPage = -1;
+ } + }
+ button.displayString = AchievementPage.getTitle(currentPage); + button.displayString = AchievementPage.getTitle(currentPage);
+ }
+
super.actionPerformed(par1GuiButton);
} }
super.actionPerformed(par1GuiButton);
@@ -314,11 +342,12 @@ @@ -314,11 +342,12 @@
int i4; int i4;
int j4; int j4;
- for (i3 = 0; i3 < AchievementList.achievementList.size(); ++i3) - for (i3 = 0; i3 < AchievementList.achievementList.size(); ++i3)
- {
- Achievement achievement = (Achievement)AchievementList.achievementList.get(i3);
-
- if (achievement.parentAchievement != null)
+ List<Achievement> achievementList = (currentPage == -1 ? minecraftAchievements : AchievementPage.getAchievementPage(currentPage).getAchievements()); + List<Achievement> achievementList = (currentPage == -1 ? minecraftAchievements : AchievementPage.getAchievementPage(currentPage).getAchievements());
+ for (i3 = 0; i3 < achievementList.size(); ++i3) + for (i3 = 0; i3 < achievementList.size(); ++i3)
+ { {
- Achievement achievement = (Achievement)AchievementList.achievementList.get(i3);
+ Achievement achievement = achievementList.get(i3); + Achievement achievement = achievementList.get(i3);
+
- if (achievement.parentAchievement != null)
+ if (achievement.parentAchievement != null && achievementList.contains(achievement.parentAchievement)) + if (achievement.parentAchievement != null && achievementList.contains(achievement.parentAchievement))
{ {
k3 = achievement.displayColumn * 24 - k + 11 + k1; k3 = achievement.displayColumn * 24 - k + 11 + k1;
@ -93,10 +91,9 @@
int i5; int i5;
- for (k3 = 0; k3 < AchievementList.achievementList.size(); ++k3) - for (k3 = 0; k3 < AchievementList.achievementList.size(); ++k3)
- {
- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(k3);
+ for (k3 = 0; k3 < achievementList.size(); ++k3) + for (k3 = 0; k3 < achievementList.size(); ++k3)
+ { {
- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(k3);
+ Achievement achievement2 = (Achievement)achievementList.get(k3); + Achievement achievement2 = (Achievement)achievementList.get(k3);
j4 = achievement2.displayColumn * 24 - k; j4 = achievement2.displayColumn * 24 - k;
l3 = achievement2.displayRow * 24 - l; l3 = achievement2.displayRow * 24 - l;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java --- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
+++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java +++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -44,18 +44,18 @@
} }
/** /**
@@ -242,6 +251,11 @@ @@ -243,6 +252,11 @@
}
protected void func_102021_a(List par1List, int par2, int par3) protected void func_102021_a(List par1List, int par2, int par3)
+ { {
+ drawHoveringText(par1List, par2, par3, fontRenderer); + drawHoveringText(par1List, par2, par3, fontRenderer);
+ } + }
+ +
+ protected void drawHoveringText(List par1List, int par2, int par3, FontRenderer font) + protected void drawHoveringText(List par1List, int par2, int par3, FontRenderer font)
{ + {
if (!par1List.isEmpty()) if (!par1List.isEmpty())
{ {
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
@@ -255,7 +269,7 @@ @@ -255,7 +269,7 @@
while (iterator.hasNext()) while (iterator.hasNext())
{ {

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java --- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java
+++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java +++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java
@@ -61,6 +61,8 @@ @@ -61,6 +61,8 @@
private Slot field_74235_v; private Slot field_74235_v;
private boolean field_74234_w; private boolean field_74234_w;
@ -61,10 +61,9 @@
Item.enchantedBook.func_92113_a(enchantment, containercreative.itemList); Item.enchantedBook.func_92113_a(enchantment, containercreative.itemList);
} }
} }
-
+ updateFilteredItems(containercreative); + updateFilteredItems(containercreative);
+ } + }
+
+ //split from above for custom search tabs + //split from above for custom search tabs
+ private void updateFilteredItems(ContainerCreative containercreative) + private void updateFilteredItems(ContainerCreative containercreative)
+ { + {
@ -116,26 +115,24 @@
{ {
this.searchField.setVisible(true); this.searchField.setVisible(true);
this.searchField.setCanLoseFocus(false); this.searchField.setCanLoseFocus(false);
@@ -653,21 +682,42 @@ @@ -653,23 +682,44 @@
super.drawScreen(par1, par2, par3); super.drawScreen(par1, par2, par3);
CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray;
- int i2 = acreativetabs.length; - int i2 = acreativetabs.length;
-
- for (int j2 = 0; j2 < i2; ++j2)
+ int start = tabPage * 10; + int start = tabPage * 10;
+ int i2 = Math.min(acreativetabs.length, ((tabPage + 1) * 10) + 2); + int i2 = Math.min(acreativetabs.length, ((tabPage + 1) * 10) + 2);
+ if (tabPage != 0) start += 2; + if (tabPage != 0) start += 2;
+ boolean rendered = false; + boolean rendered = false;
+
- for (int j2 = 0; j2 < i2; ++j2)
+ for (int j2 = start; j2 < i2; ++j2) + for (int j2 = start; j2 < i2; ++j2)
{ {
CreativeTabs creativetabs = acreativetabs[j2]; CreativeTabs creativetabs = acreativetabs[j2];
- if (this.renderCreativeInventoryHoveringText(creativetabs, par1, par2)) - if (this.renderCreativeInventoryHoveringText(creativetabs, par1, par2))
- {
+ if (creativetabs != null && this.renderCreativeInventoryHoveringText(creativetabs, par1, par2)) + if (creativetabs != null && this.renderCreativeInventoryHoveringText(creativetabs, par1, par2))
+ { {
+ rendered = true; + rendered = true;
break; break;
} }
@ -149,8 +146,8 @@
if (this.field_74235_v != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_74235_v.xDisplayPosition, this.field_74235_v.yDisplayPosition, 16, 16, par1, par2)) if (this.field_74235_v != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_74235_v.xDisplayPosition, this.field_74235_v.yDisplayPosition, 16, 16, par1, par2))
{ {
this.drawCreativeTabHoveringText(I18n.getString("inventory.binSlot"), par1, par2); this.drawCreativeTabHoveringText(I18n.getString("inventory.binSlot"), par1, par2);
+ } }
+
+ if (maxPages != 0) + if (maxPages != 0)
+ { + {
+ String page = String.format("%d / %d", tabPage + 1, maxPages + 1); + String page = String.format("%d / %d", tabPage + 1, maxPages + 1);
@ -161,10 +158,12 @@
+ fontRenderer.drawString(page, guiLeft + (xSize / 2) - (width / 2), guiTop - 44, -1); + fontRenderer.drawString(page, guiLeft + (xSize / 2) - (width / 2), guiTop - 44, -1);
+ this.zLevel = 0.0F; + this.zLevel = 0.0F;
+ itemRenderer.zLevel = 0.0F; + itemRenderer.zLevel = 0.0F;
} + }
+
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -741,14 +791,32 @@ GL11.glDisable(GL11.GL_LIGHTING);
}
@@ -741,17 +791,35 @@
int k = acreativetabs.length; int k = acreativetabs.length;
int l; int l;
@ -182,9 +181,9 @@
+ if (creativetabs1 != null && creativetabs1.getTabIndex() != selectedTabIndex) + if (creativetabs1 != null && creativetabs1.getTabIndex() != selectedTabIndex)
{ {
this.renderCreativeTab(creativetabs1); this.renderCreativeTab(creativetabs1);
+ } }
+ } }
+
+ if (tabPage != 0) + if (tabPage != 0)
+ { + {
+ if (creativetabs != CreativeTabs.tabAllSearch) + if (creativetabs != CreativeTabs.tabAllSearch)
@ -196,9 +195,12 @@
+ { + {
+ this.mc.getTextureManager().bindTexture(field_110424_t); + this.mc.getTextureManager().bindTexture(field_110424_t);
+ renderCreativeTab(CreativeTabs.tabInventory); + renderCreativeTab(CreativeTabs.tabInventory);
} + }
} + }
+
this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.getBackgroundImageName()));
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
this.searchField.drawTextBox();
@@ -766,6 +834,14 @@ @@ -766,6 +834,14 @@
this.drawTexturedModalRect(i1, k + (int)((float)(l - k - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); this.drawTexturedModalRect(i1, k + (int)((float)(l - k - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
} }

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/model/ModelBase.java --- ../src-base/minecraft/net/minecraft/client/model/ModelBase.java
+++ ../src_work/minecraft/net/minecraft/client/model/ModelBase.java +++ ../src-work/minecraft/net/minecraft/client/model/ModelBase.java
@@ -10,7 +10,6 @@ @@ -10,7 +10,6 @@
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/model/ModelBox.java --- ../src-base/minecraft/net/minecraft/client/model/ModelBox.java
+++ ../src_work/minecraft/net/minecraft/client/model/ModelBox.java +++ ../src-work/minecraft/net/minecraft/client/model/ModelBox.java
@@ -4,7 +4,6 @@ @@ -4,7 +4,6 @@
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/model/ModelRenderer.java --- ../src-base/minecraft/net/minecraft/client/model/ModelRenderer.java
+++ ../src_work/minecraft/net/minecraft/client/model/ModelRenderer.java +++ ../src-work/minecraft/net/minecraft/client/model/ModelRenderer.java
@@ -8,7 +8,6 @@ @@ -8,7 +8,6 @@
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/model/PositionTextureVertex.java --- ../src-base/minecraft/net/minecraft/client/model/PositionTextureVertex.java
+++ ../src_work/minecraft/net/minecraft/client/model/PositionTextureVertex.java +++ ../src-work/minecraft/net/minecraft/client/model/PositionTextureVertex.java
@@ -4,7 +4,6 @@ @@ -4,7 +4,6 @@
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/model/TexturedQuad.java --- ../src-base/minecraft/net/minecraft/client/model/TexturedQuad.java
+++ ../src_work/minecraft/net/minecraft/client/model/TexturedQuad.java +++ ../src-work/minecraft/net/minecraft/client/model/TexturedQuad.java
@@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java --- ../src-base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java
+++ ../src_work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java
@@ -13,6 +13,8 @@ @@ -13,6 +13,8 @@
import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.EmptyChunk; import net.minecraft.world.chunk.EmptyChunk;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java --- ../src-base/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java
+++ ../src_work/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java
@@ -191,6 +191,11 @@ @@ -191,6 +191,11 @@
import net.minecraft.world.storage.MapStorage; import net.minecraft.world.storage.MapStorage;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java --- ../src-base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
+++ ../src_work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
@@ -22,6 +22,10 @@ @@ -22,6 +22,10 @@
import net.minecraft.world.EnumGameType; import net.minecraft.world.EnumGameType;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -37,15 +37,14 @@
float f2 = (float)par8Vec3.zCoord - (float)par6; float f2 = (float)par8Vec3.zCoord - (float)par6;
boolean flag = false; boolean flag = false;
int i1; int i1;
-
- if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null)
+ if (par3ItemStack != null && + if (par3ItemStack != null &&
+ par3ItemStack.getItem() != null && + par3ItemStack.getItem() != null &&
+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2)) + par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2))
+ { + {
+ return true; + return true;
+ } + }
+
- if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null)
+ if (!par1EntityPlayer.isSneaking() || (par1EntityPlayer.getHeldItem() == null || par1EntityPlayer.getHeldItem().getItem().shouldPassSneakingClickToBlock(par2World, par4, par5, par6))) + if (!par1EntityPlayer.isSneaking() || (par1EntityPlayer.getHeldItem() == null || par1EntityPlayer.getHeldItem().getItem().shouldPassSneakingClickToBlock(par2World, par4, par5, par6)))
{ {
i1 = par2World.getBlockId(par4, par5, par6); i1 = par2World.getBlockId(par4, par5, par6);

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/multiplayer/WorldClient.java --- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java
+++ ../src_work/minecraft/net/minecraft/client/multiplayer/WorldClient.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java
@@ -29,6 +29,9 @@ @@ -29,6 +29,9 @@
import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.storage.SaveHandlerMP; import net.minecraft.world.storage.SaveHandlerMP;
@ -14,11 +14,11 @@
super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(par3), par2WorldSettings, par5Profiler, par6ILogAgent); super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(par3), par2WorldSettings, par5Profiler, par6ILogAgent);
this.sendQueue = par1NetClientHandler; this.sendQueue = par1NetClientHandler;
this.difficultySetting = par4; this.difficultySetting = par4;
+ this.mapStorage = par1NetClientHandler.mapStorage; - this.setSpawnLocation(8, 64, 8);
this.mapStorage = par1NetClientHandler.mapStorage;
+ this.isRemote = true; + this.isRemote = true;
+ finishSetup(); + finishSetup();
this.setSpawnLocation(8, 64, 8); + this.setSpawnLocation(8, 64, 8);
- this.mapStorage = par1NetClientHandler.mapStorage;
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(this)); + MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(this));
} }

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/particle/EffectRenderer.java --- ../src-base/minecraft/net/minecraft/client/particle/EffectRenderer.java
+++ ../src_work/minecraft/net/minecraft/client/particle/EffectRenderer.java +++ ../src-work/minecraft/net/minecraft/client/particle/EffectRenderer.java
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -8,23 +8,23 @@
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@@ -63,9 +64,13 @@ @@ -63,10 +64,14 @@
for (int j = 0; j < this.fxLayers[i].size(); ++j) for (int j = 0; j < this.fxLayers[i].size(); ++j)
{ {
EntityFX entityfx = (EntityFX)this.fxLayers[i].get(j); EntityFX entityfx = (EntityFX)this.fxLayers[i].get(j);
- entityfx.onUpdate(); - entityfx.onUpdate();
-
- if (entityfx.isDead) - if (entityfx.isDead)
+
+ if (entityfx != null) + if (entityfx != null)
+ { {
+ entityfx.onUpdate(); + entityfx.onUpdate();
+ } + }
+ +
+ if (entityfx == null || entityfx.isDead) + if (entityfx == null || entityfx.isDead)
{ + {
this.fxLayers[i].remove(j--); this.fxLayers[i].remove(j--);
} }
}
@@ -115,6 +120,7 @@ @@ -115,6 +120,7 @@
for (int j = 0; j < this.fxLayers[i].size(); ++j) for (int j = 0; j < this.fxLayers[i].size(); ++j)
{ {
@ -46,11 +46,10 @@
public void addBlockDestroyEffects(int par1, int par2, int par3, int par4, int par5) public void addBlockDestroyEffects(int par1, int par2, int par3, int par4, int par5)
{ {
- if (par4 != 0) - if (par4 != 0)
- {
- Block block = Block.blocksList[par4];
+ Block block = Block.blocksList[par4]; + Block block = Block.blocksList[par4];
+ if (block != null && !block.addBlockDestroyEffects(worldObj, par1, par2, par3, par5, this)) + if (block != null && !block.addBlockDestroyEffects(worldObj, par1, par2, par3, par5, this))
+ { {
- Block block = Block.blocksList[par4];
byte b0 = 4; byte b0 = 4;
for (int j1 = 0; j1 < b0; ++j1) for (int j1 = 0; j1 < b0; ++j1)

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/particle/EntityDiggingFX.java --- ../src-base/minecraft/net/minecraft/client/particle/EntityDiggingFX.java
+++ ../src_work/minecraft/net/minecraft/client/particle/EntityDiggingFX.java +++ ../src-work/minecraft/net/minecraft/client/particle/EntityDiggingFX.java
@@ -10,15 +10,22 @@ @@ -10,15 +10,22 @@
public class EntityDiggingFX extends EntityFX public class EntityDiggingFX extends EntityFX
{ {

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java --- ../src-base/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java
+++ ../src_work/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java +++ ../src-work/minecraft/net/minecraft/client/particle/EntityFireworkStarterFX.java
@@ -30,11 +30,11 @@ @@ -30,11 +30,11 @@
{ {
this.fireworkExplosions = par15NBTTagCompound.getTagList("Explosions"); this.fireworkExplosions = par15NBTTagCompound.getTagList("Explosions");

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/EntityRenderer.java --- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/EntityRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java
@@ -40,6 +40,11 @@ @@ -40,6 +40,11 @@
import org.lwjgl.opengl.GLContext; import org.lwjgl.opengl.GLContext;
import org.lwjgl.util.glu.Project; import org.lwjgl.util.glu.Project;
@ -133,11 +133,10 @@
GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_BLEND);
this.mc.mcProfiler.endStartSection("weather"); this.mc.mcProfiler.endStartSection("weather");
this.renderRainSnow(par1); this.renderRainSnow(par1);
@@ -1248,6 +1273,20 @@ @@ -1249,6 +1274,20 @@
{
this.renderCloudsCheck(renderglobal, par1); this.renderCloudsCheck(renderglobal, par1);
} }
+
+ //Forge: Moved section from above, now particles are the last thing to render. + //Forge: Moved section from above, now particles are the last thing to render.
+ this.enableLightmap((double)par1); + this.enableLightmap((double)par1);
+ this.mc.mcProfiler.endStartSection("litParticles"); + this.mc.mcProfiler.endStartSection("litParticles");
@ -151,6 +150,7 @@
+ +
+ this.mc.mcProfiler.endStartSection("FRenderLast"); + this.mc.mcProfiler.endStartSection("FRenderLast");
+ ForgeHooksClient.dispatchRenderLast(renderglobal, par1); + ForgeHooksClient.dispatchRenderLast(renderglobal, par1);
+
this.mc.mcProfiler.endStartSection("hand"); this.mc.mcProfiler.endStartSection("hand");
if (this.cameraZoom == 1.0D)

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/ItemRenderer.java --- ../src-base/minecraft/net/minecraft/client/renderer/ItemRenderer.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/ItemRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java
@@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
@ -23,7 +23,7 @@
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class ItemRenderer public class ItemRenderer
{ {
@@ -54,15 +63,32 @@ @@ -54,16 +63,33 @@
this.mapItemRenderer = new MapItemRenderer(par1Minecraft.gameSettings, par1Minecraft.getTextureManager()); this.mapItemRenderer = new MapItemRenderer(par1Minecraft.gameSettings, par1Minecraft.getTextureManager());
} }
@ -44,7 +44,7 @@
- if (par2ItemStack.getItemSpriteNumber() == 0 && par2ItemStack.itemID < Block.blocksList.length && Block.blocksList[par2ItemStack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) - if (par2ItemStack.getItemSpriteNumber() == 0 && par2ItemStack.itemID < Block.blocksList.length && Block.blocksList[par2ItemStack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
+ Block block = null; + Block block = null;
+ if (par2ItemStack.getItem() instanceof ItemBlock && par2ItemStack.itemID < Block.blocksList.length) + if (par2ItemStack.getItem() instanceof ItemBlock && par2ItemStack.itemID < Block.blocksList.length)
+ { {
+ block = Block.blocksList[par2ItemStack.itemID]; + block = Block.blocksList[par2ItemStack.itemID];
+ } + }
+ +
@ -55,9 +55,10 @@
+ ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksInstance, par1EntityLivingBase, par2ItemStack); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksInstance, par1EntityLivingBase, par2ItemStack);
+ } + }
+ else if (block != null && par2ItemStack.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) + else if (block != null && par2ItemStack.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
{ + {
texturemanager.bindTexture(texturemanager.getResourceLocation(0)); texturemanager.bindTexture(texturemanager.getResourceLocation(0));
this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F); this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
}
@@ -94,7 +120,7 @@ @@ -94,7 +120,7 @@
GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
renderItemIn2D(tessellator, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F); renderItemIn2D(tessellator, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
@ -76,32 +77,31 @@
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();
f12 = 0.8F; f12 = 0.8F;
@@ -333,11 +359,20 @@ @@ -333,12 +359,21 @@
tessellator.addVertexWithUV((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D); tessellator.addVertexWithUV((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D);
tessellator.addVertexWithUV((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D); tessellator.addVertexWithUV((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D);
tessellator.draw(); tessellator.draw();
- MapData mapdata = Item.map.getMapData(itemstack, this.mc.theWorld); - MapData mapdata = Item.map.getMapData(itemstack, this.mc.theWorld);
-
- if (mapdata != null) - if (mapdata != null)
- {
- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.getTextureManager(), mapdata);
+
+ IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP); + IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP);
+ MapData mapdata = ((ItemMap)itemstack.getItem()).getMapData(itemstack, this.mc.theWorld); + MapData mapdata = ((ItemMap)itemstack.getItem()).getMapData(itemstack, this.mc.theWorld);
+ +
+ if (custom == null) + if (custom == null)
+ { {
- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.getTextureManager(), mapdata);
+ if (mapdata != null) + if (mapdata != null)
+ { + {
+ this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.getTextureManager(), mapdata); + this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.getTextureManager(), mapdata);
+ } + }
+ } }
+ else + else
+ { + {
+ custom.renderItem(FIRST_PERSON_MAP, itemstack, mc.thePlayer, mc.getTextureManager(), mapdata); + custom.renderItem(FIRST_PERSON_MAP, itemstack, mc.thePlayer, mc.getTextureManager(), mapdata);
} + }
GL11.glPopMatrix(); GL11.glPopMatrix();
}
@@ -439,17 +474,20 @@ @@ -439,17 +474,20 @@
if (itemstack.getItem().requiresMultipleRenderPasses()) if (itemstack.getItem().requiresMultipleRenderPasses())

View file

@ -1,16 +1,16 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java --- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java +++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
@@ -25,6 +25,10 @@ @@ -26,6 +26,10 @@
* True if the renderer supports multitextures and the OpenGL version != 1.3
*/ */
private static boolean useMultitextureARB; private static boolean useMultitextureARB;
+
+ /* Stores the last values sent into setLightmapTextureCoords */ + /* Stores the last values sent into setLightmapTextureCoords */
+ public static float lastBrightnessX = 0.0f; + public static float lastBrightnessX = 0.0f;
+ public static float lastBrightnessY = 0.0f; + public static float lastBrightnessY = 0.0f;
+
/** /**
* Initializes the texture constants to be used when rendering lightmap values * Initializes the texture constants to be used when rendering lightmap values
*/
@@ -88,5 +92,11 @@ @@ -88,5 +92,11 @@
{ {
GL13.glMultiTexCoord2f(par0, par1, par2); GL13.glMultiTexCoord2f(par0, par1, par2);

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/RenderBlocks.java --- ../src-base/minecraft/net/minecraft/client/renderer/RenderBlocks.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/RenderBlocks.java +++ ../src-work/minecraft/net/minecraft/client/renderer/RenderBlocks.java
@@ -45,6 +45,8 @@ @@ -45,6 +45,8 @@
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/RenderGlobal.java --- ../src-base/minecraft/net/minecraft/client/renderer/RenderGlobal.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/RenderGlobal.java +++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java
@@ -68,6 +68,9 @@ @@ -68,6 +68,9 @@
import org.lwjgl.opengl.ARBOcclusionQuery; import org.lwjgl.opengl.ARBOcclusionQuery;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -103,15 +103,15 @@
if (this.mc.theWorld.provider.isSurfaceWorld()) if (this.mc.theWorld.provider.isSurfaceWorld())
{ {
if (this.mc.gameSettings.fancyGraphics) if (this.mc.gameSettings.fancyGraphics)
@@ -1595,6 +1628,11 @@ @@ -1596,6 +1629,11 @@
}
public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityPlayer par2EntityPlayer, float par3) public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityPlayer par2EntityPlayer, float par3)
+ { {
+ drawBlockDamageTexture(par1Tessellator, (EntityLivingBase)par2EntityPlayer, par3); + drawBlockDamageTexture(par1Tessellator, (EntityLivingBase)par2EntityPlayer, par3);
+ } + }
+ +
+ public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityLivingBase par2EntityPlayer, float par3) + public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityLivingBase par2EntityPlayer, float par3)
{ + {
double d0 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3; double d0 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3;
double d1 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3; double d1 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3;
double d2 = par2EntityPlayer.lastTickPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.lastTickPosZ) * (double)par3;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/Tessellator.java --- ../src-base/minecraft/net/minecraft/client/renderer/Tessellator.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/Tessellator.java +++ ../src-work/minecraft/net/minecraft/client/renderer/Tessellator.java
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
@ -75,11 +75,6 @@
- this.shortBuffer = this.byteBuffer.asShortBuffer(); - this.shortBuffer = this.byteBuffer.asShortBuffer();
- this.rawBuffer = new int[par1]; - this.rawBuffer = new int[par1];
- this.useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object; - this.useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object;
-
- if (this.useVBO)
- {
- this.vertexBuffers = GLAllocation.createDirectIntBuffer(this.vboCount);
- ARBVertexBufferObject.glGenBuffersARB(this.vertexBuffers);
+ } + }
+ +
+ public Tessellator() + public Tessellator()
@ -90,9 +85,12 @@
+ { + {
+ instance.defaultTexture = true; + instance.defaultTexture = true;
+ useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object; + useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object;
+
- if (this.useVBO)
+ if (useVBO) + if (useVBO)
+ { {
- this.vertexBuffers = GLAllocation.createDirectIntBuffer(this.vboCount);
- ARBVertexBufferObject.glGenBuffersARB(this.vertexBuffers);
+ vertexBuffers = GLAllocation.createDirectIntBuffer(vboCount); + vertexBuffers = GLAllocation.createDirectIntBuffer(vboCount);
+ ARBVertexBufferObject.glGenBuffersARB(vertexBuffers); + ARBVertexBufferObject.glGenBuffersARB(vertexBuffers);
} }
@ -103,10 +101,9 @@
this.isDrawing = false; this.isDrawing = false;
- if (this.vertexCount > 0) - if (this.vertexCount > 0)
- {
+ int offs = 0; + int offs = 0;
+ while (offs < vertexCount) + while (offs < vertexCount)
+ { {
+ int vtc = 0; + int vtc = 0;
+ if (drawMode == 7 && convertQuadsToTriangles) + if (drawMode == 7 && convertQuadsToTriangles)
+ { + {
@ -140,19 +137,19 @@
} }
GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
@@ -278,6 +300,12 @@ @@ -280,6 +302,12 @@
{
GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
} }
+ } }
+
+ if (rawBufferSize > 0x20000 && rawBufferIndex < (rawBufferSize << 3)) + if (rawBufferSize > 0x20000 && rawBufferIndex < (rawBufferSize << 3))
+ { + {
+ rawBufferSize = 0; + rawBufferSize = 0;
+ rawBuffer = null; + rawBuffer = null;
} + }
+
int i = this.rawBufferIndex * 4; int i = this.rawBufferIndex * 4;
this.reset();
return i;
@@ -442,6 +470,19 @@ @@ -442,6 +470,19 @@
*/ */
public void addVertex(double par1, double par3, double par5) public void addVertex(double par1, double par3, double par5)

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/WorldRenderer.java --- ../src-base/minecraft/net/minecraft/client/renderer/WorldRenderer.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/WorldRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/WorldRenderer.java
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
/** Reference to the World object. */ /** Reference to the World object. */
public World worldObj; public World worldObj;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java
@@ -14,9 +14,15 @@ @@ -14,9 +14,15 @@
import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -85,12 +85,11 @@
float f1 = 1.0F; float f1 = 1.0F;
- if (itemarmor.getArmorMaterial() == EnumArmorMaterial.CLOTH) - if (itemarmor.getArmorMaterial() == EnumArmorMaterial.CLOTH)
- {
- int j = itemarmor.getColor(itemstack);
+ //Move out of if to allow for more then just CLOTH to have color + //Move out of if to allow for more then just CLOTH to have color
+ int j = itemarmor.getColor(itemstack); + int j = itemarmor.getColor(itemstack);
+ if (j != -1) + if (j != -1)
+ { {
- int j = itemarmor.getColor(itemstack);
float f2 = (float)(j >> 16 & 255) / 255.0F; float f2 = (float)(j >> 16 & 255) / 255.0F;
float f3 = (float)(j >> 8 & 255) / 255.0F; float f3 = (float)(j >> 8 & 255) / 255.0F;
float f4 = (float)(j & 255) / 255.0F; float f4 = (float)(j & 255) / 255.0F;
@ -108,13 +107,12 @@
this.modelBipedMain.bipedHead.postRender(0.0625F); this.modelBipedMain.bipedHead.postRender(0.0625F);
- if (itemstack1.getItem().itemID < 256) - if (itemstack1.getItem().itemID < 256)
- {
- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType()))
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED);
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D)); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D));
+ +
+ if (itemstack1.getItem() instanceof ItemBlock) + if (itemstack1.getItem() instanceof ItemBlock)
+ { {
- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType()))
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType())) + if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType()))
{ {
f2 = 0.625F; f2 = 0.625F;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderItem.java --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderItem.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderItem.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderItem.java
@@ -21,6 +21,8 @@ @@ -21,6 +21,8 @@
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
@ -9,7 +9,7 @@
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderItem extends Render public class RenderItem extends Render
{ {
@@ -53,29 +55,9 @@ @@ -53,30 +55,10 @@
if (itemstack.getItem() != null) if (itemstack.getItem() != null)
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();
@ -17,7 +17,8 @@
+ float f2 = shouldBob() ? MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F; + float f2 = shouldBob() ? MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F;
float f3 = (((float)par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI); float f3 = (((float)par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI);
- byte b0 = 1; - byte b0 = 1;
- + byte b0 = getMiniBlockCount(itemstack);
- if (par1EntityItem.getEntityItem().stackSize > 1) - if (par1EntityItem.getEntityItem().stackSize > 1)
- { - {
- b0 = 2; - b0 = 2;
@ -37,20 +38,19 @@
- { - {
- b0 = 5; - b0 = 5;
- } - }
+ byte b0 = getMiniBlockCount(itemstack); -
GL11.glTranslatef((float)par2, (float)par4 + f2, (float)par6); GL11.glTranslatef((float)par2, (float)par4 + f2, (float)par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL12.GL_RESCALE_NORMAL);
float f4;
@@ -84,9 +66,18 @@ @@ -84,9 +66,18 @@
float f6; float f6;
int i; int i;
- if (itemstack.getItemSpriteNumber() == 0 && itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) - if (itemstack.getItemSpriteNumber() == 0 && itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
- {
- Block block = Block.blocksList[itemstack.itemID];
+ Block block = null; + Block block = null;
+ if (itemstack.itemID < Block.blocksList.length) + if (itemstack.itemID < Block.blocksList.length)
+ { {
- Block block = Block.blocksList[itemstack.itemID];
+ block = Block.blocksList[itemstack.itemID]; + block = Block.blocksList[itemstack.itemID];
+ } + }
+ +
@ -99,23 +99,24 @@
} }
} }
} }
@@ -204,6 +195,10 @@ @@ -205,6 +196,10 @@
* Renders a dropped item
*/ */
private void renderDroppedItem(EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7) private void renderDroppedItem(EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7)
+ { {
+ renderDroppedItem(par1EntityItem, par2Icon, par3, par4, par5, par6, par7, 0); + renderDroppedItem(par1EntityItem, par2Icon, par3, par4, par5, par6, par7, 0);
+ } + }
+ private void renderDroppedItem(EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass) + private void renderDroppedItem(EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass)
{ + {
Tessellator tessellator = Tessellator.instance; Tessellator tessellator = Tessellator.instance;
if (par2Icon == null)
@@ -240,32 +235,26 @@ @@ -240,32 +235,26 @@
f11 = 0.021875F; f11 = 0.021875F;
ItemStack itemstack = par1EntityItem.getEntityItem(); ItemStack itemstack = par1EntityItem.getEntityItem();
int j = itemstack.stackSize; int j = itemstack.stackSize;
- byte b0; - byte b0;
- + byte b0 = getMiniItemCount(itemstack);
- if (j < 2) - if (j < 2)
- { - {
- b0 = 1; - b0 = 1;
@ -132,15 +133,12 @@
- { - {
- b0 = 4; - b0 = 4;
- } - }
+ byte b0 = getMiniItemCount(itemstack); -
GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float)b0 / 2.0F)); GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float)b0 / 2.0F));
for (int k = 0; k < b0; ++k) for (int k = 0; k < b0; ++k)
{ {
- GL11.glTranslatef(0.0F, 0.0F, f12 + f11); - GL11.glTranslatef(0.0F, 0.0F, f12 + f11);
-
- if (itemstack.getItemSpriteNumber() == 0 && Block.blocksList[itemstack.itemID] != null)
+ // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug... + // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
+ if (k > 0 && shouldSpreadItems()) + if (k > 0 && shouldSpreadItems())
+ { + {
@ -153,7 +151,8 @@
+ { + {
+ GL11.glTranslatef(0f, 0f, f12 + f11); + GL11.glTranslatef(0f, 0f, f12 + f11);
+ } + }
+
- if (itemstack.getItemSpriteNumber() == 0 && Block.blocksList[itemstack.itemID] != null)
+ if (itemstack.getItemSpriteNumber() == 0) + if (itemstack.getItemSpriteNumber() == 0)
{ {
this.bindTexture(TextureMap.locationBlocksTexture); this.bindTexture(TextureMap.locationBlocksTexture);
@ -196,13 +195,11 @@
{ {
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
- par2TextureManager.bindTexture(TextureMap.locationItemsTexture); - par2TextureManager.bindTexture(TextureMap.locationItemsTexture);
-
- for (int j1 = 0; j1 <= 1; ++j1) - for (int j1 = 0; j1 <= 1; ++j1)
- {
- Icon icon = Item.itemsList[k].getIconFromDamageForRenderPass(l, j1);
+
+ for (int j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1) + for (int j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1)
+ { {
- Icon icon = Item.itemsList[k].getIconFromDamageForRenderPass(l, j1);
+ par2TextureManager.bindTexture(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); + par2TextureManager.bindTexture(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
+ Icon icon = Item.itemsList[k].getIcon(par3ItemStack, j1); + Icon icon = Item.itemsList[k].getIcon(par3ItemStack, j1);
int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1); int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1);
@ -260,12 +257,11 @@
if (par3ItemStack != null) if (par3ItemStack != null)
{ {
- this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5); - this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
-
+ if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float)par4, (float)par5)) + if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float)par4, (float)par5))
+ { + {
+ this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true); + this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true);
+ } + }
+
+ /* Modders must handle this themselves if they use custom renderers! + /* Modders must handle this themselves if they use custom renderers!
if (par3ItemStack.hasEffect()) if (par3ItemStack.hasEffect())
{ {

View file

@ -1,17 +1,16 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
@@ -223,12 +223,14 @@ @@ -223,12 +223,14 @@
if (par4EntityLivingBase.isPlayerSleeping()) if (par4EntityLivingBase.isPlayerSleeping())
{ {
- int i = par1World.getBlockId(MathHelper.floor_double(par4EntityLivingBase.posX), MathHelper.floor_double(par4EntityLivingBase.posY), MathHelper.floor_double(par4EntityLivingBase.posZ)); - int i = par1World.getBlockId(MathHelper.floor_double(par4EntityLivingBase.posX), MathHelper.floor_double(par4EntityLivingBase.posY), MathHelper.floor_double(par4EntityLivingBase.posZ));
-
- if (i == Block.bed.blockID)
+ int x = MathHelper.floor_double(par4EntityLivingBase.posX); + int x = MathHelper.floor_double(par4EntityLivingBase.posX);
+ int y = MathHelper.floor_double(par4EntityLivingBase.posY); + int y = MathHelper.floor_double(par4EntityLivingBase.posY);
+ int z = MathHelper.floor_double(par4EntityLivingBase.posZ); + int z = MathHelper.floor_double(par4EntityLivingBase.posZ);
+ Block block = Block.blocksList[par1World.getBlockId(x, y, z)]; + Block block = Block.blocksList[par1World.getBlockId(x, y, z)];
+
- if (i == Block.bed.blockID)
+ if (block != null && block.isBed(par1World, x, y, z, par4EntityLivingBase)) + if (block != null && block.isBed(par1World, x, y, z, par4EntityLivingBase))
{ {
- int j = par1World.getBlockMetadata(MathHelper.floor_double(par4EntityLivingBase.posX), MathHelper.floor_double(par4EntityLivingBase.posY), MathHelper.floor_double(par4EntityLivingBase.posZ)); - int j = par1World.getBlockMetadata(MathHelper.floor_double(par4EntityLivingBase.posX), MathHelper.floor_double(par4EntityLivingBase.posY), MathHelper.floor_double(par4EntityLivingBase.posZ));

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java
@@ -15,13 +15,22 @@ @@ -15,13 +15,22 @@
import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -58,12 +58,11 @@
float f1 = 1.0F; float f1 = 1.0F;
- if (itemarmor.getArmorMaterial() == EnumArmorMaterial.CLOTH) - if (itemarmor.getArmorMaterial() == EnumArmorMaterial.CLOTH)
- {
- int j = itemarmor.getColor(itemstack);
+ //Move outside if to allow for more then just CLOTH + //Move outside if to allow for more then just CLOTH
+ int j = itemarmor.getColor(itemstack); + int j = itemarmor.getColor(itemstack);
+ if (j != -1) + if (j != -1)
+ { {
- int j = itemarmor.getColor(itemstack);
float f2 = (float)(j >> 16 & 255) / 255.0F; float f2 = (float)(j >> 16 & 255) / 255.0F;
float f3 = (float)(j >> 8 & 255) / 255.0F; float f3 = (float)(j >> 8 & 255) / 255.0F;
float f4 = (float)(j & 255) / 255.0F; float f4 = (float)(j & 255) / 255.0F;
@ -116,10 +115,9 @@
float f2; float f2;
- if (itemstack.getItem().itemID < 256) - if (itemstack.getItem().itemID < 256)
- {
- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
+ if (itemstack != null && itemstack.getItem() instanceof ItemBlock) + if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
+ { {
- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D)); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));
+ +

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java
@@ -8,9 +8,14 @@ @@ -8,9 +8,14 @@
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java
@@ -18,6 +18,9 @@ @@ -18,6 +18,9 @@
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/texture/Stitcher.java --- ../src-base/minecraft/net/minecraft/client/renderer/texture/Stitcher.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/texture/Stitcher.java +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/Stitcher.java
@@ -187,7 +187,7 @@ @@ -187,7 +187,7 @@
if (flag4 ^ flag5) if (flag4 ^ flag5)

View file

@ -1,5 +1,5 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java --- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
@@ -11,9 +11,11 @@ @@ -11,9 +11,11 @@
import java.util.List; import java.util.List;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;

Some files were not shown because too many files have changed in this diff Show more