Compare commits

...
35 Commits
Author SHA1 Message Date
Dakota Jones 78b68dec47 Fix maintenance focus NPE (#63) 2023-07-04 03:57:15 -07:00
Martin Robertz 5053be782b update bs 2023-05-06 08:40:47 +02:00
Ryan Nasers c5a72c0dff Adding a maintenance foci, thaumic alternative to carrying a toolbox/duct-tape (#60)
* Added maintenance focus.

* Changing some lang to alastor's liking.

* Some tweaks and spotless apply.

* Some tweaks and spotless apply.

* Removed as many extra calls as I could.
2023-05-06 08:38:34 +02:00
Jason MitchellandMartin Robertz e20ae4f103 ForgeDirection (#59)
* ForgeDirection

* Update dependencies.gradle

* update bs

---------

Co-authored-by: Martin Robertz <[email protected]>
2023-05-01 14:03:15 +02:00
Martin Robertz fe84247b9e Update dependencies.gradle 2023-04-23 10:09:50 +02:00
Martin Robertz 0a55e842b1 Fix Materials (#58)
* update buildscript + spottless

* update to newest gt version

* spotless
2023-04-21 19:11:20 +02:00
Jason Mitchell 89154325ee Less super fast (#57)
* update BS

* Sneaking makes things half as fast
2023-02-11 22:15:07 -08:00
Raven Szewczyk f93be63ac7 [ci skip] upgraded build system 2023-01-31 09:52:25 +00:00
Jason Mitchell 09ed4db5b4 [ci skip] Add git-blame-ignore-revs for spotlessApply 2023-01-28 18:41:54 -08:00
Jason Mitchell 6bdb2c0b96 [ci skip] spotlessApply with the new settings 2023-01-28 18:41:54 -08:00
Jason Mitchell c312069d28 [ci skip] Update buildscript to RetroFuturaGradle 2023-01-28 18:41:21 -08:00
Alexdoru 43c4963f3a keybinds (#56)
* unbind keybind by default and put mod name as category

* use isPressed() instead of getIsPressed()
2023-01-27 22:31:25 +01:00
miozune 2690cd2cd8 Remove individual NEI handler (#55) 2023-01-02 17:32:39 +01:00
AndreyGitHub GTNH Actionsgithub-actions[bot]
92b3fb8388 Add jump distance behaviour as it was in original Traveller's Boots (#53)
* DO apply the default behaviour of Traveller's Boots (jump distance) as written in QuestBook and Thaumonomicon

* spotlessApply (#54)

Co-authored-by: Andrey <[email protected]>
Co-authored-by: GitHub GTNH Actions <>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-02 10:49:54 +01:00
miozune ef5a92448c Rewrite GUIs with ModularUI (#52)
* Rewrite GUIs with ModularUI

* Check null stack
2022-12-10 20:14:47 +01:00
d21ba33277 All numbers will obey... (#50)
* Formatting

* spotlessApply (#51)

Co-authored-by: Connor-Colenso <[email protected]>
Co-authored-by: GitHub GTNH Actions <>

Co-authored-by: GTNH-Colen <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-01 14:37:17 +01:00
miozune ab58fc5890 Fix id shift (#49) 2022-10-25 09:06:42 +02:00
Kiwi 6ee77f5da4 Update zh_CN.lang (#48)
* Update zh_CN.lang

* Update zh_CN.lang
2022-09-24 12:38:56 +02:00
greesyB d798f5df68 Make industrial wand recharger a valid energy consumer (#46)
* Update buildscript

* Make industrial wand recharger a valid energy consumer

* Redundant variable

* Add gitattributes
2022-08-29 17:57:15 +02:00
miozune f3de9f25a5 Purge OpV (fix error voltage) (#47)
* Purge OpV (fix error voltage)

* this is better
2022-08-24 11:49:50 +02:00
Martin Robertz a26415bf6e Update de_DE.lang 2022-08-21 15:40:25 +02:00
Martin Robertz 93ba5763f6 Info text (#45)
* add info text for Schemtaics

* add color

* make tooltip translate able

* add de lang file
2022-08-21 15:35:34 +02:00
4f43009e93 Fusion crafter addons recipes (#43)
* add a new Nei Texture and change Input slots to 9

* change Fusion Crafter Recipes

* spotless

* update gt dep

* fix derp

* add Fusion crafter gui to emt

(cherry picked from commit 2fd716ca3a)

* update gt dep

(cherry picked from commit 1487b7c918)

* Update dependencies.gradle

* change DE recipes a bit

* spotlessApply (#44)

Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: GitHub GTNH Actions <>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-20 17:56:23 +01:00
Martin Robertz 341935663a update build script
spotless
update gt dep
2022-08-19 20:20:59 +02:00
Martin Robertz 6d1f3974be Update dependencies.gradle 2022-08-17 10:31:21 +02:00
Martin Robertz d70b4032b4 Update dependencies.gradle 2022-08-17 08:03:20 +02:00
chochem c040ccbb4f remove DEFC controller recipe if the right mods are loaded (#42) 2022-08-10 23:51:37 +01:00
RIONDY 'POPlol333' Adam 73c043f3a8 dragonblood craft added (#39)
* dragonblood craft added

* requested change

* actually this need a isModLoaded too

* i'm def blind

* recipe of the excel + *3.5 time on the mixer
2022-08-10 20:16:16 +02:00
RIONDY 'POPlol333' Adam 299fa969ac fixes checkRecipe not looking for fluids (#40) 2022-08-10 12:15:24 +02:00
Jakub d86ea1bbca Add fluid support to DEFC (#38)
* DEFC fluid support

* Generic + overloads

* V
2022-08-06 02:27:10 +01:00
Vladislav Laetansky 53616d5ba6 Fix generators and solar panel not working without an adjacent GT tile (#37) 2022-07-31 10:33:09 +02:00
greesyB c07eb27064 Buff solar helmet of revealing (#36) 2022-07-31 14:00:01 +07:00
Prometheus0000andkuba6000 dcb7f23091 Adds Draconic Evolution Fusion Crafter (#17)
* Implements about 2/3 of the DE core crafter

* Fix block textures. Controller is disabled+not showing up anyway

* Block textures work, controller ingame, main structure check works

* Forgot

* Structure check finally fully works

* Structure

* Fix structure

* Casings

* Recipe map

* NEI

* No scala

* Assline recipe

* Nerf overclock

* Change the name to Draconic Evolution Fusion Crafter

* Fix

* tx

Co-authored-by: kuba6000 <[email protected]>
2022-07-31 13:50:27 +07:00
Jason Mitchell 1715092471 [ci skip] Migrate github actions to GTNH-Actions-Workflows 2022-07-16 10:47:53 -07:00
MuXiu1997 f751c778a2 Fix solars localization (#35) 2022-06-06 19:32:23 +02:00
150 changed files with 7472 additions and 3633 deletions

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
# Ignore spotlessApply reformat
6bdb2c0b96290f05da0233ac9f564fc35a9722b2
+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
+2 -34
View File
@@ -1,5 +1,3 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build and test name: Build and test
@@ -11,35 +9,5 @@ on:
jobs: jobs:
build-and-test: build-and-test:
runs-on: ubuntu-latest uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
steps: secrets: inherit
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup the workspace
run: ./gradlew setupCIWorkspace
- name: Build the mod
run: ./gradlew build
- name: Run server for 1.5 minutes
run: |
mkdir run
echo "eula=true" > run/eula.txt
timeout 90 ./gradlew runServer 2>&1 | tee -a server.log || true
- name: Test no errors reported during server run
run: |
chmod +x .github/scripts/test_no_error_reports
.github/scripts/test_no_error_reports
+7 -44
View File
@@ -1,51 +1,14 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Release tagged build name: Release tagged build
on: on:
push: push:
tags: tags: [ '*' ]
- '*'
permissions:
contents: write
jobs: jobs:
build: release-tags:
runs-on: ubuntu-latest uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
steps: secrets: inherit
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup the workspace
run: ./gradlew setupCIWorkspace
- name: Build the mod
run: ./gradlew build
- name: Release under current tag
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
prerelease: false
title: "${{ env.RELEASE_VERSION }}"
files: build/libs/*.jar
- name: Publish to Maven
run: ./gradlew publish
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
+1133 -386
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -1,8 +1,8 @@
// Add your dependencies here // Add your dependencies here
dependencies { dependencies {
compile 'com.github.GTNewHorizons:GT5-Unofficial:5.09.40.39:dev' compile 'com.github.GTNewHorizons:GT5-Unofficial:5.09.43.07:dev'
compile 'com.github.GTNewHorizons:Baubles:1.0.1.14:dev' compile 'com.github.GTNewHorizons:Baubles:1.0.1.16:dev'
compile 'net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev' compile 'net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev'
compile 'thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev' compile 'thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev'
Binary file not shown.
+2 -1
View File
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
Vendored
+171 -115
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"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@@ -17,78 +17,113 @@
# #
############################################################################## ##############################################################################
## #
## 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 # Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle" # Resolve links: $0 may be a link
APP_BASE_NAME=`basename "$0"` 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
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # 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"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD=maximum
warn () { warn () {
echo "$*" echo "$*"
} } >&2
die () { die () {
echo echo
echo "$*" echo "$*"
echo echo
exit 1 exit 1
} } >&2
# OS specific support (must be 'true' or 'false'). # OS specific support (must be 'true' or 'false').
cygwin=false cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false nonstop=false
case "`uname`" in case "$( uname )" in #(
CYGWIN* ) CYGWIN* ) cygwin=true ;; #(
cygwin=true Darwin* ) darwin=true ;; #(
;; MSYS* | MINGW* ) msys=true ;; #(
Darwin* ) NONSTOP* ) nonstop=true ;;
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java" JAVACMD=$JAVA_HOME/jre/sh/java
else else
JAVACMD="$JAVA_HOME/bin/java" JAVACMD=$JAVA_HOME/bin/java
fi fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else 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. 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 Please set the JAVA_HOME variable in your environment to match the
@@ -105,84 +140,105 @@ location of your Java installation."
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
MAX_FD_LIMIT=`ulimit -H -n` case $MAX_FD in #(
if [ $? -eq 0 ] ; then max*)
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
MAX_FD="$MAX_FD_LIMIT" # shellcheck disable=SC3045
fi MAX_FD=$( ulimit -H -n ) ||
ulimit -n $MAX_FD warn "Could not query maximum file descriptor limit"
if [ $? -ne 0 ] ; then esac
warn "Could not set maximum file descriptor limit: $MAX_FD" case $MAX_FD in #(
fi '' | soft) :;; #(
else *)
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
fi # shellcheck disable=SC3045
fi ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
# 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" ;;
esac esac
fi fi
# Escape application args # Collect all arguments for the java command, stacking in reverse order:
save () { # * args from the command line
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done # * the main class name
echo " " # * -classpath
} # * -D...appname settings
APP_ARGS=$(save "$@") # * --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 # For Cygwin or MSYS, switch paths to Windows format before running java
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 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 JAVACMD=$( cygpath --unix "$JAVACMD" )
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")" # 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 fi
# 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" "$@" exec "$JAVACMD" "$@"
Vendored
+15 -23
View File
@@ -14,7 +14,7 @@
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@if "%DEBUG%" == "" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@rem Gradle startup script for Windows @rem Gradle startup script for Windows
@@ -25,10 +25,14 @@
if "%OS%"=="Windows_NT" setlocal if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% 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. @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" set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@@ -37,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if %ERRORLEVEL% equ 0 goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 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_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto execute
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -61,38 +65,26 @@ echo location of your Java installation.
goto fail 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 :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @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 :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd if %ERRORLEVEL% equ 0 goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 set EXIT_CODE=%ERRORLEVEL%
exit /b 1 if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal
+1 -1
View File
@@ -19,7 +19,7 @@ repositories {
url 'https://cursemaven.com' url 'https://cursemaven.com'
content { content {
includeGroup "curse.maven" includeGroup "curse.maven"
} }
} }
maven { maven {
+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
}
+19 -15
View File
@@ -1,5 +1,11 @@
package emt; package emt;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.common.MinecraftForge;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.SidedProxy;
@@ -13,24 +19,21 @@ import cpw.mods.fml.relauncher.Side;
import emt.command.CommandOutputs; import emt.command.CommandOutputs;
import emt.init.EMTEntities; import emt.init.EMTEntities;
import emt.init.Registry; import emt.init.Registry;
import emt.nei.NEI_Config;
import emt.network.PacketEMTKeys; import emt.network.PacketEMTKeys;
import emt.network.PacketNodeInfo; import emt.network.PacketNodeInfo;
import emt.proxy.CommonProxy; import emt.proxy.CommonProxy;
import emt.tile.solar.Solars; import emt.tile.solar.Solars;
import emt.util.*; import emt.util.*;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.common.MinecraftForge;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@Mod( @Mod(
modid = EMT.MOD_ID, modid = EMT.MOD_ID,
name = EMT.NAME, name = EMT.NAME,
version = EMT.VERSION, version = EMT.VERSION,
guiFactory = EMT.GUI_FACTORY, guiFactory = EMT.GUI_FACTORY,
dependencies = EMT.DEPENDS dependencies = EMT.DEPENDS)
)
public class EMT { public class EMT {
public static final String NAME = "Electro-Magic Tools"; public static final String NAME = "Electro-Magic Tools";
public static final String MOD_ID = "EMT"; public static final String MOD_ID = "EMT";
public static final String VERSION = "GRADLETOKEN_VERSION"; public static final String VERSION = "GRADLETOKEN_VERSION";
@@ -39,19 +42,19 @@ public class EMT {
public static final String CLIENT_PROXY = "emt.proxy.ClientProxy"; public static final String CLIENT_PROXY = "emt.proxy.ClientProxy";
public static final String COMMON_PROXY = "emt.proxy.CommonProxy"; public static final String COMMON_PROXY = "emt.proxy.CommonProxy";
public static final String CHANNEL = "EMT"; public static final String CHANNEL = "EMT";
public static final String DEPENDS = public static final String DEPENDS = "required-after:Thaumcraft;" + "required-after:IC2;"
"required-after:Thaumcraft;" + + "required-after:gregtech;"
"required-after:IC2;" + + "after:Avaritia;"
"required-after:gregtech;" + + "after:MagicBees;"
"after:Avaritia;" + + "after:ForbiddenMagic;"
"after:MagicBees;" + + "after:dreamcraft;";
"after:ForbiddenMagic;" +
"after:dreamcraft;";
public static final CreativeTabs TAB = new EMTCreativeTab("EMT.creativeTab"); public static final CreativeTabs TAB = new EMTCreativeTab("EMT.creativeTab");
public static final Logger LOGGER = LogManager.getLogger("Electro-Magic Tools"); public static final Logger LOGGER = LogManager.getLogger("Electro-Magic Tools");
public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("EMT"); public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("EMT");
@SidedProxy(clientSide = "emt.proxy.ClientProxy", serverSide = "emt.proxy.CommonProxy") @SidedProxy(clientSide = "emt.proxy.ClientProxy", serverSide = "emt.proxy.CommonProxy")
public static CommonProxy proxy; public static CommonProxy proxy;
@Mod.Instance("EMT") @Mod.Instance("EMT")
public static EMT instance; public static EMT instance;
@@ -82,7 +85,8 @@ public class EMT {
} }
EMTDungeonChestGenerator.generateLoot(); EMTDungeonChestGenerator.generateLoot();
EMTEntities.registerEMTEntities(); EMTEntities.registerEMTEntities();
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
NEI_Config.Init();
} }
@Mod.EventHandler @Mod.EventHandler
+4 -2
View File
@@ -1,10 +1,12 @@
package emt.block; package emt.block;
import emt.EMT;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import emt.EMT;
public abstract class BlockBase extends Block { public abstract class BlockBase extends Block {
public final String name; public final String name;
public BlockBase(String unlocName, Material material, String textureName, SoundType soundType, float hardness) { public BlockBase(String unlocName, Material material, String textureName, SoundType soundType, float hardness) {
@@ -22,4 +24,4 @@ public abstract class BlockBase extends Block {
public BlockBase(String unlocName, Material material, SoundType soundType, float hardness) { public BlockBase(String unlocName, Material material, SoundType soundType, float hardness) {
this(unlocName, material, null, soundType, hardness); this(unlocName, material, null, soundType, hardness);
} }
} }
+15 -13
View File
@@ -1,10 +1,5 @@
package emt.block; package emt.block;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileEntityEMT;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -15,10 +10,17 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileEntityEMT;
public abstract class BlockBaseContainer extends BlockContainer { public abstract class BlockBaseContainer extends BlockContainer {
public int instance; public int instance;
public int countOfMetas; public int countOfMetas;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
IconSet[] iconSets; IconSet[] iconSets;
@@ -26,11 +28,13 @@ public abstract class BlockBaseContainer extends BlockContainer {
this(unlocName, material, soundType, 1, hardness); this(unlocName, material, soundType, 1, hardness);
} }
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, int countOfMetas, float hardness) { public BlockBaseContainer(String unlocName, Material material, SoundType soundType, int countOfMetas,
float hardness) {
this(unlocName, material, soundType, countOfMetas, 0, hardness); this(unlocName, material, soundType, countOfMetas, 0, hardness);
} }
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, int countOfMetas, int curInstance, float hardness) { public BlockBaseContainer(String unlocName, Material material, SoundType soundType, int countOfMetas,
int curInstance, float hardness) {
super(material); super(material);
this.setBlockName(EMT.MOD_ID + "." + unlocName); this.setBlockName(EMT.MOD_ID + "." + unlocName);
this.setCreativeTab(EMT.TAB); this.setCreativeTab(EMT.TAB);
@@ -64,8 +68,7 @@ public abstract class BlockBaseContainer extends BlockContainer {
TileEntityEMT tile = (TileEntityEMT) access.getTileEntity(x, y, z); TileEntityEMT tile = (TileEntityEMT) access.getTileEntity(x, y, z);
int meta = access.getBlockMetadata(x, y, z); int meta = access.getBlockMetadata(x, y, z);
if (meta >= countOfMetas) if (meta >= countOfMetas) return null;
return null;
IconSet set = iconSets[meta]; IconSet set = iconSets[meta];
@@ -97,8 +100,7 @@ public abstract class BlockBaseContainer extends BlockContainer {
@Override @Override
public IIcon getIcon(int side, int meta) { public IIcon getIcon(int side, int meta) {
if (meta >= countOfMetas) if (meta >= countOfMetas) return null;
return null;
IconSet set = iconSets[meta]; IconSet set = iconSets[meta];
@@ -120,8 +122,7 @@ public abstract class BlockBaseContainer extends BlockContainer {
int facing = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; int facing = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
TileEntityEMT tile = (TileEntityEMT) world.getTileEntity(x, y, z); TileEntityEMT tile = (TileEntityEMT) world.getTileEntity(x, y, z);
if (tile == null) if (tile == null) return;
return;
switch (facing) { switch (facing) {
case 0: case 0:
@@ -149,6 +150,7 @@ public abstract class BlockBaseContainer extends BlockContainer {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public static class IconSet { public static class IconSet {
public IIcon top; public IIcon top;
public IIcon bottom; public IIcon bottom;
public IIcon side; public IIcon side;
@@ -1,9 +1,7 @@
package emt.block; package emt.block;
import cpw.mods.fml.relauncher.Side; import java.util.Random;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileElectricCloud;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@@ -11,12 +9,16 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileElectricCloud;
import thaumcraft.client.fx.ParticleEngine; import thaumcraft.client.fx.ParticleEngine;
import thaumcraft.client.fx.particles.FXSparkle; import thaumcraft.client.fx.particles.FXSparkle;
import java.util.Random;
public class BlockElectricCloud extends BlockBase { public class BlockElectricCloud extends BlockBase {
public IIcon icon; public IIcon icon;
public BlockElectricCloud(String unlocName) { public BlockElectricCloud(String unlocName) {
@@ -27,7 +29,17 @@ public class BlockElectricCloud extends BlockBase {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Override @Override
public void randomDisplayTick(World world, int x, int y, int z, Random rnd) { public void randomDisplayTick(World world, int x, int y, int z, Random rnd) {
FXSparkle ef = new FXSparkle(world, x + 0.5F, y + 0.5F, z + 0.5F, x + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, y + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, z + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, 1.0F, 6, 3); FXSparkle ef = new FXSparkle(
world,
x + 0.5F,
y + 0.5F,
z + 0.5F,
x + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F,
y + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F,
z + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F,
1.0F,
6,
3);
ef.setGravity(0.05F); ef.setGravity(0.05F);
ParticleEngine.instance.addEffect(world, ef); ParticleEngine.instance.addEffect(world, ef);
} }
@@ -1,9 +1,8 @@
package emt.block; package emt.block;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly; import java.util.Random;
import emt.EMT;
import emt.tile.generator.TileEntityBaseGenerator;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntitySmokeFX; import net.minecraft.client.particle.EntitySmokeFX;
@@ -15,8 +14,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.List; import com.gtnewhorizons.modularui.api.UIInfos;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.generator.TileEntityBaseGenerator;
public class BlockEssentiaGenerators extends BlockBaseContainer { public class BlockEssentiaGenerators extends BlockBaseContainer {
@@ -46,6 +49,7 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
iconSets[5].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront"); iconSets[5].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront");
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(Item id, CreativeTabs tab, List list) { public void getSubBlocks(Item id, CreativeTabs tab, List list) {
list.add(new ItemStack(id, 1, 0)); list.add(new ItemStack(id, 1, 0));
@@ -61,6 +65,7 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
return new TileEntityBaseGenerator(meta); return new TileEntityBaseGenerator(meta);
} }
@Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random random) { public void randomDisplayTick(World world, int x, int y, int z, Random random) {
TileEntityBaseGenerator te = (TileEntityBaseGenerator) world.getTileEntity(x, y, z); TileEntityBaseGenerator te = (TileEntityBaseGenerator) world.getTileEntity(x, y, z);
@@ -76,7 +81,9 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
} }
} }
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2, float f3) { @Override
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2,
float f3) {
if (player.isSneaking()) { if (player.isSneaking()) {
return false; return false;
} }
@@ -85,7 +92,7 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
} }
TileEntity tileentity = world.getTileEntity(i, j, k); TileEntity tileentity = world.getTileEntity(i, j, k);
if (tileentity != null) { if (tileentity != null) {
player.openGui(emt.EMT.instance, 1, world, i, j, k); UIInfos.TILE_MODULAR_UI.open(player, world, i, j, k);
} }
return true; return true;
} }
+25 -15
View File
@@ -1,12 +1,8 @@
package emt.block; package emt.block;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly; import java.util.Random;
import emt.EMT;
import emt.gthandler.common.implementations.automation.EssentiaFiller;
import emt.tile.TileEntityEtherealMacerator;
import emt.tile.TileEntityIndustrialWandRecharge;
import ic2.api.item.IC2Items;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@@ -20,8 +16,15 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.List; import com.gtnewhorizons.modularui.api.UIInfos;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.gthandler.common.implementations.automation.EssentiaFiller;
import emt.tile.TileEntityEtherealMacerator;
import emt.tile.TileEntityIndustrialWandRecharge;
import ic2.api.item.IC2Items;
public class BlockMachines extends BlockBaseContainer { public class BlockMachines extends BlockBaseContainer {
@@ -77,11 +80,13 @@ public class BlockMachines extends BlockBaseContainer {
} }
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7,
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityIndustrialWandRecharge) { float par8, float par9) {
player.openGui(EMT.instance, 0, world, x, y, z); if (!world.isRemote) {
} else if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityEtherealMacerator) { TileEntity te = world.getTileEntity(x, y, z);
player.openGui(EMT.instance, 1, world, x, y, z); if (te instanceof TileEntityIndustrialWandRecharge || te instanceof TileEntityEtherealMacerator) {
UIInfos.TILE_MODULAR_UI.open(player, world, x, y, z);
}
} }
return true; return true;
} }
@@ -115,7 +120,12 @@ public class BlockMachines extends BlockBaseContainer {
float ry = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F;
float rz = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); EntityItem entityItem = new EntityItem(
world,
x + rx,
y + ry,
z + rz,
new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
if (item.hasTagCompound()) { if (item.hasTagCompound()) {
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy()); entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
+10 -9
View File
@@ -1,9 +1,7 @@
package emt.block; package emt.block;
import cpw.mods.fml.relauncher.Side; import java.util.Random;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileEntityPortableNode;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -11,9 +9,12 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.Explosion; import net.minecraft.world.Explosion;
import net.minecraft.world.World; import net.minecraft.world.World;
import thaumcraft.common.blocks.BlockAiry;
import java.util.Random; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileEntityPortableNode;
import thaumcraft.common.blocks.BlockAiry;
public class BlockPortableNode extends BlockAiry { public class BlockPortableNode extends BlockAiry {
@@ -54,8 +55,7 @@ public class BlockPortableNode extends BlockAiry {
return false; return false;
} }
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {}
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Override @Override
@@ -69,7 +69,8 @@ public class BlockPortableNode extends BlockAiry {
} }
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7,
float par8, float par9) {
if (!world.isRemote && player.isSneaking() && player.getHeldItem() == null) { if (!world.isRemote && player.isSneaking() && player.getHeldItem() == null) {
world.setBlockToAir(x, y, z); world.setBlockToAir(x, y, z);
world.removeTileEntity(x, y, z); world.removeTileEntity(x, y, z);
+6 -6
View File
@@ -1,8 +1,7 @@
package emt.block; package emt.block;
import cpw.mods.fml.relauncher.Side; import java.util.Random;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@@ -12,7 +11,9 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.Random; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
public class BlockShield extends Block { public class BlockShield extends Block {
@@ -72,6 +73,5 @@ public class BlockShield extends Block {
} }
@Override @Override
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {}
}
} }
+19 -17
View File
@@ -1,9 +1,8 @@
package emt.block; package emt.block;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly; import java.util.Objects;
import emt.EMT;
import emt.tile.solar.Solars;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@@ -15,8 +14,12 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.List; import com.gtnewhorizons.modularui.api.UIInfos;
import java.util.Objects;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.solar.Solars;
public class BlockSolars extends BlockBaseContainer { public class BlockSolars extends BlockBaseContainer {
@@ -41,14 +44,13 @@ public class BlockSolars extends BlockBaseContainer {
IIcon airSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside"); IIcon airSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
IIcon earthSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside"); IIcon earthSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside");
IIcon[] sides = {side, orderSide, darkSide, airSide, earthSide, waterSide, fireSide}; IIcon[] sides = { side, orderSide, darkSide, airSide, earthSide, waterSide, fireSide };
if (instance != 1 && instance != 0) if (instance != 1 && instance != 0) for (int i = 0; i < countOfMetas; i++) {
for (int i = 0; i < countOfMetas; i++) { iconSets[i].bottom = bottom;
iconSets[i].bottom = bottom; iconSets[i].side = sides[(Objects.requireNonNull(Solars.getTileEntitySolarBase(instance, i)).aspect)];
iconSets[i].side = sides[(Objects.requireNonNull(Solars.getTileEntitySolarBase(instance, i)).aspect)]; iconSets[i].top = tripleSolarTop;
iconSets[i].top = tripleSolarTop; }
}
else if (instance == 0) { else if (instance == 0) {
for (int i = 0; i < countOfMetas; i++) { for (int i = 0; i < countOfMetas; i++) {
iconSets[i].bottom = bottom; iconSets[i].bottom = bottom;
@@ -112,8 +114,7 @@ public class BlockSolars extends BlockBaseContainer {
@Override @Override
public IIcon getIcon(int side, int meta) { public IIcon getIcon(int side, int meta) {
if (meta >= countOfMetas) if (meta >= countOfMetas) return null;
return null;
if (side < 1) { if (side < 1) {
return iconSets[meta].bottom; return iconSets[meta].bottom;
@@ -137,7 +138,8 @@ public class BlockSolars extends BlockBaseContainer {
} }
@Override @Override
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2, float f3) { public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2,
float f3) {
if (player.isSneaking()) { if (player.isSneaking()) {
return false; return false;
} }
@@ -146,7 +148,7 @@ public class BlockSolars extends BlockBaseContainer {
} }
TileEntity tileentity = world.getTileEntity(i, j, k); TileEntity tileentity = world.getTileEntity(i, j, k);
if (tileentity != null) { if (tileentity != null) {
player.openGui(emt.EMT.instance, 1, world, i, j, k); UIInfos.TILE_MODULAR_UI.open(player, world, i, j, k);
} }
return true; return true;
} }
+8 -4
View File
@@ -1,15 +1,19 @@
package emt.client; package emt.client;
import cpw.mods.fml.client.registry.ClientRegistry;
import emt.util.EMTTextHelper;
import net.minecraft.client.settings.KeyBinding; import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import cpw.mods.fml.client.registry.ClientRegistry;
import emt.EMT;
import emt.util.EMTTextHelper;
public class EMTKeys { public class EMTKeys {
public static KeyBinding keyUnequip; public static KeyBinding keyUnequip;
public static void registerKeys() { public static void registerKeys() {
keyUnequip = new KeyBinding(EMTTextHelper.localize("gui.EMT.key.unequip"), Keyboard.KEY_Z, "EMT"); keyUnequip = new KeyBinding(EMTTextHelper.localize("gui.EMT.key.unequip"), Keyboard.KEY_NONE, EMT.NAME);
ClientRegistry.registerKeyBinding(keyUnequip); ClientRegistry.registerKeyBinding(keyUnequip);
} }
} }
@@ -0,0 +1,22 @@
package emt.client.gui;
import static emt.EMT.TEXTURE_PATH;
import com.gtnewhorizons.modularui.api.drawable.UITexture;
public class EMT_UITextures {
public static final UITexture OVERLAY_SLOT_FUSION_CRAFTING = UITexture
.fullImage(TEXTURE_PATH, "guis/overlay_slot/fusion_crafter");
public static final UITexture OVERLAY_SLOT_WAND = UITexture.fullImage(TEXTURE_PATH, "guis/overlay_slot/wand");
public static final UITexture PICTURE_GAUGE_EMPTY_25 = UITexture
.fullImage(TEXTURE_PATH, "guis/picture/gauge_empty_25");
public static final UITexture PICTURE_GAUGE_GENERATOR = UITexture
.fullImage(TEXTURE_PATH, "guis/picture/gauge_generator");
public static final UITexture PICTURE_GAUGE_SOLAR = UITexture.fullImage(TEXTURE_PATH, "guis/picture/gauge_solar");
public static final UITexture PICTURE_GAUGE_EMPTY_11 = UITexture
.fullImage(TEXTURE_PATH, "guis/picture/gauge_empty_11");
public static final UITexture PICTURE_SOLAR_INDICATOR = UITexture
.fullImage(TEXTURE_PATH, "guis/picture/solar_indicator");
}
@@ -1,34 +0,0 @@
package emt.client.gui;
import emt.EMT;
import emt.client.gui.container.ContainerEtheralMacerator;
import emt.tile.TileEntityEtherealMacerator;
import emt.util.EMTTextHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class GuiEtherealMacerator extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation(EMT.TEXTURE_PATH, "textures/guis/etherealmacerator.png");
public GuiEtherealMacerator(InventoryPlayer inventory, TileEntityEtherealMacerator te) {
super(new ContainerEtheralMacerator(inventory, te));
xSize = 176;
ySize = 165;
}
@Override
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
this.fontRendererObj.drawString(EMTTextHelper.localize("gui.EMT.etherealMacerator.title"), 6, 6, 4210752);
this.fontRendererObj.drawString(EMTTextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
}
@@ -1,69 +0,0 @@
package emt.client.gui;
import emt.EMT;
import emt.client.gui.container.ConainerGenerator;
import emt.tile.generator.TileEntityBaseGenerator;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GuiGenerator extends GuiContainer {
private static ResourceLocation tex = new ResourceLocation(EMT.TEXTURE_PATH, "textures/guis/generator.png");
TileEntityBaseGenerator tileentity;
private int xSize;
private int ySize;
public GuiGenerator(InventoryPlayer invPlayer, TileEntityBaseGenerator entity) {
super(new ConainerGenerator(invPlayer, entity));
this.tileentity = entity;
this.allowUserInput = false;
this.xSize = 194;
this.ySize = 168;
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String formatPanelName = I18n.format(this.tileentity.getInventoryName());
int nmPos = (this.xSize - this.fontRendererObj.getStringWidth(formatPanelName)) / 2;
this.fontRendererObj.drawStringWithShadow(formatPanelName, nmPos, 7, 6618118);
String storageString = I18n.format("emt.Storage");
String fuel = I18n.format("emt.Fuel");
if (this.tileentity.maxstorage < 1000)
this.fontRendererObj.drawString(storageString + this.tileentity.mpshownstroage * 1000 + "/" + this.tileentity.maxstorage + "EU", 36, 22, 0);
else if (10000 <= this.tileentity.maxstorage && this.tileentity.maxstorage < 10000000)
this.fontRendererObj.drawString(storageString + (this.tileentity.mpshownstroage) + "/" + (this.tileentity.maxstorage / 1000) + "kEU", 36, 22, 0);
else if (10000000 <= this.tileentity.maxstorage && this.tileentity.maxstorage < 1000000000)
this.fontRendererObj.drawString(storageString + (this.tileentity.mpshownstroage / 1000) + "/" + (this.tileentity.maxstorage / 1000000) + "MEU", 36, 22, 0);
else if (1000000000 <= this.tileentity.maxstorage)
this.fontRendererObj.drawString(storageString + (this.tileentity.mpshownstroage / 1000000) + "/" + (this.tileentity.maxstorage / 1000000000) + "GEU", 36, 22, 0);
if (this.tileentity.isActive)
this.fontRendererObj.drawString(I18n.format("emt.Generating") + Double.toString(this.tileentity.generating / 20 / 20) + " EU/t", 36, 35, 0);
else
this.fontRendererObj.drawString(I18n.format("emt.Generating") + "0 EU/t", 36, 35, 0);
this.fontRendererObj.drawString(fuel + ": " + Integer.toString(this.tileentity.fuel), 36, 48, 0);
this.fontRendererObj.drawString(fuel + "/t: " + Integer.toString((this.tileentity.fuel * 20 * 20) - this.tileentity.tick), 36, 63, 0);
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(tex);
int h = (this.width - this.xSize) / 2;
int k = (this.height - this.ySize) / 2;
drawTexturedModalRect(h, k, 0, 0, this.xSize, this.ySize);
if (this.tileentity.mpshownstroage > 0) {
int l = this.tileentity.gaugeEnergyScaled(33);
drawTexturedModalRect(h + 18, k + 23, 195, 0, l, 14);
}
if (this.tileentity.fuel > 0) {
int l = this.tileentity.gaugeFuelScaled(33);
drawTexturedModalRect(h + 18, k + 42, 195, 0, l, 14);
}
}
}
@@ -1,34 +0,0 @@
package emt.client.gui;
import emt.EMT;
import emt.client.gui.container.ContainerIndustrialWandRecharge;
import emt.tile.TileEntityIndustrialWandRecharge;
import emt.util.EMTTextHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class GuiIndustrialWandRecharger extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation(EMT.TEXTURE_PATH, "textures/guis/wandcharger.png");
public GuiIndustrialWandRecharger(InventoryPlayer inventory, TileEntityIndustrialWandRecharge te) {
super(new ContainerIndustrialWandRecharge(inventory, te));
xSize = 176;
ySize = 165;
}
@Override
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
this.fontRendererObj.drawString(EMTTextHelper.localize("gui.EMT.wandRecharge.title"), 6, 6, 4210752);
this.fontRendererObj.drawString(EMTTextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
}
-111
View File
@@ -1,111 +0,0 @@
package emt.client.gui;
import emt.EMT;
import emt.client.gui.container.ContainerSolars;
import emt.tile.solar.TileEntitySolarBase;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class GuiSolar extends GuiContainer {
private static ResourceLocation tex = new ResourceLocation(EMT.TEXTURE_PATH, "textures/guis/solar.png");
TileEntitySolarBase tileentity;
private boolean allowUserInput;
private int xSize;
private int ySize;
private String color;
private int cColor;
public GuiSolar(InventoryPlayer invPlayer, TileEntitySolarBase entity) {
super(new ContainerSolars(invPlayer, entity));
this.tileentity = entity;
this.allowUserInput = false;
this.xSize = 194;
this.ySize = 168;
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
color = this.tileentity.getInventoryName().replaceAll("Solar", "").replaceAll("Compressed", "").replaceAll("Triple", "").replaceAll("Double", "").trim();
if (color != null)
switch (color) {
case "Aer": {
GL11.glColor4f(1.0f, 0.86f, 0.0f, 1.0f);
break;
}
case "Terra": {
GL11.glColor4f(0.0f, 0.66f, 0.08f, 1.0f);
cColor = 8224255;
break;
}
case "Ordo": {
GL11.glColor4f(0.8f, 0.8f, 0.8f, 1.0f);
break;
}
case "Perditio": {
GL11.glColor4f(0.33F, 0.33F, 0.33F, 1.0F);
break;
}
case "Ignis": {
GL11.glColor4f(0.82f, 0.11f, 0.11f, 1.0f);
break;
}
case "Aqua": {
GL11.glColor4f(0.27f, 0.65f, 1.0f, 1.0f);
break;
}
default: {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
break;
}
}
else
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(tex);
int h = (this.width - this.xSize) / 2;
int k = (this.height - this.ySize) / 2;
drawTexturedModalRect(h, k, 0, 0, this.xSize, this.ySize);
if (this.tileentity.mp_storage > 0) {
int l = this.tileentity.gaugeEnergyScaled(33);
drawTexturedModalRect(h + 18, k + 23, 195, 0, l, 14);
}
if (this.tileentity.generating > 9)
drawTexturedModalRect(h + 18, k + 42, 195, 20, 11, 14);
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String formatPanelName = I18n.format(this.tileentity.getInventoryName(), new Object[0]);
int nmPos = (this.xSize - this.fontRendererObj.getStringWidth(formatPanelName)) / 2;
if (!color.equals("Terra"))
this.fontRendererObj.drawStringWithShadow(formatPanelName, 0, 7, 6618118);
else
this.fontRendererObj.drawStringWithShadow(formatPanelName, 0, 7, cColor);
String storageString = I18n.format("emt.Storage", new Object[0]);
if (this.tileentity.maxstorage < 1000)
this.fontRendererObj.drawString(storageString + this.tileentity.storage + "/" + this.tileentity.maxstorage + "EU", 36, 22, 0);
else if (10000 <= this.tileentity.maxstorage && this.tileentity.maxstorage < 10000000)
this.fontRendererObj.drawString(storageString + (this.tileentity.mp_storage) + "/" + (this.tileentity.maxstorage / 1000) + "kEU", 36, 22, 0);
else if (10000000 <= this.tileentity.maxstorage && this.tileentity.maxstorage < 1000000000)
this.fontRendererObj.drawString(storageString + (this.tileentity.mp_storage / 1000) + "/" + (this.tileentity.maxstorage / 1000000) + "MEU", 36, 22, 0);
else if (1000000000 <= this.tileentity.maxstorage)
this.fontRendererObj.drawString(storageString + (this.tileentity.mp_storage / 1000000) + "/" + (this.tileentity.maxstorage / 1000000000) + "GEU", 36, 22, 0);
if (this.tileentity.isActive)
// if (Double.toString(this.tileentity.generating).length()>5)
// this.fontRendererObj.drawString(I18n.format("emt.Generating",new Object[0])+Double.toString(this.tileentity.generating).substring(0, 4)+" EU/t", 36, 35, 0);
// else
this.fontRendererObj.drawString(I18n.format("emt.Generating", new Object[0]) + Double.toString(this.tileentity.generating) + " EU/t", 36, 35, 0);
else
this.fontRendererObj.drawString(I18n.format("emt.Generating", new Object[0]) + "0 EU/t", 36, 35, 0);
}
}
@@ -1,23 +1,30 @@
package emt.client.gui.config; package emt.client.gui.config;
import cpw.mods.fml.client.config.GuiConfig; import static emt.util.EMTConfigHandler.*;
import cpw.mods.fml.client.config.IConfigElement;
import emt.EMT;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.ConfigElement;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import static emt.util.EMTConfigHandler.*; import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.ConfigElement;
import cpw.mods.fml.client.config.GuiConfig;
import cpw.mods.fml.client.config.IConfigElement;
import emt.EMT;
public class EMTGuiConfig extends GuiConfig { public class EMTGuiConfig extends GuiConfig {
public EMTGuiConfig(GuiScreen parentScreen) { public EMTGuiConfig(GuiScreen parentScreen) {
super(parentScreen, getConfigElements(parentScreen), EMT.MOD_ID, false, false, StatCollector.translateToLocal("gui." + EMT.MOD_ID + ".config.title")); super(
parentScreen,
getConfigElements(parentScreen),
EMT.MOD_ID,
false,
false,
StatCollector.translateToLocal("gui." + EMT.MOD_ID + ".config.title"));
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@@ -1,17 +1,16 @@
package emt.client.gui.config; package emt.client.gui.config;
import cpw.mods.fml.client.IModGuiFactory; import java.util.Set;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import java.util.Set; import cpw.mods.fml.client.IModGuiFactory;
public class EMTGuiFactory implements IModGuiFactory { public class EMTGuiFactory implements IModGuiFactory {
@Override @Override
public void initialize(Minecraft minecraftInstance) { public void initialize(Minecraft minecraftInstance) {}
}
@Override @Override
public Class<? extends GuiScreen> mainConfigGuiClass() { public Class<? extends GuiScreen> mainConfigGuiClass() {
@@ -1,95 +0,0 @@
package emt.client.gui.container;
import emt.tile.generator.TileEntityBaseGenerator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.item.ItemStack;
import thaumcraft.api.aspects.Aspect;
import java.util.Locale;
public class ConainerGenerator
extends Container {
private TileEntityBaseGenerator tileentity;
public ConainerGenerator(InventoryPlayer inventoryplayer, TileEntityBaseGenerator tileentity) {
this.tileentity = tileentity;
}
public void detectAndSendChanges() {
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
icrafting.sendProgressBarUpdate(this, 0, (short) (this.tileentity.generating / 400));
icrafting.sendProgressBarUpdate(this, 1, (byte) this.tileentity.fuel);
icrafting.sendProgressBarUpdate(this, 2, (short) (this.tileentity.storage / 1000));
icrafting.sendProgressBarUpdate(this, 3, (byte) encryptAspect(this.tileentity.aspect));
icrafting.sendProgressBarUpdate(this, 4, (byte) (this.tileentity.isActive ? 1 : 0));
}
}
private byte encryptAspect(Aspect aspect) {
switch (aspect.getTag().toUpperCase(Locale.US)) {
case "POTENTIA":
return 0;
case "IGNIS":
return 1;
case "AURAM":
return 2;
case "ARBOR":
return 3;
case "AER":
return 4;
case "LUCRUM":
return 5;
}
return 0;
}
public void updateProgressBar(int i, int j) {
if (i == 0) {
this.tileentity.generating = (((int) j) * 400);
} else if (i == 1) {
if (j == 0 || this.tileentity.fuel != j)
this.tileentity.tick = 0;
this.tileentity.fuel = ((byte) j);
} else if (i == 2) {
this.tileentity.mpshownstroage = (short) j;
} else if (i == 3 && this.tileentity.aspect == null)
switch (j) {
case 0:
this.tileentity.aspect = Aspect.ENERGY;
break;
case 1:
this.tileentity.aspect = Aspect.FIRE;
break;
case 2:
this.tileentity.aspect = Aspect.AURA;
break;
case 3:
this.tileentity.aspect = Aspect.TREE;
break;
case 4:
this.tileentity.aspect = Aspect.AIR;
break;
case 5:
this.tileentity.aspect = Aspect.GREED;
break;
}
else if (i == 4) {
this.tileentity.isActive = ((byte) j) == ((byte) 1);
}
}
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
return null;
}
public boolean canInteractWith(EntityPlayer entityplayer) {
this.detectAndSendChanges();
return this.tileentity.isUseableByPlayer(entityplayer);
}
}
@@ -1,83 +0,0 @@
package emt.client.gui.container;
import emt.tile.TileEntityEtherealMacerator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.tileentity.TileEntity;
import thaumcraft.common.container.SlotOutput;
public class ContainerEtheralMacerator extends Container {
TileEntityEtherealMacerator te;
public ContainerEtheralMacerator(InventoryPlayer inventory, TileEntity te) {
this.te = ((TileEntityEtherealMacerator) te);
addSlotToContainer(new Slot(this.te, 0, 56, 26));
addSlotToContainer(new SlotOutput(this.te, 2, 116, 26));
addSlotToContainer(new SlotOutput(this.te, 1, 116, 53));
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return this.te.isUseableByPlayer(player);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
ItemStack itemstack = null;
Slot slot = (Slot) this.inventorySlots.get(par2);
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (par2 == 1) {
if (!this.mergeItemStack(itemstack1, 2, 38, true)) {
return null;
}
slot.onSlotChange(itemstack1, itemstack);
} else if (par2 != 0) {
if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) {
if (!this.mergeItemStack(itemstack1, 0, 1, false)) {
return null;
}
} else if (par2 >= 2 && par2 < 29) {
if (!this.mergeItemStack(itemstack1, 29, 38, false)) {
return null;
}
} else if (par2 >= 29 && par2 < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) {
return null;
}
} else if (!this.mergeItemStack(itemstack1, 3, 38, false)) {
return null;
}
if (itemstack1.stackSize == 0) {
slot.putStack((ItemStack) null);
} else {
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize) {
return null;
}
slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
}
return itemstack;
}
}
@@ -1,69 +0,0 @@
package emt.client.gui.container;
import emt.tile.TileEntityIndustrialWandRecharge;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerIndustrialWandRecharge extends Container {
TileEntityIndustrialWandRecharge charger;
public ContainerIndustrialWandRecharge(InventoryPlayer invPlayer, TileEntityIndustrialWandRecharge entity) {
this.charger = entity;
for (int x = 0; x < 9; x++) {
this.addSlotToContainer(new Slot(invPlayer, x, 8 + x * 18, 142));
}
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 9; x++) {
this.addSlotToContainer(new Slot(invPlayer, 9 + x + y * 9, 8 + x * 18, 84 + y * 18));
}
}
this.addSlotToContainer(new Slot(charger, 0, 80, 35));
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return charger.isUseableByPlayer(player);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
ItemStack itemstack = null;
Slot slot = (Slot) this.inventorySlots.get(par2);
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (par2 == 36) {
if (!this.mergeItemStack(itemstack1, 0, 35, false)) {
return null;
}
slot.onSlotChange(itemstack1, itemstack);
} else if (!charger.isItemValidForSlot(0, itemstack1) || !this.mergeItemStack(itemstack1, 36, 37, false)) {
return null;
}
if (itemstack1.stackSize == 0) {
slot.putStack((ItemStack) null);
} else {
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize) {
return null;
}
slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
}
return itemstack;
}
}
@@ -1,59 +0,0 @@
package emt.client.gui.container;
import emt.tile.solar.TileEntitySolarBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.item.ItemStack;
import java.nio.ByteBuffer;
public class ContainerSolars
extends Container {
byte[] generating = new byte[8];
byte[] mpStorage = new byte[8];
private TileEntitySolarBase tileentity;
public ContainerSolars(InventoryPlayer inventoryplayer, TileEntitySolarBase tileentity) {
this.tileentity = tileentity;
}
public void detectAndSendChanges() {
byte[] generating = ByteBuffer.allocate(8).putDouble(this.tileentity.generating).array();
byte[] mpStorage = ByteBuffer.allocate(8).putDouble(this.tileentity.getSourceStored() / 1000).array();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
for (int j = 0; j < generating.length; j++) {
icrafting.sendProgressBarUpdate(this, j, generating[j]);
}
for (int j = 0; j < mpStorage.length; j++) {
icrafting.sendProgressBarUpdate(this, 8 + j, mpStorage[j]);
}
}
}
public void updateProgressBar(int i, int j) {
if (i < 8) {
generating[i] = (byte) j;
if (i == 7)
this.tileentity.generating = ByteBuffer.wrap(generating).getDouble();
}
if (i > 7 && i < 16) {
mpStorage[i - 8] = (byte) j;
if (i == 15)
this.tileentity.mp_storage = (long) ByteBuffer.wrap(mpStorage).getDouble();
}
}
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
return null;
}
public boolean canInteractWith(EntityPlayer entityplayer) {
this.detectAndSendChanges();
return this.tileentity.isUseableByPlayer(entityplayer);
}
}
@@ -1,21 +1,23 @@
package emt.client.model; package emt.client.model;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class ModelSpecialArmor extends ModelBiped { public class ModelSpecialArmor extends ModelBiped {
public ModelRenderer rightWing; public ModelRenderer rightWing;
public ModelRenderer leftWing; public ModelRenderer leftWing;
public ModelRenderer center; public ModelRenderer center;
public ModelRenderer jetpack; public ModelRenderer jetpack;
public boolean isJumping; public boolean isJumping;
public int type = 0;// 0 - Nothing, 1 - Jetpack, 2 - Wings public int type = 0; // 0 - Nothing, 1 - Jetpack, 2 - Wings
public ModelSpecialArmor() { public ModelSpecialArmor() {
this(1, 0); this(1, 0);
@@ -71,12 +73,16 @@ public class ModelSpecialArmor extends ModelBiped {
model.rotateAngleZ = z; model.rotateAngleZ = z;
} }
public void render(Entity entity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) { public void render(Entity entity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_,
float p_78088_6_, float scale) {
EntityPlayer player = (EntityPlayer) entity; EntityPlayer player = (EntityPlayer) entity;
this.heldItemRight = player.inventory.getCurrentItem() != null ? 1 : 0; this.heldItemRight = player.inventory.getCurrentItem() != null ? 1 : 0;
this.isRiding = player.isRiding(); this.isRiding = player.isRiding();
this.isSneak = player.isSneaking(); this.isSneak = player.isSneaking();
this.aimedBow = player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem().getItemUseAction(player.inventory.getCurrentItem()) == EnumAction.bow && player.isUsingItem(); this.aimedBow = player.inventory.getCurrentItem() != null
&& player.inventory.getCurrentItem().getItem().getItemUseAction(player.inventory.getCurrentItem())
== EnumAction.bow
&& player.isUsingItem();
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entity); this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entity);
this.bipedBody.render(scale); this.bipedBody.render(scale);
@@ -91,10 +97,10 @@ public class ModelSpecialArmor extends ModelBiped {
this.leftWing.render(scale); this.leftWing.render(scale);
this.rightWing.render(scale); this.rightWing.render(scale);
} }
} }
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entity) { public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
float p_78087_5_, float p_78087_6_, Entity entity) {
super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entity); super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entity);
if (this.isJumping) { if (this.isJumping) {
this.rightWing.rotateAngleY = 0.5f; this.rightWing.rotateAngleY = 0.5f;
@@ -117,4 +123,4 @@ public class ModelSpecialArmor extends ModelBiped {
} }
} }
} }
} }
@@ -1,17 +1,21 @@
package emt.client.renderer; package emt.client.renderer;
import emt.EMT;
import emt.entity.EntityLaser;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
import emt.EMT;
import emt.entity.EntityLaser;
public class RenderLaser extends Render { public class RenderLaser extends Render {
private static final ResourceLocation laserTexture = new ResourceLocation(EMT.TEXTURE_PATH, "textures/models/lasermodel.png"); private static final ResourceLocation laserTexture = new ResourceLocation(
EMT.TEXTURE_PATH,
"textures/models/lasermodel.png");
@Override @Override
public void doRender(Entity entityLaser, double x, double y, double z, float par8, float pTick) { public void doRender(Entity entityLaser, double x, double y, double z, float par8, float pTick) {
@@ -1,7 +1,7 @@
package emt.client.renderer; package emt.client.renderer;
import emt.EMT; import static org.lwjgl.opengl.GL11.*;
import emt.entity.EntityShield;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GLAllocation; import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
@@ -9,13 +9,18 @@ import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
import static org.lwjgl.opengl.GL11.*; import emt.EMT;
import emt.entity.EntityShield;
public class RenderShield extends Render { public class RenderShield extends Render {
private static final ResourceLocation shieldTexture = new ResourceLocation(EMT.TEXTURE_PATH, "textures/models/shield.png");
private static final ResourceLocation shieldTexture = new ResourceLocation(
EMT.TEXTURE_PATH,
"textures/models/shield.png");
static int glCallList; static int glCallList;
static { static {
@@ -79,7 +84,8 @@ public class RenderShield extends Render {
glDisable(GL_CULL_FACE); glDisable(GL_CULL_FACE);
glPushMatrix(); glPushMatrix();
if (((EntityShield) entityShield).owner != null && !Minecraft.getMinecraft().thePlayer.getDisplayName().equals(((EntityShield) entityShield).owner.getDisplayName())) { if (((EntityShield) entityShield).owner != null && !Minecraft.getMinecraft().thePlayer.getDisplayName()
.equals(((EntityShield) entityShield).owner.getDisplayName())) {
glTranslated(x, y, z); glTranslated(x, y, z);
} }
@@ -94,5 +100,4 @@ public class RenderShield extends Render {
protected ResourceLocation getEntityTexture(Entity texture) { protected ResourceLocation getEntityTexture(Entity texture) {
return shieldTexture; return shieldTexture;
} }
} }
+28 -13
View File
@@ -1,7 +1,8 @@
package emt.command; package emt.command;
import emt.util.EMTEssentiasOutputs; import java.util.ArrayList;
import emt.util.EMTTextHelper; import java.util.List;
import net.minecraft.command.CommandBase; import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommand; import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender; import net.minecraft.command.ICommandSender;
@@ -10,10 +11,10 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString; import net.minecraft.nbt.NBTTagString;
import thaumcraft.api.aspects.Aspect;
import java.util.ArrayList; import emt.util.EMTEssentiasOutputs;
import java.util.List; import emt.util.EMTTextHelper;
import thaumcraft.api.aspects.Aspect;
public class CommandOutputs extends CommandBase { public class CommandOutputs extends CommandBase {
@@ -33,15 +34,29 @@ public class CommandOutputs extends CommandBase {
for (final Aspect aspect : Aspect.aspects.values()) { for (final Aspect aspect : Aspect.aspects.values()) {
++counter; ++counter;
if (aspect.equals(Aspect.ENERGY) || aspect.equals(Aspect.TREE) || aspect.equals(Aspect.FIRE) || aspect.equals(Aspect.AURA) || aspect.equals(Aspect.GREED) || aspect.equals(Aspect.AIR)) if (aspect.equals(Aspect.ENERGY) || aspect.equals(Aspect.TREE)
text3 += aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D / 20D) + "EU\n"; || aspect.equals(Aspect.FIRE)
|| aspect.equals(Aspect.AURA)
|| aspect.equals(Aspect.GREED)
|| aspect.equals(Aspect.AIR))
text3 += aspect.getTag() + ": "
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D / 20D)
+ "EU\n";
if (counter < 12) { if (counter < 12) {
text2 += aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D) + "EU/t\n"; text2 += aspect.getTag() + ": "
text += aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag())) + "EU\n"; + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D)
+ "EU/t\n";
text += aspect.getTag() + ": "
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()))
+ "EU\n";
} else { } else {
text2 += aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D) + "EU\n"; text2 += aspect.getTag() + ": "
text += aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag())) + "EU\n"; + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()) / 20D)
+ "EU\n";
text += aspect.getTag() + ": "
+ String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag()))
+ "EU\n";
bookL.add(text); bookL.add(text);
bookL2.add(text2); bookL2.add(text2);
text2 = ""; text2 = "";
@@ -109,8 +124,8 @@ public class CommandOutputs extends CommandBase {
public void processCommand(ICommandSender command, String[] astring) { public void processCommand(ICommandSender command, String[] astring) {
ItemStack book = mkbook(); ItemStack book = mkbook();
if (!command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).inventory.addItemStackToInventory(book)) if (!command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).inventory
.addItemStackToInventory(book))
command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).entityDropItem(book, 0); command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).entityDropItem(book, 0);
} }
} }
+15 -9
View File
@@ -29,7 +29,9 @@ public class EntityArcher extends EntitySnowman implements IExtendedEntityProper
this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector)); this.targetTasks.addTask(
3,
new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
this.tasks.addTask(4, new EntityAIWander(this, 0.30D)); this.tasks.addTask(4, new EntityAIWander(this, 0.30D));
} }
@@ -83,10 +85,17 @@ public class EntityArcher extends EntitySnowman implements IExtendedEntityProper
@Override @Override
public void attackEntityWithRangedAttack(EntityLivingBase entity, float par2) { public void attackEntityWithRangedAttack(EntityLivingBase entity, float par2) {
EntityArrow entityarrow = new EntityArrow(this.worldObj, this, entity, 1.6F, (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4)); EntityArrow entityarrow = new EntityArrow(
this.worldObj,
this,
entity,
1.6F,
(float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
int powerLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); int powerLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem());
int punchLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); int punchLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem());
entityarrow.setDamage((double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F)); entityarrow.setDamage(
(double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D
+ (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
if (powerLevel > 0) { if (powerLevel > 0) {
entityarrow.setDamage(entityarrow.getDamage() + (double) powerLevel * 0.5D + 0.5D); entityarrow.setDamage(entityarrow.getDamage() + (double) powerLevel * 0.5D + 0.5D);
@@ -105,14 +114,11 @@ public class EntityArcher extends EntitySnowman implements IExtendedEntityProper
} }
@Override @Override
public void saveNBTData(NBTTagCompound compound) { public void saveNBTData(NBTTagCompound compound) {}
}
@Override @Override
public void loadNBTData(NBTTagCompound compound) { public void loadNBTData(NBTTagCompound compound) {}
}
@Override @Override
public void init(Entity entity, World world) { public void init(Entity entity, World world) {}
}
} }
+26 -17
View File
@@ -1,9 +1,7 @@
package emt.entity; package emt.entity;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; import java.util.ArrayList;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile; import net.minecraft.entity.IProjectile;
@@ -15,11 +13,15 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.Chunk;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import thaumcraft.common.Thaumcraft; import thaumcraft.common.Thaumcraft;
import java.util.ArrayList;
public class EntityEnergyBall extends Entity implements IProjectile, IEntityAdditionalSpawnData { public class EntityEnergyBall extends Entity implements IProjectile, IEntityAdditionalSpawnData {
public static final int RADIUS = 8; public static final int RADIUS = 8;
public static final int MAX_TICKS_IN_TILE = 60; public static final int MAX_TICKS_IN_TILE = 60;
@@ -31,6 +33,7 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
* Pls, don't ask me why 1 =) * Pls, don't ask me why 1 =)
**/ **/
public int ticksInAir = 1; public int ticksInAir = 1;
public double accelerationX = 0; public double accelerationX = 0;
public double accelerationY = 0; public double accelerationY = 0;
public double accelerationZ = 0; public double accelerationZ = 0;
@@ -51,7 +54,12 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
this(world); this(world);
this.shootingEntity = shootingEntity; this.shootingEntity = shootingEntity;
this.setLocationAndAngles(shootingEntity.posX, shootingEntity.posY + shootingEntity.getEyeHeight(), shootingEntity.posZ, shootingEntity.rotationYaw, shootingEntity.rotationPitch); this.setLocationAndAngles(
shootingEntity.posX,
shootingEntity.posY + shootingEntity.getEyeHeight(),
shootingEntity.posZ,
shootingEntity.rotationYaw,
shootingEntity.rotationPitch);
} }
public EntityEnergyBall(World world) { public EntityEnergyBall(World world) {
@@ -97,7 +105,8 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
for (int chX = -chunkSize; chX < chunkSize; chX++) { for (int chX = -chunkSize; chX < chunkSize; chX++) {
for (int chZ = -chunkSize; chZ < chunkSize; chZ++) { for (int chZ = -chunkSize; chZ < chunkSize; chZ++) {
Chunk chunk = worldObj.getChunkFromChunkCoords(chX + (int) (this.posX / 16), chZ + (int) (this.posZ / 16)); Chunk chunk = worldObj
.getChunkFromChunkCoords(chX + (int) (this.posX / 16), chZ + (int) (this.posZ / 16));
if (chunk.isChunkLoaded && chunk.hasEntities) { if (chunk.isChunkLoaded && chunk.hasEntities) {
for (int i = 0; i < chunk.entityLists.length; i++) { for (int i = 0; i < chunk.entityLists.length; i++) {
@@ -106,7 +115,8 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
double width = entity.posX - this.posX; double width = entity.posX - this.posX;
double height = entity.posY - this.posY; double height = entity.posY - this.posY;
double length = entity.posZ - this.posZ; double length = entity.posZ - this.posZ;
double hyp = MathHelper.sqrt_double((width * width) + (length * length) + (height * height)); double hyp = MathHelper
.sqrt_double((width * width) + (length * length) + (height * height));
if (hyp <= RADIUS) { if (hyp <= RADIUS) {
entities.add(entity); entities.add(entity);
@@ -116,7 +126,6 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
if (worldObj.isRemote) { if (worldObj.isRemote) {
Thaumcraft.proxy.bolt(worldObj, this, entity); Thaumcraft.proxy.bolt(worldObj, this, entity);
} }
} }
} }
} }
@@ -129,7 +138,8 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
else { else {
/** Collision detection **/ /** Collision detection **/
Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec3next = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); Vec3 vec3next = Vec3
.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition mop = this.worldObj.rayTraceBlocks(vec3, vec3next); MovingObjectPosition mop = this.worldObj.rayTraceBlocks(vec3, vec3next);
this.ticksInAir++; this.ticksInAir++;
@@ -144,7 +154,8 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float) (Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; this.rotationYaw = (float) (Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F;
for (this.rotationPitch = (float) (Math.atan2((double) f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { for (this.rotationPitch = (float) (Math.atan2((double) f1, this.motionY) * 180.0D / Math.PI)
- 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
; ;
} }
@@ -203,13 +214,12 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
} }
@Override @Override
protected void entityInit() { protected void entityInit() {}
}
@Override @Override
public void writeEntityToNBT(NBTTagCompound nbt) { public void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setByte("inTile", (byte) (this.inTile ? 1 : 0)); nbt.setByte("inTile", (byte) (this.inTile ? 1 : 0));
nbt.setTag("direction", this.newDoubleNBTList(new double[]{this.motionX, this.motionY, this.motionZ})); nbt.setTag("direction", this.newDoubleNBTList(new double[] { this.motionX, this.motionY, this.motionZ }));
} }
@Override @Override
@@ -229,6 +239,5 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
} }
@Override @Override
public void setThrowableHeading(double x, double y, double z, float p1, float p2) { public void setThrowableHeading(double x, double y, double z, float p1, float p2) {}
}
} }
+71 -30
View File
@@ -1,8 +1,7 @@
package emt.entity; package emt.entity;
import cpw.mods.fml.common.registry.IThrowableEntity; import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -16,9 +15,12 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.List; import cpw.mods.fml.common.registry.IThrowableEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityLaser extends Entity implements IThrowableEntity, IProjectile { public class EntityLaser extends Entity implements IThrowableEntity, IProjectile {
public Entity shootingEntity; public Entity shootingEntity;
private Block inTile; private Block inTile;
private int xTile; private int xTile;
@@ -43,14 +45,21 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
this.shootingEntity = entity; this.shootingEntity = entity;
this.setSize(0.5F, 0.5F); this.setSize(0.5F, 0.5F);
this.setLocationAndAngles(entity.posX, entity.posY + (double) entity.getEyeHeight(), entity.posZ, entity.rotationYaw, entity.rotationPitch); this.setLocationAndAngles(
entity.posX,
entity.posY + (double) entity.getEyeHeight(),
entity.posZ,
entity.rotationYaw,
entity.rotationPitch);
this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
this.posY -= 0.10000000149011612D; this.posY -= 0.10000000149011612D;
this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
this.yOffset = 0.0F; this.yOffset = 0.0F;
this.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI)); this.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI)
this.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI)); * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
this.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI)
* MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI)); this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI));
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, speed, 1.0F); this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, speed, 1.0F);
@@ -61,8 +70,7 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
} }
@Override @Override
protected void entityInit() { protected void entityInit() {}
}
@Override @Override
public void setThrowableHeading(double x, double y, double z, float speed, float scale) { public void setThrowableHeading(double x, double y, double z, float speed, float scale) {
@@ -84,7 +92,6 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
this.motionX = velX; this.motionX = velX;
this.motionY = velY; this.motionY = velY;
this.motionZ = velZ; this.motionZ = velZ;
} }
@Override @Override
@@ -95,24 +102,34 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
if (block.getMaterial() != Material.air) { if (block.getMaterial() != Material.air) {
block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile); block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile); AxisAlignedBB axisalignedbb = block
.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) { if (axisalignedbb != null
&& axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) {
this.inGround = true; this.inGround = true;
} }
} }
block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile); block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile); AxisAlignedBB axisalignedbb = block
.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) { if (axisalignedbb != null
&& axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) {
this.inGround = true; this.inGround = true;
} }
if (this.inGround) { if (this.inGround) {
int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
if (!this.worldObj.isRemote) { if (!this.worldObj.isRemote) {
this.worldObj.createExplosion(this, (int) this.posX, (int) this.posY, (int) this.posZ, explosionStrength, true); this.worldObj.createExplosion(
this,
(int) this.posX,
(int) this.posY,
(int) this.posZ,
explosionStrength,
true);
this.setDead(); this.setDead();
} }
@@ -133,17 +150,24 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
} else { } else {
++this.ticksInAir; ++this.ticksInAir;
Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec3next = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); Vec3 vec3next = Vec3
.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec3next, false, true, false); MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec3next, false, true, false);
vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
vec3next = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); vec3next = Vec3
.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null) { if (movingobjectposition != null) {
vec3next = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); vec3next = Vec3.createVectorHelper(
movingobjectposition.hitVec.xCoord,
movingobjectposition.hitVec.yCoord,
movingobjectposition.hitVec.zCoord);
} }
Entity entity = null; Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(
this,
this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D; double d0 = 0.0D;
int l; int l;
float down; float down;
@@ -153,7 +177,8 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) { if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) {
down = 0.3F; down = 0.3F;
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double) down, (double) down, (double) down); AxisAlignedBB axisalignedbb1 = entity1.boundingBox
.expand((double) down, (double) down, (double) down);
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3next, vec3); MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3next, vec3);
if (movingobjectposition1 != null) { if (movingobjectposition1 != null) {
@@ -171,10 +196,12 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
movingobjectposition = new MovingObjectPosition(entity); movingobjectposition = new MovingObjectPosition(entity);
} }
if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) { if (movingobjectposition != null && movingobjectposition.entityHit != null
&& movingobjectposition.entityHit instanceof EntityPlayer) {
EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit; EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit;
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) { if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer
&& !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) {
movingobjectposition = null; movingobjectposition = null;
} }
} }
@@ -184,9 +211,16 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
if (movingobjectposition != null) { if (movingobjectposition != null) {
if (movingobjectposition.entityHit != null) { if (movingobjectposition.entityHit != null) {
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); f2 = MathHelper.sqrt_double(
this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
if (!this.worldObj.isRemote) { if (!this.worldObj.isRemote) {
this.worldObj.createExplosion(this, (int) this.posX, (int) this.posY, (int) this.posZ, explosionStrength, true); this.worldObj.createExplosion(
this,
(int) this.posX,
(int) this.posY,
(int) this.posZ,
explosionStrength,
true);
this.setDead(); this.setDead();
} }
} else { } else {
@@ -198,7 +232,8 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
this.motionX = movingobjectposition.hitVec.xCoord - this.posX; this.motionX = movingobjectposition.hitVec.xCoord - this.posX;
this.motionY = movingobjectposition.hitVec.yCoord - this.posY; this.motionY = movingobjectposition.hitVec.yCoord - this.posY;
this.motionZ = movingobjectposition.hitVec.zCoord - this.posZ; this.motionZ = movingobjectposition.hitVec.zCoord - this.posZ;
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); f2 = MathHelper.sqrt_double(
this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
this.posX -= this.motionX / (double) f2 * 0.05000000074505806D; this.posX -= this.motionX / (double) f2 * 0.05000000074505806D;
this.posY -= this.motionY / (double) f2 * 0.05000000074505806D; this.posY -= this.motionY / (double) f2 * 0.05000000074505806D;
this.posZ -= this.motionZ / (double) f2 * 0.05000000074505806D; this.posZ -= this.motionZ / (double) f2 * 0.05000000074505806D;
@@ -212,7 +247,8 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f2) * 180.0D
/ Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
; ;
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
@@ -227,13 +263,18 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
this.prevRotationYaw += 360.0F; this.prevRotationYaw += 360.0F;
} }
if (this.isInWater()) { if (this.isInWater()) {
for (int j1 = 0; j1 < 4; ++j1) { for (int j1 = 0; j1 < 4; ++j1) {
f3 = 0.25F; f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double) f3, this.posY - this.motionY * (double) f3, this.posZ - this.motionZ * (double) f3, this.motionX, this.motionY, this.motionZ); this.worldObj.spawnParticle(
"bubble",
this.posX - this.motionX * (double) f3,
this.posY - this.motionY * (double) f3,
this.posZ - this.motionZ * (double) f3,
this.motionX,
this.motionY,
this.motionZ);
} }
} }
this.setPosition(this.posX, this.posY, this.posZ); this.setPosition(this.posX, this.posY, this.posZ);
} }
@@ -282,4 +323,4 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
public void setThrower(Entity entity) { public void setThrower(Entity entity) {
shootingEntity = entity; shootingEntity = entity;
} }
} }
+13 -7
View File
@@ -1,14 +1,16 @@
package emt.entity; package emt.entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityShield extends Entity { public class EntityShield extends Entity {
public EntityPlayer owner; public EntityPlayer owner;
public boolean needCheck = true; public boolean needCheck = true;
@@ -33,12 +35,10 @@ public class EntityShield extends Entity {
} }
@Override @Override
protected void readEntityFromNBT(NBTTagCompound nbt) { protected void readEntityFromNBT(NBTTagCompound nbt) {}
}
@Override @Override
protected void writeEntityToNBT(NBTTagCompound nbt) { protected void writeEntityToNBT(NBTTagCompound nbt) {}
}
@Override @Override
public AxisAlignedBB getBoundingBox() { public AxisAlignedBB getBoundingBox() {
@@ -62,7 +62,13 @@ public class EntityShield extends Entity {
this.posZ = z; this.posZ = z;
float f = this.width / 2.0F; float f = this.width / 2.0F;
float f1 = this.height; float f1 = this.height;
this.boundingBox.setBounds(x - (double) f, y - (double) this.yOffset - 2 + (double) this.ySize, z - (double) f, x + (double) f, y - (double) this.yOffset - 2 + (double) this.ySize + (double) f1, z + (double) f); this.boundingBox.setBounds(
x - (double) f,
y - (double) this.yOffset - 2 + (double) this.ySize,
z - (double) f,
x + (double) f,
y - (double) this.yOffset - 2 + (double) this.ySize + (double) f1,
z + (double) f);
} }
@Override @Override
@@ -1,34 +1,38 @@
package emt.gthandler.common.blocks; package emt.gthandler.common.blocks;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT; import emt.EMT;
import net.minecraft.block.Block; import emt.gthandler.common.items.EMT_CasingBlock;
import net.minecraft.block.material.Material; import gregtech.api.enums.Textures;
import net.minecraft.client.renderer.texture.IIconRegister; import gregtech.api.render.TextureFactory;
import net.minecraft.creativetab.CreativeTabs; import gregtech.common.blocks.GT_Block_Casings_Abstract;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import java.util.List; public class EMT_GT_Block extends GT_Block_Casings_Abstract {
public class EMT_GT_Block extends Block {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private IIcon[] texture; private IIcon[] texture;
private String[] textureNames;
private String name;
public EMT_GT_Block(String name, String[] texture) { private final String[] textureNames;
super(Material.anvil);
public EMT_GT_Block(String[] texture) {
super(EMT_CasingBlock.class, "EMT_GTBLOCK_CASEING", Material.anvil);
this.setHardness(15.0F); this.setHardness(15.0F);
this.setResistance(30.0F); this.setResistance(30.0F);
this.name = name;
this.textureNames = texture; this.textureNames = texture;
this.setCreativeTab(EMT.TAB); this.setCreativeTab(EMT.TAB);
// Taking one texture slot :P
Textures.BlockIcons.setCasingTexture((byte) 1, (byte) (15 + 48), TextureFactory.of(this, 7));
} }
@Override @Override
@@ -57,24 +61,4 @@ public class EMT_GT_Block extends Block {
texture[i] = par1IconRegister.registerIcon(textureNames[i]); texture[i] = par1IconRegister.registerIcon(textureNames[i]);
} }
} }
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public String getUnlocalizedName() {
return name;
}
@Override
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
return false;
}
@Override
public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) {
return false;
}
} }
@@ -1,21 +1,22 @@
package emt.gthandler.common.implementations; package emt.gthandler.common.implementations;
import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import gregtech.api.enums.GT_Values; import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.fluids.FluidStack;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectList;
import java.util.ArrayList;
public class EssentiaHatch extends GT_MetaTileEntity_Hatch_Input { public class EssentiaHatch extends GT_MetaTileEntity_Hatch_Input {
private static int ApTe = (int) Math.ceil(Aspect.aspects.size() / GT_Values.V.length); private static int ApTe = (int) Math.ceil(Aspect.aspects.size() / GT_Values.V.length);
@@ -36,12 +37,9 @@ public class EssentiaHatch extends GT_MetaTileEntity_Hatch_Input {
public boolean addAspectList(final AspectList A) { public boolean addAspectList(final AspectList A) {
if ((this.mTier + 1) * ApTe > A.size() + current.size()) { if ((this.mTier + 1) * ApTe > A.size() + current.size()) {
if (current.visSize() + A.visSize() < (this.mTier + 1) * ApTe * 64) if (current.visSize() + A.visSize() < (this.mTier + 1) * ApTe * 64) current.add(A);
current.add(A);
return true; return true;
} else } else return false;
return false;
} }
public void setCurrent(AspectList List) { public void setCurrent(AspectList List) {
@@ -52,21 +50,18 @@ public class EssentiaHatch extends GT_MetaTileEntity_Hatch_Input {
return current; return current;
} }
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new EssentiaHatch("Essentia Hatch " + GT_Values.VN[this.mTier], this.mTier, this.getDescription(), this.mTextures); return new EssentiaHatch(
} "Essentia Hatch " + GT_Values.VN[this.mTier],
this.mTier,
this.getDescription(),
@Override this.mTextures);
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
//TODO: new GUI.
return null;
} }
@Override @Override
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
//TODO: new contanier GUI. return false;
return null;
} }
@Override @Override
@@ -83,26 +78,19 @@ public class EssentiaHatch extends GT_MetaTileEntity_Hatch_Input {
return ret; return ret;
/*String[] old = super.getInfoData(); /*
if (old.length!=0) { * String[] old = super.getInfoData(); if (old.length!=0) { String[] newDescription = new String[old.length +
String[] newDescription = new String[old.length + 1]; * 1]; for (int i = 0; i < old.length; i++) { newDescription[i] = old[i]; } newDescription[old.length] =
for (int i = 0; i < old.length; i++) { * "This Contains: " + current.size() + " different Aspects"; return newDescription; }else return new
newDescription[i] = old[i]; * String[]{"This Contains: " + current.size() + " different Aspects"};
} */
newDescription[old.length] = "This Contains: " + current.size() + " different Aspects";
return newDescription;
}else
return new String[]{"This Contains: " + current.size() + " different Aspects"};*/
} }
@Override @Override
public String[] getDescription() { //this is the fucking tooltip -_-' public String[] getDescription() { // this is the fucking tooltip -_-'
return new String[]{ return new String[] { "Essentia Hatch for usage in Multiblocks", "Can only be filled with the Essentia Filler",
"Essentia Hatch for usage in Multiblocks",
"Can only be filled with the Essentia Filler",
"Can hold " + Integer.toString((ApTe * (mTier + 1))) + " Different Essentia Types", "Can hold " + Integer.toString((ApTe * (mTier + 1))) + " Different Essentia Types",
"Can hold " + Integer.toString((64 * ApTe * (mTier + 1))) + " Essentia in total" "Can hold " + Integer.toString((64 * ApTe * (mTier + 1))) + " Essentia in total" };
};
} }
@Override @Override
@@ -151,21 +139,25 @@ public class EssentiaHatch extends GT_MetaTileEntity_Hatch_Input {
return ret; return ret;
} }
@Override
public boolean isFluidInputAllowed(FluidStack aFluid) { public boolean isFluidInputAllowed(FluidStack aFluid) {
return false; return false;
} }
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { @Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection aSide,
ItemStack aStack) {
return false; return false;
} }
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { @Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection aSide,
ItemStack aStack) {
return false; return false;
} }
@Override
public int getCapacity() { public int getCapacity() {
return 0; return 0;
} }
} }
@@ -1,21 +1,22 @@
package emt.gthandler.common.implementations.automation; package emt.gthandler.common.implementations.automation;
import java.util.ArrayList;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import emt.gthandler.common.implementations.EssentiaHatch; import emt.gthandler.common.implementations.EssentiaHatch;
import emt.tile.TileEntityEMT; import emt.tile.TileEntityEMT;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.ThaumcraftApiHelper;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.aspects.IAspectContainer; import thaumcraft.api.aspects.IAspectContainer;
import thaumcraft.api.aspects.IEssentiaTransport; import thaumcraft.api.aspects.IEssentiaTransport;
import java.util.ArrayList;
public class EssentiaFiller extends TileEntityEMT implements IAspectContainer, IEssentiaTransport { public class EssentiaFiller extends TileEntityEMT implements IAspectContainer, IEssentiaTransport {
private AspectList current = new AspectList(); private AspectList current = new AspectList();
@@ -36,7 +37,6 @@ public class EssentiaFiller extends TileEntityEMT implements IAspectContainer, I
} }
} }
tagCompound.setTag("Aspects", tlist); tagCompound.setTag("Aspects", tlist);
} }
@Override @Override
@@ -62,32 +62,27 @@ public class EssentiaFiller extends TileEntityEMT implements IAspectContainer, I
tick = 0; tick = 0;
return; return;
} }
if (T == null) if (T == null) T = this.worldObj.getTileEntity(xCoord + 1, yCoord, zCoord);
T = this.worldObj.getTileEntity(xCoord + 1, yCoord, zCoord);
if (checkTE(T)) { if (checkTE(T)) {
tick = 0; tick = 0;
return; return;
} }
if (T == null) if (T == null) T = this.worldObj.getTileEntity(xCoord, yCoord, zCoord + 1);
T = this.worldObj.getTileEntity(xCoord, yCoord, zCoord + 1);
if (checkTE(T)) { if (checkTE(T)) {
tick = 0; tick = 0;
return; return;
} }
if (T == null) if (T == null) T = this.worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
T = this.worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
if (checkTE(T)) { if (checkTE(T)) {
tick = 0; tick = 0;
return; return;
} }
if (T == null) if (T == null) T = this.worldObj.getTileEntity(xCoord - 1, yCoord, zCoord);
T = this.worldObj.getTileEntity(xCoord - 1, yCoord, zCoord);
if (checkTE(T)) { if (checkTE(T)) {
tick = 0; tick = 0;
return; return;
} }
if (T == null) if (T == null) T = this.worldObj.getTileEntity(xCoord, yCoord, zCoord - 1);
T = this.worldObj.getTileEntity(xCoord, yCoord, zCoord - 1);
if (checkTE(T)) { if (checkTE(T)) {
tick = 0; tick = 0;
return; return;
@@ -96,17 +91,14 @@ public class EssentiaFiller extends TileEntityEMT implements IAspectContainer, I
} }
private boolean checkTE(final TileEntity T) { private boolean checkTE(final TileEntity T) {
if (T == null) if (T == null) return false;
return false; if (this.current.visSize() > 0) if (T instanceof IGregTechTileEntity) {
if (this.current.visSize() > 0) IMetaTileEntity M = ((IGregTechTileEntity) T).getMetaTileEntity();
if (T instanceof IGregTechTileEntity) { if (M instanceof EssentiaHatch) {
IMetaTileEntity M = ((IGregTechTileEntity) T).getMetaTileEntity(); if (((EssentiaHatch) M).addAspectList(current)) this.current = new AspectList();
if (M instanceof EssentiaHatch) { return true;
if (((EssentiaHatch) M).addAspectList(current))
this.current = new AspectList();
return true;
}
} }
}
return false; return false;
} }
@@ -114,14 +106,26 @@ public class EssentiaFiller extends TileEntityEMT implements IAspectContainer, I
public void fillfrompipe() { public void fillfrompipe() {
TileEntity[] te = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length]; TileEntity[] te = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length];
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) { for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
te[i] = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.VALID_DIRECTIONS[i]); te[i] = ThaumcraftApiHelper.getConnectableTile(
this.worldObj,
this.xCoord,
this.yCoord,
this.zCoord,
ForgeDirection.VALID_DIRECTIONS[i]);
if (te[i] != null) { if (te[i] != null) {
IEssentiaTransport pipe = (IEssentiaTransport) te[i]; IEssentiaTransport pipe = (IEssentiaTransport) te[i];
if (!pipe.canOutputTo(ForgeDirection.VALID_DIRECTIONS[i])) { if (!pipe.canOutputTo(ForgeDirection.VALID_DIRECTIONS[i])) {
return; return;
} }
if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]) != null) && (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]) < getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) { if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]) != null)
addToContainer(pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]), pipe.takeEssentia(pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]), 1, ForgeDirection.VALID_DIRECTIONS[i])); && (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i])
< getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) {
addToContainer(
pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]),
pipe.takeEssentia(
pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]),
1,
ForgeDirection.VALID_DIRECTIONS[i]));
} }
} }
} }
@@ -166,11 +170,9 @@ public class EssentiaFiller extends TileEntityEMT implements IAspectContainer, I
@Override @Override
public boolean doesContainerContain(AspectList aspectList) { public boolean doesContainerContain(AspectList aspectList) {
ArrayList<Boolean> ret = new ArrayList<Boolean>(); ArrayList<Boolean> ret = new ArrayList<Boolean>();
for (Aspect a : aspectList.aspects.keySet()) for (Aspect a : aspectList.aspects.keySet()) if (current.aspects.containsKey(a)) {
if (current.aspects.containsKey(a)) { ret.add(true);
ret.add(true); } else ret.add(false);
} else
ret.add(false);
return !ret.contains(false); return !ret.contains(false);
} }
@@ -195,9 +197,7 @@ public class EssentiaFiller extends TileEntityEMT implements IAspectContainer, I
} }
@Override @Override
public void setSuction(Aspect aspect, int i) { public void setSuction(Aspect aspect, int i) {}
}
@Override @Override
public Aspect getSuctionType(ForgeDirection forgeDirection) { public Aspect getSuctionType(ForgeDirection forgeDirection) {
@@ -1,32 +1,41 @@
package emt.gthandler.common.items; package emt.gthandler.common.items;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT; import emt.EMT;
import emt.gthandler.common.blocks.EMT_GT_Block; import emt.gthandler.common.blocks.EMT_GT_Block;
import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_LanguageManager;
import net.minecraft.block.Block; import gregtech.common.blocks.GT_Item_Casings_Abstract;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import java.util.List; public class EMT_CasingBlock extends GT_Item_Casings_Abstract {
public class EMT_CasingBlock extends ItemBlock { public static final Block[] EMT_GT_BLOCKS = { new EMT_GT_Block(
new String[] { EMT.TEXTURE_PATH + ":machines/side", EMT.TEXTURE_PATH + ":machines/GT/inner",
EMT.TEXTURE_PATH + ":machines/GT/siderawI", EMT.TEXTURE_PATH + ":machines/GT/rawcoreI",
EMT.TEXTURE_PATH + ":machines/GT/siderawII", EMT.TEXTURE_PATH + ":machines/GT/rawcoreII",
EMT.TEXTURE_PATH + ":machines/GT/rawcoreII", // unused?
EMT.TEXTURE_PATH + ":machines/GT/ROBUST_NAQUADAH_ALLOY",
EMT.TEXTURE_PATH + ":machines/GT/BLOODY_ICHORIUM", EMT.TEXTURE_PATH + ":machines/GT/DRACONIUM",
EMT.TEXTURE_PATH + ":machines/GT/WYVERN", EMT.TEXTURE_PATH + ":machines/GT/AWAKENED_DRACONIUM",
EMT.TEXTURE_PATH + ":machines/GT/CHAOTIC", }) };
public static final Block[] EMT_GT_BLOCKS = {new EMT_GT_Block("EMT_GTBLOCK_CASEING", new String[] protected final String deccCasing01Tooltip = GT_LanguageManager
{ .addStringLocalization("gt.casing01tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 1");
EMT.TEXTURE_PATH + ":machines/side", protected final String deccCasing02Tooltip = GT_LanguageManager
EMT.TEXTURE_PATH + ":machines/GT/inner", .addStringLocalization("gt.casing02tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 2");
EMT.TEXTURE_PATH + ":machines/GT/siderawI", protected final String deccCasing03Tooltip = GT_LanguageManager
EMT.TEXTURE_PATH + ":machines/GT/rawcoreI", .addStringLocalization("gt.casing03tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 3");
EMT.TEXTURE_PATH + ":machines/GT/siderawII", protected final String deccCasing04Tooltip = GT_LanguageManager
EMT.TEXTURE_PATH + ":machines/GT/rawcoreII", .addStringLocalization("gt.casing04tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 4");
} protected final String deccCasing05Tooltip = GT_LanguageManager
)}; .addStringLocalization("gt.casing05tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 5");
protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block");
protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!");
public EMT_CasingBlock(final Block par1) { public EMT_CasingBlock(final Block par1) {
super(par1); super(par1);
@@ -46,9 +55,30 @@ public class EMT_CasingBlock extends ItemBlock {
} }
@Override @Override
public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { @SideOnly(Side.CLIENT) // so it only gets sent clientside?
aList.add(this.mNoMobsToolTip); public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList,
aList.add(this.mNoTileEntityToolTip); final boolean aF3_H) {
super.addInformation(aStack, aPlayer, aList, aF3_H);
switch (getDamage(aStack)) {
case 8:
aList.add(this.deccCasing01Tooltip);
break;
case 9:
aList.add(this.deccCasing02Tooltip);
break;
case 10:
aList.add(this.deccCasing03Tooltip);
break;
case 11:
aList.add(this.deccCasing04Tooltip);
break;
case 12:
aList.add(this.deccCasing05Tooltip);
break;
default:
break;
}
} }
@Override @Override
@@ -1,9 +1,18 @@
package emt.gthandler.common.loader; package emt.gthandler.common.loader;
import static emt.command.CommandOutputs.mkbook;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import emt.gthandler.common.implementations.EssentiaHatch; import emt.gthandler.common.implementations.EssentiaHatch;
import emt.gthandler.common.items.EMT_CasingBlock; import emt.gthandler.common.items.EMT_CasingBlock;
import emt.gthandler.common.tileentities.machines.multi.DE_Fusion_Crafter;
import emt.gthandler.common.tileentities.machines.multi.generator.EMT_Large_Essentia_Gen; import emt.gthandler.common.tileentities.machines.multi.generator.EMT_Large_Essentia_Gen;
import emt.tile.GT_MetaTileEntity_ResearchCompleter; import emt.tile.GT_MetaTileEntity_ResearchCompleter;
import gregtech.api.enums.GT_Values; import gregtech.api.enums.GT_Values;
@@ -12,46 +21,176 @@ import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_OreDictUnificator;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.config.ConfigItems; import thaumcraft.common.config.ConfigItems;
import static emt.command.CommandOutputs.mkbook;
public class EMT_GT_Loader implements Runnable { public class EMT_GT_Loader implements Runnable {
public static final int TIERS = GT_Values.VN.length - 1;
public static final int TIERS = GT_Values.VN.length; public static int aIDoffset = 13000 - GT_Values.VN.length - 1;
public static int aIDoffset = 13000 - TIERS - 1;
public static ItemStack[] EHatch = new ItemStack[TIERS]; public static ItemStack[] EHatch = new ItemStack[TIERS];
public static ItemStack LEG; public static ItemStack LEG;
public static ItemStack DECC;
public static ItemStack ResearchMultiblock; public static ItemStack ResearchMultiblock;
@Override @Override
public void run() { public void run() {
for (int i = 0; i < TIERS; i++) { for (int i = 0; i < TIERS; i++) {
EHatch[i] = new EssentiaHatch(aIDoffset + i, "Essentia Hatch " + GT_Values.VN[i], "Essentia Hatch " + GT_Values.VN[i], i).getStackForm(1L); EHatch[i] = new EssentiaHatch(
aIDoffset + i,
"Essentia Hatch " + GT_Values.VN[i],
"Essentia Hatch " + GT_Values.VN[i],
i).getStackForm(1L);
} }
GameRegistry.registerBlock(EMT_CasingBlock.EMT_GT_BLOCKS[0], EMT_CasingBlock.class, "EMT_GTBLOCK_CASEING");
LEG = new EMT_Large_Essentia_Gen(aIDoffset + TIERS + 1, "Large Essentia Generator", "Large Essentia Generator").getStackForm(1L);
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Indium, 1L), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Tungsten, 4L)}, Materials.SolderingAlloy.getMolten(576L), new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 3), 100, (int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 3), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 8L)}, Materials.Osmiridium.getMolten(576L), new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 5), 100, (int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Iridium, 1L), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmiridium, 4L)}, Materials.SolderingAlloy.getMolten(576L), new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 2), 100, (int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
if (Loader.isModLoaded("ThaumicTinkerer"))
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 2), GT_ModHandler.getModItem("ThaumicTinkerer", "kamiResource", 2L, 2)}, Materials.Concrete.getMolten(2304L), new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 4), 100, (int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
else
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 2), Materials.ElectrumFlux.getPlates(8)}, Materials.Concrete.getMolten(2304L), new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 4), 100, (int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
for (int i = 0; i < ItemList.HATCHES_INPUT.length; i++) LEG = new EMT_Large_Essentia_Gen(
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.HATCHES_INPUT[i].get(1L), new ItemStack(ConfigBlocks.blockTube, 1, 4)}, Materials.Thaumium.getMolten(288L), EHatch[i], 100, (int) (GT_Values.V[i] - (GT_Values.V[i] / 10))); aIDoffset + GT_Values.VN.length + 1,
"Large Essentia Generator",
"Large Essentia Generator").getStackForm(1L);
ResearchMultiblock = new GT_MetaTileEntity_ResearchCompleter(aIDoffset + TIERS + 2, "Research Completer", "Research Completer").getStackForm(1L); // Dragonblood recipe for magics haters
if (Loader.isModLoaded("miscutils")) {
GT_Values.RA.addMixerRecipe(
new ItemStack[] { new ItemStack(Blocks.dragon_egg, 1),
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DraconiumAwakened, 64L),
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DraconiumAwakened, 64L) },
new FluidStack[] { Materials.Radon.getPlasma(144) },
new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 8L) },
new FluidStack[] { new FluidStack(FluidRegistry.getFluid("molten.dragonblood"), 288) },
14000,
1966080);
}
// Casing blocks
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Iridium, 1L),
GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmiridium, 4L) },
Materials.SolderingAlloy.getMolten(576L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 2),
100,
(int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Indium, 1L),
GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Tungsten, 4L) },
Materials.SolderingAlloy.getMolten(576L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 3),
100,
(int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
if (Loader.isModLoaded("ThaumicTinkerer")) GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 2),
GT_ModHandler.getModItem("ThaumicTinkerer", "kamiResource", 2L, 2) },
Materials.Concrete.getMolten(2304L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 4),
100,
(int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
else GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 2),
Materials.ElectrumFlux.getPlates(8) },
Materials.Concrete.getMolten(2304L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 4),
100,
(int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 3),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 8L) },
Materials.Osmiridium.getMolten(576L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 5),
100,
(int) (GT_Values.V[5] - (GT_Values.V[5] / 10)));
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.NaquadahAlloy, 6L),
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.NaquadahAlloy, 6L) },
Materials.Void.getMolten(1152L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 7),
24000,
491520);
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { GT_ModHandler.getModItem("dreamcraft", "tile.BloodyIchorium", 1, 0),
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Osmiridium, 6L) },
Materials.Void.getMolten(1152L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 8),
24000,
491520);
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 8),
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Draconium, 6L),
GT_ModHandler.getModItem("DraconicEvolution", "draconicCore", 1, 0) },
Materials.Void.getMolten(2304L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 9),
24000,
491520); // uv
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 9),
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.CosmicNeutronium, 6L),
GT_ModHandler.getModItem("DraconicEvolution", "wyvernCore", 2, 0) },
Materials.Void.getMolten(4608L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 10),
12000,
1996080); // uhv, you need uhv to get the thing anyway?
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 10),
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.DraconiumAwakened, 6L),
GT_ModHandler.getModItem("DraconicEvolution", "awakenedCore", 3, 0) },
Materials.Void.getMolten(9216L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 11),
12000,
7864320); // uev
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 11),
GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Infinity, 6L),
GT_ModHandler.getModItem("DraconicEvolution", "chaoticCore", 4, 0) },
Materials.Void.getMolten(18432L),
new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0], 1, 12),
12000,
31457280); // uiv, use the multi
EMT_RecipeAdder.Run();
DECC = new DE_Fusion_Crafter(5001, "de_fusion_crafter", "Draconic Evolution Fusion Crafter").getStackForm(1L);
/*
* New DECF controller recipe moved to TT. only create the old one here if tectech or blood magic is not around.
*/
if (!(Loader.isModLoaded("tectech") && Loader.isModLoaded("AWWayofTime"))) {
GT_Values.RA.addAssemblylineRecipe(
GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 10780),
144000,
new Object[] { GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 10780),
ItemList.Robot_Arm_LuV.get(2L), ItemList.Electric_Motor_LuV.get(2L),
ItemList.Field_Generator_LuV.get(1L),
new Object[] { OrePrefixes.circuit.get(Materials.Master), 2 },
ItemList.Casing_Coil_Naquadah.get(8L), },
new FluidStack[] { Materials.SolderingAlloy.getMolten(2304L),
Materials.Thaumium.getMolten(1440L), },
DECC,
1500,
16384);
}
for (int i = 0; i < ItemList.HATCHES_INPUT.length; i++) {
GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { ItemList.HATCHES_INPUT[i].get(1L), new ItemStack(ConfigBlocks.blockTube, 1, 4) },
Materials.Thaumium.getMolten(288L),
EHatch[i],
100,
(int) (GT_Values.V[i] - (GT_Values.V[i] / 10)));
}
ResearchMultiblock = new GT_MetaTileEntity_ResearchCompleter(
aIDoffset + GT_Values.VN.length + 2,
"Research Completer",
"Research Completer").getStackForm(1L);
} }
public void runlate() { public void runlate() {
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(Items.book), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE)}, GT_Values.NF, mkbook(), 128, 64); GT_Values.RA.addAssemblerRecipe(
new ItemStack[] { new ItemStack(Items.book),
GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L),
new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE) },
GT_Values.NF,
mkbook(),
128,
64);
} }
} }
@@ -0,0 +1,185 @@
package emt.gthandler.common.loader;
import static gregtech.api.enums.GT_Values.E;
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
import java.util.HashSet;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import cpw.mods.fml.common.Loader;
import emt.client.gui.EMT_UITextures;
import emt.init.EMTItems;
import gregtech.api.enums.*;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
public class EMT_RecipeAdder {
public static final GT_Recipe.GT_Recipe_Map sFusionCraftingRecipes = new GT_Recipe.GT_Recipe_Map(
new HashSet<>(16),
"emt.recipe.fusioncrafting",
"Draconic Evolution Fusion Crafter",
null,
RES_PATH_GUI + "basicmachines/FusionCrafter",
9,
1,
1,
0,
1,
"Tier Casing: ",
1,
E,
false,
true).setSlotOverlay(false, false, EMT_UITextures.OVERLAY_SLOT_FUSION_CRAFTING);
public static void addFusionCraftingRecipe(ItemStack[] inputs, FluidStack[] fluidinputs, ItemStack[] outputs,
FluidStack[] fluidoutputs, int aDuration, int aEUt, int aTier) {
sFusionCraftingRecipes
.addRecipe(true, inputs, outputs, null, fluidinputs, fluidoutputs, aDuration, aEUt, aTier);
}
public static void addFusionCraftingRecipeNonOptimized(ItemStack[] inputs, FluidStack[] fluidinputs,
ItemStack[] outputs, FluidStack[] fluidoutputs, int aDuration, int aEUt, int aTier) {
sFusionCraftingRecipes
.addRecipe(false, inputs, outputs, null, fluidinputs, fluidoutputs, aDuration, aEUt, aTier);
}
public static void addFusionCraftingRecipe(ItemStack[] inputs, ItemStack output, int aDuration, int aEUt,
int aTier) {
addFusionCraftingRecipe(inputs, null, new ItemStack[] { output }, null, aDuration, aEUt, aTier);
}
// Use this if you don't want your recipes quantity to be splitted
public static void addFusionCraftingRecipeNonOptimized(ItemStack[] inputs, FluidStack fluidinput, ItemStack output,
FluidStack fluidoutput, int aDuration, int aEUt, int aTier) {
addFusionCraftingRecipeNonOptimized(
inputs,
new FluidStack[] { fluidinput },
new ItemStack[] { output },
new FluidStack[] { fluidoutput },
aDuration,
aEUt,
aTier);
}
public static void Run() {
// CORES
addFusionCraftingRecipeNonOptimized(
new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmiridium, 4),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Ichorium, 1), ItemList.QuantumEye.get(1L),
new ItemStack(EMTItems.itemEMTItems, 0, 16) },
Materials.Sunnarium.getMolten(1440),
GT_ModHandler.getModItem("DraconicEvolution", "draconicCore", 1, 0),
GT_Values.NF,
400,
500000,
1);
addFusionCraftingRecipeNonOptimized(
new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Draconium, 8),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4),
GT_ModHandler.getModItem("DraconicEvolution", "draconicCore", 4, 0),
ItemList.QuantumStar.get(1L), new ItemStack(EMTItems.itemEMTItems, 0, 17), },
Materials.Neutronium.getMolten(1440),
GT_ModHandler.getModItem("DraconicEvolution", "wyvernCore", 1, 0),
GT_Values.NF,
800,
2000000,
2);
if (Loader.isModLoaded("supersolarpanel")) {
addFusionCraftingRecipeNonOptimized(
new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.plate, Materials.DraconiumAwakened, 12),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Draconium, 4),
GT_ModHandler.getModItem("DraconicEvolution", "wyvernCore", 4, 0),
GT_ModHandler.getModItem("supersolarpanel", "enderquantumcomponent", 1, 0),
new ItemStack(EMTItems.itemEMTItems, 0, 18) },
Materials.Infinity.getMolten(1440),
GT_ModHandler.getModItem("DraconicEvolution", "awakenedCore", 1, 0),
GT_Values.NF,
1600,
8000000,
3);
} else {
addFusionCraftingRecipeNonOptimized(
new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.plate, Materials.DraconiumAwakened, 12),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Draconium, 4),
GT_ModHandler.getModItem("DraconicEvolution", "wyvernCore", 4, 0),
GT_ModHandler.getModItem("dreamcraft", "item.ManyullynCrystal", 1, 0),
new ItemStack(EMTItems.itemEMTItems, 0, 18) },
Materials.Infinity.getMolten(1440),
GT_ModHandler.getModItem("DraconicEvolution", "awakenedCore", 1, 0),
GT_Values.NF,
1600,
8000000,
3);
}
addFusionCraftingRecipeNonOptimized(
new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.plate, Materials.DraconiumAwakened, 16),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4),
GT_ModHandler.getModItem("DraconicEvolution", "awakenedCore", 4, 0),
GT_ModHandler.getModItem("DraconicEvolution", "chaosFragment", 2, 2),
new ItemStack(EMTItems.itemEMTItems, 0, 19) },
MaterialsUEVplus.SpaceTime.getMolten(1440),
GT_ModHandler.getModItem("DraconicEvolution", "chaoticCore", 1, 0),
GT_Values.NF,
3200,
24000000,
4);
// ENERGY CORES
addFusionCraftingRecipe(
new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Draconium, 8),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StellarAlloy, 4),
GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 4, 1),
GT_ModHandler.getModItem("DraconicEvolution", "draconicCore", 1, 0),
new ItemStack(EMTItems.itemEMTItems, 0, 17) },
GT_ModHandler.getModItem("DraconicEvolution", "draconiumEnergyCore", 1, 0),
1000,
500000,
2);
addFusionCraftingRecipe(
new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.plate, Materials.DraconiumAwakened, 8),
GT_ModHandler.getModItem("DraconicEvolution", "draconiumEnergyCore", 4, 0),
GT_ModHandler.getModItem("AdvancedSolarPanel", "asp_crafting_items", 4, 4),
GT_ModHandler.getModItem("DraconicEvolution", "wyvernCore", 1, 0),
new ItemStack(EMTItems.itemEMTItems, 0, 18) },
GT_ModHandler.getModItem("DraconicEvolution", "draconiumEnergyCore", 1, 1),
2000,
2000000,
3);
// Dragon Blood
if (Loader.isModLoaded("miscutils")) {
addFusionCraftingRecipeNonOptimized(
new ItemStack[] { new ItemStack(Blocks.dragon_egg, 0),
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DraconiumAwakened, 64) },
Materials.Radon.getPlasma(144),
null,
new FluidStack(FluidRegistry.getFluid("molten.dragonblood"), 288),
4200,
1966080,
3);
addFusionCraftingRecipeNonOptimized(
new ItemStack[] { GT_ModHandler.getModItem("witchery", "infinityegg", 0),
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DraconiumAwakened, 64) },
Materials.Radon.getPlasma(72),
null,
new FluidStack(FluidRegistry.getFluid("molten.dragonblood"), 432),
3600,
1966080,
3);
}
}
}
@@ -0,0 +1,217 @@
package emt.gthandler.common.tileentities.machines.multi;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import java.util.Arrays;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.tuple.Pair;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import emt.EMT;
import emt.gthandler.common.items.EMT_CasingBlock;
import emt.gthandler.common.loader.EMT_RecipeAdder;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
public class DE_Fusion_Crafter extends GT_MetaTileEntity_EnhancedMultiBlockBase<DE_Fusion_Crafter> {
private static final int CASING_INDEX = (1 << 7) + (15 + 48);
private int mTierCasing = 0;
private int mFusionTierCasing = 0;
private int mCasing = 0;
public DE_Fusion_Crafter(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
public DE_Fusion_Crafter(String aName) {
super(aName);
}
@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new DE_Fusion_Crafter(mName);
}
private static final String STRUCTURE_PIECE_MAIN = "main";
private static final List<Pair<Block, Integer>> fusionCasingTiers = Arrays
.asList(Pair.of(GregTech_API.sBlockCasings4, 6), Pair.of(GregTech_API.sBlockCasings4, 8));
private static final List<Pair<Block, Integer>> coreTiers = Arrays.asList(
Pair.of(EMT_CasingBlock.EMT_GT_BLOCKS[0], 8),
Pair.of(EMT_CasingBlock.EMT_GT_BLOCKS[0], 9),
Pair.of(EMT_CasingBlock.EMT_GT_BLOCKS[0], 10),
Pair.of(EMT_CasingBlock.EMT_GT_BLOCKS[0], 11),
Pair.of(EMT_CasingBlock.EMT_GT_BLOCKS[0], 12));
private static final IStructureDefinition<DE_Fusion_Crafter> STRUCTURE_DEFINITION = StructureDefinition
.<DE_Fusion_Crafter>builder()
.addShape(
STRUCTURE_PIECE_MAIN,
transpose(
new String[][] { { "nnnnn", "nnnnn", "nnnnn", "nnnnn", "nnnnn" },
{ " ", " F ", " FfF ", " F ", " " },
{ " ", " F ", " FfF ", " F ", " " },
{ "RRRRR", "R F R", "RFfFR", "R F R", "RRRRR" },
{ " ", " F ", " FfF ", " F ", " " },
{ " ", " F ", " FfF ", " F ", " " },
{ "RRRRR", "R F R", "RFfFR", "R F R", "RRRRR" },
{ " ", " F ", " FfF ", " F ", " " },
{ " ", " F ", " FfF ", " F ", " " },
{ "NN~NN", "NNNNN", "NNNNN", "NNNNN", "NNNNN" } }))
.addElement(
'N',
ofChain(
onElementPass(e -> e.mCasing++, ofBlock(EMT_CasingBlock.EMT_GT_BLOCKS[0], 7)),
ofHatchAdder(DE_Fusion_Crafter::addEnergyInputToMachineList, CASING_INDEX, 1),
ofHatchAdder(DE_Fusion_Crafter::addInputToMachineList, CASING_INDEX, 1),
ofHatchAdder(DE_Fusion_Crafter::addOutputToMachineList, CASING_INDEX, 1),
ofHatchAdder(DE_Fusion_Crafter::addMaintenanceToMachineList, CASING_INDEX, 1)))
.addElement('n', onElementPass(e -> e.mCasing++, ofBlock(EMT_CasingBlock.EMT_GT_BLOCKS[0], 7)))
.addElement('f', ofBlock(GregTech_API.sBlockCasings4, 7))
.addElement('F', ofBlocksTiered((Block b, int m) -> {
if (b != GregTech_API.sBlockCasings4 || (m != 6 && m != 8)) return -2;
return m == 6 ? 1 : 2;
}, fusionCasingTiers, -1, (e, i) -> e.mFusionTierCasing = i, e -> e.mFusionTierCasing))
.addElement('R', ofBlocksTiered((Block b, int m) -> {
if (b != EMT_CasingBlock.EMT_GT_BLOCKS[0] || m < 8 || m > 12) return -2;
return m - 7;
}, coreTiers, -1, (e, i) -> e.mTierCasing = i, e -> e.mTierCasing)).build();
@Override
public IStructureDefinition<DE_Fusion_Crafter> getStructureDefinition() {
return STRUCTURE_DEFINITION;
}
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
mCasing = 0;
mTierCasing = -1;
mFusionTierCasing = -1;
if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 9, 0)) return false;
if (mCasing < 19) return false;
if (mTierCasing == -2 || mFusionTierCasing == -2) return false;
if (mTierCasing > 3 && mFusionTierCasing < 2) return false;
return mMaintenanceHatches.size() == 1;
}
@Override
protected GT_Multiblock_Tooltip_Builder createTooltip() {
GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Fusion Crafter").addInfo("Controller Block for the Draconic Evolution Fusion Crafter")
.addInfo("Machine can be overclocked by using casings above the recipe tier:")
.addInfo("Recipe time is divided by number of tiers above the recipe")
.addInfo("Normal EU OC still applies !")
.addInfo(
"To see the structure, use a " + EnumChatFormatting.BLUE
+ "Tec"
+ EnumChatFormatting.DARK_BLUE
+ "Tech"
+ EnumChatFormatting.GRAY
+ " structure hologram on the Controller!")
.addSeparator().beginStructureBlock(5, 10, 5, false).addController("Front bottom center")
.addCasingInfo("Naquadah Alloy Fusion Casing", 19)
.addOtherStructurePart("Fusion Coil Block", "Center pillar")
.addOtherStructurePart("Fusion Machine Casing", "Touching Fusion Coil Block at every side")
.addOtherStructurePart("Tiered Fusion Casing", "Rings (5x5 hollow) at layer 4 and 7")
.addStructureInfo("Bloody Ichorium for tier 1, Draconium for tier 2, etc")
.addStructureInfo("To use tier 3 + you have to use fusion casing MK II")
.addInputBus("Any bottom casing", 1).addInputHatch("Any bottom casing", 1)
.addOutputBus("Any bottom casing", 1).addOutputHatch("Any bottom casing", 1)
.addEnergyHatch("Any bottom casing", 1).addMaintenanceHatch("Any bottom casing", 1)
.toolTipFinisher(EMT.NAME);
return tt;
}
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing,
int colorIndex, boolean aActive, boolean aRedstone) {
if (side == facing) {
if (aActive) return new ITexture[] { TextureFactory.of(MACHINE_CASING_MAGIC),
TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_ACTIVE).extFacing().build(),
TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW).extFacing().glow().build() };
return new ITexture[] { TextureFactory.of(MACHINE_CASING_MAGIC),
TextureFactory.builder().addIcon(OVERLAY_TELEPORTER).extFacing().build(),
TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_GLOW).extFacing().glow().build() };
}
if (aActive) return new ITexture[] { TextureFactory.of(MACHINE_CASING_MAGIC),
TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE).extFacing().build(),
TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).extFacing().glow().build() };
return new ITexture[] { TextureFactory.of(MACHINE_CASING_MAGIC),
TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC).extFacing().build(),
TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).extFacing().glow().build() };
}
@Override
public boolean isCorrectMachinePart(ItemStack aStack) {
return true;
}
@Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
return EMT_RecipeAdder.sFusionCraftingRecipes;
}
@Override
public boolean checkRecipe(ItemStack aStack) {
ItemStack[] tInputs = getCompactedInputs();
FluidStack[] tFluids = getCompactedFluids();
if (tInputs.length > 0) {
long tVoltage = getMaxInputVoltage();
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
GT_Recipe tRecipe = EMT_RecipeAdder.sFusionCraftingRecipes
.findRecipe(getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs);
if ((tRecipe != null) && (this.mTierCasing >= tRecipe.mSpecialValue)
&& (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 2, tVoltage);
if (this.mEUt > 0) this.mEUt = (-this.mEUt);
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
this.mMaxProgresstime /= ((mTierCasing - tRecipe.mSpecialValue) + 1);
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0), tRecipe.getOutput(1) };
this.mOutputFluids = new FluidStack[] { tRecipe.getFluidOutput(0) };
updateSlots();
return true;
}
}
return false;
}
public int getMaxEfficiency(ItemStack aStack) {
return 10000;
}
public int getPollutionPerTick(ItemStack aStack) {
return 0;
}
public int getDamageToComponent(ItemStack aStack) {
return 0;
}
public boolean explodesOnComponentBreak(ItemStack aStack) {
return false;
}
@Override
public void construct(ItemStack itemStack, boolean b) {
buildPiece(STRUCTURE_PIECE_MAIN, itemStack, b, 2, 9, 0);
}
}
@@ -1,5 +1,12 @@
package emt.gthandler.common.tileentities.machines.multi.generator; package emt.gthandler.common.tileentities.machines.multi.generator;
import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import emt.gthandler.common.implementations.EssentiaHatch; import emt.gthandler.common.implementations.EssentiaHatch;
import emt.gthandler.common.items.EMT_CasingBlock; import emt.gthandler.common.items.EMT_CasingBlock;
import emt.util.EMTEssentiasOutputs; import emt.util.EMTEssentiasOutputs;
@@ -12,17 +19,11 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.objects.XSTR; import gregtech.api.objects.XSTR;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.visnet.VisNetHandler; import thaumcraft.api.visnet.VisNetHandler;
import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.config.ConfigBlocks;
import java.util.ArrayList;
public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase { public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
private static final byte CASING_INDEX = 2; private static final byte CASING_INDEX = 2;
@@ -40,37 +41,37 @@ public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
@Override @Override
public String[] getDescription() { public String[] getDescription() {
return new String[]{ return new String[] { "Controller Block for the Large Essentia Generator.",
"Controller Block for the Large Essentia Generator.", "Produces energy from magical essentia decay.", "Size(WxHxD): 7x4x7, Controller (Bottom, Center)",
"Produces energy from magical essentia decay.", "Top-Middle 5x1x5 layer are Muffler Hatches", "Middle 5x2x5 layer are Essentia Diffusion Cells",
"Size(WxHxD): 7x4x7, Controller (Bottom, Center)", "Everything from here on goes either in the bottom or on the sides", "1x Fluid Input Hatch",
"Top-Middle 5x1x5 layer are Muffler Hatches", "1x Essentia Input Hatch", "1x Dynamo Hatches", "1x Maintenance Hatch",
"Middle 5x2x5 layer are Essentia Diffusion Cells",
"Everything from here on goes either in the bottom or on the sides",
"1x Fluid Input Hatch",
"1x Essentia Input Hatch",
"1x Dynamo Hatches",
"1x Maintenance Hatch",
"The outer hull is made out of Magic Containing Casings", "The outer hull is made out of Magic Containing Casings",
"Produces 20x more than the singleblock generator per essentia", "Produces 20x more than the singleblock generator per essentia",
"Causes magical and serious conventional pollution", "Causes magical and serious conventional pollution",
"Needs 1L Lubricant per second or will cause way more conventional pollution", "Needs 1L Lubricant per second or will cause way more conventional pollution",
"Needs 10 " + EMTTextHelper.LIGHT_BLUE + "Aqua" + EMTTextHelper.LIGHT_GRAY + " cVis per second or will cause way more magical pollution", "Needs 10 " + EMTTextHelper.LIGHT_BLUE
"Added by EMT", + "Aqua"
"Made by bartimaeusnek" + EMTTextHelper.LIGHT_GRAY
}; + " cVis per second or will cause way more magical pollution",
"Added by EMT", "Made by bartimaeusnek" };
} }
public int getCurrentEfficiency(ItemStack itemStack) { public int getCurrentEfficiency(ItemStack itemStack) {
return this.mEfficiency - (this.getIdealStatus() - this.getRepairStatus()) * this.getMaxEfficiency(itemStack) / 10; return this.mEfficiency
- (this.getIdealStatus() - this.getRepairStatus()) * this.getMaxEfficiency(itemStack) / 10;
} }
@Override @Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing,
if (aSide == aFacing) { int colorIndex, boolean aActive, boolean aRedstone) {
return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)}; if (side == facing) {
return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
new GT_RenderedTexture(
aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE
: Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER) };
} }
return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) };
} }
@Override @Override
@@ -176,13 +177,14 @@ public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
@Override @Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack arg1) { public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack arg1) {
final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3; final int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * 3;
final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3; final int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * 3;
for (int x = -3; x <= 3; x++) { for (int x = -3; x <= 3; x++) {
for (int z = -3; z <= 3; z++) { for (int z = -3; z <= 3; z++) {
for (int h = 0; h <= 3; h++) { for (int h = 0; h <= 3; h++) {
final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, h, zDir + z); final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity
.getIGregTechTileEntityOffset(xDir + x, h, zDir + z);
if (!(Math.abs(x) == 3 || Math.abs(z) == 3)) { if (!(Math.abs(x) == 3 || Math.abs(z) == 3)) {
// Muffler on top. // Muffler on top.
@@ -191,63 +193,62 @@ public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
return false; return false;
} }
} else if (h != 0) { } else if (h != 0) {
//inside Special Blocks // inside Special Blocks
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z) != EMT_CasingBlock.EMT_GT_BLOCKS[0]) if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
!= EMT_CasingBlock.EMT_GT_BLOCKS[0])
return false; return false;
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 1)) else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 1)) return false;
return false; } else if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX)
} else if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX) || this.addDynamoToMachineList(tTileEntity, CASING_INDEX) || this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX) || this.addInputToMachineList(tTileEntity, CASING_INDEX))) || this.addDynamoToMachineList(tTileEntity, CASING_INDEX)
//ground still casings || this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX)
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z) != EMT_CasingBlock.EMT_GT_BLOCKS[0]) || this.addInputToMachineList(tTileEntity, CASING_INDEX)))
return false; // ground still casings
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
!= EMT_CasingBlock.EMT_GT_BLOCKS[0])
return false; return false;
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) return false;
} else if (h != 0) { } else if (h != 0) {
//walls // walls
if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX) || this.addDynamoToMachineList(tTileEntity, CASING_INDEX) || this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX) || this.addInputToMachineList(tTileEntity, CASING_INDEX))) if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX)
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z) != EMT_CasingBlock.EMT_GT_BLOCKS[0]) || this.addDynamoToMachineList(tTileEntity, CASING_INDEX)
return false; || this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX)
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) || this.addInputToMachineList(tTileEntity, CASING_INDEX)))
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
!= EMT_CasingBlock.EMT_GT_BLOCKS[0])
return false; return false;
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) return false;
} else if (h == 0) { } else if (h == 0) {
//top and bottom corners // top and bottom corners
if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX) || this.addDynamoToMachineList(tTileEntity, CASING_INDEX) || this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX) || this.addInputToMachineList(tTileEntity, CASING_INDEX))) if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX)
if (((xDir + x) != 0) || ((zDir + z) != 0)) //controller || this.addDynamoToMachineList(tTileEntity, CASING_INDEX)
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z) != EMT_CasingBlock.EMT_GT_BLOCKS[0]) || this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX)
return false; || this.addInputToMachineList(tTileEntity, CASING_INDEX)))
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) if (((xDir + x) != 0) || ((zDir + z) != 0)) // controller
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
!= EMT_CasingBlock.EMT_GT_BLOCKS[0])
return false; return false;
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) return false;
} }
} }
} }
} }
if (this.mDynamoHatches.size() != 1) if (this.mDynamoHatches.size() != 1) return false;
return false;
if (this.mInputHatches.size() != 1) if (this.mInputHatches.size() != 1) return false;
return false;
if (this.mMaintenanceHatches.size() != 1) if (this.mMaintenanceHatches.size() != 1) return false;
return false;
/* /*
//repair shit debug shit * //repair shit debug shit this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true;
this.mWrench = true; * this.mHardHammer = true; this.mSolderingTool = true; this.mCrowbar = true;
this.mScrewdriver = true; */
this.mSoftHammer = true;
this.mHardHammer = true;
this.mSolderingTool = true;
this.mCrowbar = true;
*/
return true; return true;
} }
public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity instanceof EssentiaHatch) if (aTileEntity instanceof EssentiaHatch) return addEssetiaHatchToList(aTileEntity, aBaseCasingIndex);
return addEssetiaHatchToList(aTileEntity, aBaseCasingIndex);
return super.addInputToMachineList(aTileEntity, aBaseCasingIndex); return super.addInputToMachineList(aTileEntity, aBaseCasingIndex);
} }
@@ -267,22 +268,21 @@ public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
} }
} }
private void make_energy() { private void make_energy() {
AspectList fuel = this.mEssentiaHatches.get(0).getAspects(); AspectList fuel = this.mEssentiaHatches.get(0).getAspects();
double cached = 0; double cached = 0;
++tick; ++tick;
//make energy // make energy
for (final Aspect A : fuel.aspects.keySet()) { for (final Aspect A : fuel.aspects.keySet()) {
if (fuel.getAmount(A) > 0) { if (fuel.getAmount(A) > 0) {
double burnvalue = EMTEssentiasOutputs.outputs.get(A.getTag()).doubleValue(); double burnvalue = EMTEssentiasOutputs.outputs.get(A.getTag()).doubleValue();
cached += (burnvalue / 20D); cached += (burnvalue / 20D);
cached = Math.ceil(cached); cached = Math.ceil(cached);
if (tick % 20 == 0) { //every second consume 1 essentia if (tick % 20 == 0) { // every second consume 1 essentia
//consume essentia and remove it from the Aspect List if its 0 // consume essentia and remove it from the Aspect List if its 0
this.mEssentiaHatches.get(0).getAspects().reduce(A, 1); this.mEssentiaHatches.get(0).getAspects().reduce(A, 1);
if (this.mEssentiaHatches.get(0).getAspects().getAmount(A) == 0) if (this.mEssentiaHatches.get(0).getAspects().getAmount(A) == 0)
this.mEssentiaHatches.get(0).getAspects().remove(A); this.mEssentiaHatches.get(0).getAspects().remove(A);
@@ -291,26 +291,22 @@ public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
} }
if (tick % 20 == 0) { if (tick % 20 == 0) {
//consume lubricant // consume lubricant
if (has_lube) if (has_lube) this.mInputHatches.get(0).getFluid().amount -= 1;
this.mInputHatches.get(0).getFluid().amount -= 1;
tick = 0; //reset ticktimer tick = 0; // reset ticktimer
} }
//transfer energy into mEU // transfer energy into mEU
this.mEUt = (int) Math.ceil(cached); this.mEUt = (int) Math.ceil(cached);
} }
@Override @Override
public boolean checkRecipe(ItemStack arg0) { public boolean checkRecipe(ItemStack arg0) {
/* /*
if (!this.getBaseMetaTileEntity().isActive()) * if (!this.getBaseMetaTileEntity().isActive()) if (this.mEfficiency > 100) this.mEfficiency -= 8; else
if (this.mEfficiency > 100) * this.mEfficiency = 100;
this.mEfficiency -= 8; */
else
this.mEfficiency = 100;
*/
if (this.mEssentiaHatches.get(0).fuelleft() > 0) { if (this.mEssentiaHatches.get(0).fuelleft() > 0) {
this.mMaxProgresstime = 1; this.mMaxProgresstime = 1;
this.mProgresstime = 0; this.mProgresstime = 0;
@@ -322,19 +318,18 @@ public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
@Override @Override
public boolean onRunningTick(ItemStack aStack) { public boolean onRunningTick(ItemStack aStack) {
if (tick % 20 == 0) {//every second if (tick % 20 == 0) { // every second
//highers eff to max by 0.16% every running tick = 3,2% every second // highers eff to max by 0.16% every running tick = 3,2% every second
if (this.mEfficiency < this.getMaxEfficiency(null) - 320) if (this.mEfficiency < this.getMaxEfficiency(null) - 320) this.mEfficiency += 320;
this.mEfficiency += 320; else this.mEfficiency = getMaxEfficiency(null);
else
this.mEfficiency = getMaxEfficiency(null);
//check for Lubricant // check for Lubricant
this.has_lube = this.mInputHatches.get(0).getFluid() != null && this.mInputHatches.get(0).getFluid().isFluidEqual(Materials.Lubricant.getFluid(1L)) && this.mInputHatches.get(0).getFluidAmount() > 0; this.has_lube = this.mInputHatches.get(0).getFluid() != null
&& this.mInputHatches.get(0).getFluid().isFluidEqual(Materials.Lubricant.getFluid(1L))
&& this.mInputHatches.get(0).getFluidAmount() > 0;
} }
if (tick % 2 == 0) { // every 2nd tick
if (tick % 2 == 0) {//every 2nd tick
final XSTR R = new XSTR(); final XSTR R = new XSTR();
final World WORLD = this.getBaseMetaTileEntity().getWorld(); final World WORLD = this.getBaseMetaTileEntity().getWorld();
@@ -342,13 +337,13 @@ public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
int y = this.getBaseMetaTileEntity().getYCoord(); int y = this.getBaseMetaTileEntity().getYCoord();
int z = this.getBaseMetaTileEntity().getZCoord(); int z = this.getBaseMetaTileEntity().getZCoord();
//if out of aqua, make much flux but to not stop. // if out of aqua, make much flux but to not stop.
boolean outOfcVis = VisNetHandler.drainVis(WORLD, x, y, z, Aspect.WATER, 10) <= 9; boolean outOfcVis = VisNetHandler.drainVis(WORLD, x, y, z, Aspect.WATER, 10) <= 9;
//Random Change of a bit of Flux Gas. // Random Change of a bit of Flux Gas.
final int RANDOMHATCH = R.nextInt(this.mMufflerHatches.size()); final int RANDOMHATCH = R.nextInt(this.mMufflerHatches.size());
//gets a chanche to release flux gas based on missing efficiency, min 1% // gets a chanche to release flux gas based on missing efficiency, min 1%
if ((R.nextInt(getMaxEfficiency(null)) > (this.mEfficiency > 100 ? this.mEfficiency : 100)) || outOfcVis) { if ((R.nextInt(getMaxEfficiency(null)) > (this.mEfficiency > 100 ? this.mEfficiency : 100)) || outOfcVis) {
x = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getXCoord(); x = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getXCoord();
y = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getYCoord() + 1; y = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getYCoord() + 1;
@@ -402,17 +397,12 @@ public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
return old; return old;
} }
/* @Override /*
public void explodeMultiblock() { * @Override public void explodeMultiblock() { final World WORLD=this.getBaseMetaTileEntity().getWorld(); final int
* xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 3; final int zDir =
final World WORLD=this.getBaseMetaTileEntity().getWorld(); * ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 3; for (int x = -3; x <= 3;
final int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 3; * x++) for (int z = -3; z <= 3; z++) for (int h = 0; h <= 3; h++) WORLD.setBlock(xDir+x,
final int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 3; * this.getBaseMetaTileEntity().getYCoord()+h, zDir+z, ConfigBlocks.blockFluxGas, 8, 3); super.explodeMultiblock();
* }
for (int x = -3; x <= 3; x++) */
for (int z = -3; z <= 3; z++)
for (int h = 0; h <= 3; h++)
WORLD.setBlock(xDir+x, this.getBaseMetaTileEntity().getYCoord()+h, zDir+z, ConfigBlocks.blockFluxGas, 8, 3);
super.explodeMultiblock();
}*/
} }
+55 -18
View File
@@ -1,5 +1,9 @@
package emt.init; package emt.init;
import static thaumcraft.api.ThaumcraftApi.registerObjectTag;
import net.minecraft.block.Block;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import emt.block.*; import emt.block.*;
import emt.item.block.ItemBlockElectricCloud; import emt.item.block.ItemBlockElectricCloud;
@@ -8,12 +12,9 @@ import emt.item.block.ItemBlockMachines;
import emt.item.block.ItemBlockSolars; import emt.item.block.ItemBlockSolars;
import emt.tile.solar.Solars; import emt.tile.solar.Solars;
import ic2.api.item.IC2Items; import ic2.api.item.IC2Items;
import net.minecraft.block.Block;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectList;
import static thaumcraft.api.ThaumcraftApi.registerObjectTag;
public class EMTBlocks { public class EMTBlocks {
public static Block portableNode, essentiaGens, shield, emtMachines, electricCloud; public static Block portableNode, essentiaGens, shield, emtMachines, electricCloud;
@@ -49,22 +50,58 @@ public class EMTBlocks {
public static void addAspects() { public static void addAspects() {
registerObjectTag(IC2Items.getItem("rubberTrampoline"), new AspectList().add(Aspect.AIR, 5)); registerObjectTag(IC2Items.getItem("rubberTrampoline"), new AspectList().add(Aspect.AIR, 5));
registerObjectTag(IC2Items.getItem("ironFence"), new AspectList().add(Aspect.ENERGY, 1).add(Aspect.METAL, 2).add(Aspect.WEATHER, 1)); registerObjectTag(
registerObjectTag(IC2Items.getItem("reinforcedGlass"), new AspectList().add(Aspect.METAL, 2).add(Aspect.COLD, 2)); IC2Items.getItem("ironFence"),
new AspectList().add(Aspect.ENERGY, 1).add(Aspect.METAL, 2).add(Aspect.WEATHER, 1));
registerObjectTag(
IC2Items.getItem("reinforcedGlass"),
new AspectList().add(Aspect.METAL, 2).add(Aspect.COLD, 2));
registerObjectTag(IC2Items.getItem("scaffold"), new AspectList().add(Aspect.TREE, 4)); registerObjectTag(IC2Items.getItem("scaffold"), new AspectList().add(Aspect.TREE, 4));
registerObjectTag(IC2Items.getItem("ironScaffold"), new AspectList().add(Aspect.METAL, 4)); registerObjectTag(IC2Items.getItem("ironScaffold"), new AspectList().add(Aspect.METAL, 4));
registerObjectTag(IC2Items.getItem("generator"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 2).add(Aspect.MECHANISM, 1)); registerObjectTag(
registerObjectTag(IC2Items.getItem("waterMill"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.WATER, 2).add(Aspect.MECHANISM, 1)); IC2Items.getItem("generator"),
registerObjectTag(IC2Items.getItem("solarPanel"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 1).add(Aspect.LIGHT, 2).add(Aspect.MECHANISM, 1)); new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 2).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("windMill"), new AspectList().add(Aspect.ENERGY, 1).add(Aspect.WEATHER, 3).add(Aspect.MECHANISM, 1)); registerObjectTag(
registerObjectTag(IC2Items.getItem("batBox"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 3).add(Aspect.MECHANISM, 1)); IC2Items.getItem("waterMill"),
registerObjectTag(IC2Items.getItem("cesuUnit"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 4).add(Aspect.MECHANISM, 1)); new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.WATER, 2)
registerObjectTag(IC2Items.getItem("mfeUnit"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 5).add(Aspect.MECHANISM, 1)); .add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("mfsUnit"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 7).add(Aspect.MECHANISM, 1)); registerObjectTag(
registerObjectTag(IC2Items.getItem("ironFurnace"), new AspectList().add(Aspect.METAL, 2).add(Aspect.FIRE, 2).add(Aspect.MECHANISM, 1)); IC2Items.getItem("solarPanel"),
registerObjectTag(IC2Items.getItem("electroFurnace"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.FIRE, 3).add(Aspect.MECHANISM, 1)); new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 1).add(Aspect.LIGHT, 2)
registerObjectTag(IC2Items.getItem("macerator"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.MINE, 2).add(Aspect.MECHANISM, 1)); .add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("extractor"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.CRAFT, 2).add(Aspect.MECHANISM, 1)); registerObjectTag(
registerObjectTag(IC2Items.getItem("compressor"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.VOID, 3).add(Aspect.MECHANISM, 1)); IC2Items.getItem("windMill"),
new AspectList().add(Aspect.ENERGY, 1).add(Aspect.WEATHER, 3).add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("batBox"),
new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 3).add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("cesuUnit"),
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 4).add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("mfeUnit"),
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 5).add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("mfsUnit"),
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 7).add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("ironFurnace"),
new AspectList().add(Aspect.METAL, 2).add(Aspect.FIRE, 2).add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("electroFurnace"),
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.FIRE, 3)
.add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("macerator"),
new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.MINE, 2)
.add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("extractor"),
new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.CRAFT, 2)
.add(Aspect.MECHANISM, 1));
registerObjectTag(
IC2Items.getItem("compressor"),
new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.VOID, 3)
.add(Aspect.MECHANISM, 1));
} }
} }
+5 -5
View File
@@ -1,14 +1,15 @@
package emt.init; package emt.init;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityList.EntityEggInfo;
import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.EntityRegistry;
import emt.EMT; import emt.EMT;
import emt.entity.EntityArcher; import emt.entity.EntityArcher;
import emt.entity.EntityEnergyBall; import emt.entity.EntityEnergyBall;
import emt.entity.EntityLaser; import emt.entity.EntityLaser;
import emt.entity.EntityShield; import emt.entity.EntityShield;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityList.EntityEggInfo;
public class EMTEntities { public class EMTEntities {
@@ -18,8 +19,7 @@ public class EMTEntities {
private static int getUniqueEntityID() { private static int getUniqueEntityID() {
do { do {
startEID++; startEID++;
} } while (EntityList.getStringFromID(startEID) != null);
while (EntityList.getStringFromID(startEID) != null);
return startEID; return startEID;
} }
+37 -19
View File
@@ -1,5 +1,11 @@
package emt.init; package emt.init;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import emt.EMT; import emt.EMT;
import emt.item.ItemElectricScribingTools; import emt.item.ItemElectricScribingTools;
@@ -32,11 +38,6 @@ import emt.item.tool.omnitool.ItemOmnitoolDiamond;
import emt.item.tool.omnitool.ItemOmnitoolIron; import emt.item.tool.omnitool.ItemOmnitoolIron;
import emt.item.tool.omnitool.ItemOmnitoolThaumium; import emt.item.tool.omnitool.ItemOmnitoolThaumium;
import ic2.core.init.InternalName; import ic2.core.init.InternalName;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.ThaumcraftApi;
public class EMTItems { public class EMTItems {
@@ -57,6 +58,7 @@ public class EMTItems {
public static Item christmasFocus; public static Item christmasFocus;
public static Item shieldFocus; public static Item shieldFocus;
public static Item energyBallFocus; public static Item energyBallFocus;
public static Item maintenanceFocus;
public static Item electricGoggles; public static Item electricGoggles;
public static Item streamChainsaw; public static Item streamChainsaw;
public static Item rockbreakerDrill; public static Item rockbreakerDrill;
@@ -78,7 +80,8 @@ public class EMTItems {
public static Item nanoWing; public static Item nanoWing;
public static Item quantumWing; public static Item quantumWing;
public static Item quantumArmor; public static Item quantumArmor;
public static ItemArmor.ArmorMaterial featherWingMaterial = EnumHelper.addArmorMaterial("FEATEHRWiNG", 1, new int[]{2, 2, 2, 2}, 6); public static ItemArmor.ArmorMaterial featherWingMaterial = EnumHelper
.addArmorMaterial("FEATEHRWiNG", 1, new int[] { 2, 2, 2, 2 }, 6);
public static void registerItems() { public static void registerItems() {
itemEMTItems = new ItemMaterials(); itemEMTItems = new ItemMaterials();
@@ -92,42 +95,54 @@ public class EMTItems {
onering = new ItemOneRing(); onering = new ItemOneRing();
GameRegistry.registerItem(onering, "BaseBaubles"); GameRegistry.registerItem(onering, "BaseBaubles");
quantumArmor = new ItemInfusedQuantumChestplate(InternalName.itemArmorQuantumChestplate, 1).setUnlocalizedName(EMT.MOD_ID + ".quantum"); quantumArmor = new ItemInfusedQuantumChestplate(InternalName.itemArmorQuantumChestplate, 1)
.setUnlocalizedName(EMT.MOD_ID + ".quantum");
electricGoggles = new ItemElectricGoggles(ItemArmor.ArmorMaterial.IRON, 3, 0).setUnlocalizedName(EMT.MOD_ID + ".goggles.electric"); electricGoggles = new ItemElectricGoggles(ItemArmor.ArmorMaterial.IRON, 3, 0)
.setUnlocalizedName(EMT.MOD_ID + ".goggles.electric");
GameRegistry.registerItem(electricGoggles, "ElectricGogglesRevealing"); GameRegistry.registerItem(electricGoggles, "ElectricGogglesRevealing");
nanoThaumicHelmet = new ItemNanoGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(EMT.MOD_ID + ".goggles.nano"); nanoThaumicHelmet = new ItemNanoGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0)
.setUnlocalizedName(EMT.MOD_ID + ".goggles.nano");
GameRegistry.registerItem(nanoThaumicHelmet, "NanosuitGogglesRevealing"); GameRegistry.registerItem(nanoThaumicHelmet, "NanosuitGogglesRevealing");
quantumThaumicHelmet = new ItemQuantumGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(EMT.MOD_ID + ".goggles.quantum"); quantumThaumicHelmet = new ItemQuantumGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0)
.setUnlocalizedName(EMT.MOD_ID + ".goggles.quantum");
GameRegistry.registerItem(quantumThaumicHelmet, "QuantumGogglesRevealing"); GameRegistry.registerItem(quantumThaumicHelmet, "QuantumGogglesRevealing");
solarHelmetRevealing = new ItemSolarHelmetRevealing(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(EMT.MOD_ID + ".goggles.solar"); solarHelmetRevealing = new ItemSolarHelmetRevealing(ItemArmor.ArmorMaterial.DIAMOND, 3, 0)
.setUnlocalizedName(EMT.MOD_ID + ".goggles.solar");
GameRegistry.registerItem(solarHelmetRevealing, "SolarHelmetRevealing"); GameRegistry.registerItem(solarHelmetRevealing, "SolarHelmetRevealing");
electricBootsTraveller = new ItemElectricBootsTraveller(ItemArmor.ArmorMaterial.IRON, 3, 3).setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.electric"); electricBootsTraveller = new ItemElectricBootsTraveller(ItemArmor.ArmorMaterial.IRON, 3, 3)
.setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.electric");
GameRegistry.registerItem(electricBootsTraveller, "ElectricBootsTraveller"); GameRegistry.registerItem(electricBootsTraveller, "ElectricBootsTraveller");
nanoBootsTraveller = new ItemNanoBootsTraveller(ItemArmor.ArmorMaterial.DIAMOND, 3, 3).setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.nano"); nanoBootsTraveller = new ItemNanoBootsTraveller(ItemArmor.ArmorMaterial.DIAMOND, 3, 3)
.setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.nano");
GameRegistry.registerItem(nanoBootsTraveller, "NanoBootsTraveller"); GameRegistry.registerItem(nanoBootsTraveller, "NanoBootsTraveller");
quantumBootsTraveller = new ItemQuantumBootsTraveller(ItemArmor.ArmorMaterial.DIAMOND, 3, 3).setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.quantum"); quantumBootsTraveller = new ItemQuantumBootsTraveller(ItemArmor.ArmorMaterial.DIAMOND, 3, 3)
.setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.quantum");
GameRegistry.registerItem(quantumBootsTraveller, "QuantumBootsTraveller"); GameRegistry.registerItem(quantumBootsTraveller, "QuantumBootsTraveller");
electricScribingTools = new ItemElectricScribingTools().setUnlocalizedName(EMT.MOD_ID + ".scribingtools.electric"); electricScribingTools = new ItemElectricScribingTools()
.setUnlocalizedName(EMT.MOD_ID + ".scribingtools.electric");
GameRegistry.registerItem(electricScribingTools, "ElectricScribingTools"); GameRegistry.registerItem(electricScribingTools, "ElectricScribingTools");
featherWing = new ItemFeatherWing(featherWingMaterial, 7, 1).setUnlocalizedName(EMT.MOD_ID + ".wing.feather"); featherWing = new ItemFeatherWing(featherWingMaterial, 7, 1).setUnlocalizedName(EMT.MOD_ID + ".wing.feather");
GameRegistry.registerItem(featherWing, "FeatherWing"); GameRegistry.registerItem(featherWing, "FeatherWing");
thaumiumWing = new ItemThaumiumReinforcedWing(ThaumcraftApi.armorMatThaumium, 7, 1).setUnlocalizedName(EMT.MOD_ID + ".wing.thaumium"); thaumiumWing = new ItemThaumiumReinforcedWing(ThaumcraftApi.armorMatThaumium, 7, 1)
.setUnlocalizedName(EMT.MOD_ID + ".wing.thaumium");
GameRegistry.registerItem(thaumiumWing, "ThaumiumWing"); GameRegistry.registerItem(thaumiumWing, "ThaumiumWing");
nanoWing = new ItemNanoWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(EMT.MOD_ID + ".wing.nano"); nanoWing = new ItemNanoWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1)
.setUnlocalizedName(EMT.MOD_ID + ".wing.nano");
GameRegistry.registerItem(nanoWing, "NanosuitWing"); GameRegistry.registerItem(nanoWing, "NanosuitWing");
quantumWing = new ItemQuantumWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(EMT.MOD_ID + ".wing.quantum"); quantumWing = new ItemQuantumWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1)
.setUnlocalizedName(EMT.MOD_ID + ".wing.quantum");
GameRegistry.registerItem(quantumWing, "QuantumWing"); GameRegistry.registerItem(quantumWing, "QuantumWing");
thorHammer = new ItemThorHammer().setUnlocalizedName(EMT.MOD_ID + ".hammer"); thorHammer = new ItemThorHammer().setUnlocalizedName(EMT.MOD_ID + ".hammer");
@@ -183,5 +198,8 @@ public class EMTItems {
energyBallFocus = new ItemEnergyBallFocus(); energyBallFocus = new ItemEnergyBallFocus();
GameRegistry.registerItem(energyBallFocus, "EnergyBallFocus"); GameRegistry.registerItem(energyBallFocus, "EnergyBallFocus");
maintenanceFocus = new ItemMaintenanceFocus();
GameRegistry.registerItem(maintenanceFocus, "MaintenanceFocus");
} }
} }
File diff suppressed because it is too large. Load diff
+529 -65
View File
@@ -1,17 +1,18 @@
package emt.init; package emt.init;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import emt.EMT; import emt.EMT;
import emt.util.EMTConfigHandler; import emt.util.EMTConfigHandler;
import emt.util.EMTResearchAspects; import emt.util.EMTResearchAspects;
import emt.util.EMTResearchItem; import emt.util.EMTResearchItem;
import gregtech.api.GregTech_API;
import ic2.api.item.IC2Items; import ic2.api.item.IC2Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchCategories;
import thaumcraft.api.research.ResearchPage; import thaumcraft.api.research.ResearchPage;
public class EMTResearches { public class EMTResearches {
public static void register() { public static void register() {
addResearchTab(); addResearchTab();
addResearch(); addResearch();
@@ -19,269 +20,732 @@ public class EMTResearches {
public static void addResearchTab() { public static void addResearchTab() {
ResourceLocation background = new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/background.png"); ResourceLocation background = new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/background.png");
ResearchCategories.registerCategory("EMT", new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png"), background); ResearchCategories
.registerCategory("EMT", new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png"), background);
} }
public static void addResearch() { public static void addResearch() {
/** Research that can't be disabled **/ /** Research that can't be disabled **/
new EMTResearchItem("Electric Magic Tools", 0, 0, 0, new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png")).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage("")); new EMTResearchItem(
new EMTResearchItem("Diamond Chainsaw", 5, -6, 0, new ItemStack(EMTItems.diamondChainsaw)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.diamondChainsaw)); "Electric Magic Tools",
new EMTResearchItem("Thaumium Plate", 6, -6, 0, new ItemStack(EMTItems.itemEMTItems, 1, 5)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumPlate)); 0,
new EMTResearchItem("Macerating Native Ore Clusters", 5, -7, 0, IC2Items.getItem("smallGoldDust")).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage("")); 0,
new EMTResearchItem("The Legend", 5, -5, 0, new ItemStack(EMTItems.taintedThorHammer)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage("")); 0,
new EMTResearchItem("Lightning Summoner", 6, -5, 0, new ItemStack(EMTItems.itemEMTItems, 1, 6)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage("")); new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png")).setRound().setAutoUnlock()
new EMTResearchItem("The One Ring", 6, -7, 0, new ItemStack(EMTItems.onering)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage("")); .registerResearchItem().setPages(new ResearchPage(""));
new EMTResearchItem("Electric Cloud", 4, -7, 0, new ItemStack(EMTBlocks.electricCloud)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage("1"), new ResearchPage("2")); new EMTResearchItem("Diamond Chainsaw", 5, -6, 0, new ItemStack(EMTItems.diamondChainsaw)).setRound()
new EMTResearchItem("Feather Wings", 0, 2, 0, new ItemStack(EMTItems.featherWing)).setParents("Electric Magic Tools").setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(EMTRecipes.cardboard), new ResearchPage(EMTRecipes.featherWing), new ResearchPage(EMTRecipes.featherWings)); .setAutoUnlock().registerResearchItem()
//new EMTResearchItem("ResearchCompleter", EMTResearchAspects.researchCompleter, -4, -2, 0, new ItemStack(GregTech_API.sBlockMachines, 1, 13001)).setParents("Electric Magic Tools").setParentsHidden("WANDPED", "WARDEDARCANA").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.magicalMachineCasing), new ResearchPage(EMTRecipes.researchCompleter)); .setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.diamondChainsaw));
new EMTResearchItem("Thaumium Plate", 6, -6, 0, new ItemStack(EMTItems.itemEMTItems, 1, 5)).setRound()
.setAutoUnlock().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumPlate));
new EMTResearchItem("Macerating Native Ore Clusters", 5, -7, 0, IC2Items.getItem("smallGoldDust")).setRound()
.setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""));
new EMTResearchItem("The Legend", 5, -5, 0, new ItemStack(EMTItems.taintedThorHammer)).setRound()
.setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""));
new EMTResearchItem("Lightning Summoner", 6, -5, 0, new ItemStack(EMTItems.itemEMTItems, 1, 6)).setRound()
.setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""));
new EMTResearchItem("The One Ring", 6, -7, 0, new ItemStack(EMTItems.onering)).setRound().setAutoUnlock()
.registerResearchItem().setPages(new ResearchPage(""));
new EMTResearchItem("Electric Cloud", 4, -7, 0, new ItemStack(EMTBlocks.electricCloud)).setRound()
.setAutoUnlock().registerResearchItem().setPages(new ResearchPage("1"), new ResearchPage("2"));
new EMTResearchItem("Feather Wings", 0, 2, 0, new ItemStack(EMTItems.featherWing))
.setParents("Electric Magic Tools").setRound().setAutoUnlock().registerResearchItem().setPages(
new ResearchPage(EMTRecipes.cardboard),
new ResearchPage(EMTRecipes.featherWing),
new ResearchPage(EMTRecipes.featherWings));
// new EMTResearchItem("ResearchCompleter", EMTResearchAspects.researchCompleter, -4, -2, 0, new
// ItemStack(GregTech_API.sBlockMachines, 1, 13001)).setParents("Electric Magic
// Tools").setParentsHidden("WANDPED", "WARDEDARCANA").registerResearchItem().setPages(new ResearchPage(""), new
// ResearchPage(EMTRecipes.magicalMachineCasing), new ResearchPage(EMTRecipes.researchCompleter));
/*************************************/ /*************************************/
/** Research that can be disabled **/ /** Research that can be disabled **/
if (!EMTConfigHandler.thaumiumDrillResearch) { if (!EMTConfigHandler.thaumiumDrillResearch) {
new EMTResearchItem("Thaumium Drill", EMTResearchAspects.thaumiumDrillResearch, -1, -2, 1, new ItemStack(EMTItems.thaumiumDrill)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumDrill)); new EMTResearchItem(
"Thaumium Drill",
EMTResearchAspects.thaumiumDrillResearch,
-1,
-2,
1,
new ItemStack(EMTItems.thaumiumDrill)).setSecondary().setParents("Electric Magic Tools")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumDrill));
} }
if (!EMTConfigHandler.thaumiumChainsawResearch) { if (!EMTConfigHandler.thaumiumChainsawResearch) {
new EMTResearchItem("Thaumium Chainsaw", EMTResearchAspects.thaumiumChainsawResearch, -2, -2, 1, new ItemStack(EMTItems.thaumiumChainsaw)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumChainsaw)); new EMTResearchItem(
"Thaumium Chainsaw",
EMTResearchAspects.thaumiumChainsawResearch,
-2,
-2,
1,
new ItemStack(EMTItems.thaumiumChainsaw)).setSecondary().setParents("Electric Magic Tools")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumChainsaw));
} }
if (!EMTConfigHandler.electricGooglesResearch) { if (!EMTConfigHandler.electricGooglesResearch) {
new EMTResearchItem("Electric Goggles", EMTResearchAspects.electricGogglesResearch, 1, -2, 1, new ItemStack(EMTItems.electricGoggles)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricGoggles)); new EMTResearchItem(
"Electric Goggles",
EMTResearchAspects.electricGogglesResearch,
1,
-2,
1,
new ItemStack(EMTItems.electricGoggles)).setSecondary().setParents("Electric Magic Tools")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricGoggles));
} }
if (!EMTConfigHandler.electricGooglesResearch) { if (!EMTConfigHandler.electricGooglesResearch) {
if (!EMTConfigHandler.nanoGooglesResearch) { if (!EMTConfigHandler.nanoGooglesResearch) {
; ;
new EMTResearchItem("Nanosuit Goggles of Revealing", EMTResearchAspects.thaumicNanoHelmet, 2, -2, 2, new ItemStack(EMTItems.nanoThaumicHelmet)).setParents("Electric Goggles").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumicNanoHelmet)); new EMTResearchItem(
"Nanosuit Goggles of Revealing",
EMTResearchAspects.thaumicNanoHelmet,
2,
-2,
2,
new ItemStack(EMTItems.nanoThaumicHelmet)).setParents("Electric Goggles").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumicNanoHelmet));
} }
} }
if (!EMTConfigHandler.electricGooglesResearch) { if (!EMTConfigHandler.electricGooglesResearch) {
if (!EMTConfigHandler.nanoGooglesResearch) { if (!EMTConfigHandler.nanoGooglesResearch) {
if (!EMTConfigHandler.quantumGooglesResearch) { if (!EMTConfigHandler.quantumGooglesResearch) {
new EMTResearchItem("Quantum Goggles of Revealing", EMTResearchAspects.thaumicQuantumHelmet, 3, -2, 3, new ItemStack(EMTItems.quantumThaumicHelmet)).setParents("Nanosuit Goggles of Revealing").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumicQuantumHelmet)); new EMTResearchItem(
"Quantum Goggles of Revealing",
EMTResearchAspects.thaumicQuantumHelmet,
3,
-2,
3,
new ItemStack(EMTItems.quantumThaumicHelmet)).setParents("Nanosuit Goggles of Revealing")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumicQuantumHelmet));
} }
} }
} }
if (!EMTConfigHandler.ironOmnitoolResearch) { if (!EMTConfigHandler.ironOmnitoolResearch) {
new EMTResearchItem("Iron Omnitool", -2, 0, 0, new ItemStack(EMTItems.ironOmnitool)).setParents("Electric Magic Tools").setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.ironOmnitool)); new EMTResearchItem("Iron Omnitool", -2, 0, 0, new ItemStack(EMTItems.ironOmnitool))
.setParents("Electric Magic Tools").setRound().setAutoUnlock().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.ironOmnitool));
} }
if (!EMTConfigHandler.ironOmnitoolResearch) { if (!EMTConfigHandler.ironOmnitoolResearch) {
if (!EMTConfigHandler.diamondOmnitoolResearch) { if (!EMTConfigHandler.diamondOmnitoolResearch) {
new EMTResearchItem("Diamond Omnitool", EMTResearchAspects.diamondOmnitoolResearch, -4, 0, 1, new ItemStack(EMTItems.diamondOmnitool)).setSecondary().setParents("Iron Omnitool").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.diamondOmnitool), new ResearchPage(EMTRecipes.ironOmnitoolToDiamond)); new EMTResearchItem(
"Diamond Omnitool",
EMTResearchAspects.diamondOmnitoolResearch,
-4,
0,
1,
new ItemStack(EMTItems.diamondOmnitool)).setSecondary().setParents("Iron Omnitool")
.setConcealed().registerResearchItem().setPages(
new ResearchPage(""),
new ResearchPage(EMTRecipes.diamondOmnitool),
new ResearchPage(EMTRecipes.ironOmnitoolToDiamond));
} }
} }
if (!EMTConfigHandler.thaumiumDrillResearch && !EMTConfigHandler.thaumiumChainsawResearch) { if (!EMTConfigHandler.thaumiumDrillResearch && !EMTConfigHandler.thaumiumChainsawResearch) {
if (!EMTConfigHandler.thaumiumOmnitoolResearch) { if (!EMTConfigHandler.thaumiumOmnitoolResearch) {
new EMTResearchItem("Thaumium Omnitool", EMTResearchAspects.thaumiumOmnitoolResearch, -6, 0, 2, new ItemStack(EMTItems.thaumiumOmnitool)).setParentsHidden("Thaumium Drill", "Thaumium Chainsaw").setParents("Diamond Omnitool").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumOmnitool), new ResearchPage(EMTRecipes.diamondOmnitoolToThaumium)); new EMTResearchItem(
"Thaumium Omnitool",
EMTResearchAspects.thaumiumOmnitoolResearch,
-6,
0,
2,
new ItemStack(EMTItems.thaumiumOmnitool))
.setParentsHidden("Thaumium Drill", "Thaumium Chainsaw").setParents("Diamond Omnitool")
.setConcealed().registerResearchItem().setPages(
new ResearchPage(""),
new ResearchPage(EMTRecipes.thaumiumOmnitool),
new ResearchPage(EMTRecipes.diamondOmnitoolToThaumium));
} }
} }
if (!EMTConfigHandler.explosionFocusResearch) { if (!EMTConfigHandler.explosionFocusResearch) {
new EMTResearchItem("Explosion Focus", EMTResearchAspects.laserFocusResearch, 2, 3, 2, new ItemStack(EMTItems.explosionFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.explosionFocus)); new EMTResearchItem(
"Explosion Focus",
EMTResearchAspects.laserFocusResearch,
2,
3,
2,
new ItemStack(EMTItems.explosionFocus)).setParents("Electric Magic Tools").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.explosionFocus));
} }
if (!EMTConfigHandler.christmasFocusResearch) { if (!EMTConfigHandler.christmasFocusResearch) {
new EMTResearchItem("Kris-tmas Focus", EMTResearchAspects.christmasFocusResearch, 3, 3, 1, new ItemStack(EMTItems.christmasFocus)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.christmasFocus)); new EMTResearchItem(
"Kris-tmas Focus",
EMTResearchAspects.christmasFocusResearch,
3,
3,
1,
new ItemStack(EMTItems.christmasFocus)).setSecondary().setParents("Electric Magic Tools")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.christmasFocus));
} }
if (!EMTConfigHandler.shieldFocusResearch) { if (!EMTConfigHandler.shieldFocusResearch) {
new EMTResearchItem("Shield Focus", EMTResearchAspects.shieldFocusResearch, 4, 3, 2, new ItemStack(EMTItems.shieldFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.shieldFocus)); new EMTResearchItem(
"Shield Focus",
EMTResearchAspects.shieldFocusResearch,
4,
3,
2,
new ItemStack(EMTItems.shieldFocus)).setParents("Electric Magic Tools").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.shieldFocus));
} }
if (!EMTConfigHandler.energyBallFocusResearch) { if (!EMTConfigHandler.energyBallFocusResearch) {
new EMTResearchItem("Energy Ball Focus", EMTResearchAspects.energyBallFocusResearch, 1, 3, 2, new ItemStack(EMTItems.energyBallFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.energyBallFocus)); new EMTResearchItem(
"Energy Ball Focus",
EMTResearchAspects.energyBallFocusResearch,
1,
3,
2,
new ItemStack(EMTItems.energyBallFocus)).setParents("Electric Magic Tools").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.energyBallFocus));
} }
if (!EMTConfigHandler.shieldFocusResearch) { if (!EMTConfigHandler.shieldFocusResearch) {
if (!EMTConfigHandler.shieldBlockResearch) { if (!EMTConfigHandler.shieldBlockResearch) {
new EMTResearchItem("Shield Block", EMTResearchAspects.shieldBlockResearch, 4, 5, 1, new ItemStack(EMTBlocks.shield)).setSecondary().setParents("Shield Focus").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.shieldBlock)); new EMTResearchItem(
"Shield Block",
EMTResearchAspects.shieldBlockResearch,
4,
5,
1,
new ItemStack(EMTBlocks.shield)).setSecondary().setParents("Shield Focus").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.shieldBlock));
} }
} }
if (!EMTConfigHandler.potentiaGeneratorResearch) { if (!EMTConfigHandler.potentiaGeneratorResearch) {
new EMTResearchItem("Potentia Generator", EMTResearchAspects.potentiaGeneratorResearch, -2, 3, 3, new ItemStack(EMTBlocks.essentiaGens, 1, 0)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.potentiaGenerator)); new EMTResearchItem(
"Potentia Generator",
EMTResearchAspects.potentiaGeneratorResearch,
-2,
3,
3,
new ItemStack(EMTBlocks.essentiaGens, 1, 0)).setParents("Electric Magic Tools").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.potentiaGenerator));
} }
if (!EMTConfigHandler.potentiaGeneratorResearch) { if (!EMTConfigHandler.potentiaGeneratorResearch) {
if (!EMTConfigHandler.ignisGeneratorResearch) { if (!EMTConfigHandler.ignisGeneratorResearch) {
new EMTResearchItem("Ignis Generator", EMTResearchAspects.ignisGeneratorResearch, -3, 4, 1, new ItemStack(EMTBlocks.essentiaGens, 1, 1)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.ignisGenerator)); new EMTResearchItem(
"Ignis Generator",
EMTResearchAspects.ignisGeneratorResearch,
-3,
4,
1,
new ItemStack(EMTBlocks.essentiaGens, 1, 1)).setSecondary().setParents("Potentia Generator")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.ignisGenerator));
} }
} }
if (!EMTConfigHandler.potentiaGeneratorResearch) { if (!EMTConfigHandler.potentiaGeneratorResearch) {
if (!EMTConfigHandler.auramGeneratorResearch) { if (!EMTConfigHandler.auramGeneratorResearch) {
new EMTResearchItem("Auram Generator", EMTResearchAspects.auramGeneratorResearch, -1, 4, 1, new ItemStack(EMTBlocks.essentiaGens, 1, 2)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.auramGenerator)); new EMTResearchItem(
"Auram Generator",
EMTResearchAspects.auramGeneratorResearch,
-1,
4,
1,
new ItemStack(EMTBlocks.essentiaGens, 1, 2)).setSecondary().setParents("Potentia Generator")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.auramGenerator));
} }
} }
if (!EMTConfigHandler.potentiaGeneratorResearch) { if (!EMTConfigHandler.potentiaGeneratorResearch) {
if (!EMTConfigHandler.arborGeneratorResearch) { if (!EMTConfigHandler.arborGeneratorResearch) {
new EMTResearchItem("Arbor Generator", EMTResearchAspects.arborGeneratorResearch, -2, 5, 1, new ItemStack(EMTBlocks.essentiaGens, 1, 3)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.arborGenerator)); new EMTResearchItem(
"Arbor Generator",
EMTResearchAspects.arborGeneratorResearch,
-2,
5,
1,
new ItemStack(EMTBlocks.essentiaGens, 1, 3)).setSecondary().setParents("Potentia Generator")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.arborGenerator));
} }
} }
if (!EMTConfigHandler.potentiaGeneratorResearch) { if (!EMTConfigHandler.potentiaGeneratorResearch) {
if (!EMTConfigHandler.lucrumGeneratorResearch) { if (!EMTConfigHandler.lucrumGeneratorResearch) {
new EMTResearchItem("Lucrum Generator", EMTResearchAspects.lucrumGeneratorResearch, -2, 2, 1, new ItemStack(EMTBlocks.essentiaGens, 1, 5)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.lucrumGenerator)); new EMTResearchItem(
"Lucrum Generator",
EMTResearchAspects.lucrumGeneratorResearch,
-2,
2,
1,
new ItemStack(EMTBlocks.essentiaGens, 1, 5)).setSecondary().setParents("Potentia Generator")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.lucrumGenerator));
} }
} }
if (!EMTConfigHandler.potentiaGeneratorResearch) { if (!EMTConfigHandler.potentiaGeneratorResearch) {
if (!EMTConfigHandler.aerGeneratorResearch) { if (!EMTConfigHandler.aerGeneratorResearch) {
new EMTResearchItem("Aer Generator", EMTResearchAspects.aerGenerator, -2, 6, 1, new ItemStack(EMTBlocks.essentiaGens, 1, 4)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.aerGenerator)); new EMTResearchItem(
"Aer Generator",
EMTResearchAspects.aerGenerator,
-2,
6,
1,
new ItemStack(EMTBlocks.essentiaGens, 1, 4)).setSecondary().setParents("Potentia Generator")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.aerGenerator));
} }
} }
if (!EMTConfigHandler.potentiaGeneratorResearch) { if (!EMTConfigHandler.potentiaGeneratorResearch) {
if (!EMTConfigHandler.wandChargingSationResearch) { if (!EMTConfigHandler.wandChargingSationResearch) {
new EMTResearchItem("Industrial Wand Charging Station", EMTResearchAspects.wandCharger, -4, 2, 3, new ItemStack(EMTBlocks.emtMachines, 1, 0)).setParents("Potentia Generator").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.wandRecharger)); new EMTResearchItem(
"Industrial Wand Charging Station",
EMTResearchAspects.wandCharger,
-4,
2,
3,
new ItemStack(EMTBlocks.emtMachines, 1, 0)).setParents("Potentia Generator")
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.wandRecharger));
} }
} }
if (!EMTConfigHandler.thaumiumChainsawResearch) { if (!EMTConfigHandler.thaumiumChainsawResearch) {
if (!EMTConfigHandler.streamChainsawResearch) { if (!EMTConfigHandler.streamChainsawResearch) {
new EMTResearchItem("Chainsaw of the Stream", EMTResearchAspects.streamChainsawResearch, -3, -4, 3, new ItemStack(EMTItems.streamChainsaw)).setParents("Thaumium Chainsaw").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.streamChainsaw)); new EMTResearchItem(
"Chainsaw of the Stream",
EMTResearchAspects.streamChainsawResearch,
-3,
-4,
3,
new ItemStack(EMTItems.streamChainsaw)).setParents("Thaumium Chainsaw").registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.streamChainsaw));
} }
} }
if (!EMTConfigHandler.thaumiumDrillResearch) { if (!EMTConfigHandler.thaumiumDrillResearch) {
if (!EMTConfigHandler.rockbreakerDrillResearch) { if (!EMTConfigHandler.rockbreakerDrillResearch) {
new EMTResearchItem("Drill of the Rockbreaker", EMTResearchAspects.rockbreakerDrillResearch, 0, -4, 3, new ItemStack(EMTItems.rockbreakerDrill)).setParents("Thaumium Drill").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.rockbreakerDrill)); new EMTResearchItem(
"Drill of the Rockbreaker",
EMTResearchAspects.rockbreakerDrillResearch,
0,
-4,
3,
new ItemStack(EMTItems.rockbreakerDrill)).setParents("Thaumium Drill").registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.rockbreakerDrill));
} }
} }
if (!EMTConfigHandler.tinyUraniumResearch) { if (!EMTConfigHandler.tinyUraniumResearch) {
new EMTResearchItem("Tiny Uranium", EMTResearchAspects.tinyUraniumResearch, -5, -5, 1, IC2Items.getItem("Uran238")).setSecondary().setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.tinyUranium)); new EMTResearchItem(
"Tiny Uranium",
EMTResearchAspects.tinyUraniumResearch,
-5,
-5,
1,
IC2Items.getItem("Uran238")).setSecondary().setParentsHidden("Electric Magic Tools").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.tinyUranium));
} }
if (!EMTConfigHandler.thorHammerResearch) { if (!EMTConfigHandler.thorHammerResearch) {
new EMTResearchItem("Mjolnir", EMTResearchAspects.thorHammerResearch, -5, 5, 3, new ItemStack(EMTItems.thorHammer)).setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thorHammer)); new EMTResearchItem(
"Mjolnir",
EMTResearchAspects.thorHammerResearch,
-5,
5,
3,
new ItemStack(EMTItems.thorHammer)).setParentsHidden("Electric Magic Tools").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thorHammer));
} }
if (!EMTConfigHandler.thorHammerResearch) { if (!EMTConfigHandler.thorHammerResearch) {
if (!EMTConfigHandler.superchargedThorHammerResearch) { if (!EMTConfigHandler.superchargedThorHammerResearch) {
new EMTResearchItem("Supercharged Mjolnir", EMTResearchAspects.superchargedThorHammerResearch, -6, 6, 3, new ItemStack(EMTItems.electricThorHammer)).setParents("Mjolnir").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.superchargedThorHammer)); new EMTResearchItem(
"Supercharged Mjolnir",
EMTResearchAspects.superchargedThorHammerResearch,
-6,
6,
3,
new ItemStack(EMTItems.electricThorHammer)).setParents("Mjolnir").registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.superchargedThorHammer));
} }
} }
if (!EMTConfigHandler.compressedSolarsResearch) { if (!EMTConfigHandler.compressedSolarsResearch) {
new EMTResearchItem("Compressed Solars", EMTResearchAspects.compressedSolars, -4, -5, 2, new ItemStack(EMTBlocks.solars[0])).setParentsHidden("Potentia Generator").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.compressedSolar), new ResearchPage(EMTRecipes.doubleCompressedSolar), new ResearchPage(EMTRecipes.tripleCompressedSolar)); new EMTResearchItem(
"Compressed Solars",
EMTResearchAspects.compressedSolars,
-4,
-5,
2,
new ItemStack(EMTBlocks.solars[0])).setParentsHidden("Potentia Generator").setConcealed()
.registerResearchItem().setPages(
new ResearchPage(""),
new ResearchPage(EMTRecipes.compressedSolar),
new ResearchPage(EMTRecipes.doubleCompressedSolar),
new ResearchPage(EMTRecipes.tripleCompressedSolar));
} }
if (!EMTConfigHandler.compressedSolarsResearch) { if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.solarHelmetResearch) { if (!EMTConfigHandler.solarHelmetResearch) {
new EMTResearchItem("Solar Helmet of Revealing", EMTResearchAspects.solarHelmetRevealing, -2, -5, 1, new ItemStack(EMTItems.solarHelmetRevealing)).setSecondary().setParents("Compressed Solars").setParentsHidden("Quantum Goggles of Revealing").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.solarHelmetRevealing)); new EMTResearchItem(
"Solar Helmet of Revealing",
EMTResearchAspects.solarHelmetRevealing,
-2,
-5,
1,
new ItemStack(EMTItems.solarHelmetRevealing)).setSecondary().setParents("Compressed Solars")
.setParentsHidden("Quantum Goggles of Revealing").registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.solarHelmetRevealing));
} }
} }
if (!EMTConfigHandler.electricBootsResearch) { if (!EMTConfigHandler.electricBootsResearch) {
new EMTResearchItem("Electric Boots of the Traveller", EMTResearchAspects.electricBootsTravel, 2, 0, 1, new ItemStack(EMTItems.electricBootsTraveller)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricBootsTravel)); new EMTResearchItem(
"Electric Boots of the Traveller",
EMTResearchAspects.electricBootsTravel,
2,
0,
1,
new ItemStack(EMTItems.electricBootsTraveller)).setSecondary().setParents("Electric Magic Tools")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricBootsTravel));
} }
if (!EMTConfigHandler.electricBootsResearch) { if (!EMTConfigHandler.electricBootsResearch) {
if (!EMTConfigHandler.nanoBootsResearch) { if (!EMTConfigHandler.nanoBootsResearch) {
new EMTResearchItem("Nano Boots of the Traveller", EMTResearchAspects.nanoBootsTravel, 4, 0, 2, new ItemStack(EMTItems.nanoBootsTraveller)).setParents("Electric Boots of the Traveller").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.nanoBootsTravel)); new EMTResearchItem(
"Nano Boots of the Traveller",
EMTResearchAspects.nanoBootsTravel,
4,
0,
2,
new ItemStack(EMTItems.nanoBootsTraveller)).setParents("Electric Boots of the Traveller")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.nanoBootsTravel));
} }
} }
if (!EMTConfigHandler.electricBootsResearch) { if (!EMTConfigHandler.electricBootsResearch) {
if (!EMTConfigHandler.nanoBootsResearch) { if (!EMTConfigHandler.nanoBootsResearch) {
if (!EMTConfigHandler.quantumBootsResearch) { if (!EMTConfigHandler.quantumBootsResearch) {
new EMTResearchItem("Quantum Boots of the Traveller", EMTResearchAspects.quantumBootsTravel, 6, 0, 3, new ItemStack(EMTItems.quantumBootsTraveller)).setParents("Nano Boots of the Traveller").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.quantumBootsTravel)); new EMTResearchItem(
"Quantum Boots of the Traveller",
EMTResearchAspects.quantumBootsTravel,
6,
0,
3,
new ItemStack(EMTItems.quantumBootsTraveller)).setParents("Nano Boots of the Traveller")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.quantumBootsTravel));
} }
} }
} }
if (!EMTConfigHandler.electricScribingToolsResearch) { if (!EMTConfigHandler.electricScribingToolsResearch) {
new EMTResearchItem("Electric Scribing Tools", EMTResearchAspects.electricScribingTools, -6, -5, 1, new ItemStack(EMTItems.electricScribingTools)).setSecondary().setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricScribingTools)); new EMTResearchItem(
"Electric Scribing Tools",
EMTResearchAspects.electricScribingTools,
-6,
-5,
1,
new ItemStack(EMTItems.electricScribingTools)).setSecondary()
.setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricScribingTools));
} }
if (!EMTConfigHandler.etherealProcessorResearch) { if (!EMTConfigHandler.etherealProcessorResearch) {
new EMTResearchItem("Etheral Processor", EMTResearchAspects.etherealProcessor, -1, 2, 2, new ItemStack(EMTBlocks.emtMachines, 1, 1)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.etheralProcessor)); new EMTResearchItem(
"Etheral Processor",
EMTResearchAspects.etherealProcessor,
-1,
2,
2,
new ItemStack(EMTBlocks.emtMachines, 1, 1)).setParents("Electric Magic Tools").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.etheralProcessor));
} }
if (!EMTConfigHandler.compressedSolarsResearch) { if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.waterSolarsResearch) { if (!EMTConfigHandler.waterSolarsResearch) {
new EMTResearchItem("Water Infused Solar Panels", EMTResearchAspects.waterSolars, -7, -7, 1, new ItemStack(EMTBlocks.solars[0], 1, 3)).setSecondary().setParents("Compressed Solars").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.waterSolar), new ResearchPage(EMTRecipes.doubleWaterSolar), new ResearchPage(EMTRecipes.tripleWaterSolar)); new EMTResearchItem(
"Water Infused Solar Panels",
EMTResearchAspects.waterSolars,
-7,
-7,
1,
new ItemStack(EMTBlocks.solars[0], 1, 3)).setSecondary().setParents("Compressed Solars")
.registerResearchItem().setPages(
new ResearchPage(""),
new ResearchPage(EMTRecipes.waterSolar),
new ResearchPage(EMTRecipes.doubleWaterSolar),
new ResearchPage(EMTRecipes.tripleWaterSolar));
} }
} }
if (!EMTConfigHandler.compressedSolarsResearch) { if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.darkSolarsResearch) { if (!EMTConfigHandler.darkSolarsResearch) {
new EMTResearchItem("Entropy Infused Solar Panels", EMTResearchAspects.darkSolars, -8, -6, 1, new ItemStack(EMTBlocks.solars[0], 1, 6)).setSecondary().setParents("Compressed Solars").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.darkSolar), new ResearchPage(EMTRecipes.doubleDarkSolar), new ResearchPage(EMTRecipes.tripleDarkSolar)); new EMTResearchItem(
"Entropy Infused Solar Panels",
EMTResearchAspects.darkSolars,
-8,
-6,
1,
new ItemStack(EMTBlocks.solars[0], 1, 6)).setSecondary().setParents("Compressed Solars")
.registerResearchItem().setPages(
new ResearchPage(""),
new ResearchPage(EMTRecipes.darkSolar),
new ResearchPage(EMTRecipes.doubleDarkSolar),
new ResearchPage(EMTRecipes.tripleDarkSolar));
} }
} }
if (!EMTConfigHandler.compressedSolarsResearch) { if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.orderSolarsResearch) { if (!EMTConfigHandler.orderSolarsResearch) {
new EMTResearchItem("Order Infused Solar Panels", EMTResearchAspects.orderSolars, -6, -8, 1, new ItemStack(EMTBlocks.solars[0], 1, 9)).setSecondary().setParents("Compressed Solars").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.orderSolar), new ResearchPage(EMTRecipes.doubleOrderSolar), new ResearchPage(EMTRecipes.tripleOrderSolar)); new EMTResearchItem(
"Order Infused Solar Panels",
EMTResearchAspects.orderSolars,
-6,
-8,
1,
new ItemStack(EMTBlocks.solars[0], 1, 9)).setSecondary().setParents("Compressed Solars")
.registerResearchItem().setPages(
new ResearchPage(""),
new ResearchPage(EMTRecipes.orderSolar),
new ResearchPage(EMTRecipes.doubleOrderSolar),
new ResearchPage(EMTRecipes.tripleOrderSolar));
} }
} }
if (!EMTConfigHandler.compressedSolarsResearch) { if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.fireSolarsResearch) { if (!EMTConfigHandler.fireSolarsResearch) {
new EMTResearchItem("Fire Infused Solar Panels", EMTResearchAspects.fireSolars, -5, -7, 1, new ItemStack(EMTBlocks.solars[0], 1, 12)).setSecondary().setParents("Compressed Solars").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.fireSolar), new ResearchPage(EMTRecipes.doubleFireSolar), new ResearchPage(EMTRecipes.tripleFireSolar)); new EMTResearchItem(
"Fire Infused Solar Panels",
EMTResearchAspects.fireSolars,
-5,
-7,
1,
new ItemStack(EMTBlocks.solars[0], 1, 12)).setSecondary().setParents("Compressed Solars")
.registerResearchItem().setPages(
new ResearchPage(""),
new ResearchPage(EMTRecipes.fireSolar),
new ResearchPage(EMTRecipes.doubleFireSolar),
new ResearchPage(EMTRecipes.tripleFireSolar));
} }
} }
if (!EMTConfigHandler.compressedSolarsResearch) { if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.airSolarsResearch) { if (!EMTConfigHandler.airSolarsResearch) {
new EMTResearchItem("Air Infused Solar Panels", EMTResearchAspects.airSolars, -4, -6, 1, new ItemStack(EMTBlocks.solars[0], 1, 15)).setSecondary().setParents("Compressed Solars").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.airSolar), new ResearchPage(EMTRecipes.doubleAirSolar), new ResearchPage(EMTRecipes.tripleAirSolar)); new EMTResearchItem(
"Air Infused Solar Panels",
EMTResearchAspects.airSolars,
-4,
-6,
1,
new ItemStack(EMTBlocks.solars[0], 1, 15)).setSecondary().setParents("Compressed Solars")
.registerResearchItem().setPages(
new ResearchPage(""),
new ResearchPage(EMTRecipes.airSolar),
new ResearchPage(EMTRecipes.doubleAirSolar),
new ResearchPage(EMTRecipes.tripleAirSolar));
} }
} }
if (!EMTConfigHandler.compressedSolarsResearch) { if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.earthSolarsResearch) { if (!EMTConfigHandler.earthSolarsResearch) {
new EMTResearchItem("Earth Infused Solar Panels", EMTResearchAspects.earthSolars, -6, -7, 1, new ItemStack(EMTBlocks.solars[1], 1, 2)).setSecondary().setParents("Compressed Solars").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.earthSolar), new ResearchPage(EMTRecipes.doubleEarthSolar), new ResearchPage(EMTRecipes.tripleEarthSolar)); new EMTResearchItem(
"Earth Infused Solar Panels",
EMTResearchAspects.earthSolars,
-6,
-7,
1,
new ItemStack(EMTBlocks.solars[1], 1, 2)).setSecondary().setParents("Compressed Solars")
.registerResearchItem().setPages(
new ResearchPage(""),
new ResearchPage(EMTRecipes.earthSolar),
new ResearchPage(EMTRecipes.doubleEarthSolar),
new ResearchPage(EMTRecipes.tripleEarthSolar));
} }
} }
if (!EMTConfigHandler.uuMInfusionResearch) { if (!EMTConfigHandler.uuMInfusionResearch) {
new EMTResearchItem("UU-Matter Infusion", EMTResearchAspects.uuMInfusion, 5, 5, 3, new ItemStack(EMTItems.itemEMTItems, 1, 15)).setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.uuMCrystal), new ResearchPage(EMTRecipes.charcoalToCoal), new ResearchPage(EMTRecipes.glowstoneDustToBlock), new ResearchPage(EMTRecipes.stoneBricksToIronOre), new ResearchPage(EMTRecipes.arcaneStoneToCopperOre), new ResearchPage(EMTRecipes.arcaneStoneBricksToTinOre), new ResearchPage(EMTRecipes.amberBlockToLeadOre), new ResearchPage(EMTRecipes.amberBricksToUraniumOre), new ResearchPage(EMTRecipes.shardToResin), new ResearchPage(EMTRecipes.shardToRedstone), new ResearchPage(EMTRecipes.shardToLapis), new ResearchPage(EMTRecipes.ironToGold), new ResearchPage(EMTRecipes.goldToDiamond), new ResearchPage(EMTRecipes.diamondToUranium), new ResearchPage(EMTRecipes.uraniumToIridium)); new EMTResearchItem(
"UU-Matter Infusion",
EMTResearchAspects.uuMInfusion,
5,
5,
3,
new ItemStack(EMTItems.itemEMTItems, 1, 15)).setParentsHidden("Electric Magic Tools").setConcealed()
.registerResearchItem().setPages(
new ResearchPage(""),
new ResearchPage(EMTRecipes.uuMCrystal),
new ResearchPage(EMTRecipes.charcoalToCoal),
new ResearchPage(EMTRecipes.glowstoneDustToBlock),
new ResearchPage(EMTRecipes.stoneBricksToIronOre),
new ResearchPage(EMTRecipes.arcaneStoneToCopperOre),
new ResearchPage(EMTRecipes.arcaneStoneBricksToTinOre),
new ResearchPage(EMTRecipes.amberBlockToLeadOre),
new ResearchPage(EMTRecipes.amberBricksToUraniumOre),
new ResearchPage(EMTRecipes.shardToResin),
new ResearchPage(EMTRecipes.shardToRedstone),
new ResearchPage(EMTRecipes.shardToLapis),
new ResearchPage(EMTRecipes.ironToGold),
new ResearchPage(EMTRecipes.goldToDiamond),
new ResearchPage(EMTRecipes.diamondToUranium),
new ResearchPage(EMTRecipes.uraniumToIridium));
} }
if (!EMTConfigHandler.portableNodeResarch) { if (!EMTConfigHandler.portableNodeResarch) {
new EMTResearchItem("Portable Node", EMTResearchAspects.portableNode, 2, 5, 3, new ItemStack(EMTBlocks.portableNode)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.portableNode)); new EMTResearchItem(
"Portable Node",
EMTResearchAspects.portableNode,
2,
5,
3,
new ItemStack(EMTBlocks.portableNode)).setParents("Electric Magic Tools").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.portableNode));
} }
if (!EMTConfigHandler.electricHoeGrowthResearch) { if (!EMTConfigHandler.electricHoeGrowthResearch) {
new EMTResearchItem("Electric Hoe of Growth", EMTResearchAspects.electricHoeGrowth, -1, -4, 2, new ItemStack(EMTItems.electricHoeGrowth)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricHoeGrowth)); new EMTResearchItem(
"Electric Hoe of Growth",
EMTResearchAspects.electricHoeGrowth,
-1,
-4,
2,
new ItemStack(EMTItems.electricHoeGrowth)).setParents("Electric Magic Tools").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricHoeGrowth));
} }
if (!EMTConfigHandler.chargeFocusResearch) { if (!EMTConfigHandler.chargeFocusResearch) {
new EMTResearchItem("Wand Focus: Charging", EMTResearchAspects.chargeFocus, 5, 3, 2, new ItemStack(EMTItems.chargeFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.chargeFocus)); new EMTResearchItem(
"Wand Focus: Charging",
EMTResearchAspects.chargeFocus,
5,
3,
2,
new ItemStack(EMTItems.chargeFocus)).setParents("Electric Magic Tools").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.chargeFocus));
} }
if (!EMTConfigHandler.maintenanceFocusResearch) {
new EMTResearchItem(
"Wand Focus: Maintenance",
EMTResearchAspects.maintenanceFocus,
7,
4,
4,
new ItemStack(EMTItems.maintenanceFocus)).setParents("Wand Focus: Charging").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.maintenanceFocus));
}
if (!EMTConfigHandler.wandChargeFocusResearch) { if (!EMTConfigHandler.wandChargeFocusResearch) {
new EMTResearchItem("Wand Focus: Wand Charging", EMTResearchAspects.wandChargeFocus, 7, 3, 3, new ItemStack(EMTItems.wandChargeFocus)).setParents("Wand Focus: Charging").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.wandChargeFocus)); new EMTResearchItem(
"Wand Focus: Wand Charging",
EMTResearchAspects.wandChargeFocus,
7,
3,
3,
new ItemStack(EMTItems.wandChargeFocus)).setParents("Wand Focus: Charging").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.wandChargeFocus));
} }
if (!EMTConfigHandler.inventoryChargingRing) { if (!EMTConfigHandler.inventoryChargingRing) {
new EMTResearchItem("Inventory Charging Ring", EMTResearchAspects.inventoryChargingRing, 0, -5, 3, new ItemStack(EMTItems.emtBauble, 1, 1)).setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.inventoryChargingRing)); new EMTResearchItem(
"Inventory Charging Ring",
EMTResearchAspects.inventoryChargingRing,
0,
-5,
3,
new ItemStack(EMTItems.emtBauble, 1, 1)).setParentsHidden("Electric Magic Tools").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.inventoryChargingRing));
} }
if (!EMTConfigHandler.armorChargingRing) { if (!EMTConfigHandler.armorChargingRing) {
new EMTResearchItem("Armor Charging Ring", EMTResearchAspects.armorChargingRing, 0, -7, 3, new ItemStack(EMTItems.emtBauble, 1, 0)).setSecondary().setParents("Inventory Charging Ring").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.armorChargingRing)); new EMTResearchItem(
"Armor Charging Ring",
EMTResearchAspects.armorChargingRing,
0,
-7,
3,
new ItemStack(EMTItems.emtBauble, 1, 0)).setSecondary().setParents("Inventory Charging Ring")
.setConcealed().registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.armorChargingRing));
} }
if (!EMTConfigHandler.thaumiumWingResearch) { if (!EMTConfigHandler.thaumiumWingResearch) {
new EMTResearchItem("Thaumium Reinforced Wings", EMTResearchAspects.thaumiumWing, 0, 4, 0, new ItemStack(EMTItems.thaumiumWing)).setSecondary().setParents("Feather Wings").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumWing), new ResearchPage(EMTRecipes.thaumiumWings)); new EMTResearchItem(
"Thaumium Reinforced Wings",
EMTResearchAspects.thaumiumWing,
0,
4,
0,
new ItemStack(EMTItems.thaumiumWing)).setSecondary().setParents("Feather Wings").setConcealed()
.registerResearchItem().setPages(
new ResearchPage(""),
new ResearchPage(EMTRecipes.thaumiumWing),
new ResearchPage(EMTRecipes.thaumiumWings));
} }
if (!EMTConfigHandler.nanoWingResearch && !EMTConfigHandler.thaumiumWingResearch) { if (!EMTConfigHandler.nanoWingResearch && !EMTConfigHandler.thaumiumWingResearch) {
new EMTResearchItem("Nanosuit Wings", EMTResearchAspects.nanoWing, 0, 6, 2, new ItemStack(EMTItems.nanoWing)).setParents("Thaumium Reinforced Wings").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.nanoWings)); new EMTResearchItem(
"Nanosuit Wings",
EMTResearchAspects.nanoWing,
0,
6,
2,
new ItemStack(EMTItems.nanoWing)).setParents("Thaumium Reinforced Wings").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.nanoWings));
} }
if (!EMTConfigHandler.quantumWingsResearch && !EMTConfigHandler.thaumiumWingResearch && !EMTConfigHandler.nanoWingResearch) { if (!EMTConfigHandler.quantumWingsResearch && !EMTConfigHandler.thaumiumWingResearch
new EMTResearchItem("Quantum Wings", EMTResearchAspects.quantumWing, 0, 8, 3, new ItemStack(EMTItems.quantumWing)).setParents("Nanosuit Wings").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.quantumWings)); && !EMTConfigHandler.nanoWingResearch) {
new EMTResearchItem(
"Quantum Wings",
EMTResearchAspects.quantumWing,
0,
8,
3,
new ItemStack(EMTItems.quantumWing)).setParents("Nanosuit Wings").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.quantumWings));
} }
if (!EMTConfigHandler.infusedQuantumChestplate && !EMTConfigHandler.thaumiumWingResearch && !EMTConfigHandler.nanoWingResearch && !EMTConfigHandler.quantumWingsResearch) { if (!EMTConfigHandler.infusedQuantumChestplate && !EMTConfigHandler.thaumiumWingResearch
new EMTResearchItem("Infused Quantum Armor", EMTResearchAspects.quantumWing, 0, 10, 4, new ItemStack(EMTItems.quantumArmor)).setParents("Quantum Wings").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.infusedQuantumArmor)); && !EMTConfigHandler.nanoWingResearch
&& !EMTConfigHandler.quantumWingsResearch) {
new EMTResearchItem(
"Infused Quantum Armor",
EMTResearchAspects.quantumWing,
0,
10,
4,
new ItemStack(EMTItems.quantumArmor)).setParents("Quantum Wings").setConcealed()
.registerResearchItem()
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.infusedQuantumArmor));
} }
/***********************************/ /***********************************/
} }
+8 -9
View File
@@ -13,9 +13,8 @@ public class EMTTiles {
public static void registerTileEntities() { public static void registerTileEntities() {
// Essentia Gens
//Essentia Gens // legacy support
//legacy support
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitypotentiagenerator"); GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitypotentiagenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityignisgenerator"); GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityignisgenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityauramgenerator"); GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityauramgenerator");
@@ -23,16 +22,16 @@ public class EMTTiles {
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityaergenerator"); GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityaergenerator");
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitylucrumgenerator"); GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitylucrumgenerator");
//new TEs will be called TileEntityEssentiaGenerator // new TEs will be called TileEntityEssentiaGenerator
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "TileEntityEssentiaGenerator"); GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "TileEntityEssentiaGenerator");
//Machinery // Machinery
GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge"); GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge");
GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator"); GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
GameRegistry.registerTileEntity(EssentiaFiller.class, "EssentiaFillerTE"); GameRegistry.registerTileEntity(EssentiaFiller.class, "EssentiaFillerTE");
//Solars // Solars
//legacy support // legacy support
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitycompressedsolar"); GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitycompressedsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublecompressedsolar"); GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublecompressedsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplecompressedsolar"); GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplecompressedsolar");
@@ -55,10 +54,10 @@ public class EMTTiles {
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleearthsolar"); GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleearthsolar");
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleearthsolar"); GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleearthsolar");
//new TEs will be called TileEntityXCompressedSolar // new TEs will be called TileEntityXCompressedSolar
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "TileEntityXCompressedSolar"); GameRegistry.registerTileEntity(TileEntitySolarBase.class, "TileEntityXCompressedSolar");
//Random Stuff // Random Stuff
GameRegistry.registerTileEntity(TileEntityPortableNode.class, "tileentityportablenode"); GameRegistry.registerTileEntity(TileEntityPortableNode.class, "tileentityportablenode");
GameRegistry.registerTileEntity(TileElectricCloud.class, "tileEntityElectricCloud"); GameRegistry.registerTileEntity(TileElectricCloud.class, "tileEntityElectricCloud");
} }
@@ -1,5 +1,19 @@
package emt.init; package emt.init;
import static thaumcraft.api.aspects.Aspect.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import emt.EMT; import emt.EMT;
import emt.util.EMTResearchItem; import emt.util.EMTResearchItem;
import gregtech.api.enums.ItemList; import gregtech.api.enums.ItemList;
@@ -7,12 +21,6 @@ import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility; import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.ThaumcraftApiHelper;
import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectList;
@@ -23,73 +31,90 @@ import thaumcraft.api.crafting.ShapedArcaneRecipe;
import thaumcraft.api.research.ResearchItem; import thaumcraft.api.research.ResearchItem;
import thaumcraft.api.research.ResearchPage; import thaumcraft.api.research.ResearchPage;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashMap;
import static thaumcraft.api.aspects.Aspect.*;
public class EMT_GTNH_Recipes_And_Researches implements Runnable { public class EMT_GTNH_Recipes_And_Researches implements Runnable {
private static LinkedHashMap<String, IArcaneRecipe> arcaneRecipeLinkedHashMap = new LinkedHashMap<>(); private static LinkedHashMap<String, IArcaneRecipe> arcaneRecipeLinkedHashMap = new LinkedHashMap<>();
private static LinkedHashMap<String, InfusionRecipe> infusionRecipeLinkedHashMap = new LinkedHashMap<>(); private static LinkedHashMap<String, InfusionRecipe> infusionRecipeLinkedHashMap = new LinkedHashMap<>();
private static LinkedHashMap<String, CrucibleRecipe> cruciblRecipeLinkedHashMap = new LinkedHashMap<>(); private static LinkedHashMap<String, CrucibleRecipe> cruciblRecipeLinkedHashMap = new LinkedHashMap<>();
private static AspectList getPrimals(int amount) { private static AspectList getPrimals(int amount) {
return new AspectList().add(ORDER, amount).add(ENTROPY, amount).add(AIR, amount).add(EARTH, amount).add(WATER, amount).add(FIRE, amount); return new AspectList().add(ORDER, amount).add(ENTROPY, amount).add(AIR, amount).add(EARTH, amount)
.add(WATER, amount).add(FIRE, amount);
} }
@Override @Override
public void run() { public void run() {
// ItemStack glue =new ItemStack(EMTItems.itemEMTItems,1,8); // ItemStack glue =new ItemStack(EMTItems.itemEMTItems,1,8);
// HashSet<ShapelessRecipes> recipesHashSet = new HashSet<>(); // HashSet<ShapelessRecipes> recipesHashSet = new HashSet<>();
// recipesHashSet.add(new ShapelessRecipes(glue, Arrays.asList(GT_ModHandler.getModItem("TConstruct","materials",1,36),GT_ModHandler.getModItem("TConstruct","materials",1,36)))); // recipesHashSet.add(new ShapelessRecipes(glue,
// recipesHashSet.add(new ShapelessRecipes(glue, Collections.singletonList(GT_ModHandler.getModItem("TConstruct", "materials", 2, 36)))); // Arrays.asList(GT_ModHandler.getModItem("TConstruct","materials",1,36),GT_ModHandler.getModItem("TConstruct","materials",1,36))));
// for ( ShapelessRecipes sr : recipesHashSet) // recipesHashSet.add(new ShapelessRecipes(glue,
// CraftingManager.getInstance().getRecipeList().add(sr); // Collections.singletonList(GT_ModHandler.getModItem("TConstruct", "materials", 2, 36))));
// // for ( ShapelessRecipes sr : recipesHashSet)
// //Rubber ball recipes // CraftingManager.getInstance().getRecipeList().add(sr);
// GT_Values.RA.addAlloySmelterRecipe(Materials.RubberTreeSap.getDust(4),ItemList.Shape_Mold_Ball.get(0),new ItemStack(EMTItems.itemEMTItems,1,10),200,16); //
// GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(Items.paper,12),new ItemStack(EMTItems.itemEMTItems,1,10)},Materials.Glue.getMolten(6912),new ItemStack(EMTItems.itemEMTItems,1,9),600,30); // //Rubber ball recipes
// GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ball.get(0),Materials.Rubber.getMolten(576),new ItemStack(EMTItems.itemEMTItems,1,10),100,30); //
// GT_Values.RA.addPulveriserRecipe(new ItemStack(EMTItems.itemEMTItems,1,10),new ItemStack[]{Materials.Rubber.getDust(4)},null,300,2); // GT_Values.RA.addAlloySmelterRecipe(Materials.RubberTreeSap.getDust(4),ItemList.Shape_Mold_Ball.get(0),new
// GT_Values.RA.addFormingPressRecipe(Materials.Rubber.getPlates(4),ItemList.Shape_Mold_Ball.get(0),new ItemStack(EMTItems.itemEMTItems,1,10),100,30); // ItemStack(EMTItems.itemEMTItems,1,10),200,16);
// GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(Items.paper,12),new
// ItemStack(EMTItems.itemEMTItems,1,10)},Materials.Glue.getMolten(6912),new
// ItemStack(EMTItems.itemEMTItems,1,9),600,30);
//
// GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ball.get(0),Materials.Rubber.getMolten(576),new
// ItemStack(EMTItems.itemEMTItems,1,10),100,30);
// GT_Values.RA.addPulveriserRecipe(new ItemStack(EMTItems.itemEMTItems,1,10),new
// ItemStack[]{Materials.Rubber.getDust(4)},null,300,2);
// GT_Values.RA.addFormingPressRecipe(Materials.Rubber.getPlates(4),ItemList.Shape_Mold_Ball.get(0),new
// ItemStack(EMTItems.itemEMTItems,1,10),100,30);
EMTResearches.addResearchTab(); EMTResearches.addResearchTab();
runArcaneRecipes(); runArcaneRecipes();
runResreaches(); runResreaches();
} }
private void runInfusionRecipes() { private void runInfusionRecipes() {}
}
private void runKettleRecipes() { private void runKettleRecipes() {}
}
private void runArcaneRecipes() { private void runArcaneRecipes() {
arcaneRecipeLinkedHashMap.put("DiamondChainsaw", new ShapedArcaneRecipe("DiamondChainsaw", new ItemStack(EMTItems.diamondChainsaw), getPrimals(35), arcaneRecipeLinkedHashMap.put(
"sts", "DiamondChainsaw",
"pmp", new ShapedArcaneRecipe(
"pbp", "DiamondChainsaw",
's', GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Diamond, 1), new ItemStack(EMTItems.diamondChainsaw),
'p', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Diamond, 1), getPrimals(35),
't', GT_OreDictUnificator.get(OrePrefixes.toolHeadChainsaw, Materials.Thaumium, 1), "sts",
'b', ItemList.Battery_RE_LV_Sodium.get(1), "pmp",
'm', ItemList.Electric_Motor_MV.get(1) "pbp",
)); 's',
arcaneRecipeLinkedHashMap.put("ThaumiumChainsaw", new ShapedArcaneRecipe("ThaumiumChainsaw", new ItemStack(EMTItems.thaumiumChainsaw), getPrimals(35), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Diamond, 1),
"sps", 'p',
"pmp", GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Diamond, 1),
"ppp", 't',
's', GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Thaumium, 1), GT_OreDictUnificator.get(OrePrefixes.toolHeadChainsaw, Materials.Thaumium, 1),
'p', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Thaumium, 1), 'b',
'b', ItemList.Battery_RE_LV_Sodium.get(1), ItemList.Battery_RE_LV_Sodium.get(1),
'm', new ItemStack(EMTItems.diamondChainsaw) 'm',
)); ItemList.Electric_Motor_MV.get(1)));
arcaneRecipeLinkedHashMap.put(
"ThaumiumChainsaw",
new ShapedArcaneRecipe(
"ThaumiumChainsaw",
new ItemStack(EMTItems.thaumiumChainsaw),
getPrimals(35),
"sps",
"pmp",
"ppp",
's',
GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Thaumium, 1),
'p',
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Thaumium, 1),
'b',
ItemList.Battery_RE_LV_Sodium.get(1),
'm',
new ItemStack(EMTItems.diamondChainsaw)));
for (IArcaneRecipe recipe : arcaneRecipeLinkedHashMap.values()) { for (IArcaneRecipe recipe : arcaneRecipeLinkedHashMap.values()) {
ThaumcraftApi.getCraftingRecipes().add(recipe); ThaumcraftApi.getCraftingRecipes().add(recipe);
@@ -98,13 +123,32 @@ public class EMT_GTNH_Recipes_And_Researches implements Runnable {
private void runResreaches() { private void runResreaches() {
HashSet<ResearchItem> researches = new HashSet<>(); HashSet<ResearchItem> researches = new HashSet<>();
researches.add(new EMTResearchItem("ElectricMagicTools", 0, 0, 0, new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png")).setSpecial().setAutoUnlock().setPages(new ResearchPage(""))); researches.add(
researches.add(new EMTResearchItem("DiamondChainsaw", new AspectList().add(GREED, 12).add(FIRE, 9).add(METAL, 6).add(EARTH, 3), 0, -2, 2, new ItemStack(EMTItems.diamondChainsaw)).setPages(new ResearchPage(arcaneRecipeLinkedHashMap.get("DiamondChainsaw"))).setRound().setParentsHidden("ElectricMagicTools")); new EMTResearchItem(
//researches.add(new EMTResearchItem("DiamondChainsaw",new AspectList().add(GREED,12).add(FIRE,9).add(METAL,6).add(EARTH,3),0,-2,2,new ItemStack(EMTItems.diamondChainsaw)).setRound()); "ElectricMagicTools",
0,
0,
0,
new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png")).setSpecial().setAutoUnlock()
.setPages(new ResearchPage("")));
researches.add(
new EMTResearchItem(
"DiamondChainsaw",
new AspectList().add(GREED, 12).add(FIRE, 9).add(METAL, 6).add(EARTH, 3),
0,
-2,
2,
new ItemStack(EMTItems.diamondChainsaw))
.setPages(new ResearchPage(arcaneRecipeLinkedHashMap.get("DiamondChainsaw"))).setRound()
.setParentsHidden("ElectricMagicTools"));
// researches.add(new EMTResearchItem("DiamondChainsaw",new
// AspectList().add(GREED,12).add(FIRE,9).add(METAL,6).add(EARTH,3),0,-2,2,new
// ItemStack(EMTItems.diamondChainsaw)).setRound());
researches.forEach(ResearchItem::registerResearchItem); researches.forEach(ResearchItem::registerResearchItem);
} }
class ShapedArcaneRecipeIgnoresNBT extends ShapedArcaneRecipe { class ShapedArcaneRecipeIgnoresNBT extends ShapedArcaneRecipe {
protected String research; protected String research;
protected ItemStack result; protected ItemStack result;
protected AspectList aspects; protected AspectList aspects;
@@ -120,8 +164,8 @@ public class EMT_GTNH_Recipes_And_Researches implements Runnable {
this.recipe = recipe; this.recipe = recipe;
int rows = 0; int rows = 0;
int colums = 0; int colums = 0;
if (!(recipe[0] instanceof String)) if (!(recipe[0] instanceof String)) throw new UnsupportedOperationException(
throw new UnsupportedOperationException("The Recipe must start with at least one String for the first row!"); "The Recipe must start with at least one String for the first row!");
int i = 0; int i = 0;
rowcolm = new int[3]; rowcolm = new int[3];
do { do {
@@ -137,14 +181,14 @@ public class EMT_GTNH_Recipes_And_Researches implements Runnable {
int k = 0; int k = 0;
for (int j = i; j < recipe.length; j += 2) { for (int j = i; j < recipe.length; j += 2) {
k++; k++;
if (recipe[j] instanceof Character) if (recipe[j] instanceof Character) translation.put((Character) recipe[j], recipe[j + 1]);
translation.put((Character) recipe[j], recipe[j + 1]);
} }
} }
@Override @Override
public boolean matches(IInventory inv, World world, EntityPlayer player) { public boolean matches(IInventory inv, World world, EntityPlayer player) {
if (this.research.length() > 0 && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), this.research)) if (this.research.length() > 0
&& !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), this.research))
return false; return false;
else { else {
for (int y = 0; y < rowcolm.length; y++) { for (int y = 0; y < rowcolm.length; y++) {
@@ -155,21 +199,29 @@ public class EMT_GTNH_Recipes_And_Researches implements Runnable {
if (itemReplacement != null && slot == null) { if (itemReplacement != null && slot == null) {
return false; return false;
} else if (itemReplacement instanceof String) { } else if (itemReplacement instanceof String) {
if (!GT_Utility.areStacksEqual(GT_OreDictUnificator.getFirstOre(itemReplacement, 1), GT_OreDictUnificator.get(slot), true)) if (!GT_Utility.areStacksEqual(
if (!OreDictionary.getOres((String) itemReplacement).contains(slot)) GT_OreDictUnificator.getFirstOre(itemReplacement, 1),
return false; GT_OreDictUnificator.get(slot),
true))
if (!OreDictionary.getOres((String) itemReplacement).contains(slot)) return false;
} else if (itemReplacement instanceof ItemStack) { } else if (itemReplacement instanceof ItemStack) {
if (!GT_Utility.isStackValid(itemReplacement)) { if (!GT_Utility.isStackValid(itemReplacement)) {
return false; return false;
} }
if (!GT_Utility.areStacksEqual((ItemStack) itemReplacement, slot, true)) if (!GT_Utility.areStacksEqual((ItemStack) itemReplacement, slot, true))
if (!GT_Utility.areUnificationsEqual((ItemStack) itemReplacement, slot, true)) if (!GT_Utility.areUnificationsEqual((ItemStack) itemReplacement, slot, true))
if (!(((ItemStack) itemReplacement).getItem().equals(slot.getItem()) && ((ItemStack) itemReplacement).getItemDamage() == OreDictionary.WILDCARD_VALUE)) if (!(((ItemStack) itemReplacement).getItem().equals(slot.getItem())
&& ((ItemStack) itemReplacement).getItemDamage()
== OreDictionary.WILDCARD_VALUE))
return false; return false;
} else if (itemReplacement instanceof Collection) { } else if (itemReplacement instanceof Collection) {
boolean hit = false; boolean hit = false;
for (Object o : (Collection) itemReplacement) { for (Object o : (Collection) itemReplacement) {
if (GT_Utility.areStacksEqual((ItemStack) o, slot, true) || GT_Utility.areUnificationsEqual((ItemStack) o, slot, true) || (((ItemStack) o).getItem().equals(slot.getItem()) && ((ItemStack) itemReplacement).getItemDamage() == OreDictionary.WILDCARD_VALUE)) if (GT_Utility.areStacksEqual((ItemStack) o, slot, true)
|| GT_Utility.areUnificationsEqual((ItemStack) o, slot, true)
|| (((ItemStack) o).getItem().equals(slot.getItem())
&& ((ItemStack) itemReplacement).getItemDamage()
== OreDictionary.WILDCARD_VALUE))
hit = true; hit = true;
} }
if (!hit) { if (!hit) {
@@ -212,5 +264,4 @@ public class EMT_GTNH_Recipes_And_Researches implements Runnable {
return research; return research;
} }
} }
} }
+3 -3
View File
@@ -5,10 +5,10 @@ import emt.tile.solar.Solars;
import emt.util.EMTEssentiasOutputs; import emt.util.EMTEssentiasOutputs;
public class Registry { public class Registry {
private static final EMT_GT_Loader gtloader = new EMT_GT_Loader(); private static final EMT_GT_Loader gtloader = new EMT_GT_Loader();
public static void registerPreInit() { public static void registerPreInit() {}
}
public static void registerInit() { public static void registerInit() {
EMTBlocks.registerBlocks(); EMTBlocks.registerBlocks();
@@ -23,7 +23,7 @@ public class Registry {
EMTBlocks.addAspects(); EMTBlocks.addAspects();
gtloader.runlate(); gtloader.runlate();
EMTRecipes.registerLateRecipes(); EMTRecipes.registerLateRecipes();
//new EMT_GTNH_Recipes_And_Researches().run(); // new EMT_GTNH_Recipes_And_Researches().run();
EMTRecipes.registerUUMInfusionRecipes(); EMTRecipes.registerUUMInfusionRecipes();
EMTResearches.register(); EMTResearches.register();
Solars.registerReverseRecipes(); Solars.registerReverseRecipes();
+5 -3
View File
@@ -1,11 +1,12 @@
package emt.item; package emt.item;
import emt.EMT;
import emt.util.EMTTextHelper;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import emt.EMT;
import emt.util.EMTTextHelper;
public class ItemBase extends Item { public class ItemBase extends Item {
public ItemBase(String unlocName, String textureName) { public ItemBase(String unlocName, String textureName) {
@@ -22,6 +23,7 @@ public class ItemBase extends Item {
} }
public String getItemStackDisplayName(ItemStack stack) { public String getItemStackDisplayName(ItemStack stack) {
return (EMTTextHelper.GREEN + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim(); return (EMTTextHelper.GREEN
+ StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
} }
} }
@@ -1,21 +1,21 @@
package emt.item; package emt.item;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import thaumcraft.api.IScribeTools; import thaumcraft.api.IScribeTools;
import thaumcraft.common.items.ItemInkwell; import thaumcraft.common.items.ItemInkwell;
import java.util.List;
public class ItemElectricScribingTools extends ItemInkwell implements IElectricItem, IScribeTools { public class ItemElectricScribingTools extends ItemInkwell implements IElectricItem, IScribeTools {
public static int maxCharge = 400; public static int maxCharge = 400;
+31 -18
View File
@@ -1,5 +1,16 @@
package emt.item; package emt.item;
import java.util.List;
import java.util.Random;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import baubles.api.BaubleType; import baubles.api.BaubleType;
import baubles.api.IBauble; import baubles.api.IBauble;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@@ -8,18 +19,8 @@ import emt.EMT;
import emt.util.EMTConfigHandler; import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem; import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem; import ic2.api.item.IElectricItem;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import thaumcraft.api.IRunicArmor; import thaumcraft.api.IRunicArmor;
import java.util.List;
import java.util.Random;
public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor { public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
public static int wornTick; public static int wornTick;
@@ -89,8 +90,15 @@ public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
int energyLeft = EMTConfigHandler.armorBaubleProduction; int energyLeft = EMTConfigHandler.armorBaubleProduction;
for (int i = 0; i < ((EntityPlayer) player).inventory.armorInventory.length; i++) { for (int i = 0; i < ((EntityPlayer) player).inventory.armorInventory.length; i++) {
if (energyLeft > 0) { if (energyLeft > 0) {
if ((((EntityPlayer) player).inventory.armorInventory[i] != null) && (((EntityPlayer) player).inventory.armorInventory[i].getItem() instanceof IElectricItem)) { if ((((EntityPlayer) player).inventory.armorInventory[i] != null)
double sentPacket = ElectricItem.manager.charge(((EntityPlayer) player).inventory.armorInventory[i], energyLeft, 4, false, false); && (((EntityPlayer) player).inventory.armorInventory[i]
.getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager.charge(
((EntityPlayer) player).inventory.armorInventory[i],
energyLeft,
4,
false,
false);
energyLeft -= sentPacket; energyLeft -= sentPacket;
} }
} }
@@ -104,8 +112,15 @@ public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
int energyLeft = EMTConfigHandler.inventoryBaubleProdution; int energyLeft = EMTConfigHandler.inventoryBaubleProdution;
for (int i = 0; i < ((EntityPlayer) player).inventory.mainInventory.length; i++) { for (int i = 0; i < ((EntityPlayer) player).inventory.mainInventory.length; i++) {
if (energyLeft > 0) { if (energyLeft > 0) {
if ((((EntityPlayer) player).inventory.mainInventory[i] != null) && (((EntityPlayer) player).inventory.mainInventory[i].getItem() instanceof IElectricItem)) { if ((((EntityPlayer) player).inventory.mainInventory[i] != null)
double sentPacket = ElectricItem.manager.charge(((EntityPlayer) player).inventory.mainInventory[i], energyLeft, 4, false, false); && (((EntityPlayer) player).inventory.mainInventory[i]
.getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager.charge(
((EntityPlayer) player).inventory.mainInventory[i],
energyLeft,
4,
false,
false);
energyLeft -= sentPacket; energyLeft -= sentPacket;
} }
} }
@@ -117,12 +132,10 @@ public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
} }
@Override @Override
public void onEquipped(ItemStack stack, EntityLivingBase player) { public void onEquipped(ItemStack stack, EntityLivingBase player) {}
}
@Override @Override
public void onUnequipped(ItemStack stack, EntityLivingBase player) { public void onUnequipped(ItemStack stack, EntityLivingBase player) {}
}
@Override @Override
public boolean canEquip(ItemStack stack, EntityLivingBase player) { public boolean canEquip(ItemStack stack, EntityLivingBase player) {
+44 -18
View File
@@ -1,8 +1,7 @@
package emt.item; package emt.item;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -13,22 +12,21 @@ import net.minecraft.item.EnumAction;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.IIcon; import net.minecraft.util.*;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType; import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowNockEvent; import net.minecraftforge.event.entity.player.ArrowNockEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import thaumcraft.common.config.Config; import thaumcraft.common.config.Config;
import thaumcraft.common.lib.utils.InventoryUtils; import thaumcraft.common.lib.utils.InventoryUtils;
import java.util.List;
public class ItemMaterials extends Item { public class ItemMaterials extends Item {
public IIcon[] icon = new IIcon[16]; public IIcon[] icon = new IIcon[20];
public ItemMaterials() { public ItemMaterials() {
this.setCreativeTab(EMT.TAB); this.setCreativeTab(EMT.TAB);
@@ -89,6 +87,18 @@ public class ItemMaterials extends Item {
case 15: case 15:
name = "uumatterDrop"; name = "uumatterDrop";
break; break;
case 16:
name = "draconicSchematic";
break;
case 17:
name = "wyvernSchematic";
break;
case 18:
name = "awakenedSchematic";
break;
case 19:
name = "chaoticSchematic";
break;
default: default:
name = "nothing"; name = "nothing";
break; break;
@@ -96,6 +106,15 @@ public class ItemMaterials extends Item {
return "item." + EMT.MOD_ID + "." + name; return "item." + EMT.MOD_ID + "." + name;
} }
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List result, boolean advanced) {
switch (stack.getItemDamage()) {
case 16:
result.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("tooltip.EMT.draconicSchematic"));
break;
}
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ri) { public void registerIcons(IIconRegister ri) {
this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/clusteruranium"); this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/clusteruranium");
@@ -114,6 +133,10 @@ public class ItemMaterials extends Item {
this.icon[13] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/taintedfeather"); this.icon[13] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/taintedfeather");
this.icon[14] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/thaumiumWing"); this.icon[14] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/thaumiumWing");
this.icon[15] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/uumatterdrop"); this.icon[15] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/uumatterdrop");
this.icon[16] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/draconicSchematic");
this.icon[17] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/wyvernSchematic");
this.icon[18] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/awakenedSchematic");
this.icon[19] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/chaoticSchematic");
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@@ -123,7 +146,7 @@ public class ItemMaterials extends Item {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) { public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
for (int i = 1; i <= 15; i++) { for (int i = 1; i <= 19; i++) {
list.add(new ItemStack(this, 1, i)); list.add(new ItemStack(this, 1, i));
} }
} }
@@ -136,7 +159,8 @@ public class ItemMaterials extends Item {
float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f); float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f);
float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f); float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f);
double playerX = player.prevPosX + ((player.posX - player.prevPosX) * f); double playerX = player.prevPosX + ((player.posX - player.prevPosX) * f);
double playerY = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset; double playerY = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D)
- player.yOffset;
double playerZ = player.prevPosZ + ((player.posZ - player.prevPosZ) * f); double playerZ = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
Vec3 playerLoc = Vec3.createVectorHelper(playerX, playerY, playerZ); Vec3 playerLoc = Vec3.createVectorHelper(playerX, playerY, playerZ);
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F); float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
@@ -183,24 +207,26 @@ public class ItemMaterials extends Item {
} }
public int getMaxItemUseDuration(ItemStack stack) { public int getMaxItemUseDuration(ItemStack stack) {
if (stack.getItemDamage() == 6) if (stack.getItemDamage() == 6) return 72000;
return 72000;
return super.getMaxItemUseDuration(stack); return super.getMaxItemUseDuration(stack);
} }
public EnumAction getItemUseAction(ItemStack stack) { public EnumAction getItemUseAction(ItemStack stack) {
if (stack.getItemDamage() == 6) if (stack.getItemDamage() == 6) return EnumAction.bow;
return EnumAction.bow;
return EnumAction.none; return EnumAction.none;
} }
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) { public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
super.onUpdate(stack, world, entity, par4, par5); super.onUpdate(stack, world, entity, par4, par5);
if ((!entity.worldObj.isRemote) && ((stack.getItemDamage() == 13)) && ((entity instanceof EntityLivingBase)) && (!((EntityLivingBase) entity).isEntityUndead()) && (!((EntityLivingBase) entity).isPotionActive(Config.potionTaintPoisonID)) && (world.rand.nextInt(4321) <= stack.stackSize)) { if ((!entity.worldObj.isRemote) && ((stack.getItemDamage() == 13))
&& ((entity instanceof EntityLivingBase))
&& (!((EntityLivingBase) entity).isEntityUndead())
&& (!((EntityLivingBase) entity).isPotionActive(Config.potionTaintPoisonID))
&& (world.rand.nextInt(4321) <= stack.stackSize)) {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Config.potionTaintPoisonID, 120, 0, false)); ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Config.potionTaintPoisonID, 120, 0, false));
if ((entity instanceof EntityPlayer)) { if ((entity instanceof EntityPlayer)) {
InventoryUtils.consumeInventoryItem((EntityPlayer) entity, stack.getItem(), stack.getItemDamage()); InventoryUtils.consumeInventoryItem((EntityPlayer) entity, stack.getItem(), stack.getItemDamage());
} }
} }
} }
} }
+101 -71
View File
@@ -1,11 +1,8 @@
package emt.item; package emt.item;
import baubles.api.BaubleType; import java.util.List;
import baubles.api.IBauble; import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -18,14 +15,19 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import thaumcraft.api.ThaumcraftApiHelper;
import baubles.api.BaubleType;
import baubles.api.IBauble;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import thaumcraft.api.IRunicArmor; import thaumcraft.api.IRunicArmor;
import thaumcraft.api.IWarpingGear; import thaumcraft.api.IWarpingGear;
import thaumcraft.api.ThaumcraftApiHelper;
import java.util.List;
import java.util.Random;
public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRunicArmor { public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRunicArmor {
private static final String NBT_TAG_FORGE_DATA = "EMT"; private static final String NBT_TAG_FORGE_DATA = "EMT";
private static final String NBT_TAG_MIND_CORRUPTION = "MindCorruption"; private static final String NBT_TAG_MIND_CORRUPTION = "MindCorruption";
private static final String NBT_TAG_WARP = "warp"; private static final String NBT_TAG_WARP = "warp";
@@ -60,9 +62,11 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
@Override @Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
String colourCode = ""+ EnumChatFormatting.DARK_RED; String colourCode = "" + EnumChatFormatting.DARK_RED;
list.add(colourCode+"The Ring whispers to you, promising power. But at what cost? Long-term usage is NOT advised."); list.add(
list.add(colourCode+"Can RUIN your game if you don't understand what this does. READ THE QUEST!!"); colourCode
+ "The Ring whispers to you, promising power. But at what cost? Long-term usage is NOT advised.");
list.add(colourCode + "Can RUIN your game if you don't understand what this does. READ THE QUEST!!");
super.addInformation(itemStack, player, list, par4); super.addInformation(itemStack, player, list, par4);
} }
@@ -96,10 +100,8 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
// getCompoundTag already returns the contents of "ForgeData" TagCompound. Changed this to // getCompoundTag already returns the contents of "ForgeData" TagCompound. Changed this to
// save our value in EMT Sub-Tag // save our value in EMT Sub-Tag
if (tPlayerNBT.hasKey(NBT_TAG_FORGE_DATA)) if (tPlayerNBT.hasKey(NBT_TAG_FORGE_DATA)) forgeTag = tPlayerNBT.getCompoundTag(NBT_TAG_FORGE_DATA);
forgeTag = tPlayerNBT.getCompoundTag(NBT_TAG_FORGE_DATA); else tPlayerNBT.setTag(NBT_TAG_FORGE_DATA, forgeTag);
else
tPlayerNBT.setTag(NBT_TAG_FORGE_DATA, forgeTag);
return forgeTag; return forgeTag;
} }
@@ -110,8 +112,7 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
if (stack.hasTagCompound()) { if (stack.hasTagCompound()) {
if (stack.getTagCompound().hasKey(NBT_TAG_WARP)) { if (stack.getTagCompound().hasKey(NBT_TAG_WARP)) {
tWarpLevel = stack.getTagCompound().getInteger(NBT_TAG_WARP); tWarpLevel = stack.getTagCompound().getInteger(NBT_TAG_WARP);
if (increment) if (increment) stack.getTagCompound().setInteger(NBT_TAG_WARP, ++tWarpLevel);
stack.getTagCompound().setInteger(NBT_TAG_WARP, ++tWarpLevel);
} }
} else { } else {
tWarpTag.setInteger(NBT_TAG_WARP, 0); tWarpTag.setInteger(NBT_TAG_WARP, 0);
@@ -129,14 +130,13 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
} }
// Stop doing this 20 times per second... // Stop doing this 20 times per second...
if (random.nextInt(20) > 0) if (random.nextInt(20) > 0) return;
return;
/* Why dump to a new tag when you can just grab the tag and work with it? /*
NBTTagCompound tag = new NBTTagCompound(); * Why dump to a new tag when you can just grab the tag and work with it? NBTTagCompound tag = new
((EntityPlayer) player).writeToNBT(tag); * NBTTagCompound(); ((EntityPlayer) player).writeToNBT(tag); NBTTagCompound forgeTag =
NBTTagCompound forgeTag = tag.getCompoundTag("ForgeData"); * tag.getCompoundTag("ForgeData");
*/ */
// Retrieve Players NBT Data // Retrieve Players NBT Data
@@ -145,24 +145,32 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
int corruption = 0; int corruption = 0;
// get corruption levels, init to 0 if not existing yet // get corruption levels, init to 0 if not existing yet
if (forgeTag.hasKey(NBT_TAG_MIND_CORRUPTION)) if (forgeTag.hasKey(NBT_TAG_MIND_CORRUPTION)) corruption = forgeTag.getInteger(NBT_TAG_MIND_CORRUPTION);
corruption = forgeTag.getInteger(NBT_TAG_MIND_CORRUPTION); else forgeTag.setInteger(NBT_TAG_MIND_CORRUPTION, 0);
else
forgeTag.setInteger(NBT_TAG_MIND_CORRUPTION, 0);
if (!player.worldObj.isRemote) { if (!player.worldObj.isRemote) {
//EMT.LOGGER.info( String.format( "Total Corruption: %d ItemWarpLevel: %d", corruption, getItemWarpLevel( stack, false ) )); // EMT.LOGGER.info( String.format( "Total Corruption: %d ItemWarpLevel: %d", corruption, getItemWarpLevel(
// stack, false ) ));
if (corruption == 0) { if (corruption == 0) {
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "You have worn the Ring. Your soul has now been forever " + EMTTextHelper.PURPLE + "tainted. " + EMTTextHelper.RED + EMTTextHelper.ITALIC + "Beware of wearing the ring. The tainting will only " + EMTTextHelper.RED + EMTTextHelper.ITALIC + "increase, and strange things will start happening.")); ((EntityPlayer) player).addChatMessage(
new ChatComponentText(
EMTTextHelper.PURPLE + "You have worn the Ring. Your soul has now been forever "
+ EMTTextHelper.PURPLE
+ "tainted. "
+ EMTTextHelper.RED
+ EMTTextHelper.ITALIC
+ "Beware of wearing the ring. The tainting will only "
+ EMTTextHelper.RED
+ EMTTextHelper.ITALIC
+ "increase, and strange things will start happening."));
} }
// First effect should become active after ~5 Minutes // First effect should become active after ~5 Minutes
else if (corruption > 300 && corruption < 1400 && random.nextInt(100) == 0) { else if (corruption > 300 && corruption < 1400 && random.nextInt(100) == 0) {
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "The Ring somehow feels heavy")); ((EntityPlayer) player)
if (random.nextBoolean()) .addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "The Ring somehow feels heavy"));
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 500, 2, false)); if (random.nextBoolean()) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 500, 2, false));
else else player.addPotionEffect(new PotionEffect(Potion.confusion.id, 500, 2, false));
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 500, 2, false));
} else if (corruption >= 1400 && corruption < 3800 && random.nextInt(100) == 0) { } else if (corruption >= 1400 && corruption < 3800 && random.nextInt(100) == 0) {
((EntityPlayer) player).capabilities.disableDamage = false; ((EntityPlayer) player).capabilities.disableDamage = false;
player.addPotionEffect(new PotionEffect(Potion.poison.id, 500, 2, false)); player.addPotionEffect(new PotionEffect(Potion.poison.id, 500, 2, false));
@@ -174,40 +182,60 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
player.addPotionEffect(new PotionEffect(Potion.wither.id, 100, 4, false)); player.addPotionEffect(new PotionEffect(Potion.wither.id, 100, 4, false));
} }
if (corruption >= 300) { //worn more than 5 minutes if (corruption >= 300) { // worn more than 5 minutes
if (random.nextInt(100) == 0) { //every 100 seconds if (random.nextInt(100) == 0) { // every 100 seconds
getItemWarpLevel(stack, true); getItemWarpLevel(stack, true);
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "The Ring suddenly starts to glow purple")); ((EntityPlayer) player).addChatMessage(
new ChatComponentText(EMTTextHelper.PURPLE + "The Ring suddenly starts to glow purple"));
}
if (random.nextInt(300) == 0) { // randomly every 5 minutes
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 1, false); // adds 1 perm warp
ThaumcraftApiHelper.addStickyWarpToPlayer((EntityPlayer) player, random.nextInt(1)); // adds 0-1
// sticky warp
((EntityPlayer) player).addChatMessage(
new ChatComponentText(EMTTextHelper.PURPLE + "Your body suddenly starts to glow purple"));
}
if (corruption >= 3600) { // if you wear it for more than an hour total
if (random.nextInt(300) == 0) {
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 5 + random.nextInt(5), false); // adds
// 5-10
// perm
// warp
ThaumcraftApiHelper.addStickyWarpToPlayer((EntityPlayer) player, 5 + random.nextInt(5)); // adds
// 5-10
// sticky
// warp
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 10 + random.nextInt(40), true); // adds
// 10-50
// temp
// warp,
// but
// this
// is
// ultra
// easy
// to
// remove
((EntityPlayer) player).addChatMessage(
new ChatComponentText(
EMTTextHelper.PURPLE
+ "Your body resonates with the Ring and suddenly starts to glow purple ominously"));
}
} }
if (random.nextInt(300) == 0) { //randomly every 5 minutes
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 1, false); //adds 1 perm warp
ThaumcraftApiHelper.addStickyWarpToPlayer((EntityPlayer) player, random.nextInt(1)); //adds 0-1 sticky warp
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "Your body suddenly starts to glow purple"));
}
if (corruption >= 3600) { //if you wear it for more than an hour total
if (random.nextInt(300) == 0) {
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 5 + random.nextInt(5), false); //adds 5-10 perm warp
ThaumcraftApiHelper.addStickyWarpToPlayer((EntityPlayer) player, 5 + random.nextInt(5)); //adds 5-10 sticky warp
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 10 + random.nextInt(40), true); //adds 10-50 temp warp, but this is ultra easy to remove
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "Your body resonates with the Ring and suddenly starts to glow purple ominously"));
}
}
} }
} }
forgeTag.setInteger(NBT_TAG_MIND_CORRUPTION, ++corruption); forgeTag.setInteger(NBT_TAG_MIND_CORRUPTION, ++corruption);
//tag.setTag( NBT_TAG_FORGE_DATA, forgeTag); // tag.setTag( NBT_TAG_FORGE_DATA, forgeTag);
//((EntityPlayer) player).readFromNBT(tag); // ((EntityPlayer) player).readFromNBT(tag);
} }
@Override @Override
public void onEquipped(ItemStack stack, EntityLivingBase player) { public void onEquipped(ItemStack stack, EntityLivingBase player) {
// This purges all corruption once the ring is put on / a second ring is equipped? // This purges all corruption once the ring is put on / a second ring is equipped?
/* /*
NBTTagCompound tag = new NBTTagCompound(); * NBTTagCompound tag = new NBTTagCompound(); ((EntityPlayer) player).writeToNBT(tag); tag.getCompoundTag(
((EntityPlayer) player).writeToNBT(tag); * NBT_TAG_FORGE_DATA ).setInteger( NBT_TAG_MIND_CORRUPTION, 0); ((EntityPlayer) player).readFromNBT(tag);
tag.getCompoundTag( NBT_TAG_FORGE_DATA ).setInteger( NBT_TAG_MIND_CORRUPTION, 0); */
((EntityPlayer) player).readFromNBT(tag);
*/
} }
@Override @Override
@@ -216,11 +244,10 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
if (!((EntityPlayer) player).capabilities.isCreativeMode) if (!((EntityPlayer) player).capabilities.isCreativeMode)
((EntityPlayer) player).capabilities.disableDamage = false; ((EntityPlayer) player).capabilities.disableDamage = false;
/* Wtf? Remove ForgeData tag? There are more mods using this tag than just emt! /*
((EntityPlayer) player).writeToNBT(tag); * Wtf? Remove ForgeData tag? There are more mods using this tag than just emt! ((EntityPlayer)
tag.removeTag( NBT_TAG_FORGE_DATA ); * player).writeToNBT(tag); tag.removeTag( NBT_TAG_FORGE_DATA ); ((EntityPlayer) player).readFromNBT(tag);
((EntityPlayer) player).readFromNBT(tag); */
*/
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 1, false)); player.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 1, false));
} }
@@ -231,7 +258,8 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
@Override @Override
public boolean canUnequip(ItemStack stack, EntityLivingBase player) { public boolean canUnequip(ItemStack stack, EntityLivingBase player) {
// So, how this was written, you basically could not unequip the ring for 600 ticks after you equipped it, but afterwards you could? // So, how this was written, you basically could not unequip the ring for 600 ticks after you equipped it, but
// afterwards you could?
// Let's make it a random chance to remove it instead... // Let's make it a random chance to remove it instead...
// NBTTagCompound tag = getOrSetForgeTag((EntityPlayer) player); // NBTTagCompound tag = getOrSetForgeTag((EntityPlayer) player);
@@ -239,9 +267,12 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
boolean tRet = false; boolean tRet = false;
if (random.nextInt(5) == 0) { if (random.nextInt(5) == 0) {
tRet = true; tRet = true;
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.GREEN + "You removed the Ring. Maybe you should think twice before using it next time?")); ((EntityPlayer) player).addChatMessage(
} else new ChatComponentText(
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "Nooo, don't remove me! I give you great power!")); EMTTextHelper.GREEN
+ "You removed the Ring. Maybe you should think twice before using it next time?"));
} else((EntityPlayer) player).addChatMessage(
new ChatComponentText(EMTTextHelper.PURPLE + "Nooo, don't remove me! I give you great power!"));
return tRet; return tRet;
} }
@@ -250,5 +281,4 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
public int getRunicCharge(ItemStack itemStack) { public int getRunicCharge(ItemStack itemStack) {
return 0; return 0;
} }
} }
@@ -1,14 +1,7 @@
package emt.item.armor.boots; package emt.item.armor.boots;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -24,20 +17,32 @@ import net.minecraftforge.common.ISpecialArmor;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingEvent; import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.event.entity.living.LivingFallEvent; import net.minecraftforge.event.entity.living.LivingFallEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.init.EMTItems;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
import thaumcraft.api.IRunicArmor; import thaumcraft.api.IRunicArmor;
import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.IVisDiscountGear;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.Thaumcraft; import thaumcraft.common.Thaumcraft;
import thaumcraft.common.items.armor.Hover;
import java.util.List; public class ItemElectricBootsTraveller extends ItemArmor
implements IRunicArmor, IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor {
public class ItemElectricBootsTraveller extends ItemArmor implements IRunicArmor, IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor {
public int maxCharge = 100000; public int maxCharge = 100000;
public int energyPerDamage = 1000; public int energyPerDamage = 1000;
public int visDiscount = 2; public int visDiscount = 2;
public float speedBonus = 0.055F; public float speedBonus = 0.055F;
public float jumpBonus = 0.3F; // constant from Thaumcraft's EventHandlerEntity#playerJumps for basic Traveller Boots
public float jumpBonus = 0.2750000059604645F;
public double transferLimit = 100; public double transferLimit = 100;
public ItemElectricBootsTraveller(ArmorMaterial material, int par3, int par4) { public ItemElectricBootsTraveller(ArmorMaterial material, int par3, int par4) {
@@ -68,13 +73,15 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IRunicArmor
} }
@Override @Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
int slot) {
if (source.isUnblockable()) { if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0); return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
} else { } else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio(); double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage(); int energyPerDamage = getEnergyPerDamage();
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage; double damageLimit = energyPerDamage <= 0 ? 0
: (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit); return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit);
} }
} }
@@ -115,17 +122,35 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IRunicArmor
@Override @Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
if ((!player.capabilities.isFlying) && (player.moveForward > 0.0F)) { if (!player.capabilities.isFlying && player.moveForward > 0.0F) {
if ((player.worldObj.isRemote) && (!player.isSneaking())) { if (player.worldObj.isRemote && !player.isSneaking()) {
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(player.getEntityId()))) { if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(player.getEntityId())) {
Thaumcraft.instance.entityEventHandler.prevStep.put(Integer.valueOf(player.getEntityId()), Float.valueOf(player.stepHeight)); Thaumcraft.instance.entityEventHandler.prevStep.put(player.getEntityId(), player.stepHeight);
} }
player.stepHeight = 1.0F; player.stepHeight = 1.0F;
} }
if (((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F)) { if (player.onGround) {
player.moveFlying(0F, 1F, speedBonus); float bonus = speedBonus;
player.jumpMovementFactor = jumpBonus; if (player.isInWater()) {
bonus /= 4.0F;
}
if (player.isSneaking()) {
bonus /= 2.0F;
}
player.moveFlying(0.0F, 1.0F, bonus);
} else if (Hover.getHover(player.getEntityId())) {
// Base ItemBootsTraveller jumpBonus equals to jumpBonus of Electric Boots,
// so any other boots factor can be calculated via proportion method
player.jumpMovementFactor = 0.03F
/ ((ItemElectricBootsTraveller) EMTItems.electricBootsTraveller).jumpBonus
* jumpBonus;
} else {
player.jumpMovementFactor = 0.05F
/ ((ItemElectricBootsTraveller) EMTItems.electricBootsTraveller).jumpBonus
* jumpBonus;
} }
} }
} }
@@ -136,8 +161,7 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IRunicArmor
EntityPlayer player = (EntityPlayer) event.entityLiving; EntityPlayer player = (EntityPlayer) event.entityLiving;
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this; boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
if (hasArmor) if (hasArmor) player.motionY += jumpBonus;
player.motionY += jumpBonus;
} }
} }
@@ -155,17 +179,22 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IRunicArmor
if ((EMT.instance.isSimulating()) && ((event.entity instanceof EntityLivingBase))) { if ((EMT.instance.isSimulating()) && ((event.entity instanceof EntityLivingBase))) {
if (event.entity instanceof EntityPlayer) { if (event.entity instanceof EntityPlayer) {
EntityPlayer entity = (EntityPlayer) event.entity; EntityPlayer entity = (EntityPlayer) event.entity;
if ((entity.inventory.armorInventory[0] != null) && (entity.inventory.armorInventory[0].getItem() instanceof ItemElectricBootsTraveller)) { if ((entity.inventory.armorInventory[0] != null)
ItemElectricBootsTraveller tUsedBoots = (ItemElectricBootsTraveller) entity.inventory.armorInventory[0].getItem(); && (entity.inventory.armorInventory[0].getItem() instanceof ItemElectricBootsTraveller)) {
ItemElectricBootsTraveller tUsedBoots = (ItemElectricBootsTraveller) entity.inventory.armorInventory[0]
.getItem();
ItemStack stack = entity.inventory.armorInventory[0]; ItemStack stack = entity.inventory.armorInventory[0];
// Check if we dropped the minimum amount; To cover the jump-boost bonus without penalty // Check if we dropped the minimum amount; To cover the jump-boost bonus without penalty
if (tUsedBoots.getMinimumDropDist() > event.distance) { if (tUsedBoots.getMinimumDropDist() > event.distance) {
event.setCanceled(true); event.setCanceled(true);
} else { } else {
float tEnergyDemand = tUsedBoots.energyPerDamage * (((event.distance > tUsedBoots.getMaxHealthyDropDist()) ? event.distance * 3 : event.distance) - 4.0F); float tEnergyDemand = tUsedBoots.energyPerDamage
* (((event.distance > tUsedBoots.getMaxHealthyDropDist()) ? event.distance * 3
: event.distance) - 4.0F);
if (tEnergyDemand <= ElectricItem.manager.getCharge(stack)) { if (tEnergyDemand <= ElectricItem.manager.getCharge(stack)) {
//EMT.LOGGER.info( String.format("FD: %f DMG: %f EPD: %d HDD: %f", event.distance, tEnergyDemand, tUsedBoots.energyPerDamage, tUsedBoots.getMaxHealthyDropDist() )); // EMT.LOGGER.info( String.format("FD: %f DMG: %f EPD: %d HDD: %f", event.distance,
// tEnergyDemand, tUsedBoots.energyPerDamage, tUsedBoots.getMaxHealthyDropDist() ));
ElectricItem.manager.discharge(stack, tEnergyDemand, Integer.MAX_VALUE, true, false, false); ElectricItem.manager.discharge(stack, tEnergyDemand, Integer.MAX_VALUE, true, false, false);
event.setCanceled(true); event.setCanceled(true);
} }
@@ -1,12 +1,13 @@
package emt.item.armor.boots; package emt.item.armor.boots;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT; import emt.EMT;
import emt.util.EMTConfigHandler; import emt.util.EMTConfigHandler;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller { public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller {
@@ -1,12 +1,13 @@
package emt.item.armor.boots; package emt.item.armor.boots;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT; import emt.EMT;
import emt.util.EMTConfigHandler; import emt.util.EMTConfigHandler;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller { public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller {
@@ -1,20 +1,9 @@
package emt.item.armor.chestplate; package emt.item.armor.chestplate;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import java.util.ArrayList;
import cpw.mods.fml.relauncher.Side; import java.util.Collection;
import cpw.mods.fml.relauncher.SideOnly; import java.util.List;
import emt.EMT;
import emt.client.model.ModelSpecialArmor;
import emt.init.EMTItems;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IC2Items;
import ic2.core.IC2;
import ic2.core.audio.AudioSource;
import ic2.core.audio.PositionSpec;
import ic2.core.init.InternalName;
import ic2.core.item.armor.ItemArmorElectric;
import ic2.core.util.StackUtil;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -31,11 +20,23 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingFallEvent; import net.minecraftforge.event.entity.living.LivingFallEvent;
import thaumcraft.api.IRunicArmor;
import java.util.ArrayList; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import java.util.Collection; import cpw.mods.fml.relauncher.Side;
import java.util.List; import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.client.model.ModelSpecialArmor;
import emt.init.EMTItems;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IC2Items;
import ic2.core.IC2;
import ic2.core.audio.AudioSource;
import ic2.core.audio.PositionSpec;
import ic2.core.init.InternalName;
import ic2.core.item.armor.ItemArmorElectric;
import ic2.core.util.StackUtil;
import thaumcraft.api.IRunicArmor;
public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements IRunicArmor { public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements IRunicArmor {
@@ -172,11 +173,15 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
if (currentItem == IC2Items.getItem("electricJetpack").getItem()) { if (currentItem == IC2Items.getItem("electricJetpack").getItem()) {
IC2.platform.messagePlayer(player, "Jetpack enabled.", new Object[0]); IC2.platform.messagePlayer(player, "Jetpack enabled.", new Object[0]);
nbt.setByte("wing", JETPACK); nbt.setByte("wing", JETPACK);
//int charge = (int) ElectricItem.manager.getCharge(itemStack); // int charge = (int) ElectricItem.manager.getCharge(itemStack);
//if (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < 30000) { // if (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < 30000) {
// ElectricItem.manager.use(itemStack, 30000 - ElectricItem.manager.getCharge(currentStack), player); // ElectricItem.manager.use(itemStack, 30000 - ElectricItem.manager.getCharge(currentStack),
//} // player);
nbt.setInteger("jetpackCharge", (int) (ElectricItem.manager.getCharge(currentStack)/* + charge - (int) ElectricItem.manager.getCharge(itemStack))*/)); // }
nbt.setInteger(
"jetpackCharge",
(int) (ElectricItem.manager.getCharge(
currentStack) /* + charge - (int) ElectricItem.manager.getCharge(itemStack)) */));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null); player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
} else if (currentItem == EMTItems.thaumiumWing) { } else if (currentItem == EMTItems.thaumiumWing) {
IC2.platform.messagePlayer(player, "Thaumium wings enabled.", new Object[0]); IC2.platform.messagePlayer(player, "Thaumium wings enabled.", new Object[0]);
@@ -185,20 +190,31 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
} else if (currentItem == EMTItems.nanoWing) { } else if (currentItem == EMTItems.nanoWing) {
IC2.platform.messagePlayer(player, "Nano wings enabled.", new Object[0]); IC2.platform.messagePlayer(player, "Nano wings enabled.", new Object[0]);
nbt.setByte("wing", NANO); nbt.setByte("wing", NANO);
//int charge = (int) ElectricItem.manager.getCharge(itemStack); // int charge = (int) ElectricItem.manager.getCharge(itemStack);
//if (ElectricItem.manager.getCharge(currentStack) < ItemNanoWing.maxCharge) { // if (ElectricItem.manager.getCharge(currentStack) < ItemNanoWing.maxCharge) {
// ElectricItem.manager.use(itemStack, ItemNanoWing.maxCharge - ElectricItem.manager.getCharge(currentStack), player); // ElectricItem.manager.use(itemStack, ItemNanoWing.maxCharge -
//} // ElectricItem.manager.getCharge(currentStack), player);
nbt.setInteger("NWCharge", (int) (ElectricItem.manager.getCharge(player.inventory.getCurrentItem())/* + charge - (int) ElectricItem.manager.getCharge(itemStack)*/)); // }
nbt.setInteger(
"NWCharge",
(int) (ElectricItem.manager.getCharge(
player.inventory.getCurrentItem()) /*
* + charge - (int)
* ElectricItem.manager.getCharge(itemStack)
*/));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null); player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
} else if (currentItem == EMTItems.quantumWing) { } else if (currentItem == EMTItems.quantumWing) {
IC2.platform.messagePlayer(player, "Quantum wings enabled.", new Object[0]); IC2.platform.messagePlayer(player, "Quantum wings enabled.", new Object[0]);
nbt.setByte("wing", QUANTUM); nbt.setByte("wing", QUANTUM);
//int charge = (int) ElectricItem.manager.getCharge(itemStack); // int charge = (int) ElectricItem.manager.getCharge(itemStack);
//if (ElectricItem.manager.getCharge(currentStack) < ItemQuantumWing.maxCharge) { // if (ElectricItem.manager.getCharge(currentStack) < ItemQuantumWing.maxCharge) {
// ElectricItem.manager.use(itemStack, ItemQuantumWing.maxCharge - ElectricItem.manager.getCharge(currentStack), player); // ElectricItem.manager.use(itemStack, ItemQuantumWing.maxCharge -
//} // ElectricItem.manager.getCharge(currentStack), player);
nbt.setInteger("QWCharge", (int) (ElectricItem.manager.getCharge(currentStack)/* + charge - (int) ElectricItem.manager.getCharge(itemStack)*/)); // }
nbt.setInteger(
"QWCharge",
(int) (ElectricItem.manager.getCharge(
currentStack) /* + charge - (int) ElectricItem.manager.getCharge(itemStack) */));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null); player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
} }
} }
@@ -212,15 +228,16 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
ItemStack charged = new ItemStack(IC2Items.getItem("electricJetpack").getItem()); ItemStack charged = new ItemStack(IC2Items.getItem("electricJetpack").getItem());
if (nbt.getInteger("jetpackCharge") > 0) if (nbt.getInteger("jetpackCharge") > 0)
ElectricItem.manager.charge(charged, nbt.getInteger("jetpackCharge"), 1, true, false); ElectricItem.manager.charge(charged, nbt.getInteger("jetpackCharge"), 1, true, false);
else else ElectricItem.manager.charge(charged, 0, 1, true, false);
ElectricItem.manager.charge(charged, 0, 1, true, false);
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged); player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
} }
if (wing == THAUMIUM) { if (wing == THAUMIUM) {
IC2.platform.messagePlayer(player, "Thaumium wings disabled.", new Object[0]); IC2.platform.messagePlayer(player, "Thaumium wings disabled.", new Object[0]);
nbt.setByte("wing", NONE); nbt.setByte("wing", NONE);
player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(EMTItems.thaumiumWing)); player.inventory.setInventorySlotContents(
player.inventory.currentItem,
new ItemStack(EMTItems.thaumiumWing));
} }
if (wing == NANO) { if (wing == NANO) {
@@ -229,8 +246,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
ItemStack charged = new ItemStack(EMTItems.nanoWing); ItemStack charged = new ItemStack(EMTItems.nanoWing);
if (nbt.getInteger("NWCharge") > 0) if (nbt.getInteger("NWCharge") > 0)
ElectricItem.manager.charge(charged, nbt.getInteger("NWCharge"), 3, true, false); ElectricItem.manager.charge(charged, nbt.getInteger("NWCharge"), 3, true, false);
else else ElectricItem.manager.charge(charged, 0, 3, true, false);
ElectricItem.manager.charge(charged, 0, 3, true, false);
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged); player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
} }
@@ -240,8 +256,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
ItemStack charged = new ItemStack(EMTItems.quantumWing); ItemStack charged = new ItemStack(EMTItems.quantumWing);
if (nbt.getInteger("QWCharge") > 0) if (nbt.getInteger("QWCharge") > 0)
ElectricItem.manager.charge(charged, nbt.getInteger("QWCharge"), 3, true, false); ElectricItem.manager.charge(charged, nbt.getInteger("QWCharge"), 3, true, false);
else else ElectricItem.manager.charge(charged, 0, 3, true, false);
ElectricItem.manager.charge(charged, 0, 3, true, false);
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged); player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
} }
} }
@@ -249,16 +264,14 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
nbt.setBoolean("unequip", false); nbt.setBoolean("unequip", false);
} }
if ((IC2.keyboard.isJumpKeyDown(player) && wing == JETPACK) || (hoverMode && player.motionY < -0.029999999329447746D)) { if ((IC2.keyboard.isJumpKeyDown(player) && wing == JETPACK)
|| (hoverMode && player.motionY < -0.029999999329447746D)) {
jetpackUsed = useJetpack(player, hoverMode, itemStack); jetpackUsed = useJetpack(player, hoverMode, itemStack);
} }
if (wing == THAUMIUM) if (wing == THAUMIUM) useWings(player, itemStack, world, 0.15f, 0.7f, 0.5f, 0, false);
useWings(player, itemStack, world, 0.15f, 0.7f, 0.5f, 0, false); if (wing == NANO) useWings(player, itemStack, world, 0.25f, 0.6f, 0.3f, 5, true);
if (wing == NANO) if (wing == QUANTUM) useWings(player, itemStack, world, 0.33f, 0.5f, 0.2f, 7, true);
useWings(player, itemStack, world, 0.25f, 0.6f, 0.3f, 5, true);
if (wing == QUANTUM)
useWings(player, itemStack, world, 0.33f, 0.5f, 0.2f, 7, true);
if (IC2.platform.isSimulating() && toggleTimer > 0) { if (IC2.platform.isSimulating() && toggleTimer > 0) {
toggleTimer = (byte) (toggleTimer - 1); toggleTimer = (byte) (toggleTimer - 1);
@@ -268,7 +281,13 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
if (lastJetpackUsed != jetpackUsed) { if (lastJetpackUsed != jetpackUsed) {
if (jetpackUsed) { if (jetpackUsed) {
if (audioSource == null) { if (audioSource == null) {
audioSource = IC2.audioManager.createSource(player, PositionSpec.Backpack, "Tools/Jetpack/JetpackLoop.ogg", true, false, IC2.audioManager.getDefaultVolume()); audioSource = IC2.audioManager.createSource(
player,
PositionSpec.Backpack,
"Tools/Jetpack/JetpackLoop.ogg",
true,
false,
IC2.audioManager.getDefaultVolume());
} }
if (audioSource != null) { if (audioSource != null) {
audioSource.play(); audioSource.play();
@@ -340,10 +359,8 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
@Override @Override
public int getItemEnchantability() { public int getItemEnchantability() {
if (EMTConfigHandler.enchanting == false) if (EMTConfigHandler.enchanting == false) return 0;
return 0; else return 4;
else
return 4;
} }
@Override @Override
@@ -407,7 +424,8 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
} }
if (((float) ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge) <= dropPercentage) { if (((float) ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge) <= dropPercentage) {
power = (float) (power * (ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge) * dropPercentage); power = (float) (power * (ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge)
* dropPercentage);
} }
if (IC2.keyboard.isForwardKeyDown(player)) { if (IC2.keyboard.isForwardKeyDown(player)) {
@@ -464,7 +482,8 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
return true; return true;
} }
void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount, boolean isElectric) { void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1,
int amount, boolean isElectric) {
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack); NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
boolean isJumping = IC2.keyboard.isJumpKeyDown(player); boolean isJumping = IC2.keyboard.isJumpKeyDown(player);
nbt.setBoolean("isJumping", isJumping); nbt.setBoolean("isJumping", isJumping);
@@ -473,10 +492,8 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
byte f = nbt.getByte("f"); byte f = nbt.getByte("f");
nbt.setBoolean("isHolding", true); nbt.setBoolean("isHolding", true);
if (IC2.keyboard.isSneakKeyDown(player)) if (IC2.keyboard.isSneakKeyDown(player)) nbt.setByte("f", (byte) (0));
nbt.setByte("f", (byte) (0)); else nbt.setByte("f", (byte) (f + 1));
else
nbt.setByte("f", (byte) (f + 1));
if (f > 7) { if (f > 7) {
nbt.setByte("f", (byte) 7); nbt.setByte("f", (byte) 7);
@@ -499,7 +516,14 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1); world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1);
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
world.spawnParticle("cloud", player.posX - 1 + (world.rand.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (world.rand.nextInt(100) / 50d), 0, -0.5, 0); world.spawnParticle(
"cloud",
player.posX - 1 + (world.rand.nextInt(100) / 50d),
player.posY - 1,
player.posZ - 1 + (world.rand.nextInt(100) / 50d),
0,
-0.5,
0);
} }
} }
@@ -519,7 +543,10 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
int playerY = MathHelper.floor_double(player.posY); int playerY = MathHelper.floor_double(player.posY);
int playerZ = MathHelper.floor_double(player.posZ); int playerZ = MathHelper.floor_double(player.posZ);
if ((world.getBiomeGenForCoords(playerX, playerZ)).canSpawnLightningBolt() && world.canBlockSeeTheSky(playerX, playerY, playerZ) && world.isRaining() && !player.capabilities.isCreativeMode) { if ((world.getBiomeGenForCoords(playerX, playerZ)).canSpawnLightningBolt()
&& world.canBlockSeeTheSky(playerX, playerY, playerZ)
&& world.isRaining()
&& !player.capabilities.isCreativeMode) {
player.motionY += -0.05; player.motionY += -0.05;
} }
} }
@@ -537,4 +564,4 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
public int getRunicCharge(ItemStack itemStack) { public int getRunicCharge(ItemStack itemStack) {
return 0; return 0;
} }
} }
@@ -1,13 +1,7 @@
package emt.item.armor.goggles; package emt.item.armor.goggles;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -20,15 +14,23 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor; import net.minecraftforge.common.ISpecialArmor;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
import thaumcraft.api.IGoggles; import thaumcraft.api.IGoggles;
import thaumcraft.api.IRunicArmor; import thaumcraft.api.IRunicArmor;
import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.IVisDiscountGear;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.nodes.IRevealer; import thaumcraft.api.nodes.IRevealer;
import java.util.List; public class ItemElectricGoggles extends ItemArmor
implements IRunicArmor, IElectricItem, IVisDiscountGear, IGoggles, IRevealer, IMetalArmor, ISpecialArmor {
public class ItemElectricGoggles extends ItemArmor implements IRunicArmor, IElectricItem, IVisDiscountGear, IGoggles, IRevealer, IMetalArmor, ISpecialArmor {
public double maxCharge = 100000; public double maxCharge = 100000;
public double transferLimit = 100; public double transferLimit = 100;
@@ -53,8 +55,7 @@ public class ItemElectricGoggles extends ItemArmor implements IRunicArmor, IElec
} }
@Override @Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {}
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
@@ -113,13 +114,15 @@ public class ItemElectricGoggles extends ItemArmor implements IRunicArmor, IElec
} }
@Override @Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
int slot) {
if (source.isUnblockable()) { if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0); return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
} else { } else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio(); double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage(); int energyPerDamage = getEnergyPerDamage();
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage; double damageLimit = energyPerDamage <= 0 ? 0
: (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit); return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit);
} }
} }
@@ -1,15 +1,16 @@
package emt.item.armor.goggles; package emt.item.armor.goggles;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.IC2Items;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.IC2Items;
public class ItemNanoGoggles extends ItemElectricGoggles { public class ItemNanoGoggles extends ItemElectricGoggles {
public ItemNanoGoggles(ArmorMaterial material, int renderIndex, int armorType) { public ItemNanoGoggles(ArmorMaterial material, int renderIndex, int armorType) {
@@ -1,11 +1,10 @@
package emt.item.armor.goggles; package emt.item.armor.goggles;
import cpw.mods.fml.relauncher.Side; import java.lang.reflect.Field;
import cpw.mods.fml.relauncher.SideOnly; import java.util.HashMap;
import emt.EMT; import java.util.Map;
import ic2.api.item.IC2Items; import java.util.Set;
import ic2.core.IC2;
import ic2.core.util.Keyboard;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -13,11 +12,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.lang.reflect.Field; import cpw.mods.fml.relauncher.Side;
import java.util.HashMap; import cpw.mods.fml.relauncher.SideOnly;
import java.util.Map; import emt.EMT;
import java.util.Set; import ic2.api.item.IC2Items;
import ic2.core.IC2;
import ic2.core.util.Keyboard;
public class ItemQuantumGoggles extends ItemNanoGoggles { public class ItemQuantumGoggles extends ItemNanoGoggles {
@@ -1,10 +1,8 @@
package emt.item.armor.goggles; package emt.item.armor.goggles;
import cpw.mods.fml.relauncher.Side; import java.util.HashMap;
import cpw.mods.fml.relauncher.SideOnly; import java.util.Map;
import emt.EMT;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -12,18 +10,19 @@ import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.HashMap; import cpw.mods.fml.relauncher.Side;
import java.util.Map; import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
public class ItemSolarHelmetRevealing extends ItemQuantumGoggles { public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
private static final Map potionCost = new HashMap(); private static final Map potionCost = new HashMap();
/*private int ticker; /*
private int generating; * private int ticker; private int generating; private boolean sunIsUp; private boolean skyIsVisible; private
private boolean sunIsUp; * boolean noSunWorld; private boolean dampPlace;
private boolean skyIsVisible; */
private boolean noSunWorld;
private boolean dampPlace;*/
private int genDay; private int genDay;
private int genNight; private int genNight;
@@ -34,8 +33,8 @@ public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
this.setMaxStackSize(1); this.setMaxStackSize(1);
this.setCreativeTab(EMT.TAB); this.setCreativeTab(EMT.TAB);
// this.maxCharge = 20000000; //REALLY? // this.maxCharge = 20000000; //REALLY?
this.genDay = 65536; this.genDay = 2048;
this.genNight = 4096; this.genNight = 128;
maxCharge = 20000000; maxCharge = 20000000;
visDiscount = 8; visDiscount = 8;
tier = 4; tier = 4;
@@ -76,13 +75,16 @@ public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
return; return;
} }
if (worldObj.canBlockSeeTheSky((int) player.posX, (int) player.posY + 1, (int) player.posZ) && !worldObj.isRaining()) { if (worldObj.canBlockSeeTheSky((int) player.posX, (int) player.posY + 1, (int) player.posZ)
double enerj = (worldObj.isDaytime() ? (double) genDay : (double) genNight) / 12000D; && !worldObj.isRaining()) {
double enerj = worldObj.isDaytime() ? (double) genDay : (double) genNight;
for (int i = 0; i < player.inventory.armorInventory.length; i++) { for (int i = 0; i < player.inventory.armorInventory.length; i++) {
if (enerj > 0) { if (enerj > 0) {
if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) { if ((player.inventory.armorInventory[i] != null)
double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], enerj, 4, false, false); && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager
.charge(player.inventory.armorInventory[i], enerj, 4, false, false);
enerj -= sentPacket; enerj -= sentPacket;
} }
} else { } else {
@@ -91,8 +93,10 @@ public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
} }
for (int j = 0; j < player.inventory.mainInventory.length; j++) { for (int j = 0; j < player.inventory.mainInventory.length; j++) {
if (enerj > 0) { if (enerj > 0) {
if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) { if ((player.inventory.mainInventory[j] != null)
double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], enerj, 4, false, false); && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager
.charge(player.inventory.mainInventory[j], enerj, 4, false, false);
enerj -= sentPacket; enerj -= sentPacket;
} }
} else { } else {
@@ -1,13 +1,5 @@
package emt.item.armor.wings; package emt.item.armor.wings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.client.model.ModelWings;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.core.IC2;
import ic2.core.util.StackUtil;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -17,9 +9,19 @@ import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.client.model.ModelWings;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.core.IC2;
import ic2.core.util.StackUtil;
import thaumcraft.api.IRunicArmor; import thaumcraft.api.IRunicArmor;
public class ItemFeatherWing extends ItemArmor implements IRunicArmor { public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
public int visDiscount = 0; public int visDiscount = 0;
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) { public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
@@ -66,7 +68,8 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
useWings(player, stack, world, 0.11f, 0.9f, 0.9f, 0); useWings(player, stack, world, 0.11f, 0.9f, 0.9f, 0);
} }
public void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount) { public void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1,
int amount) {
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack); NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
boolean isJmuping = nbtData.getBoolean("isJumping"); boolean isJmuping = nbtData.getBoolean("isJumping");
@@ -77,12 +80,9 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
if (isJmuping) { if (isJmuping) {
byte f = nbtData.getByte("f"); byte f = nbtData.getByte("f");
nbtData.setBoolean("isHolding", true); nbtData.setBoolean("isHolding", true);
if (IC2.keyboard.isSneakKeyDown(player)) if (IC2.keyboard.isSneakKeyDown(player)) nbtData.setByte("f", (byte) (0));
nbtData.setByte("f", (byte) (0)); else nbtData.setByte("f", (byte) (f + 1));
else if (f > 7) nbtData.setByte("f", (byte) 7);
nbtData.setByte("f", (byte) (f + 1));
if (f > 7)
nbtData.setByte("f", (byte) 7);
} else if (isHolding) { } else if (isHolding) {
byte f = nbtData.getByte("f"); byte f = nbtData.getByte("f");
nbtData.setBoolean("isHolding", false); nbtData.setBoolean("isHolding", false);
@@ -95,7 +95,14 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
} }
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1); world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1);
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
world.spawnParticle("cloud", player.posX - 1 + (world.rand.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (world.rand.nextInt(100) / 50d), 0, -0.5, 0); world.spawnParticle(
"cloud",
player.posX - 1 + (world.rand.nextInt(100) / 50d),
player.posY - 1,
player.posZ - 1 + (world.rand.nextInt(100) / 50d),
0,
-0.5,
0);
} }
} }
nbtData.setByte("f", (byte) 0); nbtData.setByte("f", (byte) 0);
@@ -110,7 +117,10 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
} }
if (EMTConfigHandler.impactOfRain) { if (EMTConfigHandler.impactOfRain) {
if ((world.getBiomeGenForCoords((int) player.posX, (int) player.posZ)).canSpawnLightningBolt() && world.canBlockSeeTheSky((int) player.posX, (int) player.posY, (int) player.posZ) && world.isRaining() && !player.capabilities.isCreativeMode) { if ((world.getBiomeGenForCoords((int) player.posX, (int) player.posZ)).canSpawnLightningBolt()
&& world.canBlockSeeTheSky((int) player.posX, (int) player.posY, (int) player.posZ)
&& world.isRaining()
&& !player.capabilities.isCreativeMode) {
player.motionY += -0.03; player.motionY += -0.03;
} }
} }
@@ -1,12 +1,7 @@
package emt.item.armor.wings; package emt.item.armor.wings;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -19,7 +14,13 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor; import net.minecraftforge.common.ISpecialArmor;
import java.util.List; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectricItem, ISpecialArmor, IMetalArmor { public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectricItem, ISpecialArmor, IMetalArmor {
@@ -104,13 +105,15 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
} }
@Override @Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
int slot) {
if (source.isUnblockable()) { if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3); return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
} else { } else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio(); double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage(); int energyPerDamage = getEnergyPerDamage();
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage; double damageLimit = energyPerDamage <= 0 ? 0
: (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit); return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
} }
} }
@@ -1,15 +1,17 @@
package emt.item.armor.wings; package emt.item.armor.wings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
public class ItemQuantumWing extends ItemNanoWing { public class ItemQuantumWing extends ItemNanoWing {
public static int maxCharge = 10000000; public static int maxCharge = 10000000;
public int tier = 4; public int tier = 4;
@@ -1,20 +1,21 @@
package emt.item.armor.wings; package emt.item.armor.wings;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import thaumcraft.api.IRepairable; import thaumcraft.api.IRepairable;
import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.IVisDiscountGear;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import java.util.List;
public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisDiscountGear, IRepairable { public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisDiscountGear, IRepairable {
public ItemThaumiumReinforcedWing(ArmorMaterial material, int par3, int par4) { public ItemThaumiumReinforcedWing(ArmorMaterial material, int par3, int par4) {
@@ -1,7 +1,5 @@
package emt.item.block; package emt.item.block;
import emt.EMT;
import emt.util.EMTTextHelper;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
@@ -9,6 +7,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import emt.EMT;
import emt.util.EMTTextHelper;
public class ItemBlockElectricCloud extends ItemBlock { public class ItemBlockElectricCloud extends ItemBlock {
public IIcon icon; public IIcon icon;
@@ -29,6 +30,7 @@ public class ItemBlockElectricCloud extends ItemBlock {
@Override @Override
public String getItemStackDisplayName(ItemStack stack) { public String getItemStackDisplayName(ItemStack stack) {
return EMTTextHelper.PURPLE + EMTTextHelper.BOLD + StatCollector.translateToLocal(getUnlocalizedName() + ".name"); return EMTTextHelper.PURPLE + EMTTextHelper.BOLD
+ StatCollector.translateToLocal(getUnlocalizedName() + ".name");
} }
} }
@@ -1,18 +1,20 @@
package emt.item.block; package emt.item.block;
import emt.util.EMTConfigHandler; import java.util.List;
import emt.util.EMTEssentiasOutputs;
import emt.util.EMTTextHelper;
import gregtech.api.enums.GT_Values;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard;
import thaumcraft.api.aspects.Aspect;
import java.util.List; import org.lwjgl.input.Keyboard;
import emt.util.EMTConfigHandler;
import emt.util.EMTEssentiasOutputs;
import emt.util.EMTTextHelper;
import gregtech.api.enums.GT_Values;
import thaumcraft.api.aspects.Aspect;
public class ItemBlockEssentiaGenerators extends ItemBlock { public class ItemBlockEssentiaGenerators extends ItemBlock {
@@ -63,46 +65,145 @@ public class ItemBlockEssentiaGenerators extends ItemBlock {
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
switch (is.getItemDamage()) { switch (is.getItemDamage()) {
case 0: case 0:
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating") + EMTTextHelper.LIGHT_GRAY + Integer.toString((int) (EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag()) / 20 / 20)) + " EU/t"); list.add(
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output") + EMTTextHelper.LIGHT_GRAY + "128 EU/t @ " + getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag())) + " A"); EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
list.add(EMTTextHelper.BRIGHT_GREEN + StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu") + ": " + EMTTextHelper.LIGHT_GRAY + Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag()))) + " EU"); + EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag()) / 20 / 20))
+ " EU/t");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY
+ "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag()))
+ " A");
list.add(
EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag())))
+ " EU");
break; break;
case 1: case 1:
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating") + EMTTextHelper.LIGHT_GRAY + Integer.toString((int) (EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()) / 20 / 20)) + " EU/t"); list.add(
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output") + EMTTextHelper.LIGHT_GRAY + "128 EU/t @ " + getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag())) + " A"); EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
list.add(EMTTextHelper.BRIGHT_GREEN + StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu") + ": " + EMTTextHelper.LIGHT_GRAY + Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()))) + " EU"); + EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()) / 20 / 20))
+ " EU/t");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY
+ "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()))
+ " A");
list.add(
EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag())))
+ " EU");
break; break;
case 2: case 2:
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating") + EMTTextHelper.LIGHT_GRAY + Integer.toString((int) (EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag()) / 20 / 20)) + " EU/t"); list.add(
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output") + EMTTextHelper.LIGHT_GRAY + "128 EU/t @ " + getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag())) + " A"); EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
list.add(EMTTextHelper.BRIGHT_GREEN + StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu") + ": " + EMTTextHelper.LIGHT_GRAY + Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag()))) + " EU"); + EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag()) / 20 / 20))
+ " EU/t");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY
+ "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag()))
+ " A");
list.add(
EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag())))
+ " EU");
break; break;
case 3: case 3:
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating") + EMTTextHelper.LIGHT_GRAY + Integer.toString((int) (EMTEssentiasOutputs.outputs.get(Aspect.TREE.getTag()) / 20 / 20)) + " EU/t"); list.add(
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output") + EMTTextHelper.LIGHT_GRAY + "128 EU/t @ " + getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.TREE.getTag())) + " A"); EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
list.add(EMTTextHelper.BRIGHT_GREEN + StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu") + ": " + EMTTextHelper.LIGHT_GRAY + Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()))) + " EU"); + EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.TREE.getTag()) / 20 / 20))
+ " EU/t");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY
+ "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.TREE.getTag()))
+ " A");
list.add(
EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag())))
+ " EU");
break; break;
case 4: case 4:
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating") + EMTTextHelper.LIGHT_GRAY + Integer.toString((int) (EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag()) / 20 / 20)) + " EU/t"); list.add(
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output") + EMTTextHelper.LIGHT_GRAY + "128 EU/t @ " + getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag())) + " A"); EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
list.add(EMTTextHelper.BRIGHT_GREEN + StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu") + ": " + EMTTextHelper.LIGHT_GRAY + Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag()))) + " EU"); + EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag()) / 20 / 20))
+ " EU/t");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY
+ "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag()))
+ " A");
list.add(
EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag())))
+ " EU");
break; break;
case 5: case 5:
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating") + EMTTextHelper.LIGHT_GRAY + Integer.toString((int) (EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag()) / 20 / 20)) + " EU/t"); list.add(
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output") + EMTTextHelper.LIGHT_GRAY + "128 EU/t @ " + getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag())) + " A"); EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Generating")
list.add(EMTTextHelper.BRIGHT_GREEN + StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu") + ": " + EMTTextHelper.LIGHT_GRAY + Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag()))) + " EU"); + EMTTextHelper.LIGHT_GRAY
+ Integer.toString(
(int) (EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag()) / 20 / 20))
+ " EU/t");
list.add(
EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.Output")
+ EMTTextHelper.LIGHT_GRAY
+ "128 EU/t @ "
+ getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag()))
+ " A");
list.add(
EMTTextHelper.BRIGHT_GREEN
+ StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag())))
+ " EU");
break; break;
default: default:
break; break;
} }
list.add(EMTTextHelper.YELLOW + StatCollector.translateToLocal("emt.Storage") + EMTTextHelper.LIGHT_GRAY + Double.toString(EMTConfigHandler.EssentiaGeneratorStorage) + " EU"); list.add(
} else EMTTextHelper.YELLOW + StatCollector.translateToLocal("emt.Storage")
list.add(StatCollector.translateToLocal("emt.PressShift")); + EMTTextHelper.LIGHT_GRAY
+ Double.toString(EMTConfigHandler.EssentiaGeneratorStorage)
+ " EU");
} else list.add(StatCollector.translateToLocal("emt.PressShift"));
} }
} }
@@ -1,12 +1,12 @@
package emt.item.block; package emt.item.block;
import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import java.util.List;
public class ItemBlockMachines extends ItemBlock { public class ItemBlockMachines extends ItemBlock {
public ItemBlockMachines(Block id) { public ItemBlockMachines(Block id) {
@@ -54,6 +54,5 @@ public class ItemBlockMachines extends ItemBlock {
p_77624_3_.add("Added by bartimaeusnek"); p_77624_3_.add("Added by bartimaeusnek");
} }
} }
} }
} }
+515 -194
View File
@@ -1,24 +1,27 @@
package emt.item.block; package emt.item.block;
import static emt.util.EMTTextHelper.localize;
import static gregtech.api.util.GT_Utility.formatNumbers;
import java.io.StringReader;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.util.StringTranslate;
import org.apache.commons.io.input.ReaderInputStream;
import org.lwjgl.input.Keyboard;
import emt.EMT; import emt.EMT;
import emt.block.BlockBaseContainer; import emt.block.BlockBaseContainer;
import emt.tile.solar.Solars; import emt.tile.solar.Solars;
import emt.tile.solar.TileEntitySolarBase; import emt.tile.solar.TileEntitySolarBase;
import emt.util.EMTConfigHandler; import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper; import emt.util.EMTTextHelper;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.util.StringTranslate;
import org.apache.commons.io.input.ReaderInputStream;
import org.lwjgl.input.Keyboard;
import java.io.StringReader;
import java.util.List;
import static emt.util.EMTTextHelper.localize;
public class ItemBlockSolars extends ItemBlock { public class ItemBlockSolars extends ItemBlock {
@@ -32,113 +35,14 @@ public class ItemBlockSolars extends ItemBlock {
@Override @Override
public String getUnlocalizedName(ItemStack itemstack) { public String getUnlocalizedName(ItemStack itemstack) {
String name = ""; final String solarName = Solars.getNameFromSolar(this.instance, itemstack.getItemDamage());
final String unlocalizedName = "tile." + EMT.MOD_ID
if (instance == 0) { + "."
switch (itemstack.getItemDamage()) { + Solars.getUnlocalizedName(this.instance, itemstack.getItemDamage());
case 0: { final String unlocalizedKey = unlocalizedName + ".name";
name = "compressed"; if (!StatCollector.canTranslate(unlocalizedKey))
break; StringTranslate.inject(new ReaderInputStream(new StringReader(unlocalizedKey + "=" + solarName)));
} return unlocalizedName;
case 1: {
name = "doublecompressed";
break;
}
case 2: {
name = "triplecompressed";
break;
}
case 3: {
name = "water";
break;
}
case 4: {
name = "doublewater";
break;
}
case 5: {
name = "triplewater";
break;
}
case 6: {
name = "dark";
break;
}
case 7: {
name = "doubledark";
break;
}
case 8: {
name = "tripledark";
break;
}
case 9: {
name = "order";
break;
}
case 10: {
name = "doubleorder";
break;
}
case 11: {
name = "tripleorder";
break;
}
case 12: {
name = "fire";
break;
}
case 13: {
name = "doublefire";
break;
}
case 14: {
name = "triplefire";
break;
}
case 15: {
name = "air";
break;
}
default:
name = "nothing";
break;
}
} else if (instance == 1) {
switch (itemstack.getItemDamage()) {
case 0: {
name = "doubleair";
break;
}
case 1: {
name = "tripleair";
break;
}
case 2: {
name = "earth";
break;
}
case 3: {
name = "doubleearth";
break;
}
case 4: {
name = "tripleearth";
break;
}
default:
name = "nothing";
break;
}
} else {
name = Solars.getNameFromSolar(this.instance, itemstack.getItemDamage());
if (!StatCollector.canTranslate("tile." + EMT.MOD_ID + "." + name.replaceAll(" ", "_")))
StringTranslate.inject(new ReaderInputStream(new StringReader("tile." + EMT.MOD_ID + "." + name.replaceAll(" ", "_") + ".name=" + name)));
return "tile." + EMT.MOD_ID + "." + name.replaceAll(" ", "_");
}
return getUnlocalizedName() + "." + name;
} }
@Override @Override
@@ -153,92 +57,347 @@ public class ItemBlockSolars extends ItemBlock {
if (instance == 0) { if (instance == 0) {
switch (itemstack.getItemDamage()) { switch (itemstack.getItemDamage()) {
case 0: { case 0: {
list.add(EMTConfigHandler.compressedSolarOutput + localize("tooltip.EMT.euPerTick")); list.add(
formatNumbers(EMTConfigHandler.compressedSolarOutput)
+ localize("tooltip.EMT.euPerTick"));
break; break;
} }
case 1: { case 1: {
list.add(EMTConfigHandler.doubleCompressedSolarOutput + localize("tooltip.EMT.euPerTick")); list.add(
formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
+ localize("tooltip.EMT.euPerTick"));
break; break;
} }
case 2: { case 2: {
list.add(EMTConfigHandler.tripleCompressedSolarOutput + localize("tooltip.EMT.euPerTick")); list.add(
formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
+ localize("tooltip.EMT.euPerTick"));
break; break;
} }
case 3: {//aqua case 3: { // aqua
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.underwater")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (3F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining")); + ": "
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (6F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.thunder")); + EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.underwater"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(3F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.raining"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(6F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.thunder"));
break; break;
} }
case 4: { case 4: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.underwater")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (3F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining")); + ": "
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (6F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.thunder")); + EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.underwater"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(3F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.raining"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(6F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.thunder"));
break; break;
} }
case 5: { case 5: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.underwater")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (3F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining")); + ": "
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (6F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.thunder")); + EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.underwater"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(3F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.raining"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(6F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.thunder"));
break; break;
} }
case 6: {//dark case 6: { // dark
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break; break;
} }
case 7: { case 7: {
list.add(
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); + ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break; break;
} }
case 8: { case 8: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break; break;
} }
case 9: {//ordo case 9: { // ordo
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break; break;
} }
case 10: { case 10: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break; break;
} }
case 11: { case 11: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break; break;
} }
case 12: {//fire case 12: { // fire
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple") + " " + localize("tooltip.EMT.output.double.lava")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether")); + ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.triple")
+ " "
+ localize("tooltip.EMT.output.double.lava"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double")
+ " "
+ localize("tooltip.EMT.output.double.nether"));
break; break;
} }
case 13: { case 13: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple") + " " + localize("tooltip.EMT.output.double.lava")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether")); + ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.triple")
+ " "
+ localize("tooltip.EMT.output.double.lava"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double")
+ " "
+ localize("tooltip.EMT.output.double.nether"));
break; break;
} }
case 14: { case 14: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple") + " " + localize("tooltip.EMT.output.double.lava")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether")); + ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.triple")
+ " "
+ localize("tooltip.EMT.output.double.lava"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double")
+ " "
+ localize("tooltip.EMT.output.double.nether"));
break; break;
} }
case 15: {//aer case 15: { // aer
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.height")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.height"));
break; break;
} }
default: { default: {
@@ -249,28 +408,78 @@ public class ItemBlockSolars extends ItemBlock {
} else if (instance == 1) { } else if (instance == 1) {
switch (itemstack.getItemDamage()) { switch (itemstack.getItemDamage()) {
case 0: { case 0: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.height")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.height"));
break; break;
} }
case 1: { case 1: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.height")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.height"));
break; break;
} }
case 2: {//terra case 2: { // terra
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.low")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.compressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.low"));
break; break;
} }
case 3: { case 3: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.low")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.doubleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.low"));
break; break;
} }
case 4: { case 4: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.low")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(EMTConfigHandler.tripleCompressedSolarOutput)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.low"));
break; break;
} }
default: { default: {
@@ -281,39 +490,151 @@ public class ItemBlockSolars extends ItemBlock {
} else { } else {
switch (te.aspect) { switch (te.aspect) {
case 1: case 1:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * te.output) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * te.output) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break; break;
case 2: case 2:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * te.output) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * te.output) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(0.75F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.day"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.night"));
break; break;
case 3: case 3:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + te.output + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.height")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(te.output)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.height"));
break; break;
case 4: case 4:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + te.output + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.low")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(te.output)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double.half.low"));
break; break;
case 5: case 5:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + te.output + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * te.output) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.underwater")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (3F * te.output) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining")); + ": "
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (6F * te.output) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.thunder")); + EMTTextHelper.LIGHT_GRAY
+ formatNumbers(te.output)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(2F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.underwater"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(3F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.raining"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(6F * te.output)
+ " "
+ localize("tooltip.EMT.euPerTick")
+ " "
+ localize("tooltip.EMT.thunder"));
break; break;
case 6: case 6:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + te.output + " " + localize("tooltip.EMT.euPerTick")); list.add(
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple") + " " + localize("tooltip.EMT.output.double.lava")); EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether")); + ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(te.output)
+ " "
+ localize("tooltip.EMT.euPerTick"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.triple")
+ " "
+ localize("tooltip.EMT.output.double.lava"));
list.add(
EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ localize("tooltip.EMT.output.double")
+ " "
+ localize("tooltip.EMT.output.double.nether"));
break; break;
default: default:
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + te.output + " " + localize("tooltip.EMT.euPerTick")); list.add(
EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions")
+ ": "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(te.output)
+ " "
+ localize("tooltip.EMT.euPerTick"));
break; break;
} }
} }
list.add(EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.OutputMax") + " " + EMTTextHelper.LIGHT_GRAY + te.calculateMaxVoltAmp()[0] + "EU/t @ " + te.calculateMaxVoltAmp()[1] + "A"); list.add(
} else EMTTextHelper.BRIGHT_BLUE + StatCollector.translateToLocal("emt.OutputMax")
list.add(StatCollector.translateToLocal("emt.PressShift")); + " "
+ EMTTextHelper.LIGHT_GRAY
+ formatNumbers(te.calculateMaxVoltAmp()[0])
+ "EU/t @ "
+ formatNumbers(te.calculateMaxVoltAmp()[1])
+ "A");
} else list.add(StatCollector.translateToLocal("emt.PressShift"));
} }
} }
+12 -14
View File
@@ -1,8 +1,7 @@
package emt.item.focus; package emt.item.focus;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@@ -11,12 +10,14 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.ItemFocusBasic; import thaumcraft.api.wands.ItemFocusBasic;
import java.util.List;
public abstract class ItemBaseFocus extends ItemFocusBasic { public abstract class ItemBaseFocus extends ItemFocusBasic {
public IIcon ornament; public IIcon ornament;
@@ -75,20 +76,17 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
} }
@Override @Override
public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, MovingObjectPosition paramMovingObjectPosition) { public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer,
if (isUseItem(paramItemStack)) MovingObjectPosition paramMovingObjectPosition) {
paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE); if (isUseItem(paramItemStack)) paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE);
return paramItemStack; return paramItemStack;
} }
@Override @Override
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) { public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) {}
}
@Override @Override
public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) { public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) {}
}
@Override @Override
public String getSortingHelper(ItemStack itemstack) { public String getSortingHelper(ItemStack itemstack) {
@@ -116,4 +114,4 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
} }
} }
} }
} }
@@ -1,22 +1,24 @@
package emt.item.focus; package emt.item.focus;
import emt.util.EMTConfigHandler; import java.util.Map.Entry;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.api.wands.FocusUpgradeType;
import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.items.wands.ItemWandCasting;
import java.util.Map.Entry;
public class ItemChargeFocus extends ItemBaseFocus { public class ItemChargeFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10); private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10)
.add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
public ItemChargeFocus() { public ItemChargeFocus() {
super("charge"); super("charge");
@@ -30,8 +32,9 @@ public class ItemChargeFocus extends ItemBaseFocus {
@Override @Override
public AspectList getVisCost(ItemStack stack) { public AspectList getVisCost(ItemStack stack) {
AspectList actualCost = new AspectList(); AspectList actualCost = new AspectList();
for (Entry<Aspect, Integer> e : visCost.aspects.entrySet()) for (Entry<Aspect, Integer> e : visCost.aspects.entrySet()) actualCost.add(
actualCost.add(e.getKey(), (int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency)))); e.getKey(),
(int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency))));
return visCost; return visCost;
} }
@@ -41,7 +44,7 @@ public class ItemChargeFocus extends ItemBaseFocus {
} }
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) { public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[]{FocusUpgradeType.potency, FocusUpgradeType.frugal}; return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
} }
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) { public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
@@ -49,16 +52,21 @@ public class ItemChargeFocus extends ItemBaseFocus {
} }
@Override @Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) { public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
MovingObjectPosition movingobjectposition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) { if (player.capabilities.isCreativeMode
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (!world.isRemote) { if (!world.isRemote) {
int energyLeft = (int) (EMTConfigHandler.chargeFocusProduction * Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency))); int energyLeft = (int) (EMTConfigHandler.chargeFocusProduction
* Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
for (int i = 0; i < player.inventory.armorInventory.length; i++) { for (int i = 0; i < player.inventory.armorInventory.length; i++) {
if (energyLeft > 0) { if (energyLeft > 0) {
if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) { if ((player.inventory.armorInventory[i] != null)
double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false); && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager
.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
energyLeft -= sentPacket; energyLeft -= sentPacket;
} }
} else { } else {
@@ -67,8 +75,10 @@ public class ItemChargeFocus extends ItemBaseFocus {
} }
for (int j = 0; j < player.inventory.mainInventory.length; j++) { for (int j = 0; j < player.inventory.mainInventory.length; j++) {
if (energyLeft > 0) { if (energyLeft > 0) {
if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) { if ((player.inventory.mainInventory[j] != null)
double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false); && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager
.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
energyLeft -= sentPacket; energyLeft -= sentPacket;
} }
} else { } else {
@@ -5,6 +5,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectList;
import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.items.wands.ItemWandCasting;
@@ -33,13 +34,15 @@ public class ItemChristmasFocus extends ItemBaseFocus {
} }
@Override @Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop) { public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
MovingObjectPosition mop) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if ((mop != null) && (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)) { if ((mop != null) && (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)) {
int x = mop.blockX; int x = mop.blockX;
int y = mop.blockY + 1; int y = mop.blockY + 1;
int z = mop.blockZ; int z = mop.blockZ;
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) { if (player.capabilities.isCreativeMode
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (!world.isRemote) { if (!world.isRemote) {
EntitySnowman snowman; EntitySnowman snowman;
snowman = new EntitySnowman(world); snowman = new EntitySnowman(world);
@@ -1,13 +1,14 @@
package emt.item.focus; package emt.item.focus;
import emt.entity.EntityEnergyBall;
import ic2.api.item.ElectricItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import emt.entity.EntityEnergyBall;
import ic2.api.item.ElectricItem;
public class ItemEnergyBallFocus extends ItemBaseFocus { public class ItemEnergyBallFocus extends ItemBaseFocus {
public ItemEnergyBallFocus() { public ItemEnergyBallFocus() {
@@ -41,12 +42,13 @@ public class ItemEnergyBallFocus extends ItemBaseFocus {
return stack; return stack;
} }
float rotX = (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100; float rotX = (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI)
* MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
float rotY = (-MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI)) * 100; float rotY = (-MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
float rotZ = (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100; float rotZ = (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI)
* MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
world.spawnEntityInWorld(new EntityEnergyBall(world, player, rotX, rotY, rotZ)); world.spawnEntityInWorld(new EntityEnergyBall(world, player, rotX, rotY, rotZ));
return stack; return stack;
} }
} }
@@ -1,16 +1,18 @@
package emt.item.focus; package emt.item.focus;
import emt.entity.EntityLaser;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import emt.entity.EntityLaser;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.api.wands.FocusUpgradeType;
import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.items.wands.ItemWandCasting;
public class ItemExplosionFocus extends ItemBaseFocus { public class ItemExplosionFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 200).add(Aspect.ENTROPY, 200); private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 200).add(Aspect.ENTROPY, 200);
public ItemExplosionFocus() { public ItemExplosionFocus() {
@@ -33,9 +35,11 @@ public class ItemExplosionFocus extends ItemBaseFocus {
} }
@Override @Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) { public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
MovingObjectPosition movingobjectposition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) { if (player.capabilities.isCreativeMode
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (!world.isRemote) { if (!world.isRemote) {
EntityLaser laser; EntityLaser laser;
laser = new EntityLaser(world, player, 1); laser = new EntityLaser(world, player, 1);
@@ -47,16 +51,15 @@ public class ItemExplosionFocus extends ItemBaseFocus {
} }
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) { public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[]{FocusUpgradeType.potency, FocusUpgradeType.frugal}; return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
} }
/** /**
* Use this method to define custom logic about which upgrades can be applied. This can be used to set up upgrade "trees" * Use this method to define custom logic about which upgrades can be applied. This can be used to set up upgrade
* that make certain upgrades available only when others are unlocked first, when certain research is completed, or similar logic. * "trees" that make certain upgrades available only when others are unlocked first, when certain research is
* completed, or similar logic.
*/ */
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) { public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
return true; return true;
} }
} }
@@ -0,0 +1,77 @@
package emt.item.focus;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType;
import thaumcraft.common.items.wands.ItemWandCasting;
public class ItemMaintenanceFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 2500).add(Aspect.EARTH, 2500)
.add(Aspect.ORDER, 2500);
public ItemMaintenanceFocus() {
super("maintenance");
}
@Override
public int getFocusColor(ItemStack stack) {
return 0xC0C0C0;
}
@Override
public AspectList getVisCost(ItemStack focusstack) {
return visCost;
}
@Override
public String getSortingHelper(ItemStack itemstack) {
return "MAINTENANCE";
}
@Override
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
}
@Override
public ItemStack onFocusRightClick(ItemStack itemStack, World world, EntityPlayer player,
MovingObjectPosition mop) {
if (mop == null) return itemStack;
ItemWandCasting wand = (ItemWandCasting) itemStack.getItem();
if (!world.isRemote) {
if (!player.isSneaking()) {
return itemStack;
}
TileEntity hatchCandidateTile = world.getTileEntity(mop.blockX, mop.blockY, mop.blockZ);
if (hatchCandidateTile instanceof BaseMetaTileEntity) {
IMetaTileEntity hatchCandidateMetaTile = ((BaseMetaTileEntity) hatchCandidateTile).getMetaTileEntity();
if (hatchCandidateMetaTile instanceof GT_MetaTileEntity_Hatch_Maintenance) {
GT_MetaTileEntity_Hatch_Maintenance hatch = (GT_MetaTileEntity_Hatch_Maintenance) hatchCandidateMetaTile;
if (player.capabilities.isCreativeMode
|| wand.consumeAllVis(itemStack, player, getVisCost(itemStack), true, true)) {
hatch.mCrowbar = true;
hatch.mScrewdriver = true;
hatch.mHardHammer = true;
hatch.mSolderingTool = true;
hatch.mWrench = true;
hatch.mSoftHammer = true;
}
}
}
}
player.swingItem();
return itemStack;
}
}
@@ -1,20 +1,23 @@
package emt.item.focus; package emt.item.focus;
import emt.entity.EntityShield; import java.util.LinkedList;
import ic2.core.IC2;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import emt.entity.EntityShield;
import ic2.core.IC2;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectList;
import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.items.wands.ItemWandCasting;
import java.util.LinkedList;
public class ItemShieldFocus extends ItemBaseFocus { public class ItemShieldFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.AIR, 5);
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5)
.add(Aspect.AIR, 5);
public ItemShieldFocus() { public ItemShieldFocus() {
super("shield"); super("shield");
@@ -46,16 +49,19 @@ public class ItemShieldFocus extends ItemBaseFocus {
for (PotionEffect effect : new LinkedList<PotionEffect>(player.getActivePotionEffects())) { for (PotionEffect effect : new LinkedList<PotionEffect>(player.getActivePotionEffects())) {
IC2.platform.removePotion(player, effect.getPotionID()); IC2.platform.removePotion(player, effect.getPotionID());
} }
if (!player.capabilities.isCreativeMode && !wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) { if (!player.capabilities.isCreativeMode
&& !wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
player.stopUsingItem(); player.stopUsingItem();
} }
} }
@Override @Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition paramMovingObjectPosition) { public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
MovingObjectPosition paramMovingObjectPosition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
player.setItemInUse(itemstack, Integer.MAX_VALUE); player.setItemInUse(itemstack, Integer.MAX_VALUE);
if (!world.isRemote && (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true))) { if (!world.isRemote && (player.capabilities.isCreativeMode
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true))) {
EntityShield shield = new EntityShield(world, player); EntityShield shield = new EntityShield(world, player);
world.spawnEntityInWorld(shield); world.spawnEntityInWorld(shield);
} }
@@ -1,19 +1,21 @@
package emt.item.focus; package emt.item.focus;
import java.util.Map.Entry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import emt.util.EMTConfigHandler; import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem; import ic2.api.item.ElectricItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.api.wands.FocusUpgradeType;
import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.items.wands.ItemWandCasting;
import java.util.Map.Entry;
public class ItemWandChargingFocus extends ItemBaseFocus { public class ItemWandChargingFocus extends ItemBaseFocus {
AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10); AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10)
.add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
public ItemWandChargingFocus() { public ItemWandChargingFocus() {
super("chargeWand"); super("chargeWand");
@@ -37,13 +39,14 @@ public class ItemWandChargingFocus extends ItemBaseFocus {
@Override @Override
public AspectList getVisCost(ItemStack stack) { public AspectList getVisCost(ItemStack stack) {
AspectList actualCost = new AspectList(); AspectList actualCost = new AspectList();
for (Entry<Aspect, Integer> e : visCost.aspects.entrySet()) for (Entry<Aspect, Integer> e : visCost.aspects.entrySet()) actualCost.add(
actualCost.add(e.getKey(), (int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency)))); e.getKey(),
(int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency))));
return visCost; return visCost;
} }
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) { public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[]{FocusUpgradeType.potency, FocusUpgradeType.frugal}; return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
} }
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) { public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
@@ -58,7 +61,10 @@ public class ItemWandChargingFocus extends ItemBaseFocus {
ItemStack armor = player.inventory.armorInventory[1]; ItemStack armor = player.inventory.armorInventory[1];
if (armor != null) { if (armor != null) {
if ((ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player) && (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player)))) { if ((ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player)
&& (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player))
&& (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player))
&& (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player)))) {
int amount = (int) (100 * Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency))); int amount = (int) (100 * Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
wandItem.addRealVis(itemstack, Aspect.ORDER, amount, true); wandItem.addRealVis(itemstack, Aspect.ORDER, amount, true);
wandItem.addRealVis(itemstack, Aspect.FIRE, amount, true); wandItem.addRealVis(itemstack, Aspect.FIRE, amount, true);
@@ -1,10 +1,7 @@
package emt.item.tool; package emt.item.tool;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@@ -15,13 +12,17 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import thaumcraft.common.Thaumcraft; import thaumcraft.common.Thaumcraft;
import thaumcraft.common.blocks.BlockCustomPlant; import thaumcraft.common.blocks.BlockCustomPlant;
import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.lib.utils.Utils; import thaumcraft.common.lib.utils.Utils;
import java.util.List;
public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem { public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
public IIcon icon; public IIcon icon;
@@ -65,14 +66,16 @@ public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
} }
@Override @Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) { public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7,
float par8, float par9, float par10) {
if (stack.hasTagCompound()) { if (stack.hasTagCompound()) {
stack.stackTagCompound.setBoolean("Unbreakable", true); stack.stackTagCompound.setBoolean("Unbreakable", true);
} }
boolean did = false; boolean did = false;
for (int x1 = -1; x1 <= 1; x1++) { for (int x1 = -1; x1 <= 1; x1++) {
for (int z1 = -1; z1 <= 1; z1++) { for (int z1 = -1; z1 <= 1; z1++) {
if (ElectricItem.manager.canUse(stack, 25) && super.onItemUse(stack, player, world, x + x1, y, z + z1, par7, par8, par9, par10)) { if (ElectricItem.manager.canUse(stack, 25)
&& super.onItemUse(stack, player, world, x + x1, y, z + z1, par7, par8, par9, par10)) {
ElectricItem.manager.use(stack, 25, player); ElectricItem.manager.use(stack, 25, player);
Thaumcraft.proxy.blockSparkle(world, x + x1, y, z + z1, 8401408, 2); Thaumcraft.proxy.blockSparkle(world, x + x1, y, z + z1, 8401408, 2);
if (!did) { if (!did) {
@@ -100,7 +103,13 @@ public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 3); Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 3);
} }
if (did) { if (did) {
world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wand", 0.75F, 0.9F + world.rand.nextFloat() * 0.2F); world.playSoundEffect(
x + 0.5D,
y + 0.5D,
z + 0.5D,
"thaumcraft:wand",
0.75F,
0.9F + world.rand.nextFloat() * 0.2F);
} }
} }
if (stack.hasTagCompound()) { if (stack.hasTagCompound()) {
@@ -1,13 +1,7 @@
package emt.item.tool; package emt.item.tool;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.entity.EntityArcher;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -22,7 +16,14 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.List; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.entity.EntityArcher;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
public class ItemElectricThorHammer extends ItemSword implements IElectricItem { public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
@@ -69,7 +70,9 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
@Override @Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this))); list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.electric").replace("%player%", player.getCommandSenderName())); list.add(
EMTTextHelper.localize("tooltip.EMT.hammer.electric")
.replace("%player%", player.getCommandSenderName()));
} }
@Override @Override
@@ -1,9 +1,7 @@
package emt.item.tool; package emt.item.tool;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -17,9 +15,12 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType; import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraft.world.World; import net.minecraft.world.World;
import thaumcraft.api.IRepairable;
import java.util.List; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import thaumcraft.api.IRepairable;
public class ItemThorHammer extends ItemSword implements IRepairable { public class ItemThorHammer extends ItemSword implements IRepairable {
@@ -1,9 +1,7 @@
package emt.item.tool; package emt.item.tool;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -11,12 +9,16 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword; import net.minecraft.item.ItemSword;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import thaumcraft.api.IRepairable; import thaumcraft.api.IRepairable;
import thaumcraft.common.entities.projectile.EntityAlumentum; import thaumcraft.common.entities.projectile.EntityAlumentum;
import java.util.List;
public class ItemThorHammerBroken extends ItemSword implements IRepairable { public class ItemThorHammerBroken extends ItemSword implements IRepairable {
public ItemThorHammerBroken() { public ItemThorHammerBroken() {
@@ -1,13 +1,9 @@
package emt.item.tool.chainsaw; package emt.item.tool.chainsaw;
import cpw.mods.fml.relauncher.Side; import java.util.ArrayList;
import cpw.mods.fml.relauncher.SideOnly; import java.util.List;
import emt.EMT; import java.util.Random;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.core.IC2;
import ic2.core.util.StackUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockTorch; import net.minecraft.block.BlockTorch;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@@ -31,9 +27,14 @@ import net.minecraft.world.World;
import net.minecraftforge.common.IShearable; import net.minecraftforge.common.IShearable;
import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.ForgeEventFactory;
import java.util.ArrayList; import cpw.mods.fml.relauncher.Side;
import java.util.List; import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random; import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.core.IC2;
import ic2.core.util.StackUtil;
public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem { public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
@@ -57,14 +58,16 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
} }
@Override @Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
EntityLivingBase entityLiving) {
ElectricItem.manager.use(stack, cost, entityLiving); ElectricItem.manager.use(stack, cost, entityLiving);
return true; return true;
} }
@Override @Override
public boolean canHarvestBlock(Block block, ItemStack stack) { public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack); return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack)
|| Items.shears.canHarvestBlock(block, stack);
} }
@Override @Override
@@ -73,7 +76,8 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
return 1.0F; return 1.0F;
} }
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) { if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F
|| Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial; return efficiencyOnProperMaterial;
} else { } else {
return super.getDigSpeed(stack, block, meta); return super.getDigSpeed(stack, block, meta);
@@ -102,7 +106,8 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
} }
@Override @Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float xOffset, float yOffset, float zOffset) {
for (int i = 0; i < player.inventory.mainInventory.length; i++) { for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i]; ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null) { if (torchStack == null) {
@@ -170,7 +175,13 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
if (block instanceof IShearable) { if (block instanceof IShearable) {
IShearable target = (IShearable) block; IShearable target = (IShearable) block;
if (target.isShearable(itemstack, player.worldObj, x, y, z)) { if (target.isShearable(itemstack, player.worldObj, x, y, z)) {
ArrayList<ItemStack> drops = target.onSheared(itemstack, player.worldObj, x, y, z, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); ArrayList<ItemStack> drops = target.onSheared(
itemstack,
player.worldObj,
x,
y,
z,
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
Random rand = new Random(); Random rand = new Random();
for (ItemStack stack : drops) { for (ItemStack stack : drops) {
@@ -178,7 +189,12 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
double xOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; double xOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double yOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; double yOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double zOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; double zOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
EntityItem entityitem = new EntityItem(player.worldObj, (double) x + xOffset, (double) y + yOffset, (double) z + zOffset, stack); EntityItem entityitem = new EntityItem(
player.worldObj,
(double) x + xOffset,
(double) y + yOffset,
(double) z + zOffset,
stack);
entityitem.delayBeforeCanPickup = 10; entityitem.delayBeforeCanPickup = 10;
player.worldObj.spawnEntityInWorld(entityitem); player.worldObj.spawnEntityInWorld(entityitem);
} }
@@ -201,8 +217,15 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
} }
if (entity instanceof IShearable) { if (entity instanceof IShearable) {
IShearable target = (IShearable) entity; IShearable target = (IShearable) entity;
if (target.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) { if (target
ArrayList<ItemStack> drops = target.onSheared(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); .isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
ArrayList<ItemStack> drops = target.onSheared(
itemstack,
entity.worldObj,
(int) entity.posX,
(int) entity.posY,
(int) entity.posZ,
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
Random rand = new Random(); Random rand = new Random();
for (ItemStack stack : drops) { for (ItemStack stack : drops) {
@@ -225,7 +248,6 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
if (!nbt.hasKey("shearsMode")) { if (!nbt.hasKey("shearsMode")) {
nbt.setBoolean("shearsMode", true); nbt.setBoolean("shearsMode", true);
} }
} }
} }
@@ -1,24 +1,25 @@
package emt.item.tool.chainsaw; package emt.item.tool.chainsaw;
import cpw.mods.fml.common.network.NetworkRegistry; import java.awt.*;
import cpw.mods.fml.relauncher.Side; import java.util.ArrayList;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import thaumcraft.common.lib.network.PacketHandler; import thaumcraft.common.lib.network.PacketHandler;
import thaumcraft.common.lib.network.fx.PacketFXBlockBubble; import thaumcraft.common.lib.network.fx.PacketFXBlockBubble;
import thaumcraft.common.lib.utils.BlockUtils; import thaumcraft.common.lib.utils.BlockUtils;
import thaumcraft.common.lib.utils.Utils; import thaumcraft.common.lib.utils.Utils;
import java.awt.*;
import java.util.ArrayList;
public class ItemStreamChainsaw extends ItemThaumiumChainsaw { public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
public static ArrayList oreDictLogs = new ArrayList(); public static ArrayList oreDictLogs = new ArrayList();
@@ -50,9 +51,11 @@ public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
} }
@Override @Override
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) { public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7,
float par8, float par9, float par10) {
Block bi = world.getBlock(x, y, z); Block bi = world.getBlock(x, y, z);
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z)) && ElectricItem.manager.getCharge(itemstack) > cost) { if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))
&& ElectricItem.manager.getCharge(itemstack) > cost) {
if (!world.isRemote) { if (!world.isRemote) {
if (BlockUtils.breakFurthestBlock(world, x, y, z, bi, player)) { if (BlockUtils.breakFurthestBlock(world, x, y, z, bi, player)) {
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F); world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
@@ -75,7 +78,9 @@ public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) { if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
if (!world.isRemote) { if (!world.isRemote) {
BlockUtils.breakFurthestBlock(world, x, y, z, bi, player); BlockUtils.breakFurthestBlock(world, x, y, z, bi, player);
PacketHandler.INSTANCE.sendToAllAround(new PacketFXBlockBubble(x, y, z, new Color(0.33F, 0.33F, 1.0F).getRGB()), new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D)); PacketHandler.INSTANCE.sendToAllAround(
new PacketFXBlockBubble(x, y, z, new Color(0.33F, 0.33F, 1.0F).getRGB()),
new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D));
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F); world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
} }
@@ -1,9 +1,5 @@
package emt.item.tool.chainsaw; package emt.item.tool.chainsaw;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -12,6 +8,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
public class ItemThaumiumChainsaw extends ItemDiamondChainsaw { public class ItemThaumiumChainsaw extends ItemDiamondChainsaw {
public ItemThaumiumChainsaw() { public ItemThaumiumChainsaw() {
@@ -31,7 +32,8 @@ public class ItemThaumiumChainsaw extends ItemDiamondChainsaw {
} }
@Override @Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
EntityLivingBase entityLiving) {
ElectricItem.manager.use(stack, cost, entityLiving); ElectricItem.manager.use(stack, cost, entityLiving);
return true; return true;
} }
@@ -1,10 +1,9 @@
package emt.item.tool.drill; package emt.item.tool.drill;
import cpw.mods.fml.relauncher.Side; import java.util.ArrayList;
import cpw.mods.fml.relauncher.SideOnly; import java.util.Iterator;
import emt.EMT; import java.util.Locale;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@@ -23,18 +22,25 @@ import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.ForgeEventFactory;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import thaumcraft.common.Thaumcraft; import thaumcraft.common.Thaumcraft;
import thaumcraft.common.entities.EntityFollowingItem; import thaumcraft.common.entities.EntityFollowingItem;
import thaumcraft.common.lib.utils.BlockUtils; import thaumcraft.common.lib.utils.BlockUtils;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Locale;
public class ItemRockbreakerDrill extends ItemThaumiumDrill { public class ItemRockbreakerDrill extends ItemThaumiumDrill {
private static final Block[] isEffective = {Blocks.nether_brick, Blocks.netherrack, Blocks.glowstone, Blocks.iron_block, Blocks.gold_block, Blocks.diamond_block, Blocks.lapis_block, Blocks.redstone_block, Blocks.redstone_ore, Blocks.emerald_ore, Blocks.emerald_block, Blocks.stonebrick, Blocks.glass, Blocks.stone, Blocks.gold_ore, Blocks.iron_ore, Blocks.coal_ore, Blocks.cobblestone, private static final Block[] isEffective = { Blocks.nether_brick, Blocks.netherrack, Blocks.glowstone,
Blocks.diamond_ore, Blocks.lapis_ore, Blocks.dirt, Blocks.gravel, Blocks.sand, Blocks.sandstone, Blocks.soul_sand, Blocks.clay, Blocks.grass, Blocks.snow_layer, Blocks.snow, Blocks.farmland, Blocks.hardened_clay, Blocks.stained_hardened_clay, Blocks.mossy_cobblestone}; Blocks.iron_block, Blocks.gold_block, Blocks.diamond_block, Blocks.lapis_block, Blocks.redstone_block,
Blocks.redstone_ore, Blocks.emerald_ore, Blocks.emerald_block, Blocks.stonebrick, Blocks.glass,
Blocks.stone, Blocks.gold_ore, Blocks.iron_ore, Blocks.coal_ore, Blocks.cobblestone, Blocks.diamond_ore,
Blocks.lapis_ore, Blocks.dirt, Blocks.gravel, Blocks.sand, Blocks.sandstone, Blocks.soul_sand, Blocks.clay,
Blocks.grass, Blocks.snow_layer, Blocks.snow, Blocks.farmland, Blocks.hardened_clay,
Blocks.stained_hardened_clay, Blocks.mossy_cobblestone };
public int searchCost = 1000; public int searchCost = 1000;
public int hitCost = 400; public int hitCost = 400;
int side; int side;
@@ -71,7 +77,8 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
@Override @Override
public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) { public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) {
MovingObjectPosition movingobjectposition = BlockUtils.getTargetBlock(((Entity) (player)).worldObj, player, true); MovingObjectPosition movingobjectposition = BlockUtils
.getTargetBlock(((Entity) (player)).worldObj, player, true);
if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectType.BLOCK) { if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
side = movingobjectposition.sideHit; side = movingobjectposition.sideHit;
} }
@@ -79,7 +86,8 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
} }
@Override @Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) { public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z,
EntityLivingBase entityLiving) {
if (EMTConfigHandler.toolsInBore == false) { if (EMTConfigHandler.toolsInBore == false) {
cost = 350; cost = 350;
} else { } else {
@@ -120,14 +128,23 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
world.setBlockToAir(x + xx, y + yy, z + zz); world.setBlockToAir(x + xx, y + yy, z + zz);
ArrayList ret = bl.getDrops(world, x + xx, y + yy, z + zz, md, fortune); ArrayList ret = bl.getDrops(world, x + xx, y + yy, z + zz, md, fortune);
boolean creative = false; boolean creative = false;
if ((entityLiving instanceof EntityPlayer) && ((EntityPlayer) entityLiving).capabilities.isCreativeMode) { if ((entityLiving instanceof EntityPlayer)
&& ((EntityPlayer) entityLiving).capabilities.isCreativeMode) {
creative = true; creative = true;
} }
if (ret.size() <= 0 || creative || ((Entity) (entityLiving)).worldObj.isRemote) { if (ret.size() <= 0 || creative || ((Entity) (entityLiving)).worldObj.isRemote) {
continue; continue;
} }
ItemStack is; ItemStack is;
for (Iterator i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(new EntityFollowingItem(world, (double) x + (double) xx + 0.5D, (double) y + (double) yy + 0.5D, (double) z + (double) zz + 0.5D, is, entityLiving, 3))) { for (Iterator i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(
new EntityFollowingItem(
world,
(double) x + (double) xx + 0.5D,
(double) y + (double) yy + 0.5D,
(double) z + (double) zz + 0.5D,
is,
entityLiving,
3))) {
is = (ItemStack) i$.next(); is = (ItemStack) i$.next();
} }
} }
@@ -137,7 +154,8 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
} }
@Override @Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float xOffset, float yOffset, float zOffset) {
if (!player.isSneaking()) { if (!player.isSneaking()) {
for (int i = 0; i < player.inventory.mainInventory.length; i++) { for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i]; ItemStack torchStack = player.inventory.mainInventory[i];
@@ -150,7 +168,8 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
} }
int oldMeta = torchStack.getItemDamage(); int oldMeta = torchStack.getItemDamage();
int oldSize = torchStack.stackSize; int oldSize = torchStack.stackSize;
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset); boolean result = torchStack
.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
if (player.capabilities.isCreativeMode) { if (player.capabilities.isCreativeMode) {
torchStack.setItemDamage(oldMeta); torchStack.setItemDamage(oldMeta);
torchStack.stackSize = oldSize; torchStack.stackSize = oldSize;
@@ -165,7 +184,13 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
} else { } else {
ElectricItem.manager.use(stack, searchCost, player); ElectricItem.manager.use(stack, searchCost, player);
if (!world.isRemote) { if (!world.isRemote) {
world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F); world.playSoundEffect(
x + 0.5D,
y + 0.5D,
z + 0.5D,
"thaumcraft:wandfail",
0.2F,
0.2F + world.rand.nextFloat() * 0.2F);
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, xOffset, zOffset); return super.onItemUse(stack, player, world, x, y, z, side, xOffset, xOffset, zOffset);
} }
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
@@ -178,7 +203,8 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
} }
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
if (!((Entity) (player)).worldObj.isRemote && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) { if (!((Entity) (player)).worldObj.isRemote
&& (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) {
entity.setFire(2); entity.setFire(2);
} }
return super.onLeftClickEntity(stack, player, entity); return super.onLeftClickEntity(stack, player, entity);
@@ -1,11 +1,7 @@
package emt.item.tool.drill; package emt.item.tool.drill;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@@ -18,7 +14,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import java.util.List; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem { public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
@@ -59,7 +60,8 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
} }
@Override @Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
EntityLivingBase entityLiving) {
if (EMTConfigHandler.toolsInBore == false) { if (EMTConfigHandler.toolsInBore == false) {
cost = 250; cost = 250;
} else { } else {
@@ -71,7 +73,8 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
@Override @Override
public boolean canHarvestBlock(Block block, ItemStack stack) { public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack); return Items.diamond_pickaxe.canHarvestBlock(block, stack)
|| Items.diamond_shovel.canHarvestBlock(block, stack);
} }
@Override @Override
@@ -80,7 +83,8 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
return 1.0F; return 1.0F;
} }
if (Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F) { if (Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F
|| Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial; return efficiencyOnProperMaterial;
} else { } else {
return super.getDigSpeed(stack, block, meta); return super.getDigSpeed(stack, block, meta);
@@ -1,10 +1,5 @@
package emt.item.tool.omnitool; package emt.item.tool.omnitool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -13,6 +8,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
public class ItemOmnitoolDiamond extends ItemOmnitoolIron { public class ItemOmnitoolDiamond extends ItemOmnitoolIron {
public ItemOmnitoolDiamond() { public ItemOmnitoolDiamond() {
@@ -36,7 +37,8 @@ public class ItemOmnitoolDiamond extends ItemOmnitoolIron {
} }
@Override @Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
EntityLivingBase entityLiving) {
if (!EMTConfigHandler.toolsInBore) { if (!EMTConfigHandler.toolsInBore) {
cost = 200; cost = 200;
} else { } else {
@@ -1,11 +1,8 @@
package emt.item.tool.omnitool; package emt.item.tool.omnitool;
import cpw.mods.fml.relauncher.Side; import java.util.List;
import cpw.mods.fml.relauncher.SideOnly; import java.util.Locale;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@@ -21,8 +18,12 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.ForgeEventFactory;
import java.util.List; import cpw.mods.fml.relauncher.Side;
import java.util.Locale; import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem { public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
@@ -62,7 +63,8 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
} }
@Override @Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
EntityLivingBase entityLiving) {
if (!EMTConfigHandler.toolsInBore) { if (!EMTConfigHandler.toolsInBore) {
cost = 100; cost = 100;
} else { } else {
@@ -74,7 +76,10 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
@Override @Override
public boolean canHarvestBlock(Block block, ItemStack stack) { public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.iron_axe.canHarvestBlock(block, stack) || Items.iron_sword.canHarvestBlock(block, stack) || Items.iron_pickaxe.canHarvestBlock(block, stack) || Items.iron_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack); return Items.iron_axe.canHarvestBlock(block, stack) || Items.iron_sword.canHarvestBlock(block, stack)
|| Items.iron_pickaxe.canHarvestBlock(block, stack)
|| Items.iron_shovel.canHarvestBlock(block, stack)
|| Items.shears.canHarvestBlock(block, stack);
} }
@Override @Override
@@ -83,7 +88,11 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
return 1.0F; return 1.0F;
} }
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) { if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F
|| Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F
|| Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F
|| Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F
|| Items.shears.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial; return efficiencyOnProperMaterial;
} else { } else {
return super.getDigSpeed(stack, block, meta); return super.getDigSpeed(stack, block, meta);
@@ -99,7 +108,8 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
} }
@Override @Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float xOffset, float yOffset, float zOffset) {
for (int i = 0; i < player.inventory.mainInventory.length; i++) { for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i]; ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) { if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
@@ -1,10 +1,5 @@
package emt.item.tool.omnitool; package emt.item.tool.omnitool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -13,6 +8,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond { public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond {
public ItemOmnitoolThaumium() { public ItemOmnitoolThaumium() {
@@ -36,7 +37,8 @@ public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond {
} }
@Override @Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6,
EntityLivingBase entityLiving) {
if (!EMTConfigHandler.toolsInBore) { if (!EMTConfigHandler.toolsInBore) {
cost = 300; cost = 300;
} else { } else {
+59
View File
@@ -0,0 +1,59 @@
package emt.nei;
import net.minecraft.nbt.NBTTagCompound;
import codechicken.nei.api.IConfigureNEI;
import cpw.mods.fml.common.event.FMLInterModComms;
import emt.EMT;
public class NEI_Config implements IConfigureNEI {
public static boolean isAdded = true;
@Override
public void loadConfig() {
NEI_Config.isAdded = false;
NEI_Config.isAdded = true;
}
@Override
public String getName() {
return "EMT";
}
@Override
public String getVersion() {
return EMT.VERSION;
}
public static void Init() {
sendHandler("emt.recipe.fusioncrafting", "gregtech:gt.blockmachines:5001");
sendCatalyst("emt.recipe.fusioncrafting", "gregtech:gt.blockmachines:5001");
}
private static void sendHandler(String name, String block) {
NBTTagCompound aNBT = new NBTTagCompound();
aNBT.setString("handler", name);
aNBT.setString("modName", EMT.NAME);
aNBT.setString("modId", EMT.MOD_ID);
aNBT.setBoolean("modRequired", true);
aNBT.setString("itemName", block);
aNBT.setInteger("handlerHeight", 135);
aNBT.setInteger("handlerWidth", 166);
aNBT.setInteger("maxRecipesPerPage", 2);
aNBT.setInteger("yShift", 6);
FMLInterModComms.sendMessage("NotEnoughItems", "registerHandlerInfo", aNBT);
}
private static void sendCatalyst(String name, String stack, int priority) {
NBTTagCompound aNBT = new NBTTagCompound();
aNBT.setString("handlerID", name);
aNBT.setString("itemName", stack);
aNBT.setInteger("priority", priority);
FMLInterModComms.sendMessage("NotEnoughItems", "registerCatalystInfo", aNBT);
}
private static void sendCatalyst(String name, String stack) {
sendCatalyst(name, stack, 0);
}
}
+6 -7
View File
@@ -10,18 +10,17 @@ public class PacketEMTKeys implements IMessage, IMessageHandler<PacketEMTKeys, I
@Override @Override
public IMessage onMessage(PacketEMTKeys message, MessageContext ctx) { public IMessage onMessage(PacketEMTKeys message, MessageContext ctx) {
if (ctx.getServerHandler().playerEntity.inventory.armorInventory[2] != null && ctx.getServerHandler().playerEntity.inventory.armorInventory[2].getItem() == EMTItems.quantumArmor) { if (ctx.getServerHandler().playerEntity.inventory.armorInventory[2] != null
ctx.getServerHandler().playerEntity.inventory.armorInventory[2].stackTagCompound.setBoolean("unequip", true); && ctx.getServerHandler().playerEntity.inventory.armorInventory[2].getItem() == EMTItems.quantumArmor) {
ctx.getServerHandler().playerEntity.inventory.armorInventory[2].stackTagCompound
.setBoolean("unequip", true);
} }
return null; return null;
} }
@Override @Override
public void fromBytes(ByteBuf buf) { public void fromBytes(ByteBuf buf) {}
}
@Override @Override
public void toBytes(ByteBuf buf) { public void toBytes(ByteBuf buf) {}
}
} }
Loaded 100 of 150 files, more files were not shown because too many files have changed in this diff. Show more