Compare commits

...
23 Commits
Author SHA1 Message Date
Raven Szewczyk b1388aeb80 Fix Robes of the Stratosphere rendering memory leak (#34)
* Update buildscript and dependencies

* Fix wildcard imports

* Fix Robes of the Stratosphere rendering memory leak
2023-10-09 22:00:13 +01:00
Martin Robertz d922bfbdbf update deps 2023-09-10 22:42:12 +02:00
Jason Mitchell 7c2c6b7966 Add back the randomly aging (non 0 meta) fires. (#33) 2023-09-10 11:11:57 -07:00
Jason Mitchell acbc864d76 Infused fire (#31)
* BS + SA

* Intellij Cleanups

* Add missing overrides

* Cleanup fire code

* Less allocations

* Get rid of BlockTuple -> Far fewer allocations (It was only used for Ordo Fire which isn't very useful for NH)
Neuter Ordo fire (will be reworked once we figure out what it should do)
Mixin to fix fire rendering on water -- call the subclass's canCatchFire instead of the base class
Properly tether the fire spread to 15 blocks from the source, which never burns out.

* rm

* Spotless
2023-09-10 07:17:59 -07:00
Martin Robertz c762ad9915 Merge pull request #32 from wohaopa/master
Fix potential unsaves
2023-07-17 08:22:22 +02:00
初夏同学 f8fb442525 Fix potential unsaves 2023-07-16 00:29:26 +08:00
Martin Robertz 3bb2edda24 Merge pull request #30 from bearsdotzone/master
Bug: Aspect Crops will never yield a certain valid drop
2023-04-25 19:49:01 +02:00
abneyonline 587027c24e updated dependencies 2023-04-25 11:18:04 -05:00
Bears Dot Zone a8259fe5cc Fix off by one when generating aspect crop loot. 2023-04-25 04:22:49 +00:00
Connor-Colenso 2e906240da Merge pull request #29 from GTNewHorizons/fixarrowexploit
should fix arrow exploits for gt materials
2023-03-26 19:18:28 +01:00
chochem d79f97397a should fix arrow exploits 2023-03-26 17:57:11 +01:00
Martin Robertz 613094698d Merge pull request #28 from Zereff06/fix_fire_resistance_level
fix-> fire Resistance level
2023-02-12 22:16:01 +01:00
Zereff06 044e31d3c7 fix-> fire Resistance level 2023-02-12 20:20:41 +02:00
Raven Szewczyk 0bc9b741e3 [ci skip] upgraded build system 2023-01-31 09:56:35 +00:00
Jason Mitchell 08d1d924a0 [ci skip] Add git-blame-ignore-revs for spotlessApply 2023-01-28 19:02:01 -08:00
Jason Mitchell 481ec1cf32 [ci skip] spotlessApply with the new settings 2023-01-28 19:02:01 -08:00
Jason Mitchell 80a42e74a1 [ci skip] Update buildscript to RetroFuturaGradle 2023-01-28 19:00:46 -08:00
Martin Robertz 88a211f55e Merge pull request #27 from GTNewHorizons/keybinds
keybind
2023-01-27 20:18:49 +01:00
Alexdoru f872ef50b1 unbind keybind by default 2023-01-27 19:31:22 +01:00
Martin Robertz 508457c10a Merge pull request #26 from GTNewHorizons/java12
Update buildscript, fix potions crash on Java 12+
2023-01-24 17:06:18 +01:00
Raven Szewczyk 2f5c71014a Reorder field accesses to work 2023-01-24 10:38:44 +00:00
Raven Szewczyk be56bf2675 SpotlessApply 2023-01-24 10:18:40 +00:00
Raven Szewczyk bd8e2d9b69 Update buildscript, fix potions crash on Java 12+ 2023-01-24 10:18:25 +00:00
345 changed files with 9810 additions and 7247 deletions

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
# Ignore spotlessApply reformat
481ec1cf3284555e0df0eb5cfcf5cd0b84461093
+44
View File
@@ -0,0 +1,44 @@
* text eol=lf
*.[jJ][aA][rR] binary
*.[pP][nN][gG] binary
*.[jJ][pP][gG] binary
*.[jJ][pP][eE][gG] binary
*.[gG][iI][fF] binary
*.[tT][iI][fF] binary
*.[tT][iI][fF][fF] binary
*.[iI][cC][oO] binary
*.[sS][vV][gG] text
*.[eE][pP][sS] binary
*.[xX][cC][fF] binary
*.[kK][aA][rR] binary
*.[mM]4[aA] binary
*.[mM][iI][dD] binary
*.[mM][iI][dD][iI] binary
*.[mM][pP]3 binary
*.[oO][gG][gG] binary
*.[rR][aA] binary
*.7[zZ] binary
*.[gG][zZ] binary
*.[tT][aA][rR] binary
*.[tT][gG][zZ] binary
*.[zZ][iI][pP] binary
*.[tT][cC][nN] binary
*.[sS][oO] binary
*.[dD][lL][lL] binary
*.[dD][yY][lL][iI][bB] binary
*.[pP][sS][dD] binary
*.[tT][tT][fF] binary
*.[oO][tT][fF] binary
*.[pP][aA][tT][cC][hH] -text
*.[bB][aA][tT] text eol=crlf
*.[cC][mM][dD] text eol=crlf
*.[pP][sS]1 text eol=crlf
*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
+1 -1
View File
@@ -26,7 +26,7 @@ whitelist.json
*.iml
*.ipr
*.iws
src/main/resources/mixins.*.json
src/main/resources/mixins.*([!.]).json
*.bat
*.DS_Store
!gradlew.bat
+1305 -412
View File
File diff suppressed because it is too large. Load diff
+12 -12
View File
@@ -1,20 +1,20 @@
// Add your dependencies here
dependencies {
compile('com.github.GTNewHorizons:Baubles:1.0.1.14:dev')
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-76-GTNH:api')
api('com.github.GTNewHorizons:Baubles:1.0.1.16:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-260-GTNH:api')
compile('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.github.GTNewHorizons:Botania:1.9.1-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderCore:0.2.6:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderIO:2.3.1.29:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderStorage:1.4.11:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:waila:1.5.19:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.9.0.13-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.2.7:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.7.5.23-GTNH:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:Botania:1.10.0-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderCore:0.2.17:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderIO:2.5.2:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderStorage:1.4.12:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:waila:1.6.0:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.10.5-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.3.4:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:CodeChickenLib:1.1.8:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.17-GTNH:api') {transitive=false}
compileOnly('curse.maven:computercraft-67504:2269339')
compileOnly('curse.maven:cofh-lib-220333:2388748')
+4 -2
View File
@@ -42,11 +42,13 @@ apiPackage = api
accessTransformersFile = ThaumicTinkerer_at.cfg
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
usesMixins = true
# Adds some debug arguments like verbose output and export
usesMixinDebug = true
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage =
mixinsPackage = mixins
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
Binary file not shown.
+2 -1
View File
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+173 -116
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,78 +17,110 @@
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# 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
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -97,7 +129,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
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
@@ -105,84 +137,109 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "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 or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# 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" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
Vendored
+15 -23
View File
@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,10 +25,14 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@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="-Xmx64m" "-Xms64m"
@@ -37,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -51,7 +55,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -61,38 +65,26 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_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=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 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
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
-23
View File
@@ -1,27 +1,4 @@
// Add any additional repositories for your dependencies here
repositories {
maven {
name 'GTNH Maven'
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
allowInsecureProtocol
}
maven {
name 'ic2'
url 'https://maven.ic2.player.to/'
metadataSources {
mavenPom()
artifact()
}
}
maven {
url 'https://cursemaven.com'
content {
includeGroup "curse.maven"
}
}
maven {
url 'https://jitpack.io'
}
}
+28
View File
@@ -0,0 +1,28 @@
pluginManagement {
repositories {
maven {
// RetroFuturaGradle
name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
mavenContent {
includeGroup("com.gtnewhorizons.retrofuturagradle")
}
}
gradlePluginPortal()
mavenCentral()
mavenLocal()
}
}
plugins {
id 'com.diffplug.blowdryerSetup' version '1.6.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
}
blowdryerSetup {
repoSubfolder 'gtnhShared'
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
//devLocal '.' // Use this when testing config updates locally
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [9 Sep 2013, 01:21:51 (GMT)]
@@ -15,5 +12,4 @@
package thaumic.tinkerer.api;
public interface INoRemoveEnchant {
}
@@ -4,6 +4,7 @@ package thaumic.tinkerer.api;
* Created by Katrina on 16/04/14.
*/
public class InterModCommsOperations {
public static final String ADD_RESEARCH_BLACKLIST = "AddResearchBlacklist";
public static final String ADD_CC_BLACKLIST = "AddCCBlacklist";
}
@@ -1,23 +1,21 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [13 Sep 2013, 15:00:40 (GMT)]
*/
package thaumic.tinkerer.client.core.handler;
import net.minecraft.client.Minecraft;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.ReflectionHelper;
import net.minecraft.client.Minecraft;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.client.gui.GuiResearchRecipe;
import thaumic.tinkerer.client.core.handler.kami.ToolModeHUDHandler;
@@ -33,9 +31,12 @@ public class ClientTickHandler {
public void tickEnd(TickEvent event) {
if (event.phase == TickEvent.Phase.END) {
Minecraft mc = ClientHelper.minecraft();
if (mc.currentScreen != null && mc.currentScreen instanceof GuiResearchRecipe && !(mc.currentScreen instanceof GuiResearchPeripheral)) {
ResearchItem research = ReflectionHelper.getPrivateValue(GuiResearchRecipe.class, (GuiResearchRecipe) mc.currentScreen, 9);
if (research.key.equals(LibResearch.KEY_PERIPHERALS) || research.key.equals(LibResearch.KEY_GOLEMCONNECTOR))
if (mc.currentScreen != null && mc.currentScreen instanceof GuiResearchRecipe
&& !(mc.currentScreen instanceof GuiResearchPeripheral)) {
ResearchItem research = ReflectionHelper
.getPrivateValue(GuiResearchRecipe.class, (GuiResearchRecipe) mc.currentScreen, 9);
if (research.key.equals(LibResearch.KEY_PERIPHERALS)
|| research.key.equals(LibResearch.KEY_GOLEMCONNECTOR))
mc.displayGuiScreen(new GuiResearchPeripheral(research));
}
@@ -44,5 +45,4 @@ public class ClientTickHandler {
++elapsedTicks;
}
}
}
@@ -1,14 +1,16 @@
package thaumic.tinkerer.client.core.handler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
import thaumic.tinkerer.client.core.handler.kami.KamiArmorClientHandler;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.item.kami.armor.ItemIchorclothArmorAdv;
@@ -19,7 +21,7 @@ import thaumic.tinkerer.common.item.kami.armor.ItemIchorclothArmorAdv;
@SideOnly(Side.CLIENT)
public class GemArmorKeyHandler {
static KeyBinding SpecialAbility = new KeyBinding("ttmisc.toggleArmor", Keyboard.KEY_U, "ttmisc.keyCategory");
static KeyBinding SpecialAbility = new KeyBinding("ttmisc.toggleArmor", Keyboard.KEY_NONE, "ttmisc.keyCategory");
public GemArmorKeyHandler() {
FMLCommonHandler.instance().bus().register(this);
@@ -29,10 +31,20 @@ public class GemArmorKeyHandler {
@SubscribeEvent
public void keyUp(InputEvent.KeyInputEvent event) {
if (SpecialAbility.isPressed()) {
if ((Minecraft.getMinecraft().thePlayer.getCurrentArmor(0) != null && Minecraft.getMinecraft().thePlayer.getCurrentArmor(0).getItem() instanceof ItemIchorclothArmorAdv) || (Minecraft.getMinecraft().thePlayer.getCurrentArmor(1) != null && Minecraft.getMinecraft().thePlayer.getCurrentArmor(1).getItem() instanceof ItemIchorclothArmorAdv) || (Minecraft.getMinecraft().thePlayer.getCurrentArmor(2) != null && Minecraft.getMinecraft().thePlayer.getCurrentArmor(2).getItem() instanceof ItemIchorclothArmorAdv) || (Minecraft.getMinecraft().thePlayer.getCurrentArmor(3) != null && Minecraft.getMinecraft().thePlayer.getCurrentArmor(3).getItem() instanceof ItemIchorclothArmorAdv)) {
KamiArmorClientHandler.SetStatus(!ThaumicTinkerer.proxy.armorStatus(ThaumicTinkerer.proxy.getClientPlayer()));
if ((Minecraft.getMinecraft().thePlayer.getCurrentArmor(0) != null && Minecraft.getMinecraft().thePlayer
.getCurrentArmor(0).getItem() instanceof ItemIchorclothArmorAdv)
|| (Minecraft.getMinecraft().thePlayer.getCurrentArmor(1) != null
&& Minecraft.getMinecraft().thePlayer.getCurrentArmor(1)
.getItem() instanceof ItemIchorclothArmorAdv)
|| (Minecraft.getMinecraft().thePlayer.getCurrentArmor(2) != null
&& Minecraft.getMinecraft().thePlayer.getCurrentArmor(2)
.getItem() instanceof ItemIchorclothArmorAdv)
|| (Minecraft.getMinecraft().thePlayer.getCurrentArmor(3) != null
&& Minecraft.getMinecraft().thePlayer.getCurrentArmor(3)
.getItem() instanceof ItemIchorclothArmorAdv)) {
KamiArmorClientHandler
.SetStatus(!ThaumicTinkerer.proxy.armorStatus(ThaumicTinkerer.proxy.getClientPlayer()));
}
}
}
}
@@ -1,20 +1,16 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [10 Sep 2013, 12:16:36 (GMT)]
*/
package thaumic.tinkerer.client.core.handler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.entity.RenderItem;
@@ -26,6 +22,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import thaumcraft.api.wands.ItemFocusBasic;
import thaumcraft.common.config.Config;
import thaumcraft.common.items.wands.ItemWandCasting;
@@ -73,10 +71,20 @@ public final class HUDHandler {
}
if (new ItemStack(((ItemBlock) pickedBlock.getItem()).field_150939_a).getItem() != null)
renderItem.renderItemIntoGUI(font, ClientHelper.minecraft().renderEngine, new ItemStack(((ItemBlock) pickedBlock.getItem()).field_150939_a), xpos, ypos);
renderItem.renderItemIntoGUI(
font,
ClientHelper.minecraft().renderEngine,
new ItemStack(((ItemBlock) pickedBlock.getItem()).field_150939_a),
xpos,
ypos);
else {
if (((ItemBlock) pickedBlock.getItem()).field_150939_a == Blocks.reeds)
renderItem.renderItemIntoGUI(font, ClientHelper.minecraft().renderEngine, new ItemStack(Items.reeds), xpos, ypos);
renderItem.renderItemIntoGUI(
font,
ClientHelper.minecraft().renderEngine,
new ItemStack(Items.reeds),
xpos,
ypos);
}
font.setUnicodeFlag(unicode);
}
@@ -84,5 +92,4 @@ public final class HUDHandler {
}
}
}
}
@@ -1,7 +1,8 @@
package thaumic.tinkerer.client.core.handler.kami;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.util.StatCollector;
import cpw.mods.fml.client.FMLClientHandler;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.network.packet.kami.PacketToggleArmor;
@@ -14,10 +15,8 @@ public class KamiArmorClientHandler {
public static void SetStatus(boolean status) {
if (FMLClientHandler.instance().getClient().currentScreen == null) {
if (status)
ToolModeHUDHandler.setTooltip(StatCollector.translateToLocal("ttmisc.enableAllArmor"));
else
ToolModeHUDHandler.setTooltip(StatCollector.translateToLocal("ttmisc.disableAllArmor"));
if (status) ToolModeHUDHandler.setTooltip(StatCollector.translateToLocal("ttmisc.enableAllArmor"));
else ToolModeHUDHandler.setTooltip(StatCollector.translateToLocal("ttmisc.disableAllArmor"));
ArmorEnabled = status;
ThaumicTinkerer.netHandler.sendToServer(new PacketToggleArmor(status));
}
@@ -1,6 +1,7 @@
package thaumic.tinkerer.client.core.handler.kami;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks;
@@ -12,12 +13,13 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
import java.util.List;
public final class PlacementMirrorPredictionRenderer {
RenderBlocks blockRender = new RenderBlocks();
@@ -29,7 +31,10 @@ public final class PlacementMirrorPredictionRenderer {
List<EntityPlayer> playerEntities = world.playerEntities;
for (EntityPlayer player : playerEntities) {
ItemStack currentStack = player.getCurrentEquippedItem();
if (currentStack != null && currentStack.getItem() == ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class) && ItemPlacementMirror.getBlock(currentStack) != Blocks.air) {
if (currentStack != null
&& currentStack.getItem()
== ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class)
&& ItemPlacementMirror.getBlock(currentStack) != Blocks.air) {
renderPlayerLook(player, currentStack);
}
}
@@ -38,7 +43,10 @@ public final class PlacementMirrorPredictionRenderer {
private void renderPlayerLook(EntityPlayer player, ItemStack stack) {
ChunkCoordinates[] coords = ItemPlacementMirror.getBlocksToPlace(stack, player);
if (ItemPlacementMirror.hasBlocks(stack, player, coords)) {
ItemStack block = new ItemStack(ItemPlacementMirror.getBlock(stack), 1, ItemPlacementMirror.getBlockMeta(stack));
ItemStack block = new ItemStack(
ItemPlacementMirror.getBlock(stack),
1,
ItemPlacementMirror.getBlockMeta(stack));
ChunkCoordinates lastCoords = new ChunkCoordinates(0, 0, 0);
GL11.glPushMatrix();
@@ -54,10 +62,12 @@ public final class PlacementMirrorPredictionRenderer {
}
private void renderBlockAt(ItemStack block, ChunkCoordinates pos, ChunkCoordinates last) {
if (block.getItem() == null)
return;
if (block.getItem() == null) return;
GL11.glPushMatrix();
GL11.glTranslated(pos.posX + 0.5 - RenderManager.renderPosX, pos.posY + 0.5 - RenderManager.renderPosY, pos.posZ + 0.5 - RenderManager.renderPosZ);
GL11.glTranslated(
pos.posX + 0.5 - RenderManager.renderPosX,
pos.posY + 0.5 - RenderManager.renderPosY,
pos.posZ + 0.5 - RenderManager.renderPosZ);
GL11.glColor4f(1F, 1F, 1F, 0.6F);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
@@ -66,5 +76,4 @@ public final class PlacementMirrorPredictionRenderer {
GL11.glPopMatrix();
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Dec 29, 2013, 9:35:38 PM (GMT)]
@@ -22,12 +19,13 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import thaumic.tinkerer.client.lib.LibResources;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.lib.LibResources;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
public final class SoulHeartClientHandler {
@@ -56,60 +54,38 @@ public final class SoulHeartClientHandler {
}
/*
* @SideOnly(Side.CLIENT)
* @SubscribeEvent public void renderHealthBar(RenderGameOverlayEvent event) { if (event.type == ElementType.FOOD &&
* clientPlayerHP > 0) { if (event instanceof RenderGameOverlayEvent.Post) { Minecraft mc =
* Minecraft.getMinecraft(); int x = event.resolution.getScaledWidth() / 2 + 10; int y =
* event.resolution.getScaledHeight() - 39; //GL11.glTranslatef(0F, 10F, 0F);
* mc.renderEngine.bindTexture(heartsResource); int it = 0; for (int i = 0; i < clientPlayerHP; i++) { boolean half
* = i == clientPlayerHP - 1 && clientPlayerHP % 2 != 0; if (half || i % 2 == 0) { renderHeart(x + it * 8, y,
* !half); it++; } } mc.renderEngine.bindTexture(iconsResource); } //GL11.glTranslatef(0F, -10F, 0F); } //if
* (event.type == ElementType.AIR && event instanceof RenderGameOverlayEvent.Post && clientPlayerHP > 0)
* //GL11.glTranslatef(0F, 10F, 0F); }
*/
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onDrawScreenPre(RenderGameOverlayEvent.Pre event) {
Minecraft mc = Minecraft.getMinecraft();
if (event.type == RenderGameOverlayEvent.ElementType.HEALTH) {
renderHUD(event.resolution, mc.thePlayer, null);
}
}
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void renderHealthBar(RenderGameOverlayEvent event) {
if (event.type == ElementType.FOOD && clientPlayerHP > 0) {
if (event instanceof RenderGameOverlayEvent.Post) {
Minecraft mc = Minecraft.getMinecraft();
public static void renderHUD(ScaledResolution resolution, EntityPlayer player, ItemStack stack) {
int x = event.resolution.getScaledWidth() / 2 + 10;
int y = event.resolution.getScaledHeight() - 39;
//GL11.glTranslatef(0F, 10F, 0F);
mc.renderEngine.bindTexture(heartsResource);
int it = 0;
for (int i = 0; i < clientPlayerHP; i++) {
boolean half = i == clientPlayerHP - 1 && clientPlayerHP % 2 != 0;
if (half || i % 2 == 0) {
renderHeart(x + it * 8, y, !half);
it++;
}
}
mc.renderEngine.bindTexture(iconsResource);
}
//GL11.glTranslatef(0F, -10F, 0F);
Minecraft mc = Minecraft.getMinecraft();
mc.renderEngine.bindTexture(heartsResource);
int x = resolution.getScaledWidth() / 2 + 10;
int y = resolution.getScaledHeight() - ConfigHandler.soulHeartHeight;
if (player.getAir() < 300) {
y = resolution.getScaledHeight() - (ConfigHandler.soulHeartHeight + 10);
}
//if (event.type == ElementType.AIR && event instanceof RenderGameOverlayEvent.Post && clientPlayerHP > 0)
//GL11.glTranslatef(0F, 10F, 0F);
}*/
@SubscribeEvent(priority=EventPriority.HIGHEST)
public void onDrawScreenPre(RenderGameOverlayEvent.Pre event)
{
Minecraft mc = Minecraft.getMinecraft();
if (event.type == RenderGameOverlayEvent.ElementType.HEALTH)
{
renderHUD(event.resolution, mc.thePlayer, null);
}
}
@SideOnly(Side.CLIENT)
public static void renderHUD(ScaledResolution resolution, EntityPlayer player, ItemStack stack)
{
Minecraft mc = Minecraft.getMinecraft();
mc.renderEngine.bindTexture(heartsResource);
int x = resolution.getScaledWidth() / 2 + 10;
int y = resolution.getScaledHeight() - ConfigHandler.soulHeartHeight;
if (player.getAir() < 300) {
y = resolution.getScaledHeight() - (ConfigHandler.soulHeartHeight + 10);
}
mc.renderEngine.bindTexture(heartsResource);
mc.renderEngine.bindTexture(heartsResource);
int it = 0;
for (int i = 0; i < clientPlayerHP; i++) {
boolean half = i == clientPlayerHP - 1 && clientPlayerHP % 2 != 0;
@@ -119,9 +95,6 @@ public final class SoulHeartClientHandler {
}
}
//GL11.glEnable(3008);
//GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(Gui.icons);
}
}
mc.renderEngine.bindTexture(Gui.icons);
}
}
@@ -1,32 +1,31 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Dec 29, 2013, 11:38:29 PM (GMT)]
*/
package thaumic.tinkerer.client.core.handler.kami;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.awt.Color;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.util.MathHelper;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import org.lwjgl.opengl.GL11;
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
import java.awt.*;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
public final class ToolModeHUDHandler {
@@ -42,14 +41,14 @@ public final class ToolModeHUDHandler {
@SideOnly(Side.CLIENT)
public static void clientTick() {
if (tooltipDisplayTicks > 0)
--tooltipDisplayTicks;
if (tooltipDisplayTicks > 0) --tooltipDisplayTicks;
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void drawDislocationFocusHUD(RenderGameOverlayEvent.Post event) {
if (event.type == ElementType.ALL && tooltipDisplayTicks > 0 && !MathHelper.stringNullOrLengthZero(currentTooltip)) {
if (event.type == ElementType.ALL && tooltipDisplayTicks > 0
&& !MathHelper.stringNullOrLengthZero(currentTooltip)) {
Minecraft mc = Minecraft.getMinecraft();
ScaledResolution var5 = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
int var6 = var5.getScaledWidth();
@@ -61,19 +60,18 @@ public final class ToolModeHUDHandler {
int opacity = (int) (tooltipDisplayTicks * 256.0F / 10.0F);
if (opacity > 160)
opacity = 160;
if (opacity > 160) opacity = 160;
if (opacity > 0) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
int color = Color.getHSBColor((float) Math.cos(ClientTickHandler.elapsedTicks / 250D), 0.6F, 1F).getRGB();
int color = Color.getHSBColor((float) Math.cos(ClientTickHandler.elapsedTicks / 250D), 0.6F, 1F)
.getRGB();
var8.drawStringWithShadow(currentTooltip, tooltipStartX, tooltipStartY, color + (opacity << 24));
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
}
}
}
@@ -1,28 +1,26 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [8 Sep 2013, 18:11:25 (GMT)]
*/
package thaumic.tinkerer.client.core.helper;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.Tessellator;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import java.util.List;
public final class ClientHelper {
public static Minecraft minecraft() {
@@ -53,14 +51,12 @@ public final class ClientHelper {
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
for (var6 = 0; var6 < tooltipData.size(); ++var6) {
var7 = fontRenderer.getStringWidth(tooltipData.get(var6));
if (var7 > var5)
var5 = var7;
if (var7 > var5) var5 = var7;
}
var6 = x + 12;
var7 = y - 12;
int var9 = 8;
if (tooltipData.size() > 1)
var9 += 2 + (tooltipData.size() - 1) * 10;
if (tooltipData.size() > 1) var9 += 2 + (tooltipData.size() - 1) * 10;
float z = 300.0F;
drawGradientRect(var6 - 3, var7 - 4, z, var6 + var5 + 3, var7 - 3, color2, color2);
drawGradientRect(var6 - 3, var7 + var9 + 3, z, var6 + var5 + 3, var7 + var9 + 4, color2, color2);
@@ -75,8 +71,7 @@ public final class ClientHelper {
for (int var13 = 0; var13 < tooltipData.size(); ++var13) {
String var14 = tooltipData.get(var13);
fontRenderer.drawStringWithShadow(var14, var6, var7, -1);
if (var13 == 0)
var7 += 2;
if (var13 == 0) var7 += 2;
var7 += 10;
}
}
@@ -110,5 +105,4 @@ public final class ClientHelper {
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [8 Sep 2013, 15:47:08 (GMT)]
@@ -18,6 +15,7 @@ import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import thaumic.tinkerer.client.lib.LibResources;
public class IconHelper {
@@ -55,5 +53,4 @@ public class IconHelper {
public static IIcon forItem(IIconRegister ir, Item item, String s) {
return forName(ir, item.getUnlocalizedName().replaceAll("item.", "") + s);
}
}
@@ -1,26 +1,16 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [4 Sep 2013, 16:33:54 (GMT)]
*/
package thaumic.tinkerer.client.core.proxy;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
@@ -29,11 +19,18 @@ import net.minecraft.world.World;
import net.minecraftforge.client.EnumHelperClient;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.relauncher.Side;
import thaumcraft.client.fx.ParticleEngine;
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
import thaumic.tinkerer.client.core.handler.GemArmorKeyHandler;
import thaumic.tinkerer.client.core.handler.HUDHandler;
import thaumic.tinkerer.client.core.handler.kami.KamiArmorClientHandler;
import thaumic.tinkerer.client.core.handler.kami.PlacementMirrorPredictionRenderer;
import thaumic.tinkerer.client.core.handler.kami.SoulHeartClientHandler;
@@ -47,7 +44,11 @@ import thaumic.tinkerer.client.render.block.kami.RenderWarpGate;
import thaumic.tinkerer.client.render.item.RenderGenericSeeds;
import thaumic.tinkerer.client.render.item.RenderMobDisplay;
import thaumic.tinkerer.client.render.item.kami.RenderPlacementMirror;
import thaumic.tinkerer.client.render.tile.*;
import thaumic.tinkerer.client.render.tile.RenderTileAnimationTablet;
import thaumic.tinkerer.client.render.tile.RenderTileEnchanter;
import thaumic.tinkerer.client.render.tile.RenderTileFunnel;
import thaumic.tinkerer.client.render.tile.RenderTileMagnet;
import thaumic.tinkerer.client.render.tile.RenderTileRepairer;
import thaumic.tinkerer.client.render.tile.kami.RenderTileWarpGate;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.tile.TileEnchanter;
@@ -76,10 +77,15 @@ public class TTClientProxy extends TTCommonProxy {
if (Loader.isModLoaded("ComputerCraft")) {
MinecraftForge.EVENT_BUS.register(new FumeTool());
}
if (ConfigHandler.enableKami)
//kamiRarity = EnumHelperClient.addRarity("KAMI", 0x6, "Kami");
kamiRarity = EnumHelperClient.addEnum(new Class[][]{{EnumRarity.class, EnumChatFormatting.class, String.class}}, EnumRarity.class, "KAMI", EnumChatFormatting.LIGHT_PURPLE, "Kami");
// kamiRarity = EnumHelperClient.addRarity("KAMI", 0x6, "Kami");
kamiRarity = EnumHelperClient.addEnum(
new Class[][] { { EnumRarity.class, EnumChatFormatting.class, String.class } },
EnumRarity.class,
"KAMI",
EnumChatFormatting.LIGHT_PURPLE,
"Kami");
}
@Override
@@ -102,7 +108,6 @@ public class TTClientProxy extends TTCommonProxy {
}
}
private void registerTiles() {
ClientRegistry.bindTileEntitySpecialRenderer(TileAnimationTablet.class, new RenderTileAnimationTablet());
ClientRegistry.bindTileEntitySpecialRenderer(TileMagnet.class, new RenderTileMagnet());
@@ -125,22 +130,37 @@ public class TTClientProxy extends TTCommonProxy {
RenderingRegistry.registerBlockHandler(new RenderMagnet());
RenderingRegistry.registerBlockHandler(new RenderRepairer());
MinecraftForgeClient.registerItemRenderer(ThaumicTinkerer.registry.getFirstItemFromClass(ItemMobDisplay.class), new RenderMobDisplay());
MinecraftForgeClient.registerItemRenderer(ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedSeeds.class), new RenderGenericSeeds());
MinecraftForgeClient.registerItemRenderer(
ThaumicTinkerer.registry.getFirstItemFromClass(ItemMobDisplay.class),
new RenderMobDisplay());
MinecraftForgeClient.registerItemRenderer(
ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedSeeds.class),
new RenderGenericSeeds());
if (ConfigHandler.enableKami) {
MinecraftForgeClient.registerItemRenderer(ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class), new RenderPlacementMirror());
MinecraftForgeClient.registerItemRenderer(
ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class),
new RenderPlacementMirror());
LibRenderIDs.idWarpGate = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new RenderWarpGate());
//KeyBindingRegistry.registerKeyBinding(new GemArmorKeyHandler());
// KeyBindingRegistry.registerKeyBinding(new GemArmorKeyHandler());
}
}
@Override
public void shadowSparkle(World world, float x, float y, float z, int size) {
ItemFocusShadowbeam.Particle fx = new ItemFocusShadowbeam.Particle(world, (double)x, (double)y, (double)z, size, 0.001f, 0.001f, 0.001f, 5);
ItemFocusShadowbeam.Particle fx = new ItemFocusShadowbeam.Particle(
world,
(double) x,
(double) y,
(double) z,
size,
0.001f,
0.001f,
0.001f,
5);
ParticleEngine.instance.addEffect(world, fx);
}
@@ -161,7 +181,6 @@ public class TTClientProxy extends TTCommonProxy {
@Override
public boolean armorStatus(EntityPlayer player) {
return KamiArmorClientHandler.ArmorEnabled;
}
@Override
@@ -176,5 +195,4 @@ public class TTClientProxy extends TTCommonProxy {
public EntityPlayer getClientPlayer() {
return ClientHelper.clientPlayer();
}
}
@@ -1,25 +1,27 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [9 Sep 2013, 16:31:14 (GMT)]
*/
package thaumic.tinkerer.client.gui;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import thaumic.tinkerer.client.gui.button.GuiButtonAT;
import thaumic.tinkerer.client.gui.button.GuiButtonATRadio;
import thaumic.tinkerer.client.gui.button.IRadioButton;
@@ -29,9 +31,6 @@ import thaumic.tinkerer.common.block.tile.container.ContainerAnimationTablet;
import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet;
import thaumic.tinkerer.common.network.packet.PacketTabletButton;
import java.util.ArrayList;
import java.util.List;
public class GuiAnimationTablet extends GuiContainer {
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ANIMATION_TABLET);
@@ -39,8 +38,8 @@ public class GuiAnimationTablet extends GuiContainer {
int x, y;
TileAnimationTablet tablet;
List<GuiButtonAT> buttonListAT = new ArrayList();
List<IRadioButton> radioButtons = new ArrayList();
List<GuiButtonAT> buttonListAT = new ArrayList<>();
List<IRadioButton> radioButtons = new ArrayList<>();
public GuiAnimationTablet(TileAnimationTablet tablet, InventoryPlayer playerInv) {
super(new ContainerAnimationTablet(tablet, playerInv));
@@ -61,14 +60,12 @@ public class GuiAnimationTablet extends GuiContainer {
private void addButton(GuiButtonAT button) {
buttonListAT.add(button);
if (button instanceof IRadioButton)
radioButtons.add((IRadioButton) button);
if (button instanceof IRadioButton) radioButtons.add((IRadioButton) button);
}
@Override
protected void actionPerformed(GuiButton par1GuiButton) {
if (par1GuiButton instanceof IRadioButton)
((IRadioButton) par1GuiButton).enableFromClick();
if (par1GuiButton instanceof IRadioButton) ((IRadioButton) par1GuiButton).enableFromClick();
else buttonListAT.get(0).buttonEnabled = !buttonListAT.get(0).buttonEnabled;
tablet.leftClick = buttonListAT.get(1).buttonEnabled;
@@ -88,7 +85,8 @@ public class GuiAnimationTablet extends GuiContainer {
fontRendererObj.drawString(left, x + 48 - fontRendererObj.getStringWidth(left), y + 18, 0x999999);
fontRendererObj.drawString(right, x + 128, y + 18, 0x999999);
fontRendererObj.drawString(redstone, x + xSize / 2 - fontRendererObj.getStringWidth(redstone) / 2, y + 50, 0x999999);
fontRendererObj
.drawString(redstone, x + xSize / 2 - fontRendererObj.getStringWidth(redstone) / 2, y + 50, 0x999999);
GL11.glColor3f(1F, 1F, 1F);
}
}
}
@@ -1,25 +1,27 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Dec 11, 2013, 10:46:14 PM (GMT)]
*/
package thaumic.tinkerer.client.gui;
import java.util.Arrays;
import java.util.List;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.client.lib.UtilsFX;
@@ -31,9 +33,6 @@ import thaumic.tinkerer.client.lib.LibResources;
import thaumic.tinkerer.common.block.tile.TileAspectAnalyzer;
import thaumic.tinkerer.common.block.tile.container.ContainerAspectAnalyzer;
import java.util.Arrays;
import java.util.List;
public class GuiAspectAnalyzer extends GuiContainer {
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ASPECT_ANALYZER);
@@ -66,7 +65,8 @@ public class GuiAspectAnalyzer extends GuiContainer {
if (stack != null) {
int h = ScanManager.generateItemHash(stack.getItem(), stack.getItemDamage());
List<String> list = Thaumcraft.proxy.getScannedObjects().get(ClientHelper.clientPlayer().getGameProfile().getName());
List<String> list = Thaumcraft.proxy.getScannedObjects()
.get(ClientHelper.clientPlayer().getGameProfile().getName());
if (list != null && (list.contains("@" + h) || list.contains("#" + h))) {
AspectList tags = ThaumcraftCraftingManager.getObjectTags(stack);
tags = ThaumcraftCraftingManager.getBonusTags(stack, tags);
@@ -77,8 +77,7 @@ public class GuiAspectAnalyzer extends GuiContainer {
int y = this.y + 58;
UtilsFX.drawTag(x, y, aspect, tags.getAmount(aspect), 0, zLevel);
if (mx > x && mx < x + 16 && my > y && my < y + 16)
aspectHovered = aspect;
if (mx > x && mx < x + 16 && my > y && my < y + 16) aspectHovered = aspect;
i++;
}
@@ -89,10 +88,13 @@ public class GuiAspectAnalyzer extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int mx, int my) {
if (aspectHovered != null)
ClientHelper.renderTooltip(mx - x, my - y, Arrays.asList(EnumChatFormatting.AQUA + aspectHovered.getName(), EnumChatFormatting.GRAY + aspectHovered.getLocalizedDescription()));
if (aspectHovered != null) ClientHelper.renderTooltip(
mx - x,
my - y,
Arrays.asList(
EnumChatFormatting.AQUA + aspectHovered.getName(),
EnumChatFormatting.GRAY + aspectHovered.getLocalizedDescription()));
super.drawGuiContainerForegroundLayer(mx, my);
}
}
@@ -1,26 +1,29 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [15 Sep 2013, 00:58:22 (GMT)]
*/
package thaumic.tinkerer.client.gui;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import thaumcraft.api.aspects.Aspect;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.client.gui.button.GuiButtonEnchant;
@@ -36,15 +39,11 @@ import thaumic.tinkerer.common.lib.LibFeatures;
import thaumic.tinkerer.common.network.packet.PacketEnchanterAddEnchant;
import thaumic.tinkerer.common.network.packet.PacketEnchanterStartWorking;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
public class GuiEnchanting extends GuiContainer {
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ENCHANTER);
public TileEnchanter enchanter;
public List<String> tooltip = new ArrayList();
public List<String> tooltip = new ArrayList<>();
int x, y;
GuiButtonEnchantment[] enchantButtons = new GuiButtonEnchantment[16];
List<Integer> lastTickEnchants;
@@ -57,8 +56,8 @@ public class GuiEnchanting extends GuiContainer {
this.enchanter = enchanter;
lastTickStack = enchanter.getStackInSlot(0);
currentStack = enchanter.getStackInSlot(0);
lastTickEnchants = new ArrayList(enchanter.enchantments);
lastTickLevels = new ArrayList(enchanter.levels);
lastTickEnchants = new ArrayList<>(enchanter.enchantments);
lastTickLevels = new ArrayList<>(enchanter.levels);
}
@Override
@@ -106,21 +105,23 @@ public class GuiEnchanting extends GuiContainer {
enchantButtons[i].enabled = false;
}
if (currentStack == null || currentStack.isItemEnchanted())
return;
if (currentStack == null || currentStack.isItemEnchanted()) return;
int it = 0;
for (int enchant : EnchantmentManager.enchantmentData.keySet()) {
if (currentStack.getItem().getItemEnchantability() != 0 && EnchantmentManager.canApply(currentStack, Enchantment.enchantmentsList[enchant], enchanter.enchantments) && EnchantmentManager.canEnchantmentBeUsed(ClientHelper.clientPlayer().getGameProfile().getName(), Enchantment.enchantmentsList[enchant])) {
if (currentStack.getItem().getItemEnchantability() != 0
&& EnchantmentManager
.canApply(currentStack, Enchantment.enchantmentsList[enchant], enchanter.enchantments)
&& EnchantmentManager.canEnchantmentBeUsed(
ClientHelper.clientPlayer().getGameProfile().getName(),
Enchantment.enchantmentsList[enchant])) {
enchantButtons[it].enchant = Enchantment.enchantmentsList[enchant];
enchantButtons[it].enabled = true;
it++;
if (it >= 16)
break;
if (it >= 16) break;
}
}
}
@Override
@@ -129,14 +130,13 @@ public class GuiEnchanting extends GuiContainer {
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterStartWorking(enchanter));
} else if (par1GuiButton.id <= 16) {
GuiButtonEnchantment button = enchantButtons[par1GuiButton.id - 1];
if (button != null && button.enchant != null)
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchanter, button.enchant.effectId, 0));
if (button != null && button.enchant != null) ThaumicTinkerer.netHandler
.sendToServer(new PacketEnchanterAddEnchant(enchanter, button.enchant.effectId, 0));
} else {
int type = (par1GuiButton.id - 17) % 3;
int index = (par1GuiButton.id - 17) / 3;
if (index >= enchanter.enchantments.size() || index >= enchanter.levels.size())
return;
if (index >= enchanter.enchantments.size() || index >= enchanter.levels.size()) return;
int level = enchanter.levels.get(index);
@@ -144,15 +144,18 @@ public class GuiEnchanting extends GuiContainer {
switch (type) {
case 0: {
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, -1));
ThaumicTinkerer.netHandler
.sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, -1));
break;
}
case 1: {
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, level == 1 ? -1 : level - 1));
ThaumicTinkerer.netHandler.sendToServer(
new PacketEnchanterAddEnchant(enchanter, enchant.effectId, level == 1 ? -1 : level - 1));
break;
}
case 2: {
ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, level + 1));
ThaumicTinkerer.netHandler
.sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, level + 1));
break;
}
}
@@ -165,12 +168,13 @@ public class GuiEnchanting extends GuiContainer {
public void updateScreen() {
currentStack = enchanter.getStackInSlot(0);
buildButtonList();
if (currentStack != lastTickStack || !lastTickEnchants.equals(enchanter.enchantments) || !lastTickLevels.equals(enchanter.levels))
if (currentStack != lastTickStack || !lastTickEnchants.equals(enchanter.enchantments)
|| !lastTickLevels.equals(enchanter.levels))
buildButtonList();
lastTickStack = currentStack;
lastTickEnchants = new ArrayList(enchanter.enchantments);
lastTickLevels = new ArrayList(enchanter.enchantments);
lastTickEnchants = new ArrayList<>(enchanter.enchantments);
lastTickLevels = new ArrayList<>(enchanter.enchantments);
}
@Override
@@ -193,8 +197,7 @@ public class GuiEnchanting extends GuiContainer {
GL11.glEnable(GL11.GL_BLEND);
int xo = 15;
int z = 50;
if (enchantButtons[8].enabled)
z = 26;
if (enchantButtons[8].enabled) z = 26;
for (Aspect aspect : LibFeatures.PRIMAL_ASPECTS) {
drawAspectBar(aspect, x + xo, y + z, i, j);
xo += 15;
@@ -205,8 +208,7 @@ public class GuiEnchanting extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
if (!tooltip.isEmpty())
ClientHelper.renderTooltip(par1 - x, par2 - y, tooltip);
if (!tooltip.isEmpty()) ClientHelper.renderTooltip(par1 - x, par2 - y, tooltip);
tooltip.clear();
}
@@ -229,11 +231,10 @@ public class GuiEnchanting extends GuiContainer {
}
if (mx > x && mx <= x + 10 && my > y - size && my <= y) {
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add('\u00a7' + aspect.getChatcolor() + aspect.getName());
tooltip.add(current + "/" + totalCost);
this.tooltip = tooltip;
}
}
}
@@ -1,26 +1,28 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [12 Sep 2013, 18:37:02 (GMT)]
*/
package thaumic.tinkerer.client.gui;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import thaumic.tinkerer.client.gui.button.GuiButtonMM;
import thaumic.tinkerer.client.gui.button.GuiButtonMMRadio;
import thaumic.tinkerer.client.gui.button.IRadioButton;
@@ -31,9 +33,6 @@ import thaumic.tinkerer.common.block.tile.container.ContainerMobMagnet;
import thaumic.tinkerer.common.item.ItemSoulMould;
import thaumic.tinkerer.common.network.packet.PacketMobMagnetButton;
import java.util.ArrayList;
import java.util.List;
public class GuiMobMagnet extends GuiContainer {
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_MOB_MAGNET);
@@ -43,8 +42,8 @@ public class GuiMobMagnet extends GuiContainer {
ItemStack stack = null;
TileMobMagnet mobMagnet;
List<GuiButtonMM> buttonListMM = new ArrayList();
List<IRadioButton> radioButtons = new ArrayList();
List<GuiButtonMM> buttonListMM = new ArrayList<>();
List<IRadioButton> radioButtons = new ArrayList<>();
public GuiMobMagnet(TileMobMagnet tile, InventoryPlayer playerInv) {
super(new ContainerMobMagnet(tile, playerInv));
@@ -64,14 +63,12 @@ public class GuiMobMagnet extends GuiContainer {
private void addButton(GuiButtonMM button) {
buttonListMM.add(button);
if (button instanceof IRadioButton)
radioButtons.add((IRadioButton) button);
if (button instanceof IRadioButton) radioButtons.add((IRadioButton) button);
}
@Override
protected void actionPerformed(GuiButton par1GuiButton) {
if (par1GuiButton instanceof IRadioButton)
((IRadioButton) par1GuiButton).enableFromClick();
if (par1GuiButton instanceof IRadioButton) ((IRadioButton) par1GuiButton).enableFromClick();
else buttonListMM.get(0).enabled = !buttonListMM.get(0).enabled;
mobMagnet.adult = buttonListMM.get(0).enabled;
@@ -92,15 +89,14 @@ public class GuiMobMagnet extends GuiContainer {
if (stack != null) {
String name = ItemSoulMould.getPatternName(stack);
if (name.isEmpty())
filter = StatCollector.translateToLocal("ttmisc.none");
if (name.isEmpty()) filter = StatCollector.translateToLocal("ttmisc.none");
else filter = StatCollector.translateToLocal("entity." + name + ".name");
} else filter = StatCollector.translateToLocal("ttmisc.all");
fontRendererObj.drawString(filter, x + xSize / 2 - fontRendererObj.getStringWidth(filter) / 2 - 26, y + 16, 0x999999);
fontRendererObj
.drawString(filter, x + xSize / 2 - fontRendererObj.getStringWidth(filter) / 2 - 26, y + 16, 0x999999);
fontRendererObj.drawString(adult, x + 120, y + 30, 0x999999);
fontRendererObj.drawString(child, x + 120, y + 50, 0x999999);
GL11.glColor3f(1F, 1F, 1F);
}
}
}
@@ -1,10 +1,15 @@
package thaumic.tinkerer.client.gui;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import thaumcraft.api.aspects.Aspect;
import thaumic.tinkerer.client.gui.button.GuiButtonRP;
import thaumic.tinkerer.client.gui.button.GuiButtonRPRadio;
@@ -15,18 +20,16 @@ import thaumic.tinkerer.common.block.tile.TileRPlacer;
import thaumic.tinkerer.common.block.tile.container.ContainerRemotePlacer;
import thaumic.tinkerer.common.network.packet.PacketPlacerButton;
import java.util.ArrayList;
import java.util.List;
/**
* Created by nekosune on 30/06/14.
*/
public class GuiRemotePlacer extends GuiContainer {
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ASPECT_ANALYZER);
int x, y;
List<IRadioButton> radioButtons = new ArrayList();
List<GuiButtonRP> buttonListRP = new ArrayList();
List<IRadioButton> radioButtons = new ArrayList<>();
List<GuiButtonRP> buttonListRP = new ArrayList<>();
TileRPlacer placer;
Aspect aspectHovered = null;
@@ -46,19 +49,16 @@ public class GuiRemotePlacer extends GuiContainer {
addButton(new GuiButtonRPRadio(2, x + 100, y + 26, placer.blocks == 3, radioButtons));
addButton(new GuiButtonRPRadio(3, x + 100, y + 39, placer.blocks == 4, radioButtons));
buttonList = buttonListRP;
}
private void addButton(GuiButtonRP button) {
buttonListRP.add(button);
if (button instanceof IRadioButton)
radioButtons.add((IRadioButton) button);
if (button instanceof IRadioButton) radioButtons.add((IRadioButton) button);
}
@Override
protected void actionPerformed(GuiButton par1GuiButton) {
if (par1GuiButton instanceof IRadioButton)
((IRadioButton) par1GuiButton).enableFromClick();
if (par1GuiButton instanceof IRadioButton) ((IRadioButton) par1GuiButton).enableFromClick();
else buttonListRP.get(0).buttonEnabled = !buttonListRP.get(0).buttonEnabled;
placer.blocks = par1GuiButton.id + 1;
@@ -77,6 +77,4 @@ public class GuiRemotePlacer extends GuiContainer {
fontRendererObj.drawString("4", x + 120, y + 41, 0x999999);
GL11.glColor3f(1F, 1F, 1F);
}
}
@@ -1,28 +1,26 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [13 Sep 2013, 14:50:41 (GMT)]
*/
package thaumic.tinkerer.client.gui;
import java.awt.Desktop;
import java.net.URI;
import net.minecraft.util.StatCollector;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.StatCollector;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.client.gui.GuiResearchRecipe;
import java.awt.*;
import java.net.URI;
@SideOnly(Side.CLIENT)
public class GuiResearchPeripheral extends GuiResearchRecipe {
@@ -41,5 +39,4 @@ public class GuiResearchPeripheral extends GuiResearchRecipe {
}
} else super.keyTyped(par1, par2);
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [9 Sep 2013, 16:33:24 (GMT)]
@@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ResourceLocation;
import thaumic.tinkerer.client.lib.LibResources;
public class GuiButtonAT extends GuiButton {
@@ -38,4 +36,4 @@ public class GuiButtonAT extends GuiButton {
drawTexturedModalRect(xPosition, yPosition, 176, y, width, height);
}
}
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [9 Sep 2013, 16:33:43 (GMT)]
@@ -28,15 +25,12 @@ public class GuiButtonATRadio extends GuiButtonAT implements IRadioButton {
@Override
public void enableFromClick() {
setEnabled(true);
for (IRadioButton button : linkedButtons)
if (button != this)
button.updateStatus(this);
for (IRadioButton button : linkedButtons) if (button != this) button.updateStatus(this);
}
@Override
public void updateStatus(IRadioButton otherButton) {
if (otherButton.isEnabled())
setEnabled(false);
if (otherButton.isEnabled()) setEnabled(false);
}
@Override
@@ -48,4 +42,4 @@ public class GuiButtonATRadio extends GuiButtonAT implements IRadioButton {
public void setEnabled(boolean enabled) {
this.buttonEnabled = enabled;
}
}
}
@@ -1,32 +1,30 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [14 Sep 2013, 21:56:21 (GMT)]
*/
package thaumic.tinkerer.client.gui.button;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.client.gui.GuiEnchanting;
import thaumic.tinkerer.client.lib.LibResources;
import thaumic.tinkerer.common.block.tile.TileEnchanter;
import java.util.ArrayList;
import java.util.List;
public class GuiButtonEnchant extends GuiButton {
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ENCHANTER);
@@ -41,8 +39,7 @@ public class GuiButtonEnchant extends GuiButton {
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
if (!enabled)
return;
if (!enabled) return;
final int x = 176;
final int y = enchanter.working ? 39 : 24;
@@ -50,11 +47,13 @@ public class GuiButtonEnchant extends GuiButton {
ClientHelper.minecraft().renderEngine.bindTexture(gui);
drawTexturedModalRect(xPosition, yPosition, x, y, 15, 15);
if (par2 >= xPosition && par2 < xPosition + 15 && par3 >= yPosition && par3 < yPosition + 15 && !enchanter.working) {
List<String> tooltip = new ArrayList();
if (par2 >= xPosition && par2 < xPosition + 15
&& par3 >= yPosition
&& par3 < yPosition + 15
&& !enchanter.working) {
List<String> tooltip = new ArrayList<>();
tooltip.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal("ttmisc.startEnchant"));
parent.tooltip = tooltip;
}
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [16 Sep 2013, 16:13:50 (GMT)]
@@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ResourceLocation;
import thaumic.tinkerer.client.lib.LibResources;
public class GuiButtonEnchanterLevel extends GuiButton {
@@ -32,13 +30,11 @@ public class GuiButtonEnchanterLevel extends GuiButton {
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
if (!enabled)
return;
if (!enabled) return;
int x = 218 + (plus ? 7 : 0);
par1Minecraft.renderEngine.bindTexture(gui);
drawTexturedModalRect(xPosition, yPosition, x, 0, 7, 7);
}
}
@@ -1,35 +1,34 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [15 Sep 2013, 00:13:10 (GMT)]
*/
package thaumic.tinkerer.client.gui.button;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import thaumcraft.api.aspects.Aspect;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.client.gui.GuiEnchanting;
import thaumic.tinkerer.common.enchantment.core.EnchantmentData;
import thaumic.tinkerer.common.enchantment.core.EnchantmentManager;
import java.util.ArrayList;
import java.util.List;
public class GuiButtonEnchantment extends GuiButton {
public Enchantment enchant;
@@ -46,8 +45,7 @@ public class GuiButtonEnchantment extends GuiButton {
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
if (dontRender())
return;
if (dontRender()) return;
EnchantmentData data = EnchantmentManager.enchantmentData.get(enchant.effectId).get(1);
ClientHelper.minecraft().renderEngine.bindTexture(data.texture);
@@ -56,12 +54,21 @@ public class GuiButtonEnchantment extends GuiButton {
GL11.glDisable(GL11.GL_BLEND);
if (par2 >= xPosition && par2 < xPosition + 16 && par3 >= yPosition && par3 < yPosition + 16) {
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal(enchant.getName()));
for (Aspect aspect : data.aspects.getAspectsSorted())
tooltip.add(" \u00a7" + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + data.aspects.getAmount(aspect) + " " + StatCollector.translateToLocal("ttmisc.baseCost"));
if (this instanceof GuiButtonFramedEnchantment && !parent.enchanter.working)
tooltip.add(EnumChatFormatting.GRAY + "" + EnumChatFormatting.ITALIC + " " + StatCollector.translateToLocal("ttmisc.clickToRemove"));
for (Aspect aspect : data.aspects.getAspectsSorted()) tooltip.add(
" \u00a7" + aspect.getChatcolor()
+ aspect.getName()
+ '\u00a7'
+ "r x "
+ data.aspects.getAmount(aspect)
+ " "
+ StatCollector.translateToLocal("ttmisc.baseCost"));
if (this instanceof GuiButtonFramedEnchantment && !parent.enchanter.working) tooltip.add(
EnumChatFormatting.GRAY + ""
+ EnumChatFormatting.ITALIC
+ " "
+ StatCollector.translateToLocal("ttmisc.clickToRemove"));
parent.tooltip = tooltip;
}
@@ -78,5 +85,4 @@ public class GuiButtonEnchantment extends GuiButton {
tessellator.addVertexWithUV(par1, par2, zLevel, (par3) * f, (par4) * f1);
tessellator.draw();
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [16 Sep 2013, 15:31:55 (GMT)]
@@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.client.gui.GuiEnchanting;
import thaumic.tinkerer.client.lib.LibResources;
@@ -31,8 +29,7 @@ public class GuiButtonFramedEnchantment extends GuiButtonEnchantment {
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
if (dontRender() || parent.enchanter.enchantments.isEmpty() || parent.enchanter.levels.isEmpty())
return;
if (dontRender() || parent.enchanter.enchantments.isEmpty() || parent.enchanter.levels.isEmpty()) return;
ClientHelper.minecraft().renderEngine.bindTexture(gui);
drawTexturedModalRect(xPosition - 4, yPosition - 4, 176, 0, 24, 24);
@@ -40,10 +37,13 @@ public class GuiButtonFramedEnchantment extends GuiButtonEnchantment {
int index = parent.enchanter.enchantments.indexOf(enchant.effectId);
if (index != -1) {
int level = parent.enchanter.levels.get(index);
par1Minecraft.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("enchantment.level." + level), xPosition + 26, yPosition + 8, 0xFFFFFF);
par1Minecraft.fontRenderer.drawStringWithShadow(
StatCollector.translateToLocal("enchantment.level." + level),
xPosition + 26,
yPosition + 8,
0xFFFFFF);
}
super.drawButton(par1Minecraft, par2, par3);
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [12 Sep 2013, 18:39:55 (GMT)]
@@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ResourceLocation;
import thaumic.tinkerer.client.lib.LibResources;
public class GuiButtonMM extends GuiButton {
@@ -38,4 +36,4 @@ public class GuiButtonMM extends GuiButton {
drawTexturedModalRect(xPosition, yPosition, 176, y, width, height);
}
}
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [12 Sep 2013, 18:40:22 (GMT)]
@@ -28,15 +25,12 @@ public class GuiButtonMMRadio extends GuiButtonMM implements IRadioButton {
@Override
public void enableFromClick() {
setEnabled(true);
for (IRadioButton button : linkedButtons)
if (button != this)
button.updateStatus(this);
for (IRadioButton button : linkedButtons) if (button != this) button.updateStatus(this);
}
@Override
public void updateStatus(IRadioButton otherButton) {
if (otherButton.isEnabled())
setEnabled(false);
if (otherButton.isEnabled()) setEnabled(false);
}
@Override
@@ -48,4 +42,4 @@ public class GuiButtonMMRadio extends GuiButtonMM implements IRadioButton {
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
}
}
@@ -3,12 +3,14 @@ package thaumic.tinkerer.client.gui.button;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ResourceLocation;
import thaumic.tinkerer.client.lib.LibResources;
/**
* Created by nekosune on 30/06/14.
*/
public class GuiButtonRP extends GuiButton {
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_REMOTE_PLACER);
public boolean buttonEnabled = false;
@@ -6,6 +6,7 @@ import java.util.List;
* Created by nekosune on 30/06/14.
*/
public class GuiButtonRPRadio extends GuiButtonRP implements IRadioButton {
List<IRadioButton> linkedButtons;
public GuiButtonRPRadio(int par1, int par2, int par3, boolean enabled, List<IRadioButton> linkedButtons) {
@@ -16,15 +17,12 @@ public class GuiButtonRPRadio extends GuiButtonRP implements IRadioButton {
@Override
public void enableFromClick() {
setEnabled(true);
for (IRadioButton button : linkedButtons)
if (button != this)
button.updateStatus(this);
for (IRadioButton button : linkedButtons) if (button != this) button.updateStatus(this);
}
@Override
public void updateStatus(IRadioButton otherButton) {
if (otherButton.isEnabled())
setEnabled(false);
if (otherButton.isEnabled()) setEnabled(false);
}
@Override
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [9 Sep 2013, 16:32:08 (GMT)]
@@ -23,5 +20,4 @@ public interface IRadioButton {
public boolean isEnabled();
public void setEnabled(boolean enabled);
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Jan 10, 2014, 5:58:46 PM (GMT)]
@@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button.kami;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ResourceLocation;
import thaumic.tinkerer.client.lib.LibResources;
public class GuiButtonWG extends GuiButton {
@@ -38,4 +36,4 @@ public class GuiButtonWG extends GuiButton {
drawTexturedModalRect(xPosition, yPosition, 176, y, width, height);
}
}
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Dec 29, 2013, 10:54:58 PM (GMT)]
@@ -17,7 +14,9 @@ package thaumic.tinkerer.client.gui.kami;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import thaumic.tinkerer.client.lib.LibResources;
public class GuiIchorPouch extends GuiContainer {
@@ -30,8 +29,9 @@ public class GuiIchorPouch extends GuiContainer {
super(par1Container);
}
//Overridden to prevent a dupe
//See issue 367
// Overridden to prevent a dupe
// See issue 367
@Override
protected boolean checkHotbarKeys(int slot) {
if (this.mc.gameSettings.keyBindsHotbar[this.mc.thePlayer.inventory.currentItem].getKeyCode() != slot) {
super.checkHotbarKeys(slot);
@@ -57,5 +57,4 @@ public class GuiIchorPouch extends GuiContainer {
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
GL11.glDisable(GL11.GL_BLEND);
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Jan 10, 2014, 5:43:53 PM (GMT)]
@@ -19,7 +16,9 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import thaumic.tinkerer.client.gui.button.kami.GuiButtonWG;
import thaumic.tinkerer.client.lib.LibResources;
import thaumic.tinkerer.common.ThaumicTinkerer;
@@ -62,7 +61,7 @@ public class GuiWarpGate extends GuiContainer {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(gui);
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("ttmisc.lockedGate"), x + 20, y + 7, 0x999999);
fontRendererObj
.drawStringWithShadow(StatCollector.translateToLocal("ttmisc.lockedGate"), x + 20, y + 7, 0x999999);
}
}
@@ -1,19 +1,20 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Jan 10, 2014, 6:08:23 PM (GMT)]
*/
package thaumic.tinkerer.client.gui.kami;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.Tessellator;
@@ -23,8 +24,10 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import thaumcraft.codechicken.lib.vec.Vector3;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.common.ThaumicTinkerer;
@@ -32,10 +35,6 @@ import thaumic.tinkerer.common.block.tile.kami.TileWarpGate;
import thaumic.tinkerer.common.item.kami.ItemSkyPearl;
import thaumic.tinkerer.common.network.packet.kami.PacketWarpGateTeleport;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
public class GuiWarpGateDestinations extends GuiScreen {
private static ResourceLocation enderField = new ResourceLocation("textures/entity/end_portal.png");
@@ -45,7 +44,7 @@ public class GuiWarpGateDestinations extends GuiScreen {
int lastMouseX, lastMouseY;
int x, y;
int ticks;
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
public GuiWarpGateDestinations(TileWarpGate warpGate) {
this.warpGate = warpGate;
@@ -92,7 +91,8 @@ public class GuiWarpGateDestinations extends GuiScreen {
if (par2 >= 2 && par2 < 12) {
int num = par2 - 2;
ItemStack stack = warpGate.getStackInSlot(num);
if (stack != null && ItemSkyPearl.isAttuned(stack) && ItemSkyPearl.getDim(stack) == warpGate.getWorldObj().provider.dimensionId) {
if (stack != null && ItemSkyPearl.isAttuned(stack)
&& ItemSkyPearl.getDim(stack) == warpGate.getWorldObj().provider.dimensionId) {
int x = ItemSkyPearl.getX(stack);
int z = ItemSkyPearl.getZ(stack);
@@ -113,21 +113,19 @@ public class GuiWarpGateDestinations extends GuiScreen {
int gateY = warpGate.zCoord - y;
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
List<Object[]> coords = new ArrayList();
List<Object[]> coords = new ArrayList<>();
for (int i = 0; i < warpGate.getSizeInventory(); i++) {
ItemStack stack = warpGate.getStackInSlot(i);
if (stack != null && ItemSkyPearl.isAttuned(stack)) {
int dim = ItemSkyPearl.getDim(stack);
if (warpGate.getWorldObj().provider.dimensionId != dim)
continue;
if (warpGate.getWorldObj().provider.dimensionId != dim) continue;
int x = ItemSkyPearl.getX(stack);
int y = ItemSkyPearl.getY(stack);
int z = ItemSkyPearl.getZ(stack);
if (y != -1)
coords.add(new Object[]{x - this.x, z - this.y, stack, i});
if (y != -1) coords.add(new Object[] { x - this.x, z - this.y, stack, i });
}
}
@@ -148,17 +146,35 @@ public class GuiWarpGateDestinations extends GuiScreen {
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND);
fontRendererObj.drawStringWithShadow(EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal("ttmisc.destinations"), 3, 40, 0xFFFFFF);
fontRendererObj.drawStringWithShadow(
EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal("ttmisc.destinations"),
3,
40,
0xFFFFFF);
GL11.glColor4f(1F, 1F, 1F, 1F);
drawPearlAt(0, null, gateX, gateY, par1, par2);
for (Object[] coords_ : coords)
drawPearlAt((Integer) coords_[3], (ItemStack) coords_[2], (Integer) coords_[0], (Integer) coords_[1], par1, par2);
for (Object[] coords_ : coords) drawPearlAt(
(Integer) coords_[3],
(ItemStack) coords_[2],
(Integer) coords_[0],
(Integer) coords_[1],
par1,
par2);
if (!tooltip.isEmpty())
ClientHelper.renderTooltip(par1, par2, tooltip);
if (!tooltip.isEmpty()) ClientHelper.renderTooltip(par1, par2, tooltip);
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("ttmisc.numberKeys"), width / 2, 5, 0xFFFFFF);
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("ttmisc.spaceToReset"), width / 2, 16, 0xFFFFFF);
drawCenteredString(
fontRendererObj,
StatCollector.translateToLocal("ttmisc.numberKeys"),
width / 2,
5,
0xFFFFFF);
drawCenteredString(
fontRendererObj,
StatCollector.translateToLocal("ttmisc.spaceToReset"),
width / 2,
16,
0xFFFFFF);
}
public void drawPearlAt(int index, ItemStack stack, int xp, int yp, int mx, int my) {
@@ -171,22 +187,31 @@ public class GuiWarpGateDestinations extends GuiScreen {
GL11.glPushMatrix();
GL11.glTranslatef(xp, yp, 0);
GL11.glScalef(0.5F, 0.5F, 1F);
render.renderIcon(-8, -8, ThaumicTinkerer.registry.getFirstItemFromClass(ItemSkyPearl.class).getIconFromDamage(0), 16, 16);
render.renderIcon(
-8,
-8,
ThaumicTinkerer.registry.getFirstItemFromClass(ItemSkyPearl.class).getIconFromDamage(0),
16,
16);
GL11.glPopMatrix();
String destNum = " " + EnumChatFormatting.ITALIC + String.format(StatCollector.translateToLocal("ttmisc.destinationInd"), index + 1);
if (stack != null && stack.hasDisplayName())
destName = stack.getDisplayName();
String destNum = " " + EnumChatFormatting.ITALIC
+ String.format(StatCollector.translateToLocal("ttmisc.destinationInd"), index + 1);
if (stack != null && stack.hasDisplayName()) destName = stack.getDisplayName();
else destName = StatCollector.translateToLocal(stack == null ? "ttmisc.entrancePoint" : "ttmisc.destination");
if (stack != null)
fontRendererObj.drawString((index + 1) + ": " + destName, 5, 54 + index * 11, 0xFFFFFF);
if (stack != null) fontRendererObj.drawString((index + 1) + ": " + destName, 5, 54 + index * 11, 0xFFFFFF);
if (mx >= xp - 4 && mx <= xp + 4 && my >= yp - 4 && my < yp + 4) {
tooltip.add(EnumChatFormatting.AQUA + destName + destNum);
if (stack != null) {
ItemSkyPearl.addInfo(stack, warpGate.getWorldObj().provider.dimensionId, Vector3.fromTileEntity(warpGate), tooltip, true);
ItemSkyPearl.addInfo(
stack,
warpGate.getWorldObj().provider.dimensionId,
Vector3.fromTileEntity(warpGate),
tooltip,
true);
tooltip.add(StatCollector.translateToLocal("ttmisc.clickToTeleport"));
} else {
tooltip.add("X: " + x);
@@ -218,5 +243,4 @@ public class GuiWarpGateDestinations extends GuiScreen {
tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, par1);
tessellator.draw();
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [12 Sep 2013, 17:43:34 (GMT)]
@@ -23,6 +20,5 @@ public final class LibRenderIDs {
public static int idFire = -1;
public static int idGrain = -1;
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [4 Sep 2013, 17:38:36 (GMT)]
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [12 Sep 2013, 17:56:17 (GMT)]
@@ -85,4 +82,4 @@ public class ModelMagnet extends ModelBase {
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [12 Sep 2013, 17:56:17 (GMT)]
@@ -85,4 +82,4 @@ public class ModelRelay extends ModelBase {
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [12 Sep 2013, 17:18:53 (GMT)]
@@ -150,7 +147,6 @@ public class ModelRepairer extends ModelBase {
Opening2.render(scale);
Opening3.render(scale);
Opening4.render(scale);
}
public void renderGlass() {
@@ -168,5 +164,4 @@ public class ModelRepairer extends ModelBase {
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Jan 10, 2014, 4:41:02 PM (GMT)]
@@ -17,7 +14,9 @@ package thaumic.tinkerer.client.model.kami;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import org.lwjgl.opengl.GL11;
import thaumic.tinkerer.client.core.helper.ClientHelper;
public class ModelSpinningCubes extends ModelBase {
@@ -79,8 +78,7 @@ public class ModelSpinningCubes extends ModelBase {
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY);
spinningCube.render(1F / 16F);
if (repeat < origRepeat)
GL11.glDisable(GL11.GL_BLEND);
if (repeat < origRepeat) GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
@@ -88,8 +86,6 @@ public class ModelSpinningCubes extends ModelBase {
GL11.glEnable(GL11.GL_TEXTURE_2D);
if (repeat != 0)
renderSpinningCubes(cubes, repeat - 1, origRepeat);
if (repeat != 0) renderSpinningCubes(cubes, repeat - 1, origRepeat);
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Dec 25, 2013, 00:18:06 PM (GMT)]
@@ -70,10 +67,8 @@ public class ModelWings extends ModelBiped {
if (itemstack != null && player.getItemInUseCount() > 0) {
EnumAction enumaction = itemstack.getItemUseAction();
if (enumaction == EnumAction.block)
heldItemRight = 3;
else if (enumaction == EnumAction.bow)
aimedBow = true;
if (enumaction == EnumAction.block) heldItemRight = 3;
else if (enumaction == EnumAction.bow) aimedBow = true;
}
if (player.capabilities.isFlying) {
@@ -90,5 +85,4 @@ public class ModelWings extends ModelBiped {
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -1,11 +1,13 @@
package thaumic.tinkerer.client.render.block;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import thaumcraft.api.aspects.Aspect;
import thaumic.tinkerer.client.lib.LibRenderIDs;
import thaumic.tinkerer.common.block.BlockInfusedGrain;
@@ -15,19 +17,18 @@ import thaumic.tinkerer.common.block.BlockInfusedGrain;
*/
public class RenderInfusedCrops implements ISimpleBlockRenderingHandler {
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {}
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
GL11.glPushMatrix();
Aspect aspect = BlockInfusedGrain.getAspect(world, x, y, z);
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
if (aspect != null && !aspect.isPrimal()) {
//Hex to RGB code from vanilla tesselator
// Hex to RGB code from vanilla tesselator
float r = (aspect.getColor() >> 16 & 0xFF) / 255.0F;
float g = (aspect.getColor() >> 8 & 0xFF) / 255.0F;
float b = (aspect.getColor() & 0xFF) / 255.0F;
@@ -41,7 +42,7 @@ public class RenderInfusedCrops implements ISimpleBlockRenderingHandler {
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
renderer.renderBlockCropsImpl(block, world.getBlockMetadata(x, y, z), x, y - 0.0625F, z);
renderer.clearOverrideBlockTexture();
//Tessellator.instance.setColorOpaque_I(0xFFFFFF);
// Tessellator.instance.setColorOpaque_I(0xFFFFFF);
GL11.glPopAttrib();
GL11.glPopMatrix();
@@ -1,25 +1,24 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [12 Sep 2013, 18:08:42 (GMT)]
*/
package thaumic.tinkerer.client.render.block;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import thaumic.tinkerer.client.lib.LibRenderIDs;
import thaumic.tinkerer.client.render.tile.RenderTileMagnet;
import thaumic.tinkerer.common.block.tile.TileMagnet;
@@ -37,7 +36,8 @@ public class RenderMagnet implements ISimpleBlockRenderingHandler {
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
return false;
}
@@ -50,5 +50,4 @@ public class RenderMagnet implements ISimpleBlockRenderingHandler {
public int getRenderId() {
return LibRenderIDs.idMagnet;
}
}
}
@@ -1,25 +1,24 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Nov 30, 2013, 5:50:21 PM (GMT)]
*/
package thaumic.tinkerer.client.render.block;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import thaumic.tinkerer.client.lib.LibRenderIDs;
import thaumic.tinkerer.common.block.tile.TileRepairer;
@@ -34,7 +33,8 @@ public class RenderRepairer implements ISimpleBlockRenderingHandler {
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
return false;
}
@@ -47,5 +47,4 @@ public class RenderRepairer implements ISimpleBlockRenderingHandler {
public int getRenderId() {
return LibRenderIDs.idRepairer;
}
}
}
@@ -1,26 +1,25 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Jan 10, 2014, 4:03:03 PM (GMT)]
*/
package thaumic.tinkerer.client.render.block.kami;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import thaumcraft.client.renderers.block.BlockRenderer;
import thaumic.tinkerer.client.lib.LibRenderIDs;
import thaumic.tinkerer.common.block.kami.BlockWarpGate;
@@ -47,7 +46,8 @@ public class RenderWarpGate extends BlockRenderer implements ISimpleBlockRenderi
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
renderer.setRenderBoundsFromBlock(block);
renderer.renderStandardBlock(block, x, y, z);
@@ -73,5 +73,4 @@ public class RenderWarpGate extends BlockRenderer implements ISimpleBlockRenderi
public int getRenderId() {
return LibRenderIDs.idWarpGate;
}
}
@@ -8,7 +8,9 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import thaumcraft.api.aspects.Aspect;
import thaumic.tinkerer.common.item.ItemInfusedSeeds;
@@ -21,12 +23,9 @@ public class RenderGenericSeeds implements IItemRenderer {
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
if (type == ItemRenderType.INVENTORY)
return true;
if (type == ItemRenderType.EQUIPPED)
return true;
if (type == ItemRenderType.ENTITY)
return true;
if (type == ItemRenderType.INVENTORY) return true;
if (type == ItemRenderType.EQUIPPED) return true;
if (type == ItemRenderType.ENTITY) return true;
if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
return true;
}
@@ -35,10 +34,8 @@ public class RenderGenericSeeds implements IItemRenderer {
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
if (helper == ItemRendererHelper.ENTITY_BOBBING)
return true;
if (helper == ItemRendererHelper.ENTITY_ROTATION)
return true;
if (helper == ItemRendererHelper.ENTITY_BOBBING) return true;
if (helper == ItemRendererHelper.ENTITY_ROTATION) return true;
return false;
}
@@ -82,7 +79,15 @@ public class RenderGenericSeeds implements IItemRenderer {
private void renderItemInEquipped(ItemStack itemstack, Aspect aspect, IIcon icon) {
Tessellator tessellator = Tessellator.instance;
setColorForAspect(aspect);
ItemRenderer.renderItemIn2D(tessellator, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
ItemRenderer.renderItemIn2D(
tessellator,
icon.getMaxU(),
icon.getMinV(),
icon.getMinU(),
icon.getMaxV(),
icon.getIconWidth(),
icon.getIconHeight(),
0.0625F);
GL11.glColor3f(1.0F, 1.0F, 1.0F);
}
@@ -99,7 +104,15 @@ public class RenderGenericSeeds implements IItemRenderer {
float scale = 0.7F;
GL11.glPushMatrix();
GL11.glScalef(scale, scale, scale);
ItemRenderer.renderItemIn2D(tesselator, texture.getMaxU(), texture.getMinV(), texture.getMinU(), texture.getMaxV(), texture.getIconWidth(), texture.getIconHeight(), .05F);
ItemRenderer.renderItemIn2D(
tesselator,
texture.getMaxU(),
texture.getMinV(),
texture.getMinU(),
texture.getMaxV(),
texture.getIconWidth(),
texture.getIconHeight(),
.05F);
GL11.glPopMatrix();
}
@@ -113,12 +126,5 @@ public class RenderGenericSeeds implements IItemRenderer {
tesselator.draw();
}
private void setColorForAspect(Aspect aspect) {
//if(!aspect.isPrimal()){
// float r = (aspect.getColor() >> 16 & 0xFF) / 255.0F;
// float g = (aspect.getColor() >> 8 & 0xFF) / 255.0F;
// float b = (aspect.getColor() & 0xFF) / 255.0F;
// GL11.glColor3f(r, g, b);
//}
}
private void setColorForAspect(Aspect aspect) {}
}
@@ -8,7 +8,9 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import thaumic.tinkerer.common.core.helper.EnumMobAspect;
import thaumic.tinkerer.common.item.ItemMobDisplay;
@@ -22,7 +24,8 @@ public class RenderMobDisplay implements IItemRenderer {
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType itemRenderType, ItemStack itemStack, ItemRendererHelper itemRendererHelper) {
public boolean shouldUseRenderHelper(ItemRenderType itemRenderType, ItemStack itemStack,
ItemRendererHelper itemRendererHelper) {
return true;
}
@@ -39,9 +42,7 @@ public class RenderMobDisplay implements IItemRenderer {
verticalOffset = aspect.getVerticalOffset();
}
switch (itemRenderType) {
case ENTITY:
GL11.glPushMatrix();
GL11.glTranslated(0.5, 0.2 + verticalOffset, 0.5);
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
@@ -56,11 +57,10 @@ public class RenderMobDisplay implements IItemRenderer {
entity.copyLocationAndAnglesFrom(eItem);
if (renderer != null && renderer.getFontRendererFromRenderManager() != null) {
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
//if (renderWithLighting) RenderUtils.enableLightmap();
// if (renderWithLighting) RenderUtils.enableLightmap();
renderer.doRender(entity, 0, 0, 0, 0, 0);
GL11.glPopAttrib();
}
}
entity.worldObj = null;
}
@@ -81,11 +81,10 @@ public class RenderMobDisplay implements IItemRenderer {
Render renderer = RenderManager.instance.getEntityRenderObject(entity);
if (renderer != null && renderer.getFontRendererFromRenderManager() != null) {
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
//if (renderWithLighting) RenderUtils.enableLightmap();
// if (renderWithLighting) RenderUtils.enableLightmap();
renderer.doRender(entity, 0, 0, 0, 0, 0);
GL11.glPopAttrib();
}
}
entity.worldObj = null;
}
@@ -95,4 +94,4 @@ public class RenderMobDisplay implements IItemRenderer {
break;
}
}
}
}
@@ -7,7 +7,9 @@ import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
@@ -18,8 +20,6 @@ public class RenderPlacementMirror implements IItemRenderer {
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
//return type != ItemRenderType.INVENTORY && type!=ItemRenderType.ENTITY;
//return type != ItemRenderType.INVENTORY ;
return true;
}
@@ -40,7 +40,8 @@ public class RenderPlacementMirror implements IItemRenderer {
}
case EQUIPPED: {
for (int i = 1; i >= 0; i--) {
IIcon icon = ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class).getIconFromDamageForRenderPass(0, i);
IIcon icon = ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class)
.getIconFromDamageForRenderPass(0, i);
if (i == 0) {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
@@ -50,7 +51,15 @@ public class RenderPlacementMirror implements IItemRenderer {
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
ItemRenderer.renderItemIn2D(
Tessellator.instance,
f1,
f2,
f,
f3,
icon.getIconWidth(),
icon.getIconHeight(),
1F / 16F);
}
GL11.glDisable(GL11.GL_BLEND);
break;
@@ -74,5 +83,4 @@ public class RenderPlacementMirror implements IItemRenderer {
break;
}
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [9 Sep 2013, 17:12:26 (GMT)]
@@ -24,7 +21,9 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.client.lib.LibResources;
import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet;
@@ -36,28 +35,22 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
private static final ResourceLocation overlayRight = new ResourceLocation(LibResources.MISC_AT_RIGHT);
private static final ResourceLocation overlayIndent = new ResourceLocation(LibResources.MISC_AT_INDENT);
private static final float[][] TRANSLATIONS = new float[][]{
{0F, 0F, -1F},
{-1F, 0F, 0F},
{0F, 0F, 0F},
{-1F, 0F, -1F}
};
private static final float[][] TRANSLATIONS = new float[][] { { 0F, 0F, -1F }, { -1F, 0F, 0F }, { 0F, 0F, 0F },
{ -1F, 0F, -1F } };
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float partialTicks) {
TileAnimationTablet tile = (TileAnimationTablet) tileentity;
int meta = tile.getBlockMetadata() & 7;
if (meta < 2)
meta = 2; // Just in case
if (meta < 2) meta = 2; // Just in case
int rotation = meta == 2 ? 270 : meta == 3 ? 90 : meta == 4 ? 0 : 180;
GL11.glPushMatrix();
GL11.glTranslated(d0, d1, d2);
renderOverlay(tile, overlayCenter, -1, false, false, 0.65, 0.13F, 0F);
if (tile.leftClick)
renderOverlay(tile, overlayLeft, 1, false, true, 1, 0.13F, 0F);
if (tile.leftClick) renderOverlay(tile, overlayLeft, 1, false, true, 1, 0.13F, 0F);
else renderOverlay(tile, overlayRight, 1, false, true, 1, 0.131F, 0F);
renderOverlay(tile, overlayIndent, 0, false, false, 0.5F, 0.13F, rotation + 90F);
@@ -83,10 +76,8 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
entityitem.hoverStart = 0.0F;
GL11.glPushMatrix();
GL11.glTranslatef(0.5F, 0.55F, 0F);
if (stack.getItem() instanceof ItemBlock)
GL11.glScalef(2.5F, 2.5F, 2.5F);
else
GL11.glScalef(1.5F, 1.5F, 1.5F);
if (stack.getItem() instanceof ItemBlock) GL11.glScalef(2.5F, 2.5F, 2.5F);
else GL11.glScalef(1.5F, 1.5F, 1.5F);
RenderItem.renderInFrame = true;
RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
RenderItem.renderInFrame = false;
@@ -94,13 +85,13 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
}
}
private void renderOverlay(TileAnimationTablet tablet, ResourceLocation texture, int rotationMod, boolean useLighting, boolean useBlend, double size, float height, float forceDeg) {
private void renderOverlay(TileAnimationTablet tablet, ResourceLocation texture, int rotationMod,
boolean useLighting, boolean useBlend, double size, float height, float forceDeg) {
Minecraft mc = ClientHelper.minecraft();
mc.renderEngine.bindTexture(texture);
GL11.glPushMatrix();
GL11.glDepthMask(false);
if (!useLighting)
GL11.glDisable(GL11.GL_LIGHTING);
if (!useLighting) GL11.glDisable(GL11.GL_LIGHTING);
if (useBlend) {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
@@ -119,8 +110,7 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
tess.addVertexWithUV(size2, 0, size2, 0, 0);
tess.draw();
GL11.glDepthMask(true);
if (!useLighting)
GL11.glEnable(GL11.GL_LIGHTING);
if (!useLighting) GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}
}
@@ -1,19 +1,18 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [16 Sep 2013, 22:39:36 (GMT)]
*/
package thaumic.tinkerer.client.render.tile;
import java.awt.Color;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
@@ -22,13 +21,13 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import org.lwjgl.opengl.GL11;
import thaumcraft.client.renderers.item.ItemWandRenderer;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.common.block.tile.TileEnchanter;
import java.awt.*;
public class RenderTileEnchanter extends TileEntitySpecialRenderer {
ItemWandRenderer wandRenderer = new ItemWandRenderer();
@@ -61,7 +60,15 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
ItemRenderer.renderItemIn2D(
Tessellator.instance,
f1,
f2,
f,
f3,
icon.getIconWidth(),
icon.getIconHeight(),
1F / 16F);
GL11.glColor3f(1F, 1F, 1F);
}
renderPass++;
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [28 Sep 2013, 20:24:39 (GMT)]
@@ -18,7 +15,9 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import thaumcraft.client.renderers.block.BlockJarRenderer;
import thaumcraft.client.renderers.tile.ItemJarFilledRenderer;
import thaumic.tinkerer.common.block.tile.TileFunnel;
@@ -35,14 +34,13 @@ public class RenderTileFunnel extends TileEntitySpecialRenderer {
if (stack != null) {
GL11.glPushMatrix();
GL11.glTranslated(d0 + 0.5, d1 + 0.365, d2 + 0.5);
//if(Block.getBlockFromItem(stack.getItem())== ConfigBlocks.blockJar) {
// GL11.glTranslatef(0F, 0.25F, 0F);
// jarRenderer.renderInventoryBlock(ConfigBlocks.blockJar, 0, 0, new RenderBlocks());
//}
// if(Block.getBlockFromItem(stack.getItem())== ConfigBlocks.blockJar) {
// GL11.glTranslatef(0F, 0.25F, 0F);
// jarRenderer.renderInventoryBlock(ConfigBlocks.blockJar, 0, 0, new RenderBlocks());
// }
// else
jarRenderer1.renderItem(IItemRenderer.ItemRenderType.ENTITY, stack, (Object[]) null);
GL11.glPopMatrix();
}
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [12 Sep 2013, 17:55:04 (GMT)]
@@ -19,8 +16,10 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import thaumcraft.client.lib.UtilsFX;
import thaumcraft.common.config.ConfigItems;
import thaumcraft.common.items.armor.ItemHoverHarness;
@@ -44,14 +43,21 @@ public class RenderTileMagnet extends TileEntitySpecialRenderer {
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glTranslatef((float) x, (float) y, (float) z);
boolean blue = tileentity.getWorldObj() == null || (tileentity.getBlockMetadata() & 1) == 0;
boolean mob = tileentity.getWorldObj() == null ? RenderTileMagnet.mob : (tileentity.getBlockMetadata() & 2) == 2;
boolean mob = tileentity.getWorldObj() == null ? RenderTileMagnet.mob
: (tileentity.getBlockMetadata() & 2) == 2;
ClientHelper.minecraft().renderEngine.bindTexture(mob ? blue ? blueMob : redMob : blue ? RenderTileMagnet.blue : red);
ClientHelper.minecraft().renderEngine
.bindTexture(mob ? blue ? blueMob : redMob : blue ? RenderTileMagnet.blue : red);
int redstone = 0;
if (tileentity.getWorldObj() != null) {
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
redstone = Math.max(redstone, tileentity.getWorldObj().getIndirectPowerLevelTo(tileentity.xCoord + dir.offsetX, tileentity.yCoord + dir.offsetY, tileentity.zCoord + dir.offsetZ, dir.ordinal()));
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) redstone = Math.max(
redstone,
tileentity.getWorldObj().getIndirectPowerLevelTo(
tileentity.xCoord + dir.offsetX,
tileentity.yCoord + dir.offsetY,
tileentity.zCoord + dir.offsetZ,
dir.ordinal()));
} else redstone = 15;
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
@@ -65,7 +71,16 @@ public class RenderTileMagnet extends TileEntitySpecialRenderer {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
GL11.glScalef(1F, -1F, 1F);
UtilsFX.renderQuadCenteredFromIcon(false, icon, redstone / 15F * 0.7F + (redstone == 0 ? 0 : 0.4F), blue ? 0F : 1F, 0F, blue ? 1F : 0F, 225, GL11.GL_ONE_MINUS_SRC_ALPHA, 0.9F);
UtilsFX.renderQuadCenteredFromIcon(
false,
icon,
redstone / 15F * 0.7F + (redstone == 0 ? 0 : 0.4F),
blue ? 0F : 1F,
0F,
blue ? 1F : 0F,
225,
GL11.GL_ONE_MINUS_SRC_ALPHA,
0.9F);
}
GL11.glTranslated(0, 0, -(Math.cos(System.currentTimeMillis() / 500F) + 1) * 0.09 - 0.1);
@@ -74,4 +89,4 @@ public class RenderTileMagnet extends TileEntitySpecialRenderer {
GL11.glPopMatrix();
}
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [12 Sep 2013, 17:55:04 (GMT)]
@@ -17,8 +14,10 @@ package thaumic.tinkerer.client.render.tile;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.client.lib.LibResources;
import thaumic.tinkerer.client.model.ModelRelay;
@@ -41,4 +40,4 @@ public class RenderTileRelay extends TileEntitySpecialRenderer {
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}
}
@@ -1,19 +1,18 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Nov 30, 2013, 5:27:39 PM (GMT)]
*/
package thaumic.tinkerer.client.render.tile;
import java.awt.Color;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.Tessellator;
@@ -23,15 +22,15 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.client.lib.LibResources;
import thaumic.tinkerer.client.model.ModelRepairer;
import thaumic.tinkerer.common.block.tile.TileRepairer;
import java.awt.*;
public class RenderTileRepairer extends TileEntitySpecialRenderer {
private static final ResourceLocation modelTex = new ResourceLocation(LibResources.MODEL_REPAIRER);
@@ -85,7 +84,15 @@ public class RenderTileRepairer extends TileEntitySpecialRenderer {
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
ItemRenderer.renderItemIn2D(
Tessellator.instance,
f1,
f2,
f,
f3,
icon.getIconWidth(),
icon.getIconHeight(),
1F / 16F);
GL11.glColor3f(1F, 1F, 1F);
}
renderPass++;
@@ -131,5 +138,4 @@ public class RenderTileRepairer extends TileEntitySpecialRenderer {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}
@@ -1,13 +1,10 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Jan 10, 2014, 4:44:15 PM (GMT)]
@@ -16,7 +13,9 @@ package thaumic.tinkerer.client.render.tile.kami;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import thaumic.tinkerer.client.model.kami.ModelSpinningCubes;
public class RenderTileWarpGate extends TileEntitySpecialRenderer {
@@ -33,5 +32,4 @@ public class RenderTileWarpGate extends TileEntitySpecialRenderer {
cubes.renderSpinningCubes(12, repeat, repeat);
GL11.glPopMatrix();
}
}
@@ -1,19 +1,24 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [4 Sep 2013, 16:01:28 (GMT)]
*/
package thaumic.tinkerer.common;
import java.util.Arrays;
import net.minecraft.command.ICommandManager;
import net.minecraft.command.ServerCommandManager;
import net.minecraft.server.MinecraftServer;
import net.minecraftforge.common.DimensionManager;
import org.apache.logging.log4j.Logger;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
@@ -21,14 +26,13 @@ import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraft.command.ICommandManager;
import net.minecraft.command.ServerCommandManager;
import net.minecraft.server.MinecraftServer;
import net.minecraftforge.common.DimensionManager;
import org.apache.logging.log4j.Logger;
import thaumcraft.common.CommonProxy;
import thaumcraft.common.Thaumcraft;
import thaumic.tinkerer.api.InterModCommsOperations;
@@ -43,8 +47,6 @@ import thaumic.tinkerer.common.peripheral.PeripheralHandler;
import thaumic.tinkerer.common.registry.TTRegistry;
import thaumic.tinkerer.common.research.KamiResearchItem;
import java.util.Arrays;
@Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION, dependencies = LibMisc.DEPENDENCIES)
public class ThaumicTinkerer {
@@ -67,9 +69,11 @@ public class ThaumicTinkerer {
tcProxy = Thaumcraft.proxy;
proxy.preInit(event);
if (Loader.isModLoaded("Waila")) {
FMLInterModComms.sendMessage("Waila", "register", "thaumic.tinkerer.common.compat.TTinkererProvider.callbackRegister");
FMLInterModComms.sendMessage(
"Waila",
"register",
"thaumic.tinkerer.common.compat.TTinkererProvider.callbackRegister");
}
}
@EventHandler
@@ -89,17 +93,14 @@ public class ThaumicTinkerer {
String[] values = message.getStringValue().split(",");
KamiResearchItem.Blacklist.addAll(Arrays.asList(values));
}
if(message.key.equalsIgnoreCase(InterModCommsOperations.ADD_CC_BLACKLIST))
{
if(Loader.isModLoaded("ComputerCraft"))
blackListCCDevices(message.getStringValue());
if (message.key.equalsIgnoreCase(InterModCommsOperations.ADD_CC_BLACKLIST)) {
if (Loader.isModLoaded("ComputerCraft")) blackListCCDevices(message.getStringValue());
}
}
}
@Optional.Method(modid = "ComputerCraft")
public void blackListCCDevices(String classname)
{
public void blackListCCDevices(String classname) {
PeripheralHandler.Blacklist.add(classname);
}
@@ -115,6 +116,5 @@ public class ThaumicTinkerer {
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
proxy.postInit(event);
}
}
@@ -1,21 +1,19 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [9 Sep 2013, 15:52:53 (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -32,6 +30,9 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -49,9 +50,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.ArrayList;
import java.util.Random;
public class BlockAnimationTablet extends BlockModContainer {
IIcon iconBottom;
@@ -79,27 +77,20 @@ public class BlockAnimationTablet extends BlockModContainer {
}
@Override
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) {
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving,
ItemStack par6ItemStack) {
byte b0 = 0;
int l1 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if (l1 == 0)
b0 = 2;
if (l1 == 0) b0 = 2;
if (l1 == 1)
b0 = 5;
if (l1 == 1) b0 = 5;
if (l1 == 2)
b0 = 3;
if (l1 == 2) b0 = 3;
if (l1 == 3)
b0 = 4;
if (l1 == 3) b0 = 4;
par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2);
//TileAnimationTablet tablet = (TileAnimationTablet) par1World.getTileEntity(par2, par3, par4);
//if(par5EntityLiving instanceof EntityPlayer) {
// tablet.Owner = ((EntityPlayer) par5EntityLiving).username;
//}
}
@Override
@@ -107,10 +98,7 @@ public class BlockAnimationTablet extends BlockModContainer {
TileAnimationTablet tablet = (TileAnimationTablet) par1World.getTileEntity(par2, par3, par4);
if (tablet != null) {
if (tablet.getIsBreaking()) {
//ChunkCoordinates coords = tablet.getTargetLoc();
//par1World.destroyBlockInWorldPartially(tablet.getFakePlayer().entityId, coords.posX, coords.posY, coords.posZ, -1);
}
if (tablet.getIsBreaking()) {}
for (int j1 = 0; j1 < tablet.getSizeInventory(); ++j1) {
ItemStack itemstack = tablet.getStackInSlot(j1);
@@ -120,26 +108,31 @@ public class BlockAnimationTablet extends BlockModContainer {
float f1 = random.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
.spawnEntityInWorld(entityitem)) {
int k1 = random.nextInt(21) + 10;
if (k1 > itemstack.stackSize)
k1 = itemstack.stackSize;
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
itemstack.stackSize -= k1;
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
entityitem = new EntityItem(
par1World,
par2 + f,
par3 + f1,
par4 + f2,
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (float) random.nextGaussian() * f3;
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) random.nextGaussian() * f3;
if (itemstack.hasTagCompound())
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
}
}
//Look here if something breaks in 1.7
// Look here if something breaks in 1.7
par1World.func_147453_f(par2, par3, par4, par5);
}
@@ -148,18 +141,17 @@ public class BlockAnimationTablet extends BlockModContainer {
@Override
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) {
if (par1World.isRemote)
return;
if (par1World.isRemote) return;
boolean power = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
boolean power = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)
|| par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
int meta = par1World.getBlockMetadata(par2, par3, par4);
boolean on = (meta & 8) != 0;
if (power && !on) {
par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta | 8, 4);
} else if (!power && on)
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta & 7, 4);
} else if (!power && on) par1World.setBlockMetadataWithNotify(par2, par3, par4, meta & 7, 4);
}
@Override
@@ -175,32 +167,39 @@ public class BlockAnimationTablet extends BlockModContainer {
if (tablet.redstone && tablet.swingProgress == 0) {
tablet.findEntities(tablet.getTargetLoc());
tablet.initiateSwing();
par1World.addBlockEvent(par2, par3, par4, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class), 0, 0);
par1World.addBlockEvent(
par2,
par3,
par4,
ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class),
0,
0);
}
}
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
int par6, float par7, float par8, float par9) {
if (!par1World.isRemote) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
if (tile != null) {
TileAnimationTablet tablet = (TileAnimationTablet) tile;
if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) {
if (par5EntityPlayer.getCurrentEquippedItem() != null
&& par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) {
int meta = par1World.getBlockMetadata(par2, par3, par4);
boolean activated = (meta & 8) != 0;
if (!activated && !tablet.getIsBreaking() && tablet.swingProgress == 0) {
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta == 5 ? 2 : meta + 1, 1 | 2);
par1World.playSoundEffect(par2, par3, par4, "thaumcraft:tool", 0.6F, 1F);
} else
par5EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.animationTablet.notRotatable"));
} else par5EntityPlayer
.addChatMessage(new ChatComponentTranslation("ttmisc.animationTablet.notRotatable"));
// Rare chance this might happen, but better to cope for it.
return true;
} else {
//if(tablet.Owner==null || tablet.Owner.equals(""))
// tablet.Owner=par5EntityPlayer.username;
par5EntityPlayer.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_TABLET, par1World, par2, par3, par4);
par5EntityPlayer
.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_TABLET, par1World, par2, par3, par4);
}
}
}
@@ -211,7 +210,8 @@ public class BlockAnimationTablet extends BlockModContainer {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int par2) {
return par1 == ForgeDirection.UP.ordinal() ? iconTop : par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSides;
return par1 == ForgeDirection.UP.ordinal() ? iconTop
: par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSides;
}
@Override
@@ -261,18 +261,33 @@ public class BlockAnimationTablet extends BlockModContainer {
@Override
public IRegisterableResearch getResearchItem() {
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_ANIMATION_TABLET, new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.METAL, 1).add(Aspect.MOTION, 1).add(Aspect.ENERGY, 1), -8, 2, 4, new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class))).setWarp(1).setParents(LibResearch.KEY_MAGNETS)
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_ANIMATION_TABLET));
return (IRegisterableResearch) new TTResearchItem(
LibResearch.KEY_ANIMATION_TABLET,
new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.METAL, 1).add(Aspect.MOTION, 1)
.add(Aspect.ENERGY, 1),
-8,
2,
4,
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class))).setWarp(1)
.setParents(LibResearch.KEY_MAGNETS).setPages(
new ResearchPage("0"),
ResearchHelper.arcaneRecipePage(LibResearch.KEY_ANIMATION_TABLET));
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_ANIMATION_TABLET, LibResearch.KEY_ANIMATION_TABLET, new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class)), new AspectList().add(Aspect.AIR, 25).add(Aspect.ORDER, 15).add(Aspect.FIRE, 10),
"GIG", "ICI",
'G', new ItemStack(Items.gold_ingot),
'I', new ItemStack(Items.iron_ingot),
'C', new ItemStack(ConfigItems.itemGolemCore, 1, 100));
return new ThaumicTinkererArcaneRecipe(
LibResearch.KEY_ANIMATION_TABLET,
LibResearch.KEY_ANIMATION_TABLET,
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class)),
new AspectList().add(Aspect.AIR, 25).add(Aspect.ORDER, 15).add(Aspect.FIRE, 10),
"GIG",
"ICI",
'G',
new ItemStack(Items.gold_ingot),
'I',
new ItemStack(Items.iron_ingot),
'C',
new ItemStack(ConfigItems.itemGolemCore, 1, 100));
}
}
@@ -1,20 +1,19 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Dec 11, 2013, 10:31:09 PM (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.common.Loader;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -26,6 +25,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.common.Loader;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -43,9 +44,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.ArrayList;
import java.util.Random;
public class BlockAspectAnalyzer extends BlockModContainer {
IIcon[] icons = new IIcon[5];
@@ -61,11 +59,18 @@ public class BlockAspectAnalyzer extends BlockModContainer {
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
int par6, float par7, float par8, float par9) {
if (!par1World.isRemote) {
TileAspectAnalyzer tile = (TileAspectAnalyzer) par1World.getTileEntity(par2, par3, par4);
if (tile != null) {
par5EntityPlayer.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_ASPECT_ANALYZER, par1World, par2, par3, par4);
par5EntityPlayer.openGui(
ThaumicTinkerer.instance,
LibGuiIDs.GUI_ID_ASPECT_ANALYZER,
par1World,
par2,
par3,
par4);
}
}
@@ -85,21 +90,26 @@ public class BlockAspectAnalyzer extends BlockModContainer {
float f1 = random.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
.spawnEntityInWorld(entityitem)) {
int k1 = random.nextInt(21) + 10;
if (k1 > itemstack.stackSize)
k1 = itemstack.stackSize;
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
itemstack.stackSize -= k1;
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
entityitem = new EntityItem(
par1World,
par2 + f,
par3 + f1,
par4 + f2,
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (float) random.nextGaussian() * f3;
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) random.nextGaussian() * f3;
if (itemstack.hasTagCompound())
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
}
}
@@ -112,8 +122,7 @@ public class BlockAspectAnalyzer extends BlockModContainer {
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
for (int i = 0; i < 5; i++)
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
for (int i = 0; i < 5; i++) icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
}
@Override
@@ -158,16 +167,33 @@ public class BlockAspectAnalyzer extends BlockModContainer {
@Override
public IRegisterableResearch getResearchItem() {
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_ASPECT_ANALYZER, new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.SENSES, 1).add(Aspect.MIND, 1), 0, 1, 2, new ItemStack(this)).setParents(LibResearch.KEY_PERIPHERALS).setParentsHidden("GOGGLES", "THAUMIUM").setConcealed().setRound()
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_ASPECT_ANALYZER));
return (IRegisterableResearch) new TTResearchItem(
LibResearch.KEY_ASPECT_ANALYZER,
new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.SENSES, 1).add(Aspect.MIND, 1),
0,
1,
2,
new ItemStack(this)).setParents(LibResearch.KEY_PERIPHERALS).setParentsHidden("GOGGLES", "THAUMIUM")
.setConcealed().setRound().setPages(
new ResearchPage("0"),
ResearchHelper.arcaneRecipePage(LibResearch.KEY_ASPECT_ANALYZER));
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_ASPECT_ANALYZER, LibResearch.KEY_ASPECT_ANALYZER, new ItemStack(this), new AspectList().add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1),
"TWT", "WMW", "TWT",
'W', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6),
'M', new ItemStack(ConfigItems.itemThaumometer),
'T', new ItemStack(ConfigItems.itemResource, 1, 2));
return new ThaumicTinkererArcaneRecipe(
LibResearch.KEY_ASPECT_ANALYZER,
LibResearch.KEY_ASPECT_ANALYZER,
new ItemStack(this),
new AspectList().add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1),
"TWT",
"WMW",
"TWT",
'W',
new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6),
'M',
new ItemStack(ConfigItems.itemThaumometer),
'T',
new ItemStack(ConfigItems.itemResource, 1, 2));
}
}
@@ -1,21 +1,19 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Dec 27, 2013, 6:25:36 PM (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Arrays;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDirectional;
import net.minecraft.block.material.Material;
@@ -28,10 +26,10 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import thaumic.tinkerer.common.block.tile.TileCamo;
import java.util.Arrays;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.common.block.tile.TileCamo;
public abstract class BlockCamo extends BlockModContainer<TileCamo> {
@@ -49,8 +47,7 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
if (tile instanceof TileCamo) {
TileCamo camo = (TileCamo) tile;
Block block = camo.camo;
if (block != null && isValidRenderType(block.getRenderType()))
return block.getIcon(side, camo.camoMeta);
if (block != null && isValidRenderType(block.getRenderType())) return block.getIcon(side, camo.camoMeta);
}
return getIconFromSideAfterCheck(tile, meta, side);
@@ -61,7 +58,8 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
int par6, float par7, float par8, float par9) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
if (tile instanceof TileCamo) {
@@ -70,8 +68,7 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
boolean doChange = true;
Block block = null;
checkChange:
{
checkChange: {
if (currentStack != null) {
if (Item.getIdFromItem(currentStack.getItem()) == 0) {
doChange = false;
@@ -79,7 +76,9 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
}
block = Block.getBlockFromItem(currentStack.getItem());
if (block == null || !isValidRenderType(block.getRenderType()) || block instanceof BlockCamo || block.getMaterial() == Material.air)
if (block == null || !isValidRenderType(block.getRenderType())
|| block instanceof BlockCamo
|| block.getMaterial() == Material.air)
doChange = false;
}
}
@@ -135,7 +134,6 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
Block block = camo.camo;
if (block != null)
return block instanceof BlockCamo ? 0xFFFFFF : block.colorMultiplier(par1World, par2, par3, par4);
}
return 0xFFFFFF;
}
@@ -1,21 +1,19 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [14 Sep 2013, 01:13:25 (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -29,6 +27,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -47,9 +48,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.ArrayList;
import java.util.Random;
public class BlockEnchanter extends BlockModContainer {
Random random;
@@ -68,12 +66,14 @@ public class BlockEnchanter extends BlockModContainer {
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
int par6, float par7, float par8, float par9) {
if (!par1World.isRemote) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
if (tile != null) {
par1World.markBlockForUpdate(par2, par3, par4);
par5EntityPlayer.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_ENCHANTER, par1World, par2, par3, par4);
par5EntityPlayer
.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_ENCHANTER, par1World, par2, par3, par4);
}
}
@@ -93,21 +93,26 @@ public class BlockEnchanter extends BlockModContainer {
float f1 = random.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
.spawnEntityInWorld(entityitem)) {
int k1 = random.nextInt(21) + 10;
if (k1 > itemstack.stackSize)
k1 = itemstack.stackSize;
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
itemstack.stackSize -= k1;
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
entityitem = new EntityItem(
par1World,
par2 + f,
par3 + f1,
par4 + f2,
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (float) random.nextGaussian() * f3;
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) random.nextGaussian() * f3;
if (itemstack.hasTagCompound())
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
}
}
@@ -129,7 +134,8 @@ public class BlockEnchanter extends BlockModContainer {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int par2) {
return par1 == ForgeDirection.UP.ordinal() ? iconTop : par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSides;
return par1 == ForgeDirection.UP.ordinal() ? iconTop
: par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSides;
}
@Override
@@ -179,14 +185,36 @@ public class BlockEnchanter extends BlockModContainer {
@Override
public IRegisterableResearch getResearchItem() {
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_ENCHANTER, new AspectList().add(Aspect.MAGIC, 2).add(Aspect.AURA, 1).add(Aspect.ELDRITCH, 1).add(Aspect.DARKNESS, 1).add(Aspect.MIND, 1), 5, 4, 5, new ItemStack(this)).setParents(LibResearch.KEY_SPELL_CLOTH)
.setPages(new ResearchPage("0"), new ResearchPage("1"), new ResearchPage("2"), ResearchHelper.infusionPage(LibResearch.KEY_ENCHANTER));
return (IRegisterableResearch) new TTResearchItem(
LibResearch.KEY_ENCHANTER,
new AspectList().add(Aspect.MAGIC, 2).add(Aspect.AURA, 1).add(Aspect.ELDRITCH, 1)
.add(Aspect.DARKNESS, 1).add(Aspect.MIND, 1),
5,
4,
5,
new ItemStack(this)).setParents(LibResearch.KEY_SPELL_CLOTH).setPages(
new ResearchPage("0"),
new ResearchPage("1"),
new ResearchPage("2"),
ResearchHelper.infusionPage(LibResearch.KEY_ENCHANTER));
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererInfusionRecipe(LibResearch.KEY_ENCHANTER, new ItemStack(this), 15, new AspectList().add(Aspect.MAGIC, 50).add(Aspect.ENERGY, 20).add(Aspect.ELDRITCH, 20).add(Aspect.VOID, 20).add(Aspect.MIND, 10), new ItemStack(Blocks.enchanting_table),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1), new ItemStack(ConfigItems.itemResource, 1, 2), new ItemStack(ConfigItems.itemResource, 1, 2), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemSpellCloth.class)));
return new ThaumicTinkererInfusionRecipe(
LibResearch.KEY_ENCHANTER,
new ItemStack(this),
15,
new AspectList().add(Aspect.MAGIC, 50).add(Aspect.ENERGY, 20).add(Aspect.ELDRITCH, 20)
.add(Aspect.VOID, 20).add(Aspect.MIND, 10),
new ItemStack(Blocks.enchanting_table),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1),
new ItemStack(ConfigItems.itemResource, 1, 2),
new ItemStack(ConfigItems.itemResource, 1, 2),
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemSpellCloth.class)));
}
}
@@ -1,20 +1,22 @@
package thaumic.tinkerer.common.block;
import java.util.ArrayList;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import thaumic.tinkerer.common.block.tile.TileForcefield;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import java.util.ArrayList;
/**
* Created by pixlepix on 4/19/14.
*/
public class BlockForcefield extends BlockMod {
public BlockForcefield() {
super(Material.air);
}
@@ -26,7 +28,7 @@ public class BlockForcefield extends BlockMod {
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
return new ArrayList<ItemStack>();
return new ArrayList<>();
}
@Override
@@ -1,21 +1,19 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [28 Sep 2013, 19:33:05 (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -30,6 +28,9 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -44,9 +45,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.ArrayList;
import java.util.Random;
public class BlockFunnel extends BlockModContainer {
IIcon sideIcon, topIcon;
@@ -118,21 +116,26 @@ public class BlockFunnel extends BlockModContainer {
float f1 = random.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
.spawnEntityInWorld(entityitem)) {
int k1 = random.nextInt(21) + 10;
if (k1 > itemstack.stackSize)
k1 = itemstack.stackSize;
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
itemstack.stackSize -= k1;
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
entityitem = new EntityItem(
par1World,
par2 + f,
par3 + f1,
par4 + f2,
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (float) random.nextGaussian() * f3;
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) random.nextGaussian() * f3;
if (itemstack.hasTagCompound())
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
}
}
@@ -144,7 +147,8 @@ public class BlockFunnel extends BlockModContainer {
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
int par6, float par7, float par8, float par9) {
TileFunnel funnel = (TileFunnel) par1World.getTileEntity(par2, par3, par4);
ItemStack stack = funnel.getStackInSlot(0);
@@ -207,16 +211,29 @@ public class BlockFunnel extends BlockModContainer {
@Override
public IRegisterableResearch getResearchItem() {
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_FUNNEL, new AspectList().add(Aspect.TOOL, 1).add(Aspect.TRAVEL, 2), 0, -7, 1, new ItemStack(this)).setParentsHidden("DISTILESSENTIA").setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_FUNNEL)).setSecondary();
return (IRegisterableResearch) new TTResearchItem(
LibResearch.KEY_FUNNEL,
new AspectList().add(Aspect.TOOL, 1).add(Aspect.TRAVEL, 2),
0,
-7,
1,
new ItemStack(this)).setParentsHidden("DISTILESSENTIA").setParents(LibResearch.KEY_BRIGHT_NITOR)
.setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_FUNNEL))
.setSecondary();
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_FUNNEL, LibResearch.KEY_FUNNEL, new ItemStack(this), new AspectList().add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1),
return new ThaumicTinkererArcaneRecipe(
LibResearch.KEY_FUNNEL,
LibResearch.KEY_FUNNEL,
new ItemStack(this),
new AspectList().add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1),
"STS",
'S', new ItemStack(Blocks.stone),
'T', new ItemStack(ConfigItems.itemResource, 1, 2));
'S',
new ItemStack(Blocks.stone),
'T',
new ItemStack(ConfigItems.itemResource, 1, 2));
}
}
@@ -1,21 +1,19 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [8 Sep 2013, 22:13:36 (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
@@ -26,14 +24,14 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.registry.ITTinkererBlock;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import java.util.ArrayList;
import java.util.Random;
public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
public BlockGas() {
@@ -83,8 +81,7 @@ public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
private void setAt(World world, int x, int y, int z, int meta) {
if (world.isAirBlock(x, y, z) && world.getBlock(x, y, z) != this) {
if (!world.isRemote)
world.setBlock(x, y, z, this, meta, 2);
if (!world.isRemote) world.setBlock(x, y, z, this, meta, 2);
world.scheduleBlockUpdate(x, y, z, this, 10);
}
}
@@ -121,7 +118,7 @@ public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
return new ArrayList(); // Empty List
return new ArrayList<>(); // Empty List
}
@Override
@@ -1,29 +1,27 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [8 Sep 2013, 22:20:30 (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.lib.LibBlockNames;
import java.util.Random;
public class BlockGaseousLight extends BlockGas {
public BlockGaseousLight() {
@@ -57,4 +55,4 @@ public class BlockGaseousLight extends BlockGas {
public Class<? extends TileEntity> getTileEntity() {
return null;
}
}
}
@@ -1,29 +1,27 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [8 Sep 2013, 22:21:13 (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.lib.LibBlockNames;
import java.util.Random;
public class BlockGaseousShadow extends BlockGas {
public BlockGaseousShadow() {
@@ -34,8 +32,8 @@ public class BlockGaseousShadow extends BlockGas {
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
if (par5Random.nextFloat() < 0.0075F)
ThaumicTinkerer.tcProxy.wispFX2(par1World, par2 + 0.5, par3 + 0.5, par4 + 0.5, 0.125F, 5, true, true, -0.02F);
if (par5Random.nextFloat() < 0.0075F) ThaumicTinkerer.tcProxy
.wispFX2(par1World, par2 + 0.5, par3 + 0.5, par4 + 0.5, 0.125F, 5, true, true, -0.02F);
}
@Override
@@ -57,4 +55,4 @@ public class BlockGaseousShadow extends BlockGas {
public Class<? extends TileEntity> getTileEntity() {
return null;
}
}
}
@@ -1,6 +1,7 @@
package thaumic.tinkerer.common.block;
import cpw.mods.fml.common.Loader;
import java.util.ArrayList;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -8,6 +9,8 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.Loader;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -23,8 +26,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.ArrayList;
public class BlockGolemConnector extends BlockCamo {
public BlockGolemConnector() {
@@ -79,17 +80,39 @@ public class BlockGolemConnector extends BlockCamo {
@Override
public IRegisterableResearch getResearchItem() {
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_GOLEMCONNECTOR, new AspectList().add(Aspect.ORDER, 1).add(Aspect.TRAVEL, 2).add(Aspect.TOOL, 1), 1, 0, 0, new ItemStack(this)).setParents(LibResearch.KEY_PERIPHERALS).setParentsHidden("GOLEMBELL").setConcealed().setRound()
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_GOLEMCONNECTOR), new ResearchPage("1"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_INTERFACE + "1"), new ResearchPage("2"), new ResearchPage("3"));
return (IRegisterableResearch) new TTResearchItem(
LibResearch.KEY_GOLEMCONNECTOR,
new AspectList().add(Aspect.ORDER, 1).add(Aspect.TRAVEL, 2).add(Aspect.TOOL, 1),
1,
0,
0,
new ItemStack(this)).setParents(LibResearch.KEY_PERIPHERALS).setParentsHidden("GOLEMBELL")
.setConcealed().setRound().setPages(
new ResearchPage("0"),
ResearchHelper.arcaneRecipePage(LibResearch.KEY_GOLEMCONNECTOR),
new ResearchPage("1"),
ResearchHelper.arcaneRecipePage(LibResearch.KEY_INTERFACE + "1"),
new ResearchPage("2"),
new ResearchPage("3"));
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_GOLEMCONNECTOR, LibResearch.KEY_GOLEMCONNECTOR, new ItemStack(this), new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.ENTROPY, 15),
"WFW", "sIs", "WFW",
'I', new ItemStack(ConfigItems.itemGolemBell),
's', new ItemStack(Items.ender_pearl),
'W', new ItemStack(ConfigBlocks.blockMagicalLog),
'F', new ItemStack(Blocks.redstone_block));
return new ThaumicTinkererArcaneRecipe(
LibResearch.KEY_GOLEMCONNECTOR,
LibResearch.KEY_GOLEMCONNECTOR,
new ItemStack(this),
new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.ENTROPY, 15),
"WFW",
"sIs",
"WFW",
'I',
new ItemStack(ConfigItems.itemGolemBell),
's',
new ItemStack(Items.ender_pearl),
'W',
new ItemStack(ConfigBlocks.blockMagicalLog),
'F',
new ItemStack(Blocks.redstone_block));
}
}
}
@@ -1,7 +1,8 @@
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.BlockFarmland;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
@@ -13,6 +14,9 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.block.tile.TileInfusedFarmland;
import thaumic.tinkerer.common.lib.LibBlockNames;
@@ -20,17 +24,14 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import java.util.ArrayList;
import java.util.Random;
/**
* Created by pixlepix on 8/4/14.
*/
public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlock {
@SideOnly(Side.CLIENT)
private IIcon iconWet;
@SideOnly(Side.CLIENT)
private IIcon iconDry;
@@ -83,7 +84,8 @@ public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlo
}
@Override
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction,
IPlantable plantable) {
return plantable instanceof BlockInfusedGrain;
}
@@ -102,24 +104,24 @@ public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlo
return null;
}
//Prevent farmland degrading
// Prevent farmland degrading
@Override
public void onFallenUpon(World p_149746_1_, int p_149746_2_, int p_149746_3_, int p_149746_4_, Entity p_149746_5_, float p_149746_6_) {
}
public void onFallenUpon(World p_149746_1_, int p_149746_2_, int p_149746_3_, int p_149746_4_, Entity p_149746_5_,
float p_149746_6_) {}
@Override
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {
}
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return p_149691_1_ == 1 ? (iconWet) : Blocks.dirt.getBlockTextureFromSide(p_149691_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_) {
this.iconWet = IconHelper.forBlock(p_149651_1_, this);
}
}
@@ -1,15 +1,18 @@
package thaumic.tinkerer.common.block;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockCrops;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.common.lib.research.ResearchManager;
@@ -25,23 +28,18 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import java.util.ArrayList;
import java.util.Random;
/**
* Created by pixlepix on 4/14/14.
*/
public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
//Code based off vanilla potato code
// Code based off vanilla potato code
public static final int BREEDING_CHANCE = 10;
private IIcon[][] icons;
private TileInfusedGrain tileEntity;
//Returns 0-5 for primal aspects, or 6 if compound aspect
// Returns 0-5 for primal aspects, or 6 if compound aspect
public static int getNumberFromAspectForTexture(Aspect aspect) {
if (aspect == Aspect.AIR) {
return 0;
@@ -65,7 +63,9 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
}
public static Aspect getAspect(IBlockAccess world, int x, int y, int z) {
return world.getTileEntity(x, y, z) instanceof TileInfusedGrain ? ((TileInfusedGrain) world.getTileEntity(x, y, z)).aspect : null;
return world.getTileEntity(x, y, z) instanceof TileInfusedGrain
? ((TileInfusedGrain) world.getTileEntity(x, y, z)).aspect
: null;
}
public static void setAspect(IBlockAccess world, int x, int y, int z, Aspect aspect) {
@@ -86,7 +86,7 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
}
}
//Override BlockCrop's getIcon to prevent a crash with mods such as WAILA
// Override BlockCrop's getIcon to prevent a crash with mods such as WAILA
@Override
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return this.icons[1][0];
@@ -105,7 +105,7 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
icons = new IIcon[7][4];
String[] names = {"aer", "ignis", "aqua", "terra", "ordo", "perditio", "generic"};
String[] names = { "aer", "ignis", "aqua", "terra", "ordo", "perditio", "generic" };
for (int j = 0; j < names.length; j++) {
String s = names[j];
for (int i = 0; i < 4; i++) {
@@ -118,16 +118,15 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
public void breakBlock(World world, int x, int y, int z, Block block, int metadata) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileInfusedGrain) {
tileEntity = (TileInfusedGrain)tile;
tileEntity = (TileInfusedGrain) tile;
}
super.breakBlock(world, x, y, z, block, metadata);
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
if(world==null)
return ret;
ArrayList<ItemStack> ret = new ArrayList<>();
if (world == null) return ret;
Random rand = new Random();
int count = 1;
for (int i = 0; i < count; i++) {
@@ -146,9 +145,8 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
if (metadata >= 7) {
do {
Aspect aspect = getAspectSafe(world, x, y, z);
ItemStack retItem=AspectCropLootManager.getLootForAspect(aspect);
if(retItem!=null)
ret.add(retItem);
ItemStack retItem = AspectCropLootManager.getLootForAspect(aspect);
if (retItem != null) ret.add(retItem);
} while (world.rand.nextInt(75) < getPrimalTendencyCount(world, x, y, z, Aspect.ORDER));
}
@@ -175,10 +173,10 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
}
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
//Prevent normal growth from occuring
//Growth takes place in the tile entity
// Prevent normal growth from occuring
// Growth takes place in the tile entity
checkAndDropBlock(world, x, y, z);
}
@@ -189,7 +187,9 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
AspectList farmlandAspectList = ((TileInfusedFarmland) world.getTileEntity(x, y - 1, z)).aspectList;
for (Aspect aspect : farmlandAspectList.getAspects()) {
Random rand = new Random();
if (rand.nextInt(BREEDING_CHANCE) < (getPrimalTendencyCount(world, x, y, z, Aspect.FIRE) + 1) * farmlandAspectList.getAmount(aspect) * farmlandAspectList.getAmount(aspect)) {
if (rand.nextInt(BREEDING_CHANCE) < (getPrimalTendencyCount(world, x, y, z, Aspect.FIRE) + 1)
* farmlandAspectList.getAmount(aspect)
* farmlandAspectList.getAmount(aspect)) {
if (ResearchManager.getCombinationResult(aspect, currentAspect) != null) {
return ResearchManager.getCombinationResult(aspect, currentAspect);
}
@@ -250,17 +250,15 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
return null;
}
private TileInfusedGrain getTileEntitySafe(World world, int x, int y, int z)
{
private TileInfusedGrain getTileEntitySafe(World world, int x, int y, int z) {
if (tileEntity != null) {
return tileEntity;
}
TileEntity tile = world.getTileEntity(x, y, z);
if (tile != null && tile instanceof TileInfusedGrain)
{
return (TileInfusedGrain)tile;
if (tile != null && tile instanceof TileInfusedGrain) {
return (TileInfusedGrain) tile;
}
return null;
@@ -273,12 +271,10 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile != null && tile instanceof TileInfusedGrain)
{
return ((TileInfusedGrain)tile).aspect;
if (tile != null && tile instanceof TileInfusedGrain) {
return ((TileInfusedGrain) tile).aspect;
}
return null;
}
}
@@ -1,21 +1,21 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [12 Sep 2013, 17:01:27 (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
@@ -29,6 +29,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -53,11 +56,6 @@ import thaumic.tinkerer.common.research.RecipeHelper;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBlock {
Random random;
@@ -73,12 +71,19 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
int par6, float par7, float par8, float par9) {
if (par5EntityPlayer.getCurrentEquippedItem() != null) {
if (par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
if (tile != null && tile instanceof TileMobMagnet) {
par5EntityPlayer.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_MOB_MAGNET, par1World, par2, par3, par4);
par5EntityPlayer.openGui(
ThaumicTinkerer.instance,
LibGuiIDs.GUI_ID_MOB_MAGNET,
par1World,
par2,
par3,
par4);
if (!par1World.isRemote) {
par1World.playSoundEffect(par2, par3, par4, "thaumcraft:key", 1F, 0.5F);
}
@@ -109,21 +114,26 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl
float f1 = random.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
.spawnEntityInWorld(entityitem)) {
int k1 = random.nextInt(21) + 10;
if (k1 > itemstack.stackSize)
k1 = itemstack.stackSize;
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
itemstack.stackSize -= k1;
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
entityitem = new EntityItem(
par1World,
par2 + f,
par3 + f1,
par4 + f2,
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (float) random.nextGaussian() * f3;
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) random.nextGaussian() * f3;
if (itemstack.hasTagCompound())
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
}
}
@@ -213,36 +223,68 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl
@Override
public IRegisterableResearch getResearchItem() {
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_MAGNETS, new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 1).add(Aspect.SENSES, 1), -6, 3, 3, new ItemStack(this)).setParents(LibResearch.KEY_INTERFACE).setParentsHidden(LibResearch.KEY_FOCUS_TELEKINESIS).setConcealed()
.setPages(new ResearchPage("0"), new ResearchPage("1"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_MAGNET), ResearchHelper.arcaneRecipePage(LibResearch.KEY_MOB_MAGNET), ResearchHelper.crucibleRecipePage(LibResearch.KEY_MAGNETS));
return (IRegisterableResearch) new TTResearchItem(
LibResearch.KEY_MAGNETS,
new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 1).add(Aspect.SENSES, 1),
-6,
3,
3,
new ItemStack(this)).setParents(LibResearch.KEY_INTERFACE)
.setParentsHidden(LibResearch.KEY_FOCUS_TELEKINESIS).setConcealed().setPages(
new ResearchPage("0"),
new ResearchPage("1"),
ResearchHelper.arcaneRecipePage(LibResearch.KEY_MAGNET),
ResearchHelper.arcaneRecipePage(LibResearch.KEY_MOB_MAGNET),
ResearchHelper.crucibleRecipePage(LibResearch.KEY_MAGNETS));
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererRecipeMulti(
new ThaumicTinkererArcaneRecipe(LibResearch.KEY_MAGNET, LibResearch.KEY_MAGNETS, new ItemStack(this), new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15).add(Aspect.ENTROPY, 5),
" I ", "SIs", "WFW",
'I', new ItemStack(Items.iron_ingot),
's', new ItemStack(ConfigItems.itemShard, 1, 3),
'S', new ItemStack(ConfigItems.itemShard),
'W', new ItemStack(ConfigBlocks.blockMagicalLog),
'F', new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemFocusTelekinesis.class))),
new ThaumicTinkererArcaneRecipe(LibResearch.KEY_MOB_MAGNET, LibResearch.KEY_MAGNETS, new ItemStack(this, 1, 1), new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15).add(Aspect.ENTROPY, 5),
" G ", "SGs", "WFW",
'G', RecipeHelper.oreDictOrStack(new ItemStack(Items.gold_ingot), "ingotCopper"),
's', new ItemStack(ConfigItems.itemShard, 1, 3),
'S', new ItemStack(ConfigItems.itemShard),
'W', new ItemStack(ConfigBlocks.blockMagicalLog),
'F', new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemFocusTelekinesis.class)))
);
new ThaumicTinkererArcaneRecipe(
LibResearch.KEY_MAGNET,
LibResearch.KEY_MAGNETS,
new ItemStack(this),
new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15)
.add(Aspect.ENTROPY, 5),
" I ",
"SIs",
"WFW",
'I',
new ItemStack(Items.iron_ingot),
's',
new ItemStack(ConfigItems.itemShard, 1, 3),
'S',
new ItemStack(ConfigItems.itemShard),
'W',
new ItemStack(ConfigBlocks.blockMagicalLog),
'F',
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemFocusTelekinesis.class))),
new ThaumicTinkererArcaneRecipe(
LibResearch.KEY_MOB_MAGNET,
LibResearch.KEY_MAGNETS,
new ItemStack(this, 1, 1),
new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15)
.add(Aspect.ENTROPY, 5),
" G ",
"SGs",
"WFW",
'G',
RecipeHelper.oreDictOrStack(new ItemStack(Items.gold_ingot), "ingotCopper"),
's',
new ItemStack(ConfigItems.itemShard, 1, 3),
'S',
new ItemStack(ConfigItems.itemShard),
'W',
new ItemStack(ConfigBlocks.blockMagicalLog),
'F',
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemFocusTelekinesis.class))));
}
@Override
public HashMap<Class<? extends TileEntity>, String> getAdditionalTileEntities() {
HashMap<Class<? extends TileEntity>, String> r = new HashMap<Class<? extends TileEntity>, String>();
HashMap<Class<? extends TileEntity>, String> r = new HashMap<>();
r.put(TileMobMagnet.class, LibBlockNames.MOB_MAGNET);
return r;
}
@@ -1,38 +1,35 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [8 Sep 2013, 15:57:04 (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
import thaumic.tinkerer.common.registry.ITTinkererBlock;
import java.util.ArrayList;
public abstract class BlockMod extends Block implements ITTinkererBlock {
public BlockMod(Material par2Material) {
super(par2Material);
if (registerInCreative())
setCreativeTab(ModCreativeTab.INSTANCE);
if (registerInCreative()) setCreativeTab(ModCreativeTab.INSTANCE);
}
@Override
@@ -1,27 +1,25 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [8 Sep 2013, 18:57:45 (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
import thaumic.tinkerer.common.registry.ITTinkererBlock;
@@ -30,8 +28,7 @@ public abstract class BlockModContainer<T extends TileEntity> extends BlockConta
protected BlockModContainer(Material par2Material) {
super(par2Material);
if (registerInCreative())
setCreativeTab(ModCreativeTab.INSTANCE);
if (registerInCreative()) setCreativeTab(ModCreativeTab.INSTANCE);
}
@Override
@@ -1,36 +1,34 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [11 Sep 2013, 17:47:28 (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Random;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.item.ItemBrightNitor;
import thaumic.tinkerer.common.item.kami.armor.ItemGemLegs;
import thaumic.tinkerer.common.lib.LibBlockNames;
import java.util.List;
import java.util.Random;
public class BlockNitorGas extends BlockGas {
public BlockNitorGas() {
@@ -52,30 +50,37 @@ public class BlockNitorGas extends BlockGas {
@Override
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
if (!par1World.isRemote) {
boolean remove=false;
boolean remove = false;
int dist = par1World.getBlockMetadata(par2, par3, par4) == 1 ? 6 : 1;
List<EntityPlayer> players = par1World.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(par2 - dist, par3 - dist, par4 - dist, par2 + dist, par3 + dist, par4 + dist));
if (players.isEmpty())
{
List<EntityPlayer> players = par1World.getEntitiesWithinAABB(
EntityPlayer.class,
AxisAlignedBB.getBoundingBox(
par2 - dist,
par3 - dist,
par4 - dist,
par2 + dist,
par3 + dist,
par4 + dist));
if (players.isEmpty()) {
par1World.setBlockToAir(par2, par3, par4);
remove=true;
}
else {
remove = true;
} else {
boolean has = false;
for (EntityPlayer player : players)
if (player.inventory.hasItem(ThaumicTinkerer.registry.getFirstItemFromClass(ItemBrightNitor.class)) || (ConfigHandler.enableKami && player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem() == ThaumicTinkerer.registry.getFirstItemFromClass(ItemGemLegs.class))) {
has = true;
break;
}
if (player.inventory.hasItem(ThaumicTinkerer.registry.getFirstItemFromClass(ItemBrightNitor.class))
|| (ConfigHandler.enableKami && player.getCurrentArmor(1) != null
&& player.getCurrentArmor(1).getItem()
== ThaumicTinkerer.registry.getFirstItemFromClass(ItemGemLegs.class))) {
has = true;
break;
}
if (!has)
{
if (!has) {
par1World.setBlockToAir(par2, par3, par4);
remove=true;
remove = true;
}
}
if(!remove)
par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
if (!remove) par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
}
}
@@ -91,8 +96,7 @@ public class BlockNitorGas extends BlockGas {
@Override
public void onBlockAdded(World par1World, int par2, int par3, int par4) {
if (!par1World.isRemote)
par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
if (!par1World.isRemote) par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
}
@Override
@@ -109,4 +113,4 @@ public class BlockNitorGas extends BlockGas {
public Class<? extends TileEntity> getTileEntity() {
return null;
}
}
}
@@ -1,19 +1,19 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Dec 27, 2013, 6:36:19 PM (GMT)]
*/
package thaumic.tinkerer.common.block;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
@@ -24,6 +24,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -37,9 +38,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.ArrayList;
import java.util.List;
public class BlockPlatform extends BlockCamo {
public BlockPlatform() {
@@ -50,8 +48,10 @@ public class BlockPlatform extends BlockCamo {
}
@Override
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) {
if (par7Entity != null && par7Entity.posY > par3 + (par7Entity instanceof EntityPlayer ? 2 : 0) && (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking()))
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB,
List par6List, Entity par7Entity) {
if (par7Entity != null && par7Entity.posY > par3 + (par7Entity instanceof EntityPlayer ? 2 : 0)
&& (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking()))
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
}
@@ -97,16 +97,29 @@ public class BlockPlatform extends BlockCamo {
@Override
public IRegisterableResearch getResearchItem() {
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_PLATFORM, new AspectList().add(Aspect.SENSES, 2).add(Aspect.TREE, 1).add(Aspect.MOTION, 1), -2, 6, 3, new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_CLEANSING_TALISMAN)
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_PLATFORM)).setSecondary();
return (IRegisterableResearch) new TTResearchItem(
LibResearch.KEY_PLATFORM,
new AspectList().add(Aspect.SENSES, 2).add(Aspect.TREE, 1).add(Aspect.MOTION, 1),
-2,
6,
3,
new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_CLEANSING_TALISMAN)
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_PLATFORM))
.setSecondary();
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_PLATFORM, LibResearch.KEY_PLATFORM, new ItemStack(this, 2), new AspectList().add(Aspect.AIR, 2).add(Aspect.ENTROPY, 4),
" S ", "G G",
'G', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6),
'S', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 7));
return new ThaumicTinkererArcaneRecipe(
LibResearch.KEY_PLATFORM,
LibResearch.KEY_PLATFORM,
new ItemStack(this, 2),
new AspectList().add(Aspect.AIR, 2).add(Aspect.ENTROPY, 4),
" S ",
"G G",
'G',
new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6),
'S',
new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 7));
}
}
@@ -1,5 +1,8 @@
package thaumic.tinkerer.common.block;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.material.Material;
@@ -13,6 +16,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -32,13 +36,11 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.ArrayList;
import java.util.Random;
/**
* Created by nekosune on 28/06/14.
*/
public class BlockRPlacer extends BlockCamo implements IWandable {
IIcon[] icons = new IIcon[2];
public BlockRPlacer() {
@@ -46,7 +48,8 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
int par6, float par7, float par8, float par9) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
TileRPlacer dislocator = (TileRPlacer) tile;
@@ -58,7 +61,6 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
par1World.markBlockForUpdate(par2, par3, par4);
return true;
}
@@ -103,13 +105,34 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
@Override
public IRegisterableResearch getResearchItem() {
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_REMOTE_PLACER, new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 1).add(Aspect.SENSES, 1), -6, 3, 3, new ItemStack(this)).setParents(LibResearch.KEY_ANIMATION_TABLET).setConcealed()
.setPages(new ResearchPage("0"), new ResearchPage("1"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_REMOTE_PLACER));
return (IRegisterableResearch) new TTResearchItem(
LibResearch.KEY_REMOTE_PLACER,
new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 1).add(Aspect.SENSES, 1),
-6,
3,
3,
new ItemStack(this)).setParents(LibResearch.KEY_ANIMATION_TABLET).setConcealed().setPages(
new ResearchPage("0"),
new ResearchPage("1"),
ResearchHelper.arcaneRecipePage(LibResearch.KEY_REMOTE_PLACER));
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_REMOTE_PLACER, LibResearch.KEY_REMOTE_PLACER, new ItemStack(this), new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15).add(Aspect.ENTROPY, 5), "ses", "sds", "sss", 's', ConfigBlocks.blockStoneDevice, 'e', Items.ender_pearl, 'd', Blocks.dispenser);
return new ThaumicTinkererArcaneRecipe(
LibResearch.KEY_REMOTE_PLACER,
LibResearch.KEY_REMOTE_PLACER,
new ItemStack(this),
new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15).add(Aspect.ENTROPY, 5),
"ses",
"sds",
"sss",
's',
ConfigBlocks.blockStoneDevice,
'e',
Items.ender_pearl,
'd',
Blocks.dispenser);
}
@Override
@@ -123,14 +146,17 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
}
@Override
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase,
ItemStack par6ItemStack) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
((TileRPlacer) tile).orientation = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
((TileRPlacer) tile).orientation = BlockPistonBase
.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
par1World.markBlockForUpdate(par2, par3, par4);
}
@Override
public int onWandRightClick(World world, ItemStack itemStack, EntityPlayer entityPlayer, int i, int i2, int i3, int i4, int i5) {
public int onWandRightClick(World world, ItemStack itemStack, EntityPlayer entityPlayer, int i, int i2, int i3,
int i4, int i5) {
if (!world.isRemote) {
if (entityPlayer.isSneaking()) {
entityPlayer.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_REMOTE_PLACER, world, i, i2, i3);
@@ -142,35 +168,28 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
@Override
public ItemStack onWandRightClick(World world, ItemStack itemStack, EntityPlayer entityPlayer) {
return itemStack;
}
@Override
public void onUsingWandTick(ItemStack itemStack, EntityPlayer entityPlayer, int i) {
}
public void onUsingWandTick(ItemStack itemStack, EntityPlayer entityPlayer, int i) {}
@Override
public void onWandStoppedUsing(ItemStack itemStack, World world, EntityPlayer entityPlayer, int i) {
}
public void onWandStoppedUsing(ItemStack itemStack, World world, EntityPlayer entityPlayer, int i) {}
@Override
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) {
if (par1World.isRemote)
return;
if (par1World.isRemote) return;
boolean power = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
boolean power = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)
|| par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
int meta = par1World.getBlockMetadata(par2, par3, par4);
boolean on = meta != 0;
if (power && !on) {
par1World.scheduleBlockUpdate(par2, par3, par4, this, tickRate(par1World));
par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 4);
} else if (!power && on)
par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4);
} else if (!power && on) par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4);
}
@Override
@@ -1,22 +1,19 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Nov 30, 2013, 5:36:26 PM (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
@@ -32,6 +29,10 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -48,9 +49,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.ArrayList;
import java.util.Random;
public class BlockRepairer extends BlockModContainer {
Random random;
@@ -64,7 +62,8 @@ public class BlockRepairer extends BlockModContainer {
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
int par6, float par7, float par8, float par9) {
TileRepairer repairer = (TileRepairer) par1World.getTileEntity(par2, par3, par4);
ItemStack stack = repairer.getStackInSlot(0);
@@ -92,21 +91,18 @@ public class BlockRepairer extends BlockModContainer {
}
@Override
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) {
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving,
ItemStack par6ItemStack) {
byte b0 = 0;
int l1 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if (l1 == 0)
b0 = 2;
if (l1 == 0) b0 = 2;
if (l1 == 1)
b0 = 5;
if (l1 == 1) b0 = 5;
if (l1 == 2)
b0 = 3;
if (l1 == 2) b0 = 3;
if (l1 == 3)
b0 = 4;
if (l1 == 3) b0 = 4;
par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2);
}
@@ -124,29 +120,32 @@ public class BlockRepairer extends BlockModContainer {
float f1 = random.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
.spawnEntityInWorld(entityitem)) {
int k1 = random.nextInt(21) + 10;
if (k1 > itemstack.stackSize)
k1 = itemstack.stackSize;
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
itemstack.stackSize -= k1;
int dmg;
if (Loader.isModLoaded("TConstruct")) {
if (TinkersConstructCompat.isTConstructTool(itemstack)) {
dmg = TinkersConstructCompat.getDamage(itemstack);
} else
dmg = itemstack.getItemDamage();
} else
dmg = itemstack.getItemDamage();
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, dmg));
} else dmg = itemstack.getItemDamage();
} else dmg = itemstack.getItemDamage();
entityitem = new EntityItem(
par1World,
par2 + f,
par3 + f1,
par4 + f2,
new ItemStack(itemstack.getItem(), k1, dmg));
float f3 = 0.05F;
entityitem.motionX = (float) random.nextGaussian() * f3;
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) random.nextGaussian() * f3;
if (itemstack.hasTagCompound())
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
}
}
@@ -215,14 +214,33 @@ public class BlockRepairer extends BlockModContainer {
@Override
public IRegisterableResearch getResearchItem() {
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_REPAIRER, new AspectList().add(Aspect.TOOL, 2).add(Aspect.CRAFT, 1).add(Aspect.ORDER, 1).add(Aspect.MAGIC, 1), -1, -9, 3, new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_FUNNEL).setParentsHidden("THAUMIUM", "ENCHFABRIC")
.setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_REPAIRER));
return (IRegisterableResearch) new TTResearchItem(
LibResearch.KEY_REPAIRER,
new AspectList().add(Aspect.TOOL, 2).add(Aspect.CRAFT, 1).add(Aspect.ORDER, 1).add(Aspect.MAGIC, 1),
-1,
-9,
3,
new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_FUNNEL)
.setParentsHidden("THAUMIUM", "ENCHFABRIC")
.setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_REPAIRER));
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererInfusionRecipe(LibResearch.KEY_REPAIRER, new ItemStack(this), 8, new AspectList().add(Aspect.TOOL, 15).add(Aspect.CRAFT, 20).add(Aspect.ORDER, 10).add(Aspect.MAGIC, 15), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4),
new ItemStack(Items.iron_ingot), new ItemStack(Items.gold_ingot), new ItemStack(Items.diamond), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.planks), new ItemStack(Items.leather), new ItemStack(ConfigItems.itemResource, 1, 7), new ItemStack(ConfigItems.itemResource, 1, 2));
return new ThaumicTinkererInfusionRecipe(
LibResearch.KEY_REPAIRER,
new ItemStack(this),
8,
new AspectList().add(Aspect.TOOL, 15).add(Aspect.CRAFT, 20).add(Aspect.ORDER, 10).add(Aspect.MAGIC, 15),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4),
new ItemStack(Items.iron_ingot),
new ItemStack(Items.gold_ingot),
new ItemStack(Items.diamond),
new ItemStack(Blocks.cobblestone),
new ItemStack(Blocks.planks),
new ItemStack(Items.leather),
new ItemStack(ConfigItems.itemResource, 1, 7),
new ItemStack(ConfigItems.itemResource, 1, 2));
}
@Override
@@ -1,21 +1,19 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [9 Sep 2013, 15:52:53 (GMT)]
*/
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -26,6 +24,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -42,9 +43,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.ArrayList;
import java.util.Random;
public class BlockSummon extends Block implements ITTinkererBlock {
IIcon iconTop;
@@ -92,7 +90,8 @@ public class BlockSummon extends Block implements ITTinkererBlock {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int meta) {
return par1 == ForgeDirection.UP.ordinal() ? iconTop : par1 == ForgeDirection.DOWN.ordinal() ? Block.getBlockFromName("obsidian").getIcon(0, 0) : iconSide;
return par1 == ForgeDirection.UP.ordinal() ? iconTop
: par1 == ForgeDirection.DOWN.ordinal() ? Block.getBlockFromName("obsidian").getIcon(0, 0) : iconSide;
}
@Override
@@ -127,13 +126,33 @@ public class BlockSummon extends Block implements ITTinkererBlock {
@Override
public IRegisterableResearch getResearchItem() {
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_SUMMON, new AspectList().add(Aspect.WEAPON, 1).add(Aspect.BEAST, 3).add(Aspect.MAGIC, 3), -5, 8, 3, new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockSummon.class))).setWarp(3).setParents(LibResearch.KEY_BLOOD_SWORD)
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_SUMMON + "0"), ResearchHelper.recipePage(LibResearch.KEY_SUMMON + "1"), ResearchHelper.infusionPage(LibResearch.KEY_SUMMON), new ResearchPage("1"));
return (IRegisterableResearch) new TTResearchItem(
LibResearch.KEY_SUMMON,
new AspectList().add(Aspect.WEAPON, 1).add(Aspect.BEAST, 3).add(Aspect.MAGIC, 3),
-5,
8,
3,
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockSummon.class))).setWarp(3)
.setParents(LibResearch.KEY_BLOOD_SWORD).setPages(
new ResearchPage("0"),
ResearchHelper.arcaneRecipePage(LibResearch.KEY_SUMMON + "0"),
ResearchHelper.recipePage(LibResearch.KEY_SUMMON + "1"),
ResearchHelper.infusionPage(LibResearch.KEY_SUMMON),
new ResearchPage("1"));
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererArcaneRecipe(LibResearch.KEY_SUMMON + "0", LibResearch.KEY_SUMMON, new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockSummon.class)), new AspectList().add(Aspect.ORDER, 50).add(Aspect.ENTROPY, 50), "WWW", "SSS", 'S', new ItemStack(Blocks.stone), 'W', new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1));
return new ThaumicTinkererArcaneRecipe(
LibResearch.KEY_SUMMON + "0",
LibResearch.KEY_SUMMON,
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockSummon.class)),
new AspectList().add(Aspect.ORDER, 50).add(Aspect.ENTROPY, 50),
"WWW",
"SSS",
'S',
new ItemStack(Blocks.stone),
'W',
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1));
}
}
@@ -1,7 +1,8 @@
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -15,23 +16,20 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.ConfigBlocks;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.quartz.BlockDarkQuartz;
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
import thaumic.tinkerer.common.item.ItemTravelSlab;
import thaumic.tinkerer.common.item.quartz.ItemDarkQuartzSlab;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ITTinkererBlock;
import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import java.util.ArrayList;
import java.util.Random;
/**
* Created by Katrina on 13/04/2015.
*/
@@ -58,7 +56,7 @@ public class BlockTravelSlab extends BlockSlab implements ITTinkererBlock {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int par2) {
return ConfigBlocks.blockCosmeticSolid.getIcon(par1,2);
return ConfigBlocks.blockCosmeticSolid.getIcon(par1, 2);
}
@Override
@@ -66,11 +64,6 @@ public class BlockTravelSlab extends BlockSlab implements ITTinkererBlock {
return Item.getItemFromBlock(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class));
}
//@Override
//public int idDropped(int par1, Random par2Random, int par3) {
// return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID;
//}
@Override
public ItemStack createStackedBlock(int par1) {
return new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class));
@@ -129,26 +122,27 @@ public class BlockTravelSlab extends BlockSlab implements ITTinkererBlock {
if (isOpaqueCube()) {
return null;
}
return new ThaumicTinkererCraftingBenchRecipe("PAVETRAVEL", new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class), 6),
return new ThaumicTinkererCraftingBenchRecipe(
"PAVETRAVEL",
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class), 6),
"QQQ",
'Q', new ItemStack(ConfigBlocks.blockCosmeticSolid,1,2));
'Q',
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 2));
}
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity e) {
if(world.getBlock(x, y, z) == this) {
if(e instanceof EntityLivingBase) {
if(world.isRemote) {
if (world.getBlock(x, y, z) == this) {
if (e instanceof EntityLivingBase) {
if (world.isRemote) {
Thaumcraft.proxy.blockSparkle(world, x, y, z, '?', 5);
}
((EntityLivingBase)e).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 40, 1));
((EntityLivingBase)e).addPotionEffect(new PotionEffect(Potion.jump.id, 40, 0));
((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 40, 1));
((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.jump.id, 40, 0));
}
super.onEntityWalking(world, x, y, z, e);
}
}
}
@@ -1,6 +1,7 @@
package thaumic.tinkerer.common.block;
import net.minecraft.block.Block;
import java.util.ArrayList;
import net.minecraft.block.BlockStairs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -10,28 +11,24 @@ import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.ConfigBlocks;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.quartz.BlockDarkQuartz;
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ITTinkererBlock;
import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipeMulti;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import java.util.ArrayList;
/**
* Created by Katrina on 16/04/2015.
*/
public class BlockTravelStairs extends BlockStairs implements ITTinkererBlock {
public BlockTravelStairs() {
super(ConfigBlocks.blockCosmeticSolid,2);
super(ConfigBlocks.blockCosmeticSolid, 2);
setCreativeTab(ModCreativeTab.INSTANCE);
}
@@ -73,21 +70,26 @@ public class BlockTravelStairs extends BlockStairs implements ITTinkererBlock {
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererRecipeMulti(
new ThaumicTinkererCraftingBenchRecipe("PAVETRAVEL", new ItemStack(this, 4),
" Q", " QQ", "QQQ",
'Q', new ItemStack(ConfigBlocks.blockCosmeticSolid,1,2))
);
new ThaumicTinkererCraftingBenchRecipe(
"PAVETRAVEL",
new ItemStack(this, 4),
" Q",
" QQ",
"QQQ",
'Q',
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 2)));
}
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity e) {
if(world.getBlock(x, y, z) == this) {
if(e instanceof EntityLivingBase) {
if(world.isRemote) {
if (world.getBlock(x, y, z) == this) {
if (e instanceof EntityLivingBase) {
if (world.isRemote) {
Thaumcraft.proxy.blockSparkle(world, x, y, z, '?', 5);
}
((EntityLivingBase)e).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 40, 1));
((EntityLivingBase)e).addPotionEffect(new PotionEffect(Potion.jump.id, 40, 0));
((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 40, 1));
((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.jump.id, 40, 0));
}
super.onEntityWalking(world, x, y, z, e);
@@ -1,7 +1,9 @@
package thaumic.tinkerer.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
@@ -19,37 +21,31 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.ConfigBlocks;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.quartz.BlockDarkQuartz;
import thaumic.tinkerer.common.block.tile.TileWardedSlab;
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
import thaumic.tinkerer.common.item.ItemTravelSlab;
import thaumic.tinkerer.common.item.ItemWardSlab;
import thaumic.tinkerer.common.item.quartz.ItemDarkQuartzSlab;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ITTinkererBlock;
import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
/**
* Created by Katrina on 13/04/2015.
*/
public class BlockWardSlab extends BlockSlab implements ITTinkererBlock,ITileEntityProvider {
public class BlockWardSlab extends BlockSlab implements ITTinkererBlock, ITileEntityProvider {
public BlockWardSlab(boolean par2) {
super(par2, Material.rock);
setHardness(0.8F);
setResistance(10F);
isBlockContainer=true;
isBlockContainer = true;
if (!par2) {
setLightOpacity(0);
setCreativeTab(ModCreativeTab.INSTANCE);
@@ -67,7 +63,7 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock,ITileEnt
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int par2) {
return ConfigBlocks.blockCosmeticSolid.getIcon(par1,3);
return ConfigBlocks.blockCosmeticSolid.getIcon(par1, 3);
}
@Override
@@ -75,11 +71,6 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock,ITileEnt
return Item.getItemFromBlock(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWardSlab.class));
}
//@Override
//public int idDropped(int par1, Random par2Random, int par3) {
// return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID;
//}
@Override
public ItemStack createStackedBlock(int par1) {
return new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWardSlab.class));
@@ -143,9 +134,12 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock,ITileEnt
if (isOpaqueCube()) {
return null;
}
return new ThaumicTinkererCraftingBenchRecipe("PAVEWARD", new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWardSlab.class), 6),
return new ThaumicTinkererCraftingBenchRecipe(
"PAVEWARD",
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWardSlab.class), 6),
"QQQ",
'Q', new ItemStack(ConfigBlocks.blockCosmeticSolid, 1,3));
'Q',
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 3));
}
@Override
@@ -154,41 +148,78 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock,ITileEnt
int list;
if (world.isBlockIndirectlyGettingPowered(x, y, z)) {
for (list = 0; list < Thaumcraft.proxy.particleCount(2); ++list) {
Thaumcraft.proxy.blockRunes(world, (double) x, (double) ((float) y + 0.7F), (double) z, 0.2F + world.rand.nextFloat() * 0.4F, world.rand.nextFloat() * 0.3F, 0.8F + world.rand.nextFloat() * 0.2F, 20, -0.02F);
Thaumcraft.proxy.blockRunes(
world,
(double) x,
(double) ((float) y + 0.7F),
(double) z,
0.2F + world.rand.nextFloat() * 0.4F,
world.rand.nextFloat() * 0.3F,
0.8F + world.rand.nextFloat() * 0.2F,
20,
-0.02F);
}
} else if (world.getBlock(x, y + 1, z) != ConfigBlocks.blockAiry && world.getBlock(x, y + 1, z).getBlocksMovement(world, x, y + 1, z) || world.getBlock(x, y + 2, z) != ConfigBlocks.blockAiry && world.getBlock(x, y + 1, z).getBlocksMovement(world, x, y + 1, z)) {
for (list = 0; list < Thaumcraft.proxy.particleCount(3); ++list) {
Thaumcraft.proxy.blockRunes(world, (double) x, (double) ((float) y + 0.7F), (double) z, 0.9F + world.rand.nextFloat() * 0.1F, world.rand.nextFloat() * 0.3F, world.rand.nextFloat() * 0.3F, 24, -0.02F);
}
} else {
List var10 = world.getEntitiesWithinAABBExcludingEntity((Entity) null, AxisAlignedBB.getBoundingBox((double) x, (double) y, (double) z, (double) (x + 1), (double) (y + 1), (double) (z + 1)).expand(1.0D, 1.0D, 1.0D));
if (!var10.isEmpty()) {
Iterator iterator = var10.iterator();
} else if (world.getBlock(x, y + 1, z) != ConfigBlocks.blockAiry
&& world.getBlock(x, y + 1, z).getBlocksMovement(world, x, y + 1, z)
|| world.getBlock(x, y + 2, z) != ConfigBlocks.blockAiry
&& world.getBlock(x, y + 1, z).getBlocksMovement(world, x, y + 1, z)) {
for (list = 0; list < Thaumcraft.proxy.particleCount(3); ++list) {
Thaumcraft.proxy.blockRunes(
world,
(double) x,
(double) ((float) y + 0.7F),
(double) z,
0.9F + world.rand.nextFloat() * 0.1F,
world.rand.nextFloat() * 0.3F,
world.rand.nextFloat() * 0.3F,
24,
-0.02F);
}
} else {
List var10 = world.getEntitiesWithinAABBExcludingEntity(
(Entity) null,
AxisAlignedBB.getBoundingBox(
(double) x,
(double) y,
(double) z,
(double) (x + 1),
(double) (y + 1),
(double) (z + 1)).expand(1.0D, 1.0D, 1.0D));
if (!var10.isEmpty()) {
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
if (entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer)) {
Thaumcraft.proxy.blockRunes(world, (double) x, (double) ((float) y + 0.6F + world.rand.nextFloat() * Math.max(0.8F, entity.getEyeHeight())), (double) z, 0.6F + world.rand.nextFloat() * 0.4F, 0.0F, 0.3F + world.rand.nextFloat() * 0.7F, 20, 0.0F);
break;
}
}
}
}
for (Object o : var10) {
Entity entity = (Entity) o;
if (entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer)) {
Thaumcraft.proxy.blockRunes(
world,
(double) x,
(double) ((float) y + 0.6F
+ world.rand.nextFloat()
* Math.max(0.8F, entity.getEyeHeight())),
(double) z,
0.6F + world.rand.nextFloat() * 0.4F,
0.0F,
0.3F + world.rand.nextFloat() * 0.7F,
20,
0.0F);
break;
}
}
}
}
}
}
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity e) {
if(world.getBlock(x, y, z) == this) {
if(e instanceof EntityLivingBase) {
if(world.isRemote) {
if (world.getBlock(x, y, z) == this) {
if (e instanceof EntityLivingBase) {
if (world.isRemote) {
Thaumcraft.proxy.blockSparkle(world, x, y, z, '?', 5);
}
((EntityLivingBase)e).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 40, 1));
((EntityLivingBase)e).addPotionEffect(new PotionEffect(Potion.jump.id, 40, 0));
((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 40, 1));
((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.jump.id, 40, 0));
}
super.onEntityWalking(world, x, y, z, e);
@@ -197,7 +228,7 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock,ITileEnt
@Override
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) {
return !((TileWardedSlab)world.getTileEntity(x,y,z)).gettingPower();
return !((TileWardedSlab) world.getTileEntity(x, y, z)).gettingPower();
}
@Override
@@ -1,14 +1,17 @@
package thaumic.tinkerer.common.block.fire;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.IBlockAccess;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
@@ -17,9 +20,10 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.HashMap;
public class BlockFireAir extends BlockFireBase {
private static HashMap<Block, Block> blockTransformation = null;
@Override
public String getBlockName() {
return LibBlockNames.BLOCK_FIRE_AIR;
@@ -27,39 +31,53 @@ public class BlockFireAir extends BlockFireBase {
@Override
public IRegisterableResearch getResearchItem() {
if(!ConfigHandler.enableFire)
return null;
return (TTResearchItem) new TTResearchItem(LibResearch.KEY_FIRE_AER, new AspectList().add(Aspect.FIRE, 5).add(Aspect.AIR, 5), 3, -7, 2, new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_AER)).setSecondary();
if (!ConfigHandler.enableFire) return null;
return (TTResearchItem) new TTResearchItem(
LibResearch.KEY_FIRE_AER,
new AspectList().add(Aspect.FIRE, 5).add(Aspect.AIR, 5),
3,
-7,
2,
new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_AER))
.setSecondary();
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
if(!ConfigHandler.enableFire)
return null;
return new ThaumicTinkererCrucibleRecipe(LibResearch.KEY_FIRE_AER, new ItemStack(this), new ItemStack(ConfigItems.itemShard, 1, 0), new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.AIR, 5));
if (!ConfigHandler.enableFire) return null;
return new ThaumicTinkererCrucibleRecipe(
LibResearch.KEY_FIRE_AER,
new ItemStack(this),
new ItemStack(ConfigItems.itemShard, 1, 0),
new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.AIR, 5));
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
result.put(new BlockTuple(Blocks.log), new BlockTuple(Blocks.sand));
result.put(new BlockTuple(Blocks.leaves), new BlockTuple(Blocks.sandstone));
result.put(new BlockTuple(Blocks.leaves2), new BlockTuple(Blocks.sandstone));
result.put(new BlockTuple(Blocks.log2), new BlockTuple(Blocks.sand));
result.put(new BlockTuple(Blocks.ice), new BlockTuple(Blocks.glass));
private static void initBlockTransformation() {
blockTransformation = new HashMap<>();
blockTransformation.put(Blocks.log, Blocks.sand);
blockTransformation.put(Blocks.leaves, Blocks.sandstone);
blockTransformation.put(Blocks.leaves2, Blocks.sandstone);
blockTransformation.put(Blocks.log2, Blocks.sand);
blockTransformation.put(Blocks.ice, Blocks.glass);
if (ConfigHandler.enableCake) {
result.put(new BlockTuple(Blocks.water), new BlockTuple(Blocks.cake));
blockTransformation.put(Blocks.water, Blocks.cake);
}
result.put(new BlockTuple(Blocks.dirt), new BlockTuple(Blocks.sand));
result.put(new BlockTuple(Blocks.grass), new BlockTuple(Blocks.sand));
return result;
blockTransformation.put(Blocks.dirt, Blocks.sand);
blockTransformation.put(Blocks.grass, Blocks.sand);
}
@Override
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(World w, int x, int y, int z) {
public HashMap<Block, Block> getBlockTransformation() {
if (blockTransformation == null) {
initBlockTransformation();
}
return blockTransformation;
}
@Override
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
return getBlockTransformation();
}
}
@@ -1,7 +1,16 @@
package thaumic.tinkerer.common.block.fire;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import static net.minecraftforge.common.util.ForgeDirection.DOWN;
import static net.minecraftforge.common.util.ForgeDirection.EAST;
import static net.minecraftforge.common.util.ForgeDirection.NORTH;
import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
import static net.minecraftforge.common.util.ForgeDirection.UP;
import static net.minecraftforge.common.util.ForgeDirection.WEST;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFire;
import net.minecraft.block.material.MapColor;
@@ -12,210 +21,205 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.item.ItemBlockFire;
import thaumic.tinkerer.common.registry.ITTinkererBlock;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
import static net.minecraftforge.common.util.ForgeDirection.*;
public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock {
public static final String LARGESMOKE = "largesmoke";
private IIcon[] icons;
private IIcon itemIcon;
public abstract HashMap<BlockTuple, BlockTuple> getBlockTransformation();
private static final Random random = new Random();
public boolean isTransmutationTarget(Block block, World w, int x, int y, int z) {
public abstract HashMap<Block, Block> getBlockTransformation();
return isTransmutationTarget(new BlockTuple(block), w, x, y, z);
public boolean isTransmutationTarget(Block block, IBlockAccess w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).containsKey(block);
}
public boolean isTransmutationResult(Block block, World w, int x, int y, int z) {
return isTransmutationResult(new BlockTuple(block), w, x, y, z);
public boolean isTransmutationResult(Block block, IBlockAccess w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).containsValue(block);
}
public boolean isTransmutationTarget(BlockTuple block, World w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).keySet().contains(block);
}
public boolean isTransmutationResult(BlockTuple block, World w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).values().contains(block);
}
public abstract HashMap<BlockTuple, BlockTuple> getBlockTransformation(World w, int x, int y, int z);
public abstract HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z);
public boolean isNeighborTarget(World w, int x, int y, int z) {
for (ForgeDirection f : ForgeDirection.VALID_DIRECTIONS) {
if (w.blockExists(x + f.offsetX, y + f.offsetY, z + f.offsetZ) && isTransmutationTarget(w.getBlock(x + f.offsetX, y + f.offsetY, z + f.offsetZ), w, x + f.offsetX, y + f.offsetY, z + f.offsetZ)) {
for (final ForgeDirection f : ForgeDirection.VALID_DIRECTIONS) {
final int xTar = x + f.offsetX;
final int yTar = y + f.offsetY;
final int zTar = z + f.offsetZ;
if (!w.blockExists(xTar, yTar, zTar)) continue;
if (isTransmutationTarget(w.getBlock(xTar, yTar, zTar), w, xTar, yTar, zTar)) {
return true;
}
}
return false;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) {
return null;
}
public int getDecayChance(World w, int x, int y, int z) {
return 1;
}
public boolean isOpaqueCube() {
return false;
}
public boolean renderAsNormalBlock() {
return false;
}
public int getRenderType() {
return 3;
}
public int quantityDropped(Random p_149745_1_) {
return 0;
}
@Override
public int tickRate(World p_149738_1_) {
return ConfigHandler.enableFireMechanics ? 200 : 0x7ffffff0;
}
public void setBlockWithTransmutationTarget(World world, int x, int y, int z, int meta, Block block) {
Random random = new Random();
if (isTransmutationTarget(world.getBlock(x, z, y), world, x, y, z) && random.nextInt(getDecayChance(world, x, y, z)) == 0) {
world.setBlock(x, z, y, getBlockTransformation(world, x, y, z).get(new BlockTuple(world.getBlock(x, z, y))).block, getBlockTransformation(world, x, y, z).get(new BlockTuple(world.getBlock(x, z, y))).meta, 3);
final Block targetBlock = world.getBlock(x, y, z);
if (isTransmutationTarget(targetBlock, world, x, y, z)) {
final Block targetTransform = getBlockTransformation(world, x, y, z).get(targetBlock);
world.setBlock(x, y, z, targetTransform, 0, 3);
} else {
world.setBlock(x, z, y, block, meta, 3);
world.setBlock(x, y, z, block, meta, 3);
}
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if (world.getGameRules().getGameRuleBooleanValue("doFireTick") && ConfigHandler.enableFire && ConfigHandler.enableFireMechanics) {
if (!(world.getGameRules().getGameRuleBooleanValue("doFireTick") && ConfigHandler.enableFire
&& ConfigHandler.enableFireMechanics)) {
return;
}
if (world.isRaining() && (world.canLightningStrikeAt(x, y, z) || world.canLightningStrikeAt(x - 1, y, z) || world.canLightningStrikeAt(x + 1, y, z) || world.canLightningStrikeAt(x, y, z - 1) || world.canLightningStrikeAt(x, y, z + 1))) {
world.setBlockToAir(x, y, z);
} else {
if (!isNeighborTarget(world, x, y, z)) {
world.setBlockToAir(x, y, z);
}
if (rand.nextInt(20) == 0) {
if (isNeighborTarget(world, x, y, z)) {
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
if (isTransmutationTarget(world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ), world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) {
Random random = new Random();
if (random.nextInt(getDecayChance(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) == 0) {
world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, getBlockTransformation(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ).get(new BlockTuple(world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ))).block, getBlockTransformation(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ).get(new BlockTuple(world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ))).meta, 3);
} else {
world.setBlockToAir(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
}
}
}
if (world.isRaining() && (world.canLightningStrikeAt(x, y, z) || world.canLightningStrikeAt(x - 1, y, z)
|| world.canLightningStrikeAt(x + 1, y, z)
|| world.canLightningStrikeAt(x, y, z - 1)
|| world.canLightningStrikeAt(x, y, z + 1))) {
// Check if it's raining and if it can be put out by rain
world.setBlockToAir(x, y, z);
return;
}
final int blockMeta = world.getBlockMetadata(x, y, z);
// Source block doesn't burn out
if (blockMeta != 0 && !isNeighborTarget(world, x, y, z)) {
// Extinguish if there's no valid fuel around
world.setBlockToAir(x, y, z);
return;
}
// Check Transforms
if (rand.nextInt(20) == 0 && (isNeighborTarget(world, x, y, z))) {
for (final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
final int xT = x + dir.offsetX;
final int yT = y + dir.offsetY;
final int zT = z + dir.offsetZ;
final Block targetBlock = world.getBlock(xT, yT, zT);
final Block targetTransform = getBlockTransformation(world, xT, yT, zT).get(targetBlock);
if (targetTransform == null) continue;
world.setBlock(xT, yT, zT, targetTransform, 0, 3);
}
}
if (blockMeta < 15 && blockMeta > 0) {
// Randomly increase the age of a fire
// 0 meta is considered a source and never increases, for any other meta we have a chance to increase
final int newMeta = Math.min(blockMeta + rand.nextInt(3) / 2, 15);
if (newMeta > blockMeta) {
world.setBlockMetadataWithNotify(x, y, z, newMeta, 4);
}
} else if (blockMeta >= 15) {
// No spreading if we're at max meta
return;
}
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + rand.nextInt(3));
final boolean highHumidity = world.isBlockHighHumidity(x, y, z);
byte strMod = 0;
if (highHumidity) {
strMod = -50;
}
// Spread
for (final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
this.tryCatchFire(
world,
x + dir.offsetX,
y + dir.offsetY,
z + dir.offsetZ,
300 + strMod,
rand,
blockMeta,
dir);
}
for (int xt = x - 1; xt <= x + 1; xt++) {
for (int zt = z - 1; zt <= z + 1; zt++) {
for (int yt = y - 1; yt <= y + 2; yt++) {
if (xt == x && yt == y && zt == z) {
continue;
}
int fireChance = this.getChanceOfNeighborsEncouragingFire(world, xt, yt, zt);
if (fireChance <= 0) {
continue;
}
fireChance = ((fireChance + 70) / (blockMeta + 30)) + 70;
if (highHumidity) {
fireChance /= 2;
}
}
}
int l = world.getBlockMetadata(x, y, z);
if (l < 15) {
world.setBlockMetadataWithNotify(x, y, z, l + rand.nextInt(3) / 2, 4);
}
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + rand.nextInt(3));
boolean flag1 = world.isBlockHighHumidity(x, y, z);
byte b0 = 0;
if (flag1) {
b0 = -50;
}
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
this.tryCatchFire(world, x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ, 300 + b0, rand, l, direction);
}
for (int i1 = x - 1; i1 <= x + 1; i1++) {
for (int j1 = z - 1; j1 <= z + 1; j1++) {
for (int k1 = y - 1; k1 <= y + 2; k1++) {
if (i1 != x || k1 != y || j1 != z) {
int l1 = 100;
int i2 = this.getChanceOfNeighborsEncouragingFire(world, i1, k1, j1);
if (i2 > 0) {
int j2 = (i2 + 70) / (l + 30);
j2 += 70;
if (flag1) {
j2 /= 2;
}
if (j2 > 0 && rand.nextInt(l1) <= j2 && (!world.isRaining() || !world.canLightningStrikeAt(i1, k1, j1)) && !world.canLightningStrikeAt(i1 - 1, k1, z) && !world.canLightningStrikeAt(i1 + 1, k1, j1) && !world.canLightningStrikeAt(i1, k1, j1 - 1) && !world.canLightningStrikeAt(i1, k1, j1 + 1)) {
int k2 = l + rand.nextInt(5) / 4;
if (k2 > 15) {
k2 = 15;
}
setBlockWithTransmutationTarget(world, i1, j1, k1, k2, this);
}
}
}
if (fireChance <= 0 || rand.nextInt(100) > fireChance
|| (world.isRaining() && world.canLightningStrikeAt(xt, yt, zt))
|| world.canLightningStrikeAt(xt - 1, yt, z)
|| world.canLightningStrikeAt(xt + 1, yt, zt)
|| world.canLightningStrikeAt(xt, yt, zt - 1)
|| world.canLightningStrikeAt(xt, yt, zt + 1)) {
continue;
}
final int targetMeta = Math.min(blockMeta + 1, 15);
setBlockWithTransmutationTarget(world, xt, yt, zt, targetMeta, this);
}
}
}
}
public boolean func_149698_L() {
return false;
}
public int getBlockFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
if (isTransmutationTarget(world.getBlock(x, y, z), (World) world, x, y, z)) {
final Block block = world.getBlock(x, y, z);
if (isTransmutationTarget(block, world, x, y, z)) {
return 100;
}
if (isTransmutationResult(world.getBlock(x, y, z), (World) world, x, y, z)) {
if (isTransmutationResult(block, world, x, y, z)) {
return 0;
}
return world.getBlock(x, y, z).getFlammability(world, x, y, z, face);
}
private void tryCatchFire(World world, int x, int y, int z, int strength, Random rand, int meta, ForgeDirection face) {
int j1 = getBlockFlammability(world, x, y, z, face);
private void tryCatchFire(World world, int x, int y, int z, int strength, Random rand, int meta,
ForgeDirection dir) {
final int blockFlammability = getBlockFlammability(world, x, y, z, dir);
if (rand.nextInt(strength) < j1) {
boolean flag = world.getBlock(x, y, z) == Blocks.tnt;
if (rand.nextInt(strength) >= blockFlammability) {
return;
}
final boolean isTnt = world.getBlock(x, y, z) == Blocks.tnt;
if (rand.nextInt(meta + 10) < 5 && !world.canLightningStrikeAt(x, y, z)) {
int k1 = meta + rand.nextInt(5) / 4;
if (rand.nextInt(meta + 10) < 5 && !world.canLightningStrikeAt(x, y, z)) {
// Newer fires have a higher chance of transmuting
final int nextMeta = Math.max(Math.min(meta + rand.nextInt(5) / 4, 15), 1);
setBlockWithTransmutationTarget(world, x, y, z, nextMeta, this);
} else {
setBlockWithTransmutationTarget(world, x, y, z, 0, Blocks.air);
}
if (k1 > 15) {
k1 = 15;
}
setBlockWithTransmutationTarget(world, x, y, z, k1, this);
} else {
setBlockWithTransmutationTarget(world, x, y, z, 0, Blocks.air);
}
if (flag) {
Blocks.tnt.onBlockDestroyedByPlayer(world, x, y, z, 1);
}
if (isTnt) {
Blocks.tnt.onBlockDestroyedByPlayer(world, x, y, z, 1);
}
}
@@ -241,52 +245,51 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
}
/**
* Returns if this block is collidable (only used by Fire). Args: x, y, z
*/
public boolean isCollidable() {
return false;
}
/**
* 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
*/
@Override
@Deprecated
public boolean canBlockCatchFire(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_) {
return canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP);
}
@Deprecated
public int func_149846_a(World p_149846_1_, int p_149846_2_, int p_149846_3_, int p_149846_4_, int p_149846_5_) {
return getChanceToEncourageFire(p_149846_1_, p_149846_2_, p_149846_3_, p_149846_4_, p_149846_5_, UP);
public boolean canBlockCatchFire(IBlockAccess w, int x, int y, int z) {
return canCatchFire(w, x, y, z, UP);
}
@Override
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
if(p_149689_5_ instanceof EntityPlayer)
ThaumicTinkerer.log.info("Player: "+((EntityPlayer)p_149689_5_).getDisplayName()+" placed TT Fire");
@Deprecated
public int func_149846_a(World w, int x, int y, int z, int chance) {
return getChanceToEncourageFire(w, x, y, z, chance, UP);
}
@Override
public void onBlockPlacedBy(World w, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) {
if (entity instanceof EntityPlayer)
ThaumicTinkerer.log.info("Player: " + ((EntityPlayer) entity).getDisplayName() + " placed TT Fire");
}
/**
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
*/
public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) {
@Override
public boolean canPlaceBlockAt(World w, int x, int y, int z) {
return true;
}
@Override
public boolean canCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
return getBlockFlammability(world, x, y, z, face) > 0;
}
@Override
public int getChanceToEncourageFire(IBlockAccess world, int x, int y, int z, int oldChance, ForgeDirection face) {
int newChance = world.getBlock(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
final int newChance = world.getBlock(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
return (newChance > oldChance ? newChance : oldChance);
return (Math.max(newChance, oldChance));
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor Block
*/
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) && !this.canNeighborBurn(world, x, y, z)) {
world.setBlockToAir(x, y, z);
@@ -296,6 +299,7 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
/**
* Called whenever the block is added into the world. Args: world, x, y, z
*/
@Override
public void onBlockAdded(World world, int x, int y, int z) {
if (world.provider.dimensionId > 0 || !Blocks.portal.func_150000_e(world, x, y, z)) {
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + world.rand.nextInt(10));
@@ -305,10 +309,18 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
/**
* A randomly called display update to be able to add particles or other items for display
*/
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
if (rand.nextInt(24) == 0) {
world.playSound((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), "fire.fire", 1.0F + rand.nextFloat(), rand.nextFloat() * 0.7F + 0.3F, false);
world.playSound(
x + 0.5F,
y + 0.5F,
z + 0.5F,
"fire.fire",
1.0F + rand.nextFloat(),
rand.nextFloat() * 0.7F + 0.3F,
false);
}
int l;
@@ -316,61 +328,63 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
float f1;
float f2;
if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) && !Blocks.fire.canCatchFire(world, x, y - 1, z, UP)) {
if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)
&& !Blocks.fire.canCatchFire(world, x, y - 1, z, UP)) {
if (Blocks.fire.canCatchFire(world, x - 1, y, z, EAST)) {
for (l = 0; l < 2; ++l) {
f = (float) x + rand.nextFloat() * 0.1F;
f1 = (float) y + rand.nextFloat();
f2 = (float) z + rand.nextFloat();
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
f = x + rand.nextFloat() * 0.1F;
f1 = y + rand.nextFloat();
f2 = z + rand.nextFloat();
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
if (Blocks.fire.canCatchFire(world, x + 1, y, z, WEST)) {
for (l = 0; l < 2; ++l) {
f = (float) (x + 1) - rand.nextFloat() * 0.1F;
f1 = (float) y + rand.nextFloat();
f2 = (float) z + rand.nextFloat();
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
f = (x + 1) - rand.nextFloat() * 0.1F;
f1 = y + rand.nextFloat();
f2 = z + rand.nextFloat();
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
if (Blocks.fire.canCatchFire(world, x, y, z - 1, SOUTH)) {
for (l = 0; l < 2; ++l) {
f = (float) x + rand.nextFloat();
f1 = (float) y + rand.nextFloat();
f2 = (float) z + rand.nextFloat() * 0.1F;
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
f = x + rand.nextFloat();
f1 = y + rand.nextFloat();
f2 = z + rand.nextFloat() * 0.1F;
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
if (Blocks.fire.canCatchFire(world, x, y, z + 1, NORTH)) {
for (l = 0; l < 2; ++l) {
f = (float) x + rand.nextFloat();
f1 = (float) y + rand.nextFloat();
f2 = (float) (z + 1) - rand.nextFloat() * 0.1F;
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
f = x + rand.nextFloat();
f1 = y + rand.nextFloat();
f2 = (z + 1) - rand.nextFloat() * 0.1F;
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
if (Blocks.fire.canCatchFire(world, x, y + 1, z, DOWN)) {
for (l = 0; l < 2; ++l) {
f = (float) x + rand.nextFloat();
f1 = (float) (y + 1) - rand.nextFloat() * 0.1F;
f2 = (float) z + rand.nextFloat();
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
f = x + rand.nextFloat();
f1 = (y + 1) - rand.nextFloat() * 0.1F;
f2 = z + rand.nextFloat();
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
} else {
for (l = 0; l < 3; ++l) {
f = (float) x + rand.nextFloat();
f1 = (float) y + rand.nextFloat() * 0.5F + 0.5F;
f2 = (float) z + rand.nextFloat();
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
f = x + rand.nextFloat();
f1 = y + rand.nextFloat() * 0.5F + 0.5F;
f2 = z + rand.nextFloat();
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
}
@Override
public MapColor getMapColor(int p_149728_1_) {
return MapColor.tntColor;
}
@@ -400,9 +414,11 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
return ItemBlockFire.class;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.icons = new IIcon[]{IconHelper.forName(iconRegister, this.getBlockName() + "_layer_0"), IconHelper.forName(iconRegister, this.getBlockName() + "_layer_1")};
this.icons = new IIcon[] { IconHelper.forName(iconRegister, this.getBlockName() + "_layer_0"),
IconHelper.forName(iconRegister, this.getBlockName() + "_layer_1") };
String s = "";
if (this instanceof BlockFireAir) {
@@ -427,6 +443,7 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
itemIcon = IconHelper.forName(iconRegister, s);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getFireIcon(int p_149840_1_) {
return this.icons[p_149840_1_];
@@ -435,18 +452,10 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
/**
* Gets the block's texture. Args: side, meta
*/
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return itemIcon;
}
private static class FireInfo {
public int encouragement = 0;
public int flammibility = 0;
public FireInfo(int flammibility, int encouragement) {
this.flammibility = flammibility;
this.encouragement = encouragement;
}
}
}
@@ -1,15 +1,19 @@
package thaumic.tinkerer.common.block.fire;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
@@ -18,9 +22,10 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.HashMap;
public class BlockFireChaos extends BlockFireBase {
private static HashMap<Block, Block> blockTransformation = null;
@Override
public String getBlockName() {
return LibBlockNames.BLOCK_FIRE_CHAOS;
@@ -28,17 +33,29 @@ public class BlockFireChaos extends BlockFireBase {
@Override
public IRegisterableResearch getResearchItem() {
if(!ConfigHandler.enableFire)
return null;
return (TTResearchItem) new TTResearchItem(LibResearch.KEY_FIRE_PERDITIO, new AspectList().add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), 2, -8, 3, new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_PERDITIO)).setSecondary();
if (!ConfigHandler.enableFire) return null;
return (TTResearchItem) new TTResearchItem(
LibResearch.KEY_FIRE_PERDITIO,
new AspectList().add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5),
2,
-8,
3,
new ItemStack(this))
.setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(
new ResearchPage("0"),
ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_PERDITIO))
.setSecondary();
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
if(!ConfigHandler.enableFire)
return null;
return new ThaumicTinkererCrucibleRecipe(LibResearch.KEY_FIRE_PERDITIO, new ItemStack(this), new ItemStack(ConfigItems.itemShard, 1, 5), new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.ENTROPY, 5));
if (!ConfigHandler.enableFire) return null;
return new ThaumicTinkererCrucibleRecipe(
LibResearch.KEY_FIRE_PERDITIO,
new ItemStack(this),
new ItemStack(ConfigItems.itemShard, 1, 5),
new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.ENTROPY, 5));
}
@Override
@@ -46,20 +63,26 @@ public class BlockFireChaos extends BlockFireBase {
return 1;
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
result.put(new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireAir.class)), new BlockTuple(Blocks.fire));
result.put(new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireWater.class)), new BlockTuple(Blocks.fire));
result.put(new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireEarth.class)), new BlockTuple(Blocks.fire));
result.put(new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireIgnis.class)), new BlockTuple(Blocks.fire));
result.put(new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireOrder.class)), new BlockTuple(Blocks.fire));
return result;
private static void initBlockTransformation() {
blockTransformation = new HashMap<>();
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireAir.class), Blocks.fire);
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireWater.class), Blocks.fire);
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireEarth.class), Blocks.fire);
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireIgnis.class), Blocks.fire);
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireOrder.class), Blocks.fire);
}
@Override
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(World w, int x, int y, int z) {
public HashMap<Block, Block> getBlockTransformation() {
if (blockTransformation == null) {
initBlockTransformation();
}
return blockTransformation;
}
@Override
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
return getBlockTransformation();
}
}
@@ -1,14 +1,17 @@
package thaumic.tinkerer.common.block.fire;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.IBlockAccess;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
@@ -17,9 +20,10 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.HashMap;
public class BlockFireEarth extends BlockFireBase {
private static HashMap<Block, Block> blockTransformation = null;
public BlockFireEarth() {
super();
}
@@ -31,45 +35,61 @@ public class BlockFireEarth extends BlockFireBase {
@Override
public IRegisterableResearch getResearchItem() {
if(!ConfigHandler.enableFire)
return null;
return (TTResearchItem) new TTResearchItem(LibResearch.KEY_FIRE_TERRA, new AspectList().add(Aspect.FIRE, 5).add(Aspect.EARTH, 5), 4, -6, 2, new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_TERRA)).setSecondary();
if (!ConfigHandler.enableFire) return null;
return (TTResearchItem) new TTResearchItem(
LibResearch.KEY_FIRE_TERRA,
new AspectList().add(Aspect.FIRE, 5).add(Aspect.EARTH, 5),
4,
-6,
2,
new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_TERRA))
.setSecondary();
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
if(!ConfigHandler.enableFire)
return null;
return new ThaumicTinkererCrucibleRecipe(LibResearch.KEY_FIRE_TERRA, new ItemStack(this), new ItemStack(ConfigItems.itemShard, 1, 3), new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.EARTH, 5));
if (!ConfigHandler.enableFire) return null;
return new ThaumicTinkererCrucibleRecipe(
LibResearch.KEY_FIRE_TERRA,
new ItemStack(this),
new ItemStack(ConfigItems.itemShard, 1, 3),
new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.EARTH, 5));
}
private static void initBlockTransformation() {
blockTransformation = new HashMap<>();
blockTransformation.put(Blocks.sand, Blocks.dirt);
blockTransformation.put(Blocks.gravel, Blocks.clay);
blockTransformation.put(Blocks.nether_brick, Blocks.planks);
blockTransformation.put(Blocks.nether_brick_fence, Blocks.fence);
blockTransformation.put(Blocks.nether_brick_stairs, Blocks.oak_stairs);
blockTransformation.put(Blocks.cactus, Blocks.log);
blockTransformation.put(Blocks.snow_layer, Blocks.tallgrass);
blockTransformation.put(Blocks.stone, Blocks.dirt);
blockTransformation.put(Blocks.mob_spawner, Blocks.iron_block);
blockTransformation.put(Blocks.log, Blocks.dirt);
blockTransformation.put(Blocks.log2, Blocks.dirt);
blockTransformation.put(Blocks.leaves, Blocks.dirt);
blockTransformation.put(Blocks.leaves2, Blocks.dirt);
blockTransformation.put(Blocks.cobblestone, Blocks.dirt);
blockTransformation.put(Blocks.planks, Blocks.dirt);
blockTransformation.put(Blocks.glass, Blocks.dirt);
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
result.put(new BlockTuple(Blocks.sand), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.gravel), new BlockTuple(Blocks.clay));
result.put(new BlockTuple(Blocks.nether_brick), new BlockTuple(Blocks.planks));
result.put(new BlockTuple(Blocks.nether_brick_fence), new BlockTuple(Blocks.fence));
result.put(new BlockTuple(Blocks.nether_brick_stairs), new BlockTuple(Blocks.oak_stairs));
result.put(new BlockTuple(Blocks.cactus), new BlockTuple(Blocks.log));
result.put(new BlockTuple(Blocks.snow_layer), new BlockTuple(Blocks.tallgrass));
result.put(new BlockTuple(Blocks.stone), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.mob_spawner), new BlockTuple(Blocks.iron_block));
result.put(new BlockTuple(Blocks.log), new BlockTuple(Blocks.dirt));
public HashMap<Block, Block> getBlockTransformation() {
if (blockTransformation == null) {
initBlockTransformation();
}
result.put(new BlockTuple(Blocks.log2), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.leaves), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.leaves2), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.cobblestone), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.planks), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.glass), new BlockTuple(Blocks.dirt));
return result;
return blockTransformation;
}
@Override
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(World w, int x, int y, int z) {
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
return getBlockTransformation();
}
}
@@ -1,14 +1,17 @@
package thaumic.tinkerer.common.block.fire;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.IBlockAccess;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
@@ -17,10 +20,10 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.HashMap;
public class BlockFireIgnis extends BlockFireBase {
private static HashMap<Block, Block> blockTransformation = null;
@Override
public String getBlockName() {
return LibBlockNames.BLOCK_FIRE_FIRE;
@@ -28,46 +31,62 @@ public class BlockFireIgnis extends BlockFireBase {
@Override
public IRegisterableResearch getResearchItem() {
if(!ConfigHandler.enableFire)
return null;
return (TTResearchItem) new TTResearchItem(LibResearch.KEY_FIRE_IGNIS, new AspectList().add(Aspect.FIRE, 10), 4, -4, 2, new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_IGNIS)).setSecondary();
if (!ConfigHandler.enableFire) return null;
return (TTResearchItem) new TTResearchItem(
LibResearch.KEY_FIRE_IGNIS,
new AspectList().add(Aspect.FIRE, 10),
4,
-4,
2,
new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_IGNIS))
.setSecondary();
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
if(!ConfigHandler.enableFire)
return null;
return new ThaumicTinkererCrucibleRecipe(LibResearch.KEY_FIRE_IGNIS, new ItemStack(this), new ItemStack(ConfigItems.itemShard, 1, 1), new AspectList().add(Aspect.FIRE, 10).add(Aspect.AIR, 5));
if (!ConfigHandler.enableFire) return null;
return new ThaumicTinkererCrucibleRecipe(
LibResearch.KEY_FIRE_IGNIS,
new ItemStack(this),
new ItemStack(ConfigItems.itemShard, 1, 1),
new AspectList().add(Aspect.FIRE, 10).add(Aspect.AIR, 5));
}
private static void initBlockTransformation() {
blockTransformation = new HashMap<>();
blockTransformation.put(Blocks.grass, Blocks.netherrack);
blockTransformation.put(Blocks.dirt, Blocks.netherrack);
blockTransformation.put(Blocks.sand, Blocks.soul_sand);
blockTransformation.put(Blocks.gravel, Blocks.soul_sand);
blockTransformation.put(Blocks.clay, Blocks.glowstone);
blockTransformation.put(Blocks.coal_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.iron_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.diamond_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.emerald_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.gold_block, Blocks.quartz_ore);
blockTransformation.put(Blocks.lapis_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.redstone_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.lit_redstone_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.water, Blocks.lava);
blockTransformation.put(Blocks.wheat, Blocks.nether_wart);
blockTransformation.put(Blocks.potatoes, Blocks.nether_wart);
blockTransformation.put(Blocks.carrots, Blocks.nether_wart);
blockTransformation.put(Blocks.red_flower, Blocks.brown_mushroom);
blockTransformation.put(Blocks.yellow_flower, Blocks.yellow_flower);
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
result.put(new BlockTuple(Blocks.grass), new BlockTuple(Blocks.netherrack));
result.put(new BlockTuple(Blocks.dirt), new BlockTuple(Blocks.netherrack));
result.put(new BlockTuple(Blocks.sand), new BlockTuple(Blocks.soul_sand));
result.put(new BlockTuple(Blocks.gravel), new BlockTuple(Blocks.soul_sand));
result.put(new BlockTuple(Blocks.clay), new BlockTuple(Blocks.glowstone));
result.put(new BlockTuple(Blocks.coal_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.iron_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.diamond_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.emerald_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.gold_block), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.lapis_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.redstone_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.lit_redstone_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.water), new BlockTuple(Blocks.lava));
result.put(new BlockTuple(Blocks.wheat), new BlockTuple(Blocks.nether_wart));
result.put(new BlockTuple(Blocks.potatoes), new BlockTuple(Blocks.nether_wart));
result.put(new BlockTuple(Blocks.carrots), new BlockTuple(Blocks.nether_wart));
result.put(new BlockTuple(Blocks.red_flower), new BlockTuple(Blocks.brown_mushroom));
result.put(new BlockTuple(Blocks.yellow_flower), new BlockTuple(Blocks.yellow_flower));
return result;
public HashMap<Block, Block> getBlockTransformation() {
if (blockTransformation == null) {
initBlockTransformation();
}
return blockTransformation;
}
@Override
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(World w, int x, int y, int z) {
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
return getBlockTransformation();
}
}
@@ -1,22 +1,17 @@
package thaumic.tinkerer.common.block.fire;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraft.world.IBlockAccess;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
@@ -25,21 +20,17 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.ArrayList;
import java.util.HashMap;
public class BlockFireOrder extends BlockFireBase {
public HashMap<BlockTuple, BlockTuple> fireResults = new HashMap<BlockTuple, BlockTuple>();
public HashMap<Block, Block> fireResults = new HashMap<>();
private HashMap<Block, Block> oreDictinaryOresCache;
public BlockFireOrder() {
super();
fireResults.put(new BlockTuple(Blocks.stone), null);
fireResults.put(new BlockTuple(Blocks.glass), null);
fireResults.put(new BlockTuple(Blocks.sand), null);
fireResults.put(new BlockTuple(Blocks.gravel), null);
fireResults.put(Blocks.stone, null);
fireResults.put(Blocks.glass, null);
fireResults.put(Blocks.sand, null);
fireResults.put(Blocks.gravel, null);
}
@Override
@@ -49,116 +40,45 @@ public class BlockFireOrder extends BlockFireBase {
@Override
public IRegisterableResearch getResearchItem() {
if(!ConfigHandler.enableFire)
return null;
return (TTResearchItem) new TTResearchItem(LibResearch.KEY_FIRE_ORDO, new AspectList().add(Aspect.FIRE, 5).add(Aspect.ORDER, 5), 3, -3, 2, new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_ORDO)).setSecondary();
if (!ConfigHandler.enableFire) return null;
return (TTResearchItem) new TTResearchItem(
LibResearch.KEY_FIRE_ORDO,
new AspectList().add(Aspect.FIRE, 5).add(Aspect.ORDER, 5),
3,
-3,
2,
new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_ORDO))
.setSecondary();
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
if(!ConfigHandler.enableFire)
return null;
return new ThaumicTinkererCrucibleRecipe(LibResearch.KEY_FIRE_ORDO, new ItemStack(this), new ItemStack(ConfigItems.itemShard, 1, 4), new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.ORDER, 5));
if (!ConfigHandler.enableFire) return null;
return new ThaumicTinkererCrucibleRecipe(
LibResearch.KEY_FIRE_ORDO,
new ItemStack(this),
new ItemStack(ConfigItems.itemShard, 1, 4),
new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.ORDER, 5));
}
@Override
public int getDecayChance(World world, int x, int y, int z) {
int dropSize = world.getBlock(x, y, z).getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0).size();
if (dropSize == 2) {
return 2;
}
if (dropSize >= 3) {
return 1;
}
return 3;
}
public HashMap<Block, Block> getOreDictionaryOres() {
if (oreDictinaryOresCache == null) {
HashMap<Block, Block> result = new HashMap<Block, Block>();
for (String ore : OreDictionary.getOreNames()) {
if (ore.startsWith("ore")) {
for (String block : OreDictionary.getOreNames()) {
if (block.startsWith("block") && block.substring(5).equalsIgnoreCase(ore.substring(3))) {
if (OreDictionary.getOres(block).size() > 0 && OreDictionary.getOres(ore).size() > 0) {
result.put(((ItemBlock) OreDictionary.getOres(ore).get(0).getItem()).field_150939_a, ((ItemBlock) OreDictionary.getOres(block).get(0).getItem()).field_150939_a);
}
}
}
}
}
oreDictinaryOresCache = result;
}
return oreDictinaryOresCache;
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
public HashMap<Block, Block> getBlockTransformation() {
return fireResults;
}
@Override
public boolean isTransmutationResult(BlockTuple block, World w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).values().contains(block);
}
public ItemStack getBlockCraftingResult(World w, ItemStack itemStack) {
InventoryCrafting blockCraftInventory = new InventoryCrafting(new Container() {
@Override
public boolean canInteractWith(EntityPlayer entityPlayer) {
return false;
}
}, 3, 3);
for (int i = 0; i < 9; i++) {
blockCraftInventory.setInventorySlotContents(i, itemStack);
}
return CraftingManager.getInstance().findMatchingRecipe(blockCraftInventory, w);
}
private boolean allEqual(ArrayList<ItemStack> list) {
for (ItemStack o : list) {
if (!o.isItemEqual(list.get(0))) {
return false;
}
}
return true;
public boolean isTransmutationResult(Block block, IBlockAccess w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).containsValue(block);
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation(World w, int x, int y, int z) {
Block block = w.getBlock(x, y, z);
int meta = w.getBlockMetadata(x, y, z);
if (!fireResults.containsKey(new BlockTuple(block, meta))) {
Block result = null;
int resultMeta = 0;
ArrayList<ItemStack> drops = block.getDrops(w, x, y, z, meta, 0);
if (drops.size() > 0 && (drops.size() == 1 || allEqual(drops))) {
ItemStack stack = drops.get(0);
ItemStack blockStack = getBlockCraftingResult(w, stack);
if (blockStack == null) {
ItemStack ingotStack = FurnaceRecipes.smelting().getSmeltingResult(stack);
blockStack = getBlockCraftingResult(w, ingotStack);
}
if (blockStack != null && Block.getBlockFromItem(blockStack.getItem()) != null) {
result = Block.getBlockFromItem(blockStack.getItem());
resultMeta = blockStack.getItemDamage();
}
}
fireResults.put(new BlockTuple(block, meta), new BlockTuple(result, resultMeta));
}
return fireResults;
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
return getBlockTransformation();
}
public boolean isTransmutationTarget(BlockTuple block, World w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).keySet().contains(block) && getBlockTransformation().get(block) != null && getBlockTransformation().get(block).block != null;
@Override
public boolean isTransmutationTarget(Block block, IBlockAccess w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).containsKey(block) && getBlockTransformation().get(block) != null;
}
}
@@ -1,14 +1,17 @@
package thaumic.tinkerer.common.block.fire;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.IBlockAccess;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
@@ -17,9 +20,10 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import java.util.HashMap;
public class BlockFireWater extends BlockFireBase {
private static HashMap<Block, Block> blockTransformation = null;
public BlockFireWater() {
super();
}
@@ -31,33 +35,49 @@ public class BlockFireWater extends BlockFireBase {
@Override
public IRegisterableResearch getResearchItem() {
if(!ConfigHandler.enableFire)
return null;
return (TTResearchItem) new TTResearchItem(LibResearch.KEY_FIRE_AQUA, new AspectList().add(Aspect.FIRE, 5).add(Aspect.WATER, 5), 2, -2, 2, new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_AQUA)).setSecondary();
if (!ConfigHandler.enableFire) return null;
return (TTResearchItem) new TTResearchItem(
LibResearch.KEY_FIRE_AQUA,
new AspectList().add(Aspect.FIRE, 5).add(Aspect.WATER, 5),
2,
-2,
2,
new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed()
.setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_AQUA))
.setSecondary();
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
if(!ConfigHandler.enableFire)
return null;
return new ThaumicTinkererCrucibleRecipe(LibResearch.KEY_FIRE_AQUA, new ItemStack(this), new ItemStack(ConfigItems.itemShard, 1, 2), new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.WATER, 5));
if (!ConfigHandler.enableFire) return null;
return new ThaumicTinkererCrucibleRecipe(
LibResearch.KEY_FIRE_AQUA,
new ItemStack(this),
new ItemStack(ConfigItems.itemShard, 1, 2),
new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.WATER, 5));
}
private static void initBlockTransformation() {
blockTransformation = new HashMap<>();
blockTransformation.put(Blocks.sand, Blocks.ice);
blockTransformation.put(Blocks.netherrack, Blocks.snow);
blockTransformation.put(Blocks.soul_sand, Blocks.ice);
blockTransformation.put(Blocks.glowstone, Blocks.ice);
blockTransformation.put(Blocks.lava, Blocks.obsidian);
blockTransformation.put(Blocks.flowing_lava, Blocks.obsidian);
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
result.put(new BlockTuple(Blocks.sand), new BlockTuple(Blocks.ice));
result.put(new BlockTuple(Blocks.netherrack), new BlockTuple(Blocks.snow));
result.put(new BlockTuple(Blocks.soul_sand), new BlockTuple(Blocks.ice));
result.put(new BlockTuple(Blocks.glowstone), new BlockTuple(Blocks.ice));
result.put(new BlockTuple(Blocks.lava), new BlockTuple(Blocks.obsidian));
result.put(new BlockTuple(Blocks.flowing_lava), new BlockTuple(Blocks.obsidian));
return result;
public HashMap<Block, Block> getBlockTransformation() {
if (blockTransformation == null) {
initBlockTransformation();
}
return blockTransformation;
}
@Override
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(World w, int x, int y, int z) {
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
return getBlockTransformation();
}
}
@@ -1,8 +1,7 @@
package thaumic.tinkerer.common.block.kami;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -21,6 +20,10 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.block.BlockMod;
import thaumic.tinkerer.common.block.tile.kami.TileBedrockPortal;
@@ -32,8 +35,6 @@ import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import java.util.Random;
public class BlockBedrockPortal extends BlockMod {
@SideOnly(Side.CLIENT)
@@ -48,7 +49,8 @@ public class BlockBedrockPortal extends BlockMod {
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p_149727_5_, int p_149727_6_,
float p_149727_7_, float p_149727_8_, float p_149727_9_) {
world.setBlock(x, y, z, Blocks.bedrock);
return super.onBlockActivated(world, x, y, z, p_149727_5_, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_);
}
@@ -58,7 +60,6 @@ public class BlockBedrockPortal extends BlockMod {
public void registerBlockIcons(IIconRegister iconRegister) {
icon = IconHelper.forName(iconRegister, "portal");
}
@Override
@@ -97,6 +98,7 @@ public class BlockBedrockPortal extends BlockMod {
return false;
}
@Override
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
if (par5 != 1 && par5 != 0 && !super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5)) {
return false;
@@ -105,7 +107,13 @@ public class BlockBedrockPortal extends BlockMod {
int j1 = par3 + Facing.offsetsYForSide[Facing.oppositeSide[par5]];
int k1 = par4 + Facing.offsetsZForSide[Facing.oppositeSide[par5]];
boolean flag = (par1IBlockAccess.getBlockMetadata(i1, j1, k1) & 8) != 0;
return flag ? (par5 == 0 || (par5 == 1 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true : true)) : (par5 == 1 || (par5 == 0 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true : true));
return flag
? (par5 == 0
|| (par5 == 1 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true
: true))
: (par5 == 1
|| (par5 == 0 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true
: true));
}
}
@@ -117,8 +125,12 @@ public class BlockBedrockPortal extends BlockMod {
if (entity instanceof EntityPlayer && !par1World.isRemote) {
FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) entity, ConfigHandler.bedrockDimensionID, new TeleporterBedrock((WorldServer) par1World));
if(entity.worldObj.getBlock(par2, 250, par4) == Blocks.bedrock) {
FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager()
.transferPlayerToDimension(
(EntityPlayerMP) entity,
ConfigHandler.bedrockDimensionID,
new TeleporterBedrock((WorldServer) par1World));
if (entity.worldObj.getBlock(par2, 250, par4) == Blocks.bedrock) {
entity.worldObj.setBlock(par2, 250, par4, Blocks.air);
}
if (entity.worldObj.getBlock(par2, 251, par4) == Blocks.bedrock) {
@@ -138,7 +150,11 @@ public class BlockBedrockPortal extends BlockMod {
} else if (entity.worldObj.provider instanceof WorldProviderBedrock) {
if (entity instanceof EntityPlayer && !par1World.isRemote) {
FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) entity, 0, new TeleporterBedrock((WorldServer) par1World));
FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager()
.transferPlayerToDimension(
(EntityPlayerMP) entity,
0,
new TeleporterBedrock((WorldServer) par1World));
Random rand = new Random();
@@ -150,7 +166,8 @@ public class BlockBedrockPortal extends BlockMod {
int y = 120;
while (entity.worldObj.getBlock(x, y, z) == Blocks.air || entity.worldObj.getBlock(x, y, z).isAir(par1World, x, y, z)) {
while (entity.worldObj.getBlock(x, y, z) == Blocks.air
|| entity.worldObj.getBlock(x, y, z).isAir(par1World, x, y, z)) {
y--;
// Avoid infinite loop.
if (y <= 1) {
@@ -163,7 +180,6 @@ public class BlockBedrockPortal extends BlockMod {
((EntityPlayerMP) entity).playerNetServerHandler.setPlayerLocation(x + 0.5, y + 3, z + 0.5, 0, 0);
}
}
}
public void travelToDimension(int par1, Entity e) {
@@ -183,7 +199,8 @@ public class BlockBedrockPortal extends BlockMod {
e.worldObj.removeEntity(e);
e.isDead = false;
e.worldObj.theProfiler.startSection("reposition");
minecraftserver.getConfigurationManager().transferEntityToWorld(e, j, worldserver, worldserver1, new TeleporterBedrock(worldserver));
minecraftserver.getConfigurationManager()
.transferEntityToWorld(e, j, worldserver, worldserver1, new TeleporterBedrock(worldserver));
e.worldObj.theProfiler.endStartSection("reloading");
Entity entity = EntityList.createEntityByName(EntityList.getEntityString(e), worldserver1);
@@ -192,8 +209,14 @@ public class BlockBedrockPortal extends BlockMod {
if (j == 1 && par1 == 1) {
ChunkCoordinates chunkcoordinates = worldserver1.getSpawnPoint();
chunkcoordinates.posY = e.worldObj.getTopSolidOrLiquidBlock(chunkcoordinates.posX, chunkcoordinates.posZ);
entity.setLocationAndAngles((double) chunkcoordinates.posX, (double) chunkcoordinates.posY, (double) chunkcoordinates.posZ, entity.rotationYaw, entity.rotationPitch);
chunkcoordinates.posY = e.worldObj
.getTopSolidOrLiquidBlock(chunkcoordinates.posX, chunkcoordinates.posZ);
entity.setLocationAndAngles(
(double) chunkcoordinates.posX,
(double) chunkcoordinates.posY,
(double) chunkcoordinates.posZ,
entity.rotationYaw,
entity.rotationPitch);
}
worldserver1.spawnEntityInWorld(entity);
@@ -1,19 +1,19 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4.
* Thaumcraft 4 (c) Azanor 2012
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [Jan 10, 2014, 3:54:41 PM (GMT)]
*/
package thaumic.tinkerer.common.block.kami;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -26,6 +26,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -49,9 +50,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.KamiResearchItem;
import thaumic.tinkerer.common.research.ResearchHelper;
import java.util.ArrayList;
import java.util.Random;
public class BlockWarpGate extends BlockModContainer {
public static IIcon[] icons = new IIcon[3];
@@ -66,12 +64,14 @@ public class BlockWarpGate extends BlockModContainer {
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
int par6, float par7, float par8, float par9) {
if (!par1World.isRemote) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
if (tile != null) {
par1World.markBlockForUpdate(par2, par3, par4);
par5EntityPlayer.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_WARP_GATE, par1World, par2, par3, par4);
par5EntityPlayer
.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_WARP_GATE, par1World, par2, par3, par4);
}
}
@@ -91,27 +91,31 @@ public class BlockWarpGate extends BlockModContainer {
float f1 = random.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World
.spawnEntityInWorld(entityitem)) {
int k1 = random.nextInt(21) + 10;
if (k1 > itemstack.stackSize)
k1 = itemstack.stackSize;
if (k1 > itemstack.stackSize) k1 = itemstack.stackSize;
itemstack.stackSize -= k1;
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
entityitem = new EntityItem(
par1World,
par2 + f,
par3 + f1,
par4 + f2,
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (float) random.nextGaussian() * f3;
entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) random.nextGaussian() * f3;
if (itemstack.hasTagCompound())
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
if (itemstack.hasTagCompound()) entityitem.getEntityItem()
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
}
}
par1World.func_147453_f(par2, par3, par4, par5);
}
super.breakBlock(par1World, par2, par3, par4, par5, par6);
@@ -129,8 +133,7 @@ public class BlockWarpGate extends BlockModContainer {
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
for (int i = 0; i < icons.length; i++)
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
for (int i = 0; i < icons.length; i++) icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
}
@Override
@@ -183,11 +186,20 @@ public class BlockWarpGate extends BlockModContainer {
if (!Config.allowMirrors) {
return null;
}
if(!ConfigHandler.enableKami)
return null;
return (IRegisterableResearch) new KamiResearchItem(LibResearch.KEY_WARP_GATE, new AspectList().add(Aspect.TRAVEL, 2).add(Aspect.ELDRITCH, 1).add(Aspect.FLIGHT, 1).add(Aspect.MECHANISM, 1), 19, 6, 5, new ItemStack(this)).setParents(LibResearch.KEY_ICHORCLOTH_CHEST_GEM).setParentsHidden(LibResearch.KEY_ICHORCLOTH_BOOTS_GEM)
.setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_WARP_GATE), new ResearchPage("1"), ResearchHelper.infusionPage(LibResearch.KEY_SKY_PEARL));
if (!ConfigHandler.enableKami) return null;
return (IRegisterableResearch) new KamiResearchItem(
LibResearch.KEY_WARP_GATE,
new AspectList().add(Aspect.TRAVEL, 2).add(Aspect.ELDRITCH, 1).add(Aspect.FLIGHT, 1)
.add(Aspect.MECHANISM, 1),
19,
6,
5,
new ItemStack(this)).setParents(LibResearch.KEY_ICHORCLOTH_CHEST_GEM)
.setParentsHidden(LibResearch.KEY_ICHORCLOTH_BOOTS_GEM).setPages(
new ResearchPage("0"),
ResearchHelper.infusionPage(LibResearch.KEY_WARP_GATE),
new ResearchPage("1"),
ResearchHelper.infusionPage(LibResearch.KEY_SKY_PEARL));
}
@Override
@@ -195,7 +207,17 @@ public class BlockWarpGate extends BlockModContainer {
if (!Config.allowMirrors) {
return null;
}
return new ThaumicTinkererInfusionRecipe(LibResearch.KEY_WARP_GATE, new ItemStack(this), 8, new AspectList().add(Aspect.TRAVEL, 64).add(Aspect.ELDRITCH, 50).add(Aspect.FLIGHT, 50), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 2), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 7), new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTransvectorDislocator.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 6), new ItemStack(Items.diamond), new ItemStack(Items.feather));
return new ThaumicTinkererInfusionRecipe(
LibResearch.KEY_WARP_GATE,
new ItemStack(this),
8,
new AspectList().add(Aspect.TRAVEL, 64).add(Aspect.ELDRITCH, 50).add(Aspect.FLIGHT, 50),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 2),
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)),
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 7),
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTransvectorDislocator.class)),
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 6),
new ItemStack(Items.diamond),
new ItemStack(Items.feather));
}
}
@@ -1,7 +1,5 @@
package thaumic.tinkerer.common.block.mobilizer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Items;
@@ -11,6 +9,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -30,8 +31,10 @@ public class BlockMobilizer extends BlockMod {
@SideOnly(Side.CLIENT)
private IIcon iconTop;
@SideOnly(Side.CLIENT)
private IIcon iconBottom;
@SideOnly(Side.CLIENT)
private IIcon iconSide;
@@ -40,8 +43,7 @@ public class BlockMobilizer extends BlockMod {
}
@Override
public void onBlockPreDestroy(World par1World, int par2, int par3,
int par4, int par5) {
public void onBlockPreDestroy(World par1World, int par2, int par3, int par4, int par5) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
if (tile != null && tile instanceof TileEntityMobilizer) {
@@ -71,7 +73,8 @@ public class BlockMobilizer extends BlockMod {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int meta) {
return par1 == ForgeDirection.UP.ordinal() ? iconTop : par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSide;
return par1 == ForgeDirection.UP.ordinal() ? iconTop
: par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSide;
}
@Override
@@ -91,14 +94,32 @@ public class BlockMobilizer extends BlockMod {
@Override
public IRegisterableResearch getResearchItem() {
return (IRegisterableResearch) new TTResearchItem(LibResearch.KEY_MOBILIZER, new AspectList().add(Aspect.MOTION, 2).add(Aspect.ORDER, 2), -7, 5, 3, new ItemStack(this)).setParents(LibResearch.KEY_MAGNETS)
.setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_MOBILIZER), ResearchHelper.arcaneRecipePage(LibResearch.KEY_RELAY)).setSecondary();
return (IRegisterableResearch) new TTResearchItem(
LibResearch.KEY_MOBILIZER,
new AspectList().add(Aspect.MOTION, 2).add(Aspect.ORDER, 2),
-7,
5,
3,
new ItemStack(this))
.setParents(LibResearch.KEY_MAGNETS)
.setPages(
new ResearchPage("0"),
ResearchHelper.infusionPage(LibResearch.KEY_MOBILIZER),
ResearchHelper.arcaneRecipePage(LibResearch.KEY_RELAY))
.setSecondary();
}
@Override
public ThaumicTinkererRecipe getRecipeItem() {
return new ThaumicTinkererInfusionRecipe(LibResearch.KEY_MOBILIZER, new ItemStack(this), 4, new AspectList().add(Aspect.MOTION, 15).add(Aspect.ORDER, 20).add(Aspect.MAGIC, 15), new ItemStack(ConfigBlocks.blockLifter),
new ItemStack(Items.iron_ingot), new ItemStack(Items.feather), new ItemStack(Items.iron_ingot), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1));
return new ThaumicTinkererInfusionRecipe(
LibResearch.KEY_MOBILIZER,
new ItemStack(this),
4,
new AspectList().add(Aspect.MOTION, 15).add(Aspect.ORDER, 20).add(Aspect.MAGIC, 15),
new ItemStack(ConfigBlocks.blockLifter),
new ItemStack(Items.iron_ingot),
new ItemStack(Items.feather),
new ItemStack(Items.iron_ingot),
new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1));
}
}
Loaded 100 of 345 files, more files were not shown because too many files have changed in this diff. Show more