mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-26 06:43:01 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3492bae96f | ||
|
|
0732ee46c7 | ||
|
|
b971a13b14 |
No files matched your search
Executable
+51
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# bashsupport disable=BP5006 # Global environment variables
|
||||
RUNDIR="run" \
|
||||
CRASH="crash-reports" \
|
||||
SERVERLOG="server.log"
|
||||
|
||||
# enable nullglob to get 0 results when no match rather than the pattern
|
||||
shopt -s nullglob
|
||||
|
||||
# store matches in array
|
||||
crash_reports=("$RUNDIR/$CRASH/crash"*.txt)
|
||||
|
||||
# if array not empty there are crash_reports
|
||||
if [ "${#crash_reports[@]}" -gt 0 ]; then
|
||||
# get the latest crash_report from array
|
||||
latest_crash_report="${crash_reports[-1]}"
|
||||
{
|
||||
printf 'Latest crash report detected %s:\n' "${latest_crash_report##*/}"
|
||||
cat "$latest_crash_report"
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet --fixed-strings 'Fatal errors were detected' "$SERVERLOG"; then
|
||||
{
|
||||
printf 'Fatal errors detected:\n'
|
||||
cat server.log
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet --fixed-strings 'The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED' \
|
||||
"$SERVERLOG"; then
|
||||
{
|
||||
printf 'Server force stopped:'
|
||||
cat server.log
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep --quiet --perl-regexp --only-matching '.+Done \(.+\)\! For help, type "help" or "\?"' "$SERVERLOG"; then
|
||||
{
|
||||
printf 'Server did not finish startup:'
|
||||
cat server.log
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf 'No crash reports detected'
|
||||
exit 0
|
||||
@@ -30,4 +30,3 @@ src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
*.DS_Store
|
||||
!gradlew.bat
|
||||
layout.json
|
||||
+1483
-3
File diff suppressed because it is too large.
Load diff
+4
-10
@@ -1,15 +1,9 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:Baubles-Expanded:2.1.13-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:ModularUI:1.2.20:dev')
|
||||
api('com.github.GTNewHorizons:ThaumicBoots:1.4.14:dev') {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Electro-Magic-Tools'
|
||||
exclude module: 'Baubles'
|
||||
}
|
||||
compile 'com.github.GTNewHorizons:GT5-Unofficial:5.09.42.65-pre:dev'
|
||||
compile 'com.github.GTNewHorizons:Baubles:1.0.1.14:dev'
|
||||
|
||||
api('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.448:dev')
|
||||
compile 'net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev'
|
||||
compile 'thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev'
|
||||
}
|
||||
+24
-163
@@ -1,203 +1,64 @@
|
||||
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
|
||||
# LOCAL to test local config updates.
|
||||
gtnh.settings.blowdryerTag = 0.2.0
|
||||
|
||||
# Human-readable mod name, available for mcmod.info population.
|
||||
modName = Electro-Magic Tools
|
||||
|
||||
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
|
||||
# Conventionally lowercase.
|
||||
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
|
||||
modId = EMT
|
||||
|
||||
# Root package of the mod, used to find various classes in other properties,
|
||||
# mcmod.info substitution, enabling assertions in run tasks, etc.
|
||||
modGroup = emt
|
||||
|
||||
# Whether to use modGroup as the maven publishing group.
|
||||
# When false, com.github.GTNewHorizons is used.
|
||||
useModGroupForPublishing = false
|
||||
# WHY is there no version field?
|
||||
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
|
||||
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
|
||||
|
||||
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
|
||||
# Will update your build.gradle automatically whenever an update is available
|
||||
autoUpdateBuildScript = false
|
||||
|
||||
# Version of Minecraft to target
|
||||
minecraftVersion = 1.7.10
|
||||
|
||||
# Version of Minecraft Forge to target
|
||||
forgeVersion = 10.13.4.1614
|
||||
|
||||
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
|
||||
channel = stable
|
||||
|
||||
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
|
||||
mappingsVersion = 12
|
||||
|
||||
# Defines other MCP mappings for dependency deobfuscation.
|
||||
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
|
||||
|
||||
# Select a default username for testing your mod. You can always override this per-run by running
|
||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
|
||||
# restart Minecraft in development. Choose this dependent on your mod:
|
||||
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
|
||||
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = true
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
enableGenericInjection = true
|
||||
|
||||
# Generate a class with a String field for the mod version named as defined below.
|
||||
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
|
||||
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
|
||||
generateGradleTokenClass = emt.EMTTags
|
||||
|
||||
# Name of the token containing the project's current version to generate/replace.
|
||||
gradleTokenVersion = VERSION
|
||||
|
||||
# [DEPRECATED] Mod ID replacement token.
|
||||
gradleTokenModId =
|
||||
|
||||
# [DEPRECATED] Mod name replacement token.
|
||||
gradleTokenModName =
|
||||
|
||||
# [DEPRECATED] Mod Group replacement token.
|
||||
gradleTokenGroupName =
|
||||
|
||||
# [DEPRECATED]
|
||||
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
|
||||
# Define a source file of your project with:
|
||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
|
||||
# version in @Mod([...], version = VERSION, [...]).
|
||||
# Leave these properties empty to skip individual token replacements.
|
||||
replaceGradleTokenInFile =
|
||||
# version in @Mod([...], version = VERSION, [...])
|
||||
# Leave these properties empty to skip individual token replacements
|
||||
replaceGradleTokenInFile = EMT.java
|
||||
gradleTokenModId =
|
||||
gradleTokenModName =
|
||||
gradleTokenVersion = GRADLETOKEN_VERSION
|
||||
gradleTokenGroupName =
|
||||
|
||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
|
||||
# leave this property empty.
|
||||
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
|
||||
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
|
||||
apiPackage =
|
||||
|
||||
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
||||
# There can be multiple files in a space-separated list.
|
||||
# Example value: mymodid_at.cfg nei_at.cfg
|
||||
# Example value: mymodid_at.cfg
|
||||
accessTransformersFile =
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
|
||||
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
|
||||
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
|
||||
# Mixin classes will have access to "main" classes, but not the other way around.
|
||||
separateMixinSourceSet =
|
||||
|
||||
# Adds some debug arguments like verbose output and class export.
|
||||
usesMixinDebug = false
|
||||
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
mixinsPackage =
|
||||
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
# This parameter is for legacy compatibility only
|
||||
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
|
||||
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
||||
coreModClass =
|
||||
|
||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
||||
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||
containsMixinsAndOrCoreModOnly = false
|
||||
|
||||
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
|
||||
forceEnableMixins = false
|
||||
|
||||
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
|
||||
# responsibility to check the license and request permission for distribution if required.
|
||||
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
|
||||
# responsibility check the licence and request permission for distribution, if required.
|
||||
usesShadowedDependencies = false
|
||||
|
||||
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
|
||||
# their own classes, making the minimization unreliable.
|
||||
minimizeShadowedDependencies = true
|
||||
|
||||
# If disabled, won't rename the shadowed classes.
|
||||
relocateShadowedDependencies = true
|
||||
|
||||
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
includeWellKnownRepositories = true
|
||||
|
||||
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||
# list of strings, with the acceptable keys being(case does not matter):
|
||||
# cursemaven
|
||||
# modrinth
|
||||
excludeWellKnownRepositories =
|
||||
|
||||
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
|
||||
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
|
||||
usesMavenPublishing = true
|
||||
|
||||
# Maven repository to publish the mod to.
|
||||
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
|
||||
|
||||
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
|
||||
#
|
||||
# The project's ID on Modrinth. Can be either the slug or the ID.
|
||||
# Leave this empty if you don't want to publish to Modrinth.
|
||||
modrinthProjectId =
|
||||
|
||||
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
|
||||
# Syntax: scope1-type1:name1;scope2-type2:name2;...
|
||||
# Where scope can be one of [required, optional, incompatible, embedded],
|
||||
# type can be one of [project, version],
|
||||
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
|
||||
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||
modrinthRelations =
|
||||
|
||||
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||
#
|
||||
# The project's numeric ID on CurseForge. You can find this in the About Project box.
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
curseForgeProjectId =
|
||||
|
||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||
# Syntax: type1:name1;type2:name2;...
|
||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||
# and the name is the CurseForge project slug of the other mod.
|
||||
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
|
||||
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||
curseForgeRelations =
|
||||
|
||||
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
|
||||
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
|
||||
# projects. New projects should not use this parameter.
|
||||
# customArchiveBaseName =
|
||||
|
||||
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||
# The check is ONLY performed if the version is a git tag.
|
||||
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
|
||||
# versionPattern =
|
||||
|
||||
# Uncomment to prevent the source code from being published.
|
||||
# noPublishedSources = true
|
||||
|
||||
# Uncomment this to disable Spotless checks.
|
||||
# This should only be uncommented to keep it easier to sync with upstream/other forks.
|
||||
# That is, if there is no other active fork/upstream, NEVER change this.
|
||||
# disableSpotless = true
|
||||
|
||||
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
|
||||
# disableCheckstyle = true
|
||||
|
||||
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
|
||||
# (force use delegated build).
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
|
||||
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
|
||||
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
|
||||
# ideaOverrideBuildType = idea
|
||||
|
||||
# Whether IDEA should run spotless checks when pressing the Build button.
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# ideaCheckSpotlessOnBuild = true
|
||||
|
||||
#customArchiveBaseName =
|
||||
Vendored
BIN
Binary file not shown.
+1
-2
@@ -1,7 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -15,8 +15,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -57,7 +55,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# 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/.
|
||||
@@ -85,8 +83,10 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
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.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -133,13 +133,10 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
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
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@@ -147,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -155,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -200,15 +197,11 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
# 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" \
|
||||
|
||||
Vendored
+10
-12
@@ -13,8 +13,6 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@@ -45,11 +43,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -59,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
|
||||
+25
-1
@@ -1,4 +1,28 @@
|
||||
// Add any additional repositories for your dependencies here
|
||||
// Add any additional repositiroes for your dependencies here
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name 'GTNH Maven'
|
||||
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
|
||||
allowInsecureProtocol
|
||||
}
|
||||
mavenCentral()
|
||||
maven {
|
||||
name 'ic2'
|
||||
url 'https://maven.ic2.player.to/'
|
||||
metadataSources {
|
||||
mavenPom()
|
||||
artifact()
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url 'https://cursemaven.com'
|
||||
content {
|
||||
includeGroup "curse.maven"
|
||||
}
|
||||
}
|
||||
|
||||
maven {
|
||||
url 'https://jitpack.io'
|
||||
}
|
||||
}
|
||||
+10
-5
@@ -4,10 +4,10 @@ pluginManagement {
|
||||
maven {
|
||||
// RetroFuturaGradle
|
||||
name "GTNH Maven"
|
||||
url "https://nexus.gtnewhorizons.com/repository/public/"
|
||||
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
allowInsecureProtocol = true
|
||||
mavenContent {
|
||||
includeGroup("com.gtnewhorizons")
|
||||
includeGroupByRegex("com\\.gtnewhorizons\\..+")
|
||||
includeGroup("com.gtnewhorizons.retrofuturagradle")
|
||||
}
|
||||
}
|
||||
gradlePluginPortal()
|
||||
@@ -17,7 +17,12 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.42'
|
||||
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
|
||||
}
|
||||
+15
-27
@@ -7,7 +7,6 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
@@ -20,15 +19,12 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import emt.command.CommandOutputs;
|
||||
import emt.init.EMTEntities;
|
||||
import emt.init.Registry;
|
||||
import emt.nei.NEI_Config;
|
||||
import emt.network.PacketEMTKeys;
|
||||
import emt.network.PacketNodeInfo;
|
||||
import emt.proxy.CommonProxy;
|
||||
import emt.tile.solar.Solars;
|
||||
import emt.util.EMTClientEventHandler;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTCreativeTab;
|
||||
import emt.util.EMTDungeonChestGenerator;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import emt.util.EMTEventHandler;
|
||||
import emt.util.*;
|
||||
|
||||
@Mod(
|
||||
modid = EMT.MOD_ID,
|
||||
@@ -40,21 +36,18 @@ public class EMT {
|
||||
|
||||
public static final String NAME = "Electro-Magic Tools";
|
||||
public static final String MOD_ID = "EMT";
|
||||
public static final String VERSION = EMTTags.VERSION;
|
||||
public static final String RESOURCE_PATH = "emt";
|
||||
public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
public static final String TEXTURE_PATH = "emt";
|
||||
public static final String GUI_FACTORY = "emt.client.gui.config.EMTGuiFactory";
|
||||
public static final String CLIENT_PROXY = "emt.proxy.ClientProxy";
|
||||
public static final String COMMON_PROXY = "emt.proxy.CommonProxy";
|
||||
public static final String CHANNEL = "EMT";
|
||||
public static final String DEPENDS = """
|
||||
required-after:Thaumcraft;\
|
||||
required-after:IC2;\
|
||||
required-after:modularui;\
|
||||
after:gregtech;\
|
||||
after:Avaritia;\
|
||||
after:MagicBees;\
|
||||
after:ForbiddenMagic;\
|
||||
after:dreamcraft""";
|
||||
public static final String DEPENDS = "required-after:Thaumcraft;" + "required-after:IC2;"
|
||||
+ "required-after:gregtech;"
|
||||
+ "after:Avaritia;"
|
||||
+ "after:MagicBees;"
|
||||
+ "after:ForbiddenMagic;"
|
||||
+ "after:dreamcraft;";
|
||||
public static final CreativeTabs TAB = new EMTCreativeTab("EMT.creativeTab");
|
||||
public static final Logger LOGGER = LogManager.getLogger("Electro-Magic Tools");
|
||||
public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("EMT");
|
||||
@@ -65,18 +58,12 @@ public class EMT {
|
||||
@Mod.Instance("EMT")
|
||||
public static EMT instance;
|
||||
|
||||
public static boolean isBootsActive = false;
|
||||
public static final String BOOTS = "thaumicboots";
|
||||
|
||||
public boolean isSimulating() {
|
||||
return !FMLCommonHandler.instance().getEffectiveSide().isClient();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
if (Loader.isModLoaded(BOOTS)) {
|
||||
isBootsActive = true;
|
||||
}
|
||||
EMTConfigHandler.init(event.getSuggestedConfigurationFile());
|
||||
FMLCommonHandler.instance().bus().register(new EMTEventHandler());
|
||||
if (FMLCommonHandler.instance().getSide().isClient()) {
|
||||
@@ -85,9 +72,7 @@ public class EMT {
|
||||
Registry.registerPreInit();
|
||||
EMTEssentiasOutputs.addPrimalOutputs();
|
||||
registerPackets();
|
||||
if (Registry.enableGTCompat) {
|
||||
Solars.populateCache();
|
||||
}
|
||||
Solars.populateCache();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
@@ -100,6 +85,8 @@ public class EMT {
|
||||
}
|
||||
EMTDungeonChestGenerator.generateLoot();
|
||||
EMTEntities.registerEMTEntities();
|
||||
|
||||
NEI_Config.Init();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
@@ -114,5 +101,6 @@ public class EMT {
|
||||
|
||||
public void registerPackets() {
|
||||
INSTANCE.registerMessage(PacketEMTKeys.class, PacketEMTKeys.class, 0, Side.SERVER);
|
||||
INSTANCE.registerMessage(PacketNodeInfo.class, PacketNodeInfo.class, 1, Side.CLIENT);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public abstract class BlockBase extends Block {
|
||||
name = unlocName;
|
||||
setBlockName(EMT.MOD_ID + ".block." + unlocName);
|
||||
if (textureName != null) {
|
||||
setBlockTextureName(EMT.RESOURCE_PATH + ":" + textureName);
|
||||
setBlockTextureName(EMT.TEXTURE_PATH + ":" + textureName);
|
||||
}
|
||||
setCreativeTab(EMT.TAB);
|
||||
setStepSound(soundType);
|
||||
|
||||
@@ -10,12 +10,12 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
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.particles.FXSparkle;
|
||||
|
||||
public class BlockElectricCloud extends BlockBase {
|
||||
|
||||
@@ -56,7 +56,7 @@ public class BlockElectricCloud extends BlockBase {
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
icon = ir.registerIcon(EMT.RESOURCE_PATH + ":empty");
|
||||
icon = ir.registerIcon(EMT.TEXTURE_PATH + ":empty");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,25 +33,25 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
super.registerBlockIcons(ir);
|
||||
this.blockIcon = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/top");
|
||||
this.blockIcon = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||
|
||||
for (int meta = 0; meta < subtypes; meta++) {
|
||||
iconSets[meta].top = ir.registerIcon(EMT.RESOURCE_PATH + ":essentiagenerator/top");
|
||||
iconSets[meta].bottom = ir.registerIcon(EMT.RESOURCE_PATH + ":essentiagenerator/top");
|
||||
iconSets[meta].side = ir.registerIcon(EMT.RESOURCE_PATH + ":essentiagenerator/side");
|
||||
iconSets[meta].top = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/top");
|
||||
iconSets[meta].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/top");
|
||||
iconSets[meta].side = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/side");
|
||||
}
|
||||
|
||||
iconSets[0].frontOff = ir.registerIcon(EMT.RESOURCE_PATH + ":essentiagenerator/potentiafront");
|
||||
iconSets[1].frontOff = ir.registerIcon(EMT.RESOURCE_PATH + ":essentiagenerator/ignisfront");
|
||||
iconSets[2].frontOff = ir.registerIcon(EMT.RESOURCE_PATH + ":essentiagenerator/auramfront");
|
||||
iconSets[3].frontOff = ir.registerIcon(EMT.RESOURCE_PATH + ":essentiagenerator/arborfront");
|
||||
iconSets[4].frontOff = ir.registerIcon(EMT.RESOURCE_PATH + ":essentiagenerator/aerfront");
|
||||
iconSets[5].frontOff = ir.registerIcon(EMT.RESOURCE_PATH + ":essentiagenerator/aerfront");
|
||||
iconSets[0].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/potentiafront");
|
||||
iconSets[1].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/ignisfront");
|
||||
iconSets[2].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/auramfront");
|
||||
iconSets[3].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/arborfront");
|
||||
iconSets[4].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront");
|
||||
iconSets[5].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(id, 1, 0));
|
||||
list.add(new ItemStack(id, 1, 1));
|
||||
list.add(new ItemStack(id, 1, 2));
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.gtnewhorizons.modularui.api.UIInfos;
|
||||
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;
|
||||
@@ -36,31 +37,31 @@ public class BlockMachines extends BlockBaseContainer {
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
super.registerBlockIcons(ir);
|
||||
|
||||
this.blockIcon = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/top");
|
||||
this.blockIcon = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||
|
||||
iconSets[0].top = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/top");
|
||||
iconSets[1].top = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/etherealmaceratortop");
|
||||
iconSets[2].top = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/etherealmaceratortop");
|
||||
iconSets[0].top = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||
iconSets[1].top = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
iconSets[2].top = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
|
||||
iconSets[0].bottom = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/side");
|
||||
iconSets[1].bottom = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/etherealmacerator");
|
||||
iconSets[2].bottom = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/etherealmaceratortop");
|
||||
iconSets[0].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/side");
|
||||
iconSets[1].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmacerator");
|
||||
iconSets[2].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
|
||||
iconSets[0].side = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/side");
|
||||
iconSets[1].side = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/etherealmacerator");
|
||||
iconSets[2].side = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/etherealmaceratortop");
|
||||
iconSets[0].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/side");
|
||||
iconSets[1].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmacerator");
|
||||
iconSets[2].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
|
||||
iconSets[0].frontOff = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/wandcharger");
|
||||
iconSets[1].frontOff = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/etherealmaceratorfront");
|
||||
iconSets[2].frontOff = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/etherealmaceratortop");
|
||||
iconSets[0].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/wandcharger");
|
||||
iconSets[1].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratorfront");
|
||||
iconSets[2].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
|
||||
iconSets[0].frontOn = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/wandcharger");
|
||||
iconSets[1].frontOn = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/etherealmaceratorfrontactive");
|
||||
iconSets[2].frontOn = ir.registerIcon(EMT.RESOURCE_PATH + ":machines/etherealmaceratortop");
|
||||
iconSets[0].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/wandcharger");
|
||||
iconSets[1].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratorfrontactive");
|
||||
iconSets[2].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(id, 1, 0));
|
||||
list.add(new ItemStack(id, 1, 1));
|
||||
list.add(new ItemStack(id, 1, 2));
|
||||
@@ -72,6 +73,8 @@ public class BlockMachines extends BlockBaseContainer {
|
||||
return new TileEntityIndustrialWandRecharge();
|
||||
} else if (meta == 1) {
|
||||
return new TileEntityEtherealMacerator();
|
||||
} else if (meta == 2) {
|
||||
return new EssentiaFiller();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.common.blocks.BlockAiry;
|
||||
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 {
|
||||
|
||||
@@ -60,7 +60,7 @@ public class BlockPortableNode extends BlockAiry {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister ri) {
|
||||
texture = ri.registerIcon(EMT.RESOURCE_PATH + ":portablenode");
|
||||
texture = ri.registerIcon(EMT.TEXTURE_PATH + ":portablenode");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -79,7 +79,7 @@ public class BlockPortableNode extends BlockAiry {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class BlockShield extends Block {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":shield");
|
||||
this.blockIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":shield");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,19 +30,19 @@ public class BlockSolars extends BlockBaseContainer {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
IIcon solarTop = ir.registerIcon(EMT.RESOURCE_PATH + ":solars/solartop");
|
||||
IIcon doubleSolarTop = ir.registerIcon(EMT.RESOURCE_PATH + ":solars/doublesolartop");
|
||||
IIcon tripleSolarTop = ir.registerIcon(EMT.RESOURCE_PATH + ":solars/triplesolartop");
|
||||
IIcon solarTop = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
|
||||
IIcon doubleSolarTop = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/doublesolartop");
|
||||
IIcon tripleSolarTop = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/triplesolartop");
|
||||
|
||||
IIcon bottom = ir.registerIcon(EMT.RESOURCE_PATH + ":solars/bottom");
|
||||
IIcon bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
|
||||
|
||||
IIcon side = ir.registerIcon(EMT.RESOURCE_PATH + ":solars/side");
|
||||
IIcon waterSide = ir.registerIcon(EMT.RESOURCE_PATH + ":solars/water/waterside");
|
||||
IIcon darkSide = ir.registerIcon(EMT.RESOURCE_PATH + ":solars/dark/darkside");
|
||||
IIcon orderSide = ir.registerIcon(EMT.RESOURCE_PATH + ":solars/order/orderside");
|
||||
IIcon fireSide = ir.registerIcon(EMT.RESOURCE_PATH + ":solars/fire/fireside");
|
||||
IIcon airSide = ir.registerIcon(EMT.RESOURCE_PATH + ":solars/air/airside");
|
||||
IIcon earthSide = ir.registerIcon(EMT.RESOURCE_PATH + ":solars/earth/earthside");
|
||||
IIcon side = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/side");
|
||||
IIcon waterSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/water/waterside");
|
||||
IIcon darkSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/dark/darkside");
|
||||
IIcon orderSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/order/orderside");
|
||||
IIcon fireSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/fire/fireside");
|
||||
IIcon airSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
|
||||
IIcon earthSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside");
|
||||
|
||||
IIcon[] sides = { side, orderSide, darkSide, airSide, earthSide, waterSide, fireSide };
|
||||
|
||||
@@ -105,7 +105,7 @@ public class BlockSolars extends BlockBaseContainer {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
for (int meta = 0; meta < countOfMetas; meta++) {
|
||||
list.add(new ItemStack(id, 1, meta));
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package emt.client.gui;
|
||||
|
||||
import static emt.EMT.RESOURCE_PATH;
|
||||
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(RESOURCE_PATH, "guis/overlay_slot/fusion_crafter");
|
||||
public static final UITexture OVERLAY_SLOT_WAND = UITexture.fullImage(RESOURCE_PATH, "guis/overlay_slot/wand");
|
||||
.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(RESOURCE_PATH, "guis/picture/gauge_empty_25");
|
||||
.fullImage(TEXTURE_PATH, "guis/picture/gauge_empty_25");
|
||||
public static final UITexture PICTURE_GAUGE_GENERATOR = UITexture
|
||||
.fullImage(RESOURCE_PATH, "guis/picture/gauge_generator");
|
||||
public static final UITexture PICTURE_GAUGE_SOLAR = UITexture.fullImage(RESOURCE_PATH, "guis/picture/gauge_solar");
|
||||
.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(RESOURCE_PATH, "guis/picture/gauge_empty_11");
|
||||
.fullImage(TEXTURE_PATH, "guis/picture/gauge_empty_11");
|
||||
public static final UITexture PICTURE_SOLAR_INDICATOR = UITexture
|
||||
.fullImage(RESOURCE_PATH, "guis/picture/solar_indicator");
|
||||
.fullImage(TEXTURE_PATH, "guis/picture/solar_indicator");
|
||||
}
|
||||
@@ -12,8 +12,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelSpecialArmor extends ModelBiped {
|
||||
|
||||
private static ModelSpecialArmor instance;
|
||||
|
||||
public ModelRenderer rightWing;
|
||||
public ModelRenderer leftWing;
|
||||
public ModelRenderer center;
|
||||
@@ -32,43 +30,41 @@ public class ModelSpecialArmor extends ModelBiped {
|
||||
public ModelSpecialArmor(float scale, float offset, int type) {
|
||||
super(scale, offset, type == 1 ? 128 : 64, type == 0 ? 32 : type == 1 ? 96 : 64);
|
||||
this.type = type;
|
||||
switch (this.type) {
|
||||
case 1:
|
||||
this.textureWidth = 128;
|
||||
this.textureHeight = 96;
|
||||
this.jetpack = new ModelRenderer(this, 16, 69);
|
||||
this.jetpack.setTextureSize(64, 48);
|
||||
this.jetpack.addBox(-4.0F, -12.0F, -2.0F, 8, 12 * 2, 4, scale * 2);
|
||||
this.jetpack.setRotationPoint(0.0F, 0.0F + offset, 0.0F);
|
||||
break;
|
||||
|
||||
this.textureWidth = 128;
|
||||
this.textureHeight = 96;
|
||||
this.jetpack = new ModelRenderer(this, 16, 69);
|
||||
this.jetpack.setTextureSize(64, 48);
|
||||
this.jetpack.addBox(-4.0F, -12.0F, -2.0F, 8, 12 * 2, 4, scale * 2);
|
||||
this.jetpack.setRotationPoint(0.0F, 0.0F + offset, 0.0F);
|
||||
case 2:
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 64;
|
||||
rightWing = new ModelRenderer(this, 24, 0 + 32);
|
||||
rightWing.addBox(-11F, -1F, 0F, 11, 13, 1);
|
||||
rightWing.setRotationPoint(-2F, 0F, 3F);
|
||||
rightWing.setTextureSize(64, 32);
|
||||
rightWing.mirror = false;
|
||||
setRotation(rightWing, 0F, 0.1570796F, 0F);
|
||||
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 64;
|
||||
rightWing = new ModelRenderer(this, 24, 0 + 32);
|
||||
rightWing.addBox(-11F, -1F, 0F, 11, 13, 1);
|
||||
rightWing.setRotationPoint(-2F, 0F, 3F);
|
||||
rightWing.setTextureSize(64, 32);
|
||||
rightWing.mirror = false;
|
||||
setRotation(rightWing, 0F, 0.1570796F, 0F);
|
||||
leftWing = new ModelRenderer(this, 0, 0 + 32);
|
||||
leftWing.addBox(0F, -1F, 0F, 11, 13, 1);
|
||||
leftWing.setRotationPoint(2F, 0F, 3F);
|
||||
leftWing.setTextureSize(64, 32);
|
||||
leftWing.mirror = true;
|
||||
setRotation(leftWing, 0F, -0.1570796F, 0F);
|
||||
|
||||
leftWing = new ModelRenderer(this, 0, 0 + 32);
|
||||
leftWing.addBox(0F, -1F, 0F, 11, 13, 1);
|
||||
leftWing.setRotationPoint(2F, 0F, 3F);
|
||||
leftWing.setTextureSize(64, 32);
|
||||
leftWing.mirror = true;
|
||||
setRotation(leftWing, 0F, -0.1570796F, 0F);
|
||||
|
||||
center = new ModelRenderer(this, 0, 14 + 32);
|
||||
center.addBox(0F, 0F, 1F, 8, 14, 1);
|
||||
center.setRotationPoint(-4F, 0F, 3F);
|
||||
center.setTextureSize(64, 32);
|
||||
center.mirror = true;
|
||||
setRotation(center, 0F, 0F, 0F);
|
||||
|
||||
}
|
||||
|
||||
public static ModelSpecialArmor getInstance() {
|
||||
if (instance == null) instance = new ModelSpecialArmor();
|
||||
|
||||
return instance;
|
||||
center = new ModelRenderer(this, 0, 14 + 32);
|
||||
center.addBox(0F, 0F, 1F, 8, 14, 1);
|
||||
center.setRotationPoint(-4F, 0F, 3F);
|
||||
center.setTextureSize(64, 32);
|
||||
center.mirror = true;
|
||||
setRotation(center, 0F, 0F, 0F);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
@@ -100,7 +96,6 @@ public class ModelSpecialArmor extends ModelBiped {
|
||||
this.center.render(scale);
|
||||
this.leftWing.render(scale);
|
||||
this.rightWing.render(scale);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,9 +105,6 @@ public class ModelSpecialArmor extends ModelBiped {
|
||||
if (this.isJumping) {
|
||||
this.rightWing.rotateAngleY = 0.5f;
|
||||
this.leftWing.rotateAngleY = -0.5f;
|
||||
} else {
|
||||
this.rightWing.rotateAngleY = 0.1570796F;
|
||||
this.leftWing.rotateAngleY = -0.1570796F;
|
||||
}
|
||||
|
||||
if (this.isSneak) {
|
||||
@@ -121,22 +113,14 @@ public class ModelSpecialArmor extends ModelBiped {
|
||||
this.jetpack.rotateAngleX = 0.5F;
|
||||
break;
|
||||
case 2:
|
||||
this.center.offsetY -= 0.1;
|
||||
this.rightWing.offsetY -= 0.1;
|
||||
this.leftWing.offsetY -= 0.1;
|
||||
this.center.rotateAngleX = 0.5F;
|
||||
this.rightWing.rotateAngleX = 0.5F;
|
||||
this.leftWing.rotateAngleX = 0.5F;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (this.type) {
|
||||
case 1:
|
||||
this.jetpack.rotateAngleX = 0F;
|
||||
break;
|
||||
case 2:
|
||||
this.center.rotateAngleX = 0F;
|
||||
this.rightWing.rotateAngleX = 0F;
|
||||
this.leftWing.rotateAngleX = 0F;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,14 +4,8 @@ import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ModelWings extends ModelBiped {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static ModelWings instance = null;
|
||||
|
||||
public boolean isJumping = false;
|
||||
ModelRenderer rightWing;
|
||||
ModelRenderer leftWing;
|
||||
@@ -47,12 +41,6 @@ public class ModelWings extends ModelBiped {
|
||||
this.bipedBody.addChild(center);
|
||||
}
|
||||
|
||||
public static ModelWings getInstance() {
|
||||
if (instance == null) instance = new ModelWings();
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
@@ -67,25 +55,20 @@ public class ModelWings extends ModelBiped {
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float playerTicksExisted,
|
||||
float playerRotationYawHead, float playerRotationPitch, float f5, Entity entity) {
|
||||
public void setRotationAngles(float f, float f1, float pt, float f3, float f4, float f5, Entity entity) {
|
||||
|
||||
if (isJumping) {
|
||||
this.rightWing.rotateAngleY = 0.5f;
|
||||
this.leftWing.rotateAngleY = -0.5f;
|
||||
} else {
|
||||
this.rightWing.rotateAngleY = 0.1570796F;
|
||||
this.leftWing.rotateAngleY = -0.1570796F;
|
||||
}
|
||||
|
||||
if (entity.isSneaking()) {
|
||||
this.center.offsetY -= 0.1;
|
||||
this.rightWing.offsetY -= 0.1;
|
||||
this.leftWing.offsetY -= 0.1;
|
||||
this.center.rotateAngleX = 0.5F;
|
||||
this.rightWing.rotateAngleX = 0.5F;
|
||||
this.leftWing.rotateAngleX = 0.5F;
|
||||
} else {
|
||||
this.center.rotateAngleX = 0.0F;
|
||||
this.rightWing.rotateAngleX = 0;
|
||||
this.leftWing.rotateAngleX = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import emt.entity.EntityLaser;
|
||||
public class RenderLaser extends Render {
|
||||
|
||||
private static final ResourceLocation laserTexture = new ResourceLocation(
|
||||
EMT.RESOURCE_PATH,
|
||||
EMT.TEXTURE_PATH,
|
||||
"textures/models/lasermodel.png");
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,7 @@ import emt.entity.EntityShield;
|
||||
public class RenderShield extends Render {
|
||||
|
||||
private static final ResourceLocation shieldTexture = new ResourceLocation(
|
||||
EMT.RESOURCE_PATH,
|
||||
EMT.TEXTURE_PATH,
|
||||
"textures/models/shield.png");
|
||||
static int glCallList;
|
||||
|
||||
@@ -89,7 +89,7 @@ public class RenderShield extends Render {
|
||||
glTranslated(x, y, z);
|
||||
}
|
||||
|
||||
glCallList(glCallList);
|
||||
glCallList(this.glCallList);
|
||||
|
||||
glPopMatrix();
|
||||
glPopAttrib();
|
||||
|
||||
@@ -12,9 +12,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import emt.util.EMTTextHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class CommandOutputs extends CommandBase {
|
||||
|
||||
@@ -97,7 +97,7 @@ public class CommandOutputs extends CommandBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
public String getCommandUsage(ICommandSender p_71518_1_) {
|
||||
return "/emt_outputs";
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class CommandOutputs extends CommandBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> addTabCompletionOptions(ICommandSender command, String[] stringArray) {
|
||||
public List addTabCompletionOptions(ICommandSender command, String[] stringArray) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
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;
|
||||
|
||||
public class EntityEnergyBall extends Entity implements IProjectile, IEntityAdditionalSpawnData {
|
||||
|
||||
@@ -99,7 +99,7 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
|
||||
}
|
||||
|
||||
/** Generating Coords for every Entity **/
|
||||
ArrayList<Entity> entities = new ArrayList<>();
|
||||
ArrayList<Entity> entities = new ArrayList();
|
||||
|
||||
int chunkSize = ((RADIUS - 1) >> 4) + 2;
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
|
||||
}
|
||||
|
||||
Entity entity = null;
|
||||
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(
|
||||
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;
|
||||
@@ -173,7 +173,7 @@ public class EntityLaser extends Entity implements IThrowableEntity, IProjectile
|
||||
float down;
|
||||
|
||||
for (l = 0; l < list.size(); ++l) {
|
||||
Entity entity1 = list.get(l);
|
||||
Entity entity1 = (Entity) list.get(l);
|
||||
|
||||
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) {
|
||||
down = 0.3F;
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
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.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.gthandler.common.items.EMT_CasingBlock;
|
||||
import gregtech.api.enums.Textures;
|
||||
import gregtech.api.render.TextureFactory;
|
||||
import gregtech.common.blocks.GT_Block_Casings_Abstract;
|
||||
|
||||
public class EMT_GT_Block extends GT_Block_Casings_Abstract {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] texture;
|
||||
|
||||
private final String[] textureNames;
|
||||
|
||||
public EMT_GT_Block(String[] texture) {
|
||||
super(EMT_CasingBlock.class, "EMT_GTBLOCK_CASEING", Material.anvil);
|
||||
this.setHardness(15.0F);
|
||||
this.setResistance(30.0F);
|
||||
this.textureNames = texture;
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
|
||||
// Taking one texture slot :P
|
||||
Textures.BlockIcons.setCasingTexture((byte) 1, (byte) (15 + 48), TextureFactory.of(this, 7));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(final int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
|
||||
for (int i = 0; i < textureNames.length; i++) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return meta < texture.length ? texture[meta] : texture[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
texture = new IIcon[textureNames.length];
|
||||
for (int i = 0; i < textureNames.length; i++) {
|
||||
texture[i] = par1IconRegister.registerIcon(textureNames[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
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.fluids.FluidStack;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.interfaces.ITexture;
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
import gregtech.api.metatileentity.MetaTileEntity;
|
||||
import gregtech.api.metatileentity.implementations.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 AspectList current = new AspectList();
|
||||
|
||||
public EssentiaHatch(int aID, String aName, String aNameRegional, int aTier) {
|
||||
super(aID, aName, aNameRegional, aTier);
|
||||
}
|
||||
|
||||
public EssentiaHatch(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
|
||||
super(aName, aTier, aDescription, aTextures);
|
||||
}
|
||||
|
||||
public EssentiaHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
|
||||
super(aName, aTier, aDescription, aTextures);
|
||||
}
|
||||
|
||||
public boolean addAspectList(final AspectList A) {
|
||||
|
||||
if ((this.mTier + 1) * ApTe > A.size() + current.size()) {
|
||||
if (current.visSize() + A.visSize() < (this.mTier + 1) * ApTe * 64) current.add(A);
|
||||
return true;
|
||||
} else return false;
|
||||
}
|
||||
|
||||
public void setCurrent(AspectList List) {
|
||||
this.current = List;
|
||||
}
|
||||
|
||||
public AspectList getAspects() {
|
||||
return current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
|
||||
return new EssentiaHatch(
|
||||
"Essentia Hatch " + GT_Values.VN[this.mTier],
|
||||
this.mTier,
|
||||
this.getDescription(),
|
||||
this.mTextures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getInfoData() {
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
list.add("This Essentia-Hatch contains:");
|
||||
for (final Aspect A : this.current.aspects.keySet())
|
||||
list.add(A.getName() + ": " + Integer.toString(current.getAmount(A)));
|
||||
|
||||
String[] ret = new String[list.size()];
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
ret[i] = list.get(i);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* String[] old = super.getInfoData(); if (old.length!=0) { String[] newDescription = new String[old.length +
|
||||
* 1]; for (int i = 0; i < old.length; i++) { newDescription[i] = old[i]; } newDescription[old.length] =
|
||||
* "This Contains: " + current.size() + " different Aspects"; return newDescription; }else return new
|
||||
* String[]{"This Contains: " + current.size() + " different Aspects"};
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getDescription() { // this is the fucking tooltip -_-'
|
||||
return new String[] { "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((64 * ApTe * (mTier + 1))) + " Essentia in total" };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGivingInformation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveNBTData(NBTTagCompound var1) {
|
||||
|
||||
NBTTagList tlist = new NBTTagList();
|
||||
Aspect[] aspectA = current.getAspects();
|
||||
for (int i = 0; i < aspectA.length; ++i) {
|
||||
Aspect aspect = aspectA[i];
|
||||
if (aspect != null) {
|
||||
NBTTagCompound f = new NBTTagCompound();
|
||||
f.setString("key", aspect.getTag());
|
||||
f.setInteger("amount", current.getAmount(aspect));
|
||||
tlist.appendTag(f);
|
||||
}
|
||||
}
|
||||
var1.setTag("Aspects", tlist);
|
||||
super.saveNBTData(var1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadNBTData(NBTTagCompound var1) {
|
||||
current = new AspectList();
|
||||
NBTTagList tlist = var1.getTagList("Aspects", 10);
|
||||
|
||||
for (int j = 0; j < tlist.tagCount(); ++j) {
|
||||
NBTTagCompound rs = tlist.getCompoundTagAt(j);
|
||||
if (rs.hasKey("key")) {
|
||||
current.add(Aspect.getAspect(rs.getString("key")), rs.getInteger("amount"));
|
||||
}
|
||||
}
|
||||
|
||||
super.loadNBTData(var1);
|
||||
}
|
||||
|
||||
public int fuelleft() {
|
||||
int ret = 0;
|
||||
for (final Aspect A : current.aspects.keySet()) {
|
||||
ret += current.getAmount(A);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFluidInputAllowed(FluidStack aFluid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
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 thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IAspectContainer;
|
||||
import thaumcraft.api.aspects.IEssentiaTransport;
|
||||
import emt.gthandler.common.implementations.EssentiaHatch;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
|
||||
public class EssentiaFiller extends TileEntityEMT implements IAspectContainer, IEssentiaTransport {
|
||||
|
||||
private AspectList current = new AspectList();
|
||||
private byte tick = 0;
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
NBTTagList tlist = new NBTTagList();
|
||||
Aspect[] aspectA = current.getAspects();
|
||||
for (int i = 0; i < aspectA.length; ++i) {
|
||||
Aspect aspect = aspectA[i];
|
||||
if (aspect != null) {
|
||||
NBTTagCompound f = new NBTTagCompound();
|
||||
f.setString("key", aspect.getTag());
|
||||
f.setInteger("amount", current.getAmount(aspect));
|
||||
tlist.appendTag(f);
|
||||
}
|
||||
}
|
||||
tagCompound.setTag("Aspects", tlist);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
current = new AspectList();
|
||||
NBTTagList tlist = tagCompound.getTagList("Aspects", 10);
|
||||
for (int j = 0; j < tlist.tagCount(); ++j) {
|
||||
NBTTagCompound rs = tlist.getCompoundTagAt(j);
|
||||
if (rs.hasKey("key")) {
|
||||
current.add(Aspect.getAspect(rs.getString("key")), rs.getInteger("amount"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
++tick;
|
||||
fillfrompipe();
|
||||
if (tick % 20 == 0) {
|
||||
TileEntity T = this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
|
||||
if (checkTE(T)) {
|
||||
tick = 0;
|
||||
return;
|
||||
}
|
||||
if (T == null) T = this.worldObj.getTileEntity(xCoord + 1, yCoord, zCoord);
|
||||
if (checkTE(T)) {
|
||||
tick = 0;
|
||||
return;
|
||||
}
|
||||
if (T == null) T = this.worldObj.getTileEntity(xCoord, yCoord, zCoord + 1);
|
||||
if (checkTE(T)) {
|
||||
tick = 0;
|
||||
return;
|
||||
}
|
||||
if (T == null) T = this.worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
|
||||
if (checkTE(T)) {
|
||||
tick = 0;
|
||||
return;
|
||||
}
|
||||
if (T == null) T = this.worldObj.getTileEntity(xCoord - 1, yCoord, zCoord);
|
||||
if (checkTE(T)) {
|
||||
tick = 0;
|
||||
return;
|
||||
}
|
||||
if (T == null) T = this.worldObj.getTileEntity(xCoord, yCoord, zCoord - 1);
|
||||
if (checkTE(T)) {
|
||||
tick = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkTE(final TileEntity T) {
|
||||
if (T == null) return false;
|
||||
if (this.current.visSize() > 0) if (T instanceof IGregTechTileEntity) {
|
||||
IMetaTileEntity M = ((IGregTechTileEntity) T).getMetaTileEntity();
|
||||
if (M instanceof EssentiaHatch) {
|
||||
if (((EssentiaHatch) M).addAspectList(current)) this.current = new AspectList();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void fillfrompipe() {
|
||||
TileEntity[] te = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length];
|
||||
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]);
|
||||
if (te[i] != null) {
|
||||
IEssentiaTransport pipe = (IEssentiaTransport) te[i];
|
||||
if (!pipe.canOutputTo(ForgeDirection.VALID_DIRECTIONS[i])) {
|
||||
return;
|
||||
}
|
||||
if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]) != null)
|
||||
&& (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]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getAspects() {
|
||||
return current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAspects(AspectList aspectList) {
|
||||
this.current.add(aspectList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerAccept(Aspect aspect) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addToContainer(Aspect aspect, int i) {
|
||||
current.add(aspect, i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean takeFromContainer(Aspect aspect, int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean takeFromContainer(AspectList aspectList) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerContainAmount(Aspect aspect, int i) {
|
||||
return current.aspects.containsKey(aspect) && i <= current.getAmount(aspect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerContain(AspectList aspectList) {
|
||||
ArrayList<Boolean> ret = new ArrayList<Boolean>();
|
||||
for (Aspect a : aspectList.aspects.keySet()) if (current.aspects.containsKey(a)) {
|
||||
ret.add(true);
|
||||
} else ret.add(false);
|
||||
return !ret.contains(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int containerContains(Aspect aspect) {
|
||||
return current.aspects.containsKey(aspect) ? current.getAmount(aspect) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnectable(ForgeDirection forgeDirection) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInputFrom(ForgeDirection forgeDirection) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canOutputTo(ForgeDirection forgeDirection) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSuction(Aspect aspect, int i) {}
|
||||
|
||||
@Override
|
||||
public Aspect getSuctionType(ForgeDirection forgeDirection) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSuctionAmount(ForgeDirection forgeDirection) {
|
||||
return 256;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int takeEssentia(Aspect aspect, int i, ForgeDirection forgeDirection) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addEssentia(Aspect aspect, int i, ForgeDirection forgeDirection) {
|
||||
current.add(aspect, i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Aspect getEssentiaType(ForgeDirection forgeDirection) {
|
||||
return current.getAspects()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEssentiaAmount(ForgeDirection forgeDirection) {
|
||||
int ret = 0;
|
||||
for (final Aspect A : current.aspects.keySet()) {
|
||||
ret += current.getAmount(A);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinimumSuction() {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderExtendedTube() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
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.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.gthandler.common.blocks.EMT_GT_Block;
|
||||
import gregtech.api.util.GT_LanguageManager;
|
||||
import gregtech.common.blocks.GT_Item_Casings_Abstract;
|
||||
|
||||
public class EMT_CasingBlock extends GT_Item_Casings_Abstract {
|
||||
|
||||
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", }) };
|
||||
|
||||
protected final String deccCasing01Tooltip = GT_LanguageManager
|
||||
.addStringLocalization("gt.casing01tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 1");
|
||||
protected final String deccCasing02Tooltip = GT_LanguageManager
|
||||
.addStringLocalization("gt.casing02tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 2");
|
||||
protected final String deccCasing03Tooltip = GT_LanguageManager
|
||||
.addStringLocalization("gt.casing03tooltip", "Draconic Evolution Fusion Crafter Casing, Tier 3");
|
||||
protected final String deccCasing04Tooltip = GT_LanguageManager
|
||||
.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");
|
||||
|
||||
public EMT_CasingBlock(final Block par1) {
|
||||
super(par1);
|
||||
this.setMaxDamage(0);
|
||||
this.setHasSubtypes(true);
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(final int aMeta) {
|
||||
return aMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(final ItemStack aStack) {
|
||||
return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT) // so it only gets sent clientside?
|
||||
public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList,
|
||||
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
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack stack, int pass) {
|
||||
return this.field_150939_a.getIcon(0, stack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||
return getIcon(stack, renderPass);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) {
|
||||
return this.field_150939_a.getIcon(0, p_77618_2_);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,196 @@
|
||||
package emt.gthandler.common.loader;
|
||||
|
||||
import static emt.command.CommandOutputs.mkbook;
|
||||
import static gregtech.api.recipe.RecipeMaps.assemblerRecipes;
|
||||
import static gregtech.api.util.GTRecipeBuilder.SECONDS;
|
||||
|
||||
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 gregtech.api.enums.GTValues;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import emt.gthandler.common.implementations.EssentiaHatch;
|
||||
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.tile.GT_MetaTileEntity_ResearchCompleter;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.enums.ItemList;
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.enums.OrePrefixes;
|
||||
import gregtech.api.enums.TierEU;
|
||||
import gregtech.api.util.GTOreDictUnificator;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import gregtech.api.util.GT_ModHandler;
|
||||
import gregtech.api.util.GT_OreDictUnificator;
|
||||
|
||||
public class EMT_GT_Loader {
|
||||
public class EMT_GT_Loader implements Runnable {
|
||||
|
||||
public static void runlate() {
|
||||
GTValues.RA.stdBuilder()
|
||||
.itemInputs(
|
||||
new ItemStack(Items.book),
|
||||
GTOreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L),
|
||||
new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE))
|
||||
.itemOutputs(mkbook()).duration(6 * SECONDS).eut(TierEU.RECIPE_MV / 2).addTo(assemblerRecipes);
|
||||
public static final int TIERS = GT_Values.VN.length - 1;
|
||||
public static int aIDoffset = 13000 - GT_Values.VN.length - 1;
|
||||
public static ItemStack[] EHatch = new ItemStack[TIERS];
|
||||
public static ItemStack LEG;
|
||||
public static ItemStack DECC;
|
||||
public static ItemStack ResearchMultiblock;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
LEG = new EMT_Large_Essentia_Gen(
|
||||
aIDoffset + GT_Values.VN.length + 1,
|
||||
"Large Essentia Generator",
|
||||
"Large Essentia Generator").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() {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
+217
@@ -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.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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
|
||||
boolean aActive, boolean aRedstone) {
|
||||
if (aSide == aFacing) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
+408
@@ -0,0 +1,408 @@
|
||||
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 thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.visnet.VisNetHandler;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import emt.gthandler.common.implementations.EssentiaHatch;
|
||||
import emt.gthandler.common.items.EMT_CasingBlock;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import emt.util.EMTTextHelper;
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.enums.Textures;
|
||||
import gregtech.api.interfaces.ITexture;
|
||||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
|
||||
import gregtech.api.objects.GT_RenderedTexture;
|
||||
import gregtech.api.objects.XSTR;
|
||||
|
||||
public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
|
||||
|
||||
private static final byte CASING_INDEX = 2;
|
||||
public ArrayList<EssentiaHatch> mEssentiaHatches = new ArrayList();
|
||||
private byte tick = 0;
|
||||
private boolean has_lube = false;
|
||||
|
||||
public EMT_Large_Essentia_Gen(int aID, String aName, String aNameRegional) {
|
||||
super(aID, aName, aNameRegional);
|
||||
}
|
||||
|
||||
public EMT_Large_Essentia_Gen(String aName) {
|
||||
super(aName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getDescription() {
|
||||
return new String[] { "Controller Block for the Large Essentia Generator.",
|
||||
"Produces energy from magical essentia decay.", "Size(WxHxD): 7x4x7, Controller (Bottom, Center)",
|
||||
"Top-Middle 5x1x5 layer are Muffler Hatches", "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",
|
||||
"Produces 20x more than the singleblock generator per essentia",
|
||||
"Causes magical and serious 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",
|
||||
"Added by EMT", "Made by bartimaeusnek" };
|
||||
}
|
||||
|
||||
public int getCurrentEfficiency(ItemStack itemStack) {
|
||||
return this.mEfficiency
|
||||
- (this.getIdealStatus() - this.getRepairStatus()) * this.getMaxEfficiency(itemStack) / 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
|
||||
boolean aActive, boolean aRedstone) {
|
||||
if (aSide == aFacing) {
|
||||
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) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMetaTileEntity newMetaEntity(IGregTechTileEntity arg0) {
|
||||
return new EMT_Large_Essentia_Gen(this.mName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
// TODO Auto-generated method stub
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int p_70301_1_) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
// TODO Auto-generated method stub
|
||||
return this.mName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
// TODO Auto-generated method stub
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
|
||||
// TODO Auto-generated method stub
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack arg1) {
|
||||
|
||||
final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3;
|
||||
final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3;
|
||||
|
||||
for (int x = -3; x <= 3; x++) {
|
||||
for (int z = -3; z <= 3; z++) {
|
||||
for (int h = 0; h <= 3; h++) {
|
||||
final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity
|
||||
.getIGregTechTileEntityOffset(xDir + x, h, zDir + z);
|
||||
|
||||
if (!(Math.abs(x) == 3 || Math.abs(z) == 3)) {
|
||||
// Muffler on top.
|
||||
if ((h == 3)) {
|
||||
if (!this.addMufflerToMachineList(tTileEntity, CASING_INDEX)) {
|
||||
return false;
|
||||
}
|
||||
} else if (h != 0) {
|
||||
// inside Special Blocks
|
||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
|
||||
!= EMT_CasingBlock.EMT_GT_BLOCKS[0])
|
||||
return false;
|
||||
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 1)) return false;
|
||||
} else if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX)
|
||||
|| this.addDynamoToMachineList(tTileEntity, CASING_INDEX)
|
||||
|| this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX)
|
||||
|| this.addInputToMachineList(tTileEntity, CASING_INDEX)))
|
||||
// ground still casings
|
||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
|
||||
!= EMT_CasingBlock.EMT_GT_BLOCKS[0])
|
||||
return false;
|
||||
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) return false;
|
||||
|
||||
} else if (h != 0) {
|
||||
// walls
|
||||
if (!(this.addEssetiaHatchToList(tTileEntity, CASING_INDEX)
|
||||
|| this.addDynamoToMachineList(tTileEntity, CASING_INDEX)
|
||||
|| this.addMaintenanceToMachineList(tTileEntity, CASING_INDEX)
|
||||
|| this.addInputToMachineList(tTileEntity, CASING_INDEX)))
|
||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
|
||||
!= EMT_CasingBlock.EMT_GT_BLOCKS[0])
|
||||
return false;
|
||||
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) return false;
|
||||
} else if (h == 0) {
|
||||
// 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 (((xDir + x) != 0) || ((zDir + z) != 0)) // controller
|
||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z)
|
||||
!= EMT_CasingBlock.EMT_GT_BLOCKS[0])
|
||||
return false;
|
||||
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0)) return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.mDynamoHatches.size() != 1) return false;
|
||||
|
||||
if (this.mInputHatches.size() != 1) return false;
|
||||
|
||||
if (this.mMaintenanceHatches.size() != 1) return false;
|
||||
|
||||
/*
|
||||
* //repair shit debug shit this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true;
|
||||
* this.mHardHammer = true; this.mSolderingTool = true; this.mCrowbar = true;
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
|
||||
if (aTileEntity instanceof EssentiaHatch) return addEssetiaHatchToList(aTileEntity, aBaseCasingIndex);
|
||||
return super.addInputToMachineList(aTileEntity, aBaseCasingIndex);
|
||||
}
|
||||
|
||||
private boolean addEssetiaHatchToList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
|
||||
if (aTileEntity == null) {
|
||||
return false;
|
||||
} else {
|
||||
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
|
||||
if (aMetaTileEntity == null) {
|
||||
return false;
|
||||
} else if (aMetaTileEntity instanceof EssentiaHatch) {
|
||||
((EssentiaHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
|
||||
return this.mEssentiaHatches.add((EssentiaHatch) aMetaTileEntity);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void make_energy() {
|
||||
AspectList fuel = this.mEssentiaHatches.get(0).getAspects();
|
||||
double cached = 0;
|
||||
|
||||
++tick;
|
||||
|
||||
// make energy
|
||||
for (final Aspect A : fuel.aspects.keySet()) {
|
||||
if (fuel.getAmount(A) > 0) {
|
||||
double burnvalue = EMTEssentiasOutputs.outputs.get(A.getTag()).doubleValue();
|
||||
cached += (burnvalue / 20D);
|
||||
cached = Math.ceil(cached);
|
||||
|
||||
if (tick % 20 == 0) { // every second consume 1 essentia
|
||||
// consume essentia and remove it from the Aspect List if its 0
|
||||
this.mEssentiaHatches.get(0).getAspects().reduce(A, 1);
|
||||
if (this.mEssentiaHatches.get(0).getAspects().getAmount(A) == 0)
|
||||
this.mEssentiaHatches.get(0).getAspects().remove(A);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tick % 20 == 0) {
|
||||
// consume lubricant
|
||||
if (has_lube) this.mInputHatches.get(0).getFluid().amount -= 1;
|
||||
|
||||
tick = 0; // reset ticktimer
|
||||
}
|
||||
|
||||
// transfer energy into mEU
|
||||
this.mEUt = (int) Math.ceil(cached);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkRecipe(ItemStack arg0) {
|
||||
/*
|
||||
* if (!this.getBaseMetaTileEntity().isActive()) if (this.mEfficiency > 100) this.mEfficiency -= 8; else
|
||||
* this.mEfficiency = 100;
|
||||
*/
|
||||
if (this.mEssentiaHatches.get(0).fuelleft() > 0) {
|
||||
this.mMaxProgresstime = 1;
|
||||
this.mProgresstime = 0;
|
||||
}
|
||||
|
||||
return this.mEssentiaHatches.get(0).fuelleft() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onRunningTick(ItemStack aStack) {
|
||||
|
||||
if (tick % 20 == 0) { // every second
|
||||
// highers eff to max by 0.16% every running tick = 3,2% every second
|
||||
if (this.mEfficiency < this.getMaxEfficiency(null) - 320) this.mEfficiency += 320;
|
||||
else this.mEfficiency = getMaxEfficiency(null);
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
if (tick % 2 == 0) { // every 2nd tick
|
||||
|
||||
final XSTR R = new XSTR();
|
||||
final World WORLD = this.getBaseMetaTileEntity().getWorld();
|
||||
int x = this.getBaseMetaTileEntity().getXCoord();
|
||||
int y = this.getBaseMetaTileEntity().getYCoord();
|
||||
int z = this.getBaseMetaTileEntity().getZCoord();
|
||||
|
||||
// if out of aqua, make much flux but to not stop.
|
||||
boolean outOfcVis = VisNetHandler.drainVis(WORLD, x, y, z, Aspect.WATER, 10) <= 9;
|
||||
|
||||
// Random Change of a bit of Flux Gas.
|
||||
final int RANDOMHATCH = R.nextInt(this.mMufflerHatches.size());
|
||||
|
||||
// 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) {
|
||||
x = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getXCoord();
|
||||
y = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getYCoord() + 1;
|
||||
z = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getZCoord();
|
||||
WORLD.setBlock(x, y, z, ConfigBlocks.blockFluxGas, R.nextInt(8), 3);
|
||||
}
|
||||
}
|
||||
|
||||
make_energy();
|
||||
++this.mProgresstime;
|
||||
return super.onRunningTick(aStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean explodesOnComponentBreak(ItemStack arg0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageToComponent(ItemStack arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEfficiency(ItemStack arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
return 10000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPollutionPerTick(ItemStack arg0) {
|
||||
return has_lube ? 50 : 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCorrectMachinePart(ItemStack arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGivingInformation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getInfoData() {
|
||||
String[] old = super.getInfoData();
|
||||
old[2] = "Produces " + EMTTextHelper.RED + mEUt + EMTTextHelper.WHITE + "EU/t";
|
||||
return old;
|
||||
}
|
||||
|
||||
/*
|
||||
* @Override public void explodeMultiblock() { final World WORLD=this.getBaseMetaTileEntity().getWorld(); final int
|
||||
* xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 3; final int zDir =
|
||||
* ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 3; 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();
|
||||
* }
|
||||
*/
|
||||
}
|
||||
@@ -4,25 +4,22 @@ import static thaumcraft.api.ThaumcraftApi.registerObjectTag;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import emt.block.BlockElectricCloud;
|
||||
import emt.block.BlockEssentiaGenerators;
|
||||
import emt.block.BlockMachines;
|
||||
import emt.block.BlockPortableNode;
|
||||
import emt.block.BlockShield;
|
||||
import emt.block.*;
|
||||
import emt.item.block.ItemBlockElectricCloud;
|
||||
import emt.item.block.ItemBlockEssentiaGenerators;
|
||||
import emt.item.block.ItemBlockMachines;
|
||||
import emt.item.block.ItemBlockSolars;
|
||||
import emt.tile.solar.Solars;
|
||||
import ic2.api.item.IC2Items;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
public class EMTBlocks {
|
||||
|
||||
public static Block portableNode, essentiaGens, shield, emtMachines, electricCloud;
|
||||
|
||||
public static Block[] solars = new Block[0];
|
||||
public static Block[] solars = new Block[Solars.getCountOfInstances()];
|
||||
|
||||
public static void registerBlocks() {
|
||||
portableNode = new BlockPortableNode("portablenode");
|
||||
@@ -31,17 +28,22 @@ public class EMTBlocks {
|
||||
shield = new BlockShield("shield");
|
||||
GameRegistry.registerBlock(shield, "ShieldBlock");
|
||||
|
||||
if (Registry.enableGTCompat) {
|
||||
solars = Solars.registerBlocks();
|
||||
for (int i = 0; i < solars.length; i++) {
|
||||
if (i == 0) {
|
||||
solars[i] = new BlockSolars("solar", Solars.getCountOfMetas(i), i);
|
||||
GameRegistry.registerBlock(solars[i], ItemBlockSolars.class, "EMTSolars");
|
||||
} else {
|
||||
solars[i] = new BlockSolars("solar" + (i + 1), Solars.getCountOfMetas(i), i);
|
||||
GameRegistry.registerBlock(solars[i], ItemBlockSolars.class, "EMTSolars" + (i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
emtMachines = new BlockMachines("machine");
|
||||
GameRegistry.registerBlock(emtMachines, ItemBlockMachines.class, "EMTMachines");
|
||||
|
||||
if (Registry.enableGTCompat) {
|
||||
essentiaGens = new BlockEssentiaGenerators("essentia");
|
||||
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");
|
||||
}
|
||||
essentiaGens = new BlockEssentiaGenerators("essentia");
|
||||
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");
|
||||
|
||||
electricCloud = new BlockElectricCloud("electricCloud");
|
||||
GameRegistry.registerBlock(electricCloud, ItemBlockElectricCloud.class, "electricCloud");
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import emt.EMT;
|
||||
import emt.item.ItemElectricScribingTools;
|
||||
@@ -24,13 +25,7 @@ import emt.item.armor.wings.ItemFeatherWing;
|
||||
import emt.item.armor.wings.ItemNanoWing;
|
||||
import emt.item.armor.wings.ItemQuantumWing;
|
||||
import emt.item.armor.wings.ItemThaumiumReinforcedWing;
|
||||
import emt.item.focus.ItemChargeFocus;
|
||||
import emt.item.focus.ItemChristmasFocus;
|
||||
import emt.item.focus.ItemEnergyBallFocus;
|
||||
import emt.item.focus.ItemExplosionFocus;
|
||||
import emt.item.focus.ItemMaintenanceFocus;
|
||||
import emt.item.focus.ItemShieldFocus;
|
||||
import emt.item.focus.ItemWandChargingFocus;
|
||||
import emt.item.focus.*;
|
||||
import emt.item.tool.ItemElectricHoeGrowth;
|
||||
import emt.item.tool.ItemElectricThorHammer;
|
||||
import emt.item.tool.ItemThorHammer;
|
||||
@@ -44,7 +39,6 @@ import emt.item.tool.omnitool.ItemOmnitoolDiamond;
|
||||
import emt.item.tool.omnitool.ItemOmnitoolIron;
|
||||
import emt.item.tool.omnitool.ItemOmnitoolThaumium;
|
||||
import ic2.core.init.InternalName;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
|
||||
public class EMTItems {
|
||||
|
||||
@@ -64,7 +58,6 @@ public class EMTItems {
|
||||
public static Item christmasFocus;
|
||||
public static Item shieldFocus;
|
||||
public static Item energyBallFocus;
|
||||
public static Item maintenanceFocus;
|
||||
public static Item electricGoggles;
|
||||
public static Item streamChainsaw;
|
||||
public static Item rockbreakerDrill;
|
||||
@@ -204,8 +197,5 @@ public class EMTItems {
|
||||
|
||||
energyBallFocus = new ItemEnergyBallFocus();
|
||||
GameRegistry.registerItem(energyBallFocus, "EnergyBallFocus");
|
||||
|
||||
maintenanceFocus = new ItemMaintenanceFocus();
|
||||
GameRegistry.registerItem(maintenanceFocus, "MaintenanceFocus");
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,15 @@ import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.crafting.CrucibleRecipe;
|
||||
import thaumcraft.api.crafting.InfusionRecipe;
|
||||
import thaumcraft.api.crafting.ShapedArcaneRecipe;
|
||||
import thaumcraft.api.crafting.ShapelessArcaneRecipe;
|
||||
import thaumcraft.common.blocks.ItemJarNode;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
@@ -24,15 +32,6 @@ import ic2.api.recipe.RecipeInputItemStack;
|
||||
import ic2.api.recipe.Recipes;
|
||||
import ic2.core.BasicMachineRecipeManager;
|
||||
import ic2.core.Ic2Items;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.crafting.CrucibleRecipe;
|
||||
import thaumcraft.api.crafting.InfusionRecipe;
|
||||
import thaumcraft.api.crafting.ShapedArcaneRecipe;
|
||||
import thaumcraft.api.crafting.ShapelessArcaneRecipe;
|
||||
import thaumcraft.common.blocks.ItemJarNode;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
public class EMTRecipes {
|
||||
|
||||
@@ -68,7 +67,6 @@ public class EMTRecipes {
|
||||
public static InfusionRecipe thaumicNanoHelmet;
|
||||
public static InfusionRecipe explosionFocus;
|
||||
public static InfusionRecipe shieldFocus;
|
||||
public static InfusionRecipe maintenanceFocus;
|
||||
public static InfusionRecipe potentiaGenerator;
|
||||
public static InfusionRecipe streamChainsaw;
|
||||
public static InfusionRecipe rockbreakerDrill;
|
||||
@@ -103,6 +101,8 @@ public class EMTRecipes {
|
||||
public static ShapedArcaneRecipe electricScribingTools;
|
||||
public static ShapedArcaneRecipe thaumiumWing;
|
||||
public static ShapedArcaneRecipe thaumiumWings;
|
||||
public static ShapedArcaneRecipe researchCompleter;
|
||||
public static ShapedArcaneRecipe magicalMachineCasing;
|
||||
public static CrucibleRecipe ignisGenerator;
|
||||
public static CrucibleRecipe auramGenerator;
|
||||
public static CrucibleRecipe arborGenerator;
|
||||
@@ -534,19 +534,6 @@ public class EMTRecipes {
|
||||
new ItemStack(Blocks.soul_sand), new ItemStack(Blocks.obsidian),
|
||||
new ItemStack(Blocks.obsidian) });
|
||||
|
||||
if (Registry.enableGTCompat) {
|
||||
maintenanceFocus = addInfusionCraftingRecipe(
|
||||
"Wand Focus: Maintenance",
|
||||
new ItemStack(EMTItems.maintenanceFocus),
|
||||
6,
|
||||
EMTCraftingAspects.maintenanceFocus,
|
||||
new ItemStack(EMTItems.chargeFocus),
|
||||
new ItemStack[] { new ItemStack(ConfigItems.itemShard, 1, 5),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 4), new ItemStack(ConfigItems.itemShard, 1, 3),
|
||||
new ItemStack(EMTItems.itemEMTItems, 1, 9), new ItemStack(ConfigItems.itemShard, 1, 2),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 1), new ItemStack(ConfigItems.itemShard, 1, 0),
|
||||
new ItemStack(GameRegistry.findItem("gregtech", "gt.metaitem.01"), 1, 32764) });
|
||||
}
|
||||
potentiaGenerator = addInfusionCraftingRecipe(
|
||||
"Potentia Generator",
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 0),
|
||||
@@ -615,20 +602,16 @@ public class EMTRecipes {
|
||||
new ItemStack(Blocks.diamond_block), new ItemStack(ConfigItems.itemShard, 1, 5),
|
||||
new ItemStack(ConfigBlocks.blockJar) });
|
||||
|
||||
if (Registry.enableGTCompat) {
|
||||
solarHelmetRevealing = addInfusionCraftingRecipe(
|
||||
"Solar Helmet of Revealing",
|
||||
getChargedItem(EMTItems.solarHelmetRevealing, 10),
|
||||
5,
|
||||
EMTCraftingAspects.solarHelmetRevealing,
|
||||
new ItemStack(EMTItems.quantumThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(EMTBlocks.solars[0], 1, 1), IC2Items.getItem("glassFiberCableItem"),
|
||||
new ItemStack(
|
||||
IC2Items.getItem("lapotronCrystal").getItem(),
|
||||
1,
|
||||
OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 4) });
|
||||
}
|
||||
solarHelmetRevealing = addInfusionCraftingRecipe(
|
||||
"Solar Helmet of Revealing",
|
||||
getChargedItem(EMTItems.solarHelmetRevealing, 10),
|
||||
5,
|
||||
EMTCraftingAspects.solarHelmetRevealing,
|
||||
new ItemStack(EMTItems.quantumThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(EMTBlocks.solars[0], 1, 1), IC2Items.getItem("glassFiberCableItem"),
|
||||
new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 4) });
|
||||
|
||||
electricBootsTravel = addInfusionCraftingRecipe(
|
||||
"Electric Boots of the Traveller",
|
||||
getChargedItem(EMTItems.electricBootsTraveller, 10),
|
||||
@@ -672,19 +655,17 @@ public class EMTRecipes {
|
||||
new ItemStack(Blocks.iron_block), new ItemStack(EMTItems.itemEMTItems, 1, 5),
|
||||
new ItemStack(EMTItems.itemEMTItems, 1, 5) });
|
||||
|
||||
if (Registry.enableGTCompat) {
|
||||
tripleCompressedSolar = addInfusionCraftingRecipe(
|
||||
"Compressed Solars",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
2,
|
||||
EMTCraftingAspects.compressedSolars,
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
new ItemStack[] { new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1), new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1), new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1), new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1) });
|
||||
}
|
||||
tripleCompressedSolar = addInfusionCraftingRecipe(
|
||||
"Compressed Solars",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
2,
|
||||
EMTCraftingAspects.compressedSolars,
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
new ItemStack[] { new ItemStack(EMTBlocks.solars[0], 1, 1), new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1), new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1), new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1), new ItemStack(EMTBlocks.solars[0], 1, 1) });
|
||||
|
||||
electricHoeGrowth = addInfusionCraftingRecipe(
|
||||
"Electric Hoe of Growth",
|
||||
getChargedItem(EMTItems.electricHoeGrowth, 10),
|
||||
@@ -872,26 +853,26 @@ public class EMTRecipes {
|
||||
EMTCraftingAspects.tinyUraniumCrafting,
|
||||
IC2Items.getItem("Uran238"));
|
||||
|
||||
if (Registry.enableGTCompat) {
|
||||
compressedSolar = addArcaneCraftingRecipe(
|
||||
"Compressed Solars",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.compressedSolars,
|
||||
"XXX",
|
||||
"XXX",
|
||||
"XXX",
|
||||
'X',
|
||||
IC2Items.getItem("solarPanel"));
|
||||
doubleCompressedSolar = addArcaneCraftingRecipe(
|
||||
"Compressed Solars",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.compressedSolars,
|
||||
"XXX",
|
||||
"XXX",
|
||||
"XXX",
|
||||
'X',
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0));
|
||||
}
|
||||
compressedSolar = addArcaneCraftingRecipe(
|
||||
"Compressed Solars",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.compressedSolars,
|
||||
"XXX",
|
||||
"XXX",
|
||||
"XXX",
|
||||
'X',
|
||||
IC2Items.getItem("solarPanel"));
|
||||
|
||||
doubleCompressedSolar = addArcaneCraftingRecipe(
|
||||
"Compressed Solars",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.compressedSolars,
|
||||
"XXX",
|
||||
"XXX",
|
||||
"XXX",
|
||||
'X',
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0));
|
||||
|
||||
electricScribingTools = addArcaneCraftingRecipe(
|
||||
"Electric Scribing Tools",
|
||||
getChargedItem(EMTItems.electricScribingTools, 10),
|
||||
@@ -928,140 +909,151 @@ public class EMTRecipes {
|
||||
'X',
|
||||
new ItemStack(EMTItems.itemEMTItems, 1, 14));
|
||||
|
||||
if (Registry.enableGTCompat) {
|
||||
/** Crucible Recipes **/
|
||||
ignisGenerator = addCrucibleRecipe(
|
||||
"Ignis Generator",
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 1),
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 0),
|
||||
EMTCraftingAspects.ignisGeneratorCrafting);
|
||||
// magicalMachineCasing = addArcaneCraftingRecipe("ResearchCompleter", new
|
||||
// ItemStack(GregTech_API.sBlockCasings8, 1, 6), EMTCraftingAspects.magicalMachineCasing, "XYX", "XZX", "XYX",
|
||||
// 'X', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Thaumium, 1), 'Y', new
|
||||
// ItemStack(ConfigItems.itemResource, 1, 14) , 'Z', GT_OreDictUnificator.get(OrePrefixes.frameGt,
|
||||
// Materials.Thaumium, 1));
|
||||
|
||||
auramGenerator = addCrucibleRecipe(
|
||||
"Auram Generator",
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 2),
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 0),
|
||||
EMTCraftingAspects.auramGeneratorCrafting);
|
||||
// researchCompleter = addArcaneCraftingRecipe("ResearchCompleter", new ItemStack(GregTech_API.sBlockMachines,
|
||||
// 1, 13001), EMTCraftingAspects.researchCompleter, "XYX", "YZY", "XAX", 'X',
|
||||
// GT_OreDictUnificator.get(OrePrefixes.circuit.get(Materials.Good), 1L), 'Y', new
|
||||
// ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 2), 'Z', new ItemStack(GregTech_API.sBlockCasings8, 1, 6),
|
||||
// 'A', new ItemStack(ConfigBlocks.blockStoneDevice, 1, 5));
|
||||
|
||||
arborGenerator = addCrucibleRecipe(
|
||||
"Arbor Generator",
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 3),
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 0),
|
||||
EMTCraftingAspects.arborGeneratorCrafting);
|
||||
/** Crucible Recipes **/
|
||||
ignisGenerator = addCrucibleRecipe(
|
||||
"Ignis Generator",
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 1),
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 0),
|
||||
EMTCraftingAspects.ignisGeneratorCrafting);
|
||||
|
||||
aerGenerator = addCrucibleRecipe(
|
||||
"Aer Generator",
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 4),
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 0),
|
||||
EMTCraftingAspects.aerGenerator);
|
||||
auramGenerator = addCrucibleRecipe(
|
||||
"Auram Generator",
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 2),
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 0),
|
||||
EMTCraftingAspects.auramGeneratorCrafting);
|
||||
|
||||
waterSolar = addCrucibleRecipe(
|
||||
"Water Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 3),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.waterSolars);
|
||||
arborGenerator = addCrucibleRecipe(
|
||||
"Arbor Generator",
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 3),
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 0),
|
||||
EMTCraftingAspects.arborGeneratorCrafting);
|
||||
|
||||
doubleWaterSolar = addCrucibleRecipe(
|
||||
"Water Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 4),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.waterSolars);
|
||||
aerGenerator = addCrucibleRecipe(
|
||||
"Aer Generator",
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 4),
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 0),
|
||||
EMTCraftingAspects.aerGenerator);
|
||||
|
||||
tripleWaterSolar = addCrucibleRecipe(
|
||||
"Water Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 5),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
EMTCraftingAspects.waterSolars);
|
||||
waterSolar = addCrucibleRecipe(
|
||||
"Water Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 3),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.waterSolars);
|
||||
|
||||
darkSolar = addCrucibleRecipe(
|
||||
"Entropy Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 6),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.darkSolars);
|
||||
doubleWaterSolar = addCrucibleRecipe(
|
||||
"Water Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 4),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.waterSolars);
|
||||
|
||||
doubleDarkSolar = addCrucibleRecipe(
|
||||
"Entropy Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 7),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.darkSolars);
|
||||
tripleWaterSolar = addCrucibleRecipe(
|
||||
"Water Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 5),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
EMTCraftingAspects.waterSolars);
|
||||
|
||||
tripleDarkSolar = addCrucibleRecipe(
|
||||
"Entropy Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 8),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
EMTCraftingAspects.darkSolars);
|
||||
darkSolar = addCrucibleRecipe(
|
||||
"Entropy Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 6),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.darkSolars);
|
||||
|
||||
orderSolar = addCrucibleRecipe(
|
||||
"Order Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 9),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.orderSolars);
|
||||
doubleDarkSolar = addCrucibleRecipe(
|
||||
"Entropy Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 7),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.darkSolars);
|
||||
|
||||
doubleOrderSolar = addCrucibleRecipe(
|
||||
"Order Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 10),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.orderSolars);
|
||||
tripleDarkSolar = addCrucibleRecipe(
|
||||
"Entropy Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 8),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
EMTCraftingAspects.darkSolars);
|
||||
|
||||
tripleOrderSolar = addCrucibleRecipe(
|
||||
"Order Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 11),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
EMTCraftingAspects.orderSolars);
|
||||
orderSolar = addCrucibleRecipe(
|
||||
"Order Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 9),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.orderSolars);
|
||||
|
||||
fireSolar = addCrucibleRecipe(
|
||||
"Fire Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 12),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.fireSolars);
|
||||
doubleOrderSolar = addCrucibleRecipe(
|
||||
"Order Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 10),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.orderSolars);
|
||||
|
||||
doubleFireSolar = addCrucibleRecipe(
|
||||
"Fire Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 13),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.fireSolars);
|
||||
tripleOrderSolar = addCrucibleRecipe(
|
||||
"Order Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 11),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
EMTCraftingAspects.orderSolars);
|
||||
|
||||
tripleFireSolar = addCrucibleRecipe(
|
||||
"Fire Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 14),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
EMTCraftingAspects.fireSolars);
|
||||
fireSolar = addCrucibleRecipe(
|
||||
"Fire Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 12),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.fireSolars);
|
||||
|
||||
airSolar = addCrucibleRecipe(
|
||||
"Air Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 15),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.airSolars);
|
||||
doubleFireSolar = addCrucibleRecipe(
|
||||
"Fire Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 13),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.fireSolars);
|
||||
|
||||
doubleAirSolar = addCrucibleRecipe(
|
||||
"Air Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[1], 1, 0),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.airSolars);
|
||||
tripleFireSolar = addCrucibleRecipe(
|
||||
"Fire Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 14),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
EMTCraftingAspects.fireSolars);
|
||||
|
||||
tripleAirSolar = addCrucibleRecipe(
|
||||
"Air Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[1], 1, 1),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
EMTCraftingAspects.airSolars);
|
||||
airSolar = addCrucibleRecipe(
|
||||
"Air Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 15),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.airSolars);
|
||||
|
||||
earthSolar = addCrucibleRecipe(
|
||||
"Earth Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[1], 1, 2),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.earthSolars);
|
||||
doubleAirSolar = addCrucibleRecipe(
|
||||
"Air Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[1], 1, 0),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.airSolars);
|
||||
|
||||
doubleEarthSolar = addCrucibleRecipe(
|
||||
"Earth Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[1], 1, 3),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.earthSolars);
|
||||
tripleAirSolar = addCrucibleRecipe(
|
||||
"Air Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[1], 1, 1),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
EMTCraftingAspects.airSolars);
|
||||
|
||||
earthSolar = addCrucibleRecipe(
|
||||
"Earth Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[1], 1, 2),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 0),
|
||||
EMTCraftingAspects.earthSolars);
|
||||
|
||||
doubleEarthSolar = addCrucibleRecipe(
|
||||
"Earth Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[1], 1, 3),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 1),
|
||||
EMTCraftingAspects.earthSolars);
|
||||
|
||||
tripleEarthSolar = addCrucibleRecipe(
|
||||
"Earth Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[1], 1, 4),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
EMTCraftingAspects.earthSolars);
|
||||
|
||||
tripleEarthSolar = addCrucibleRecipe(
|
||||
"Earth Infused Solar Panels",
|
||||
new ItemStack(EMTBlocks.solars[1], 1, 4),
|
||||
new ItemStack(EMTBlocks.solars[0], 1, 2),
|
||||
EMTCraftingAspects.earthSolars);
|
||||
}
|
||||
ItemStack itemStack = new ItemStack(ConfigItems.itemJarNode);
|
||||
((ItemJarNode) itemStack.getItem()).setAspects(itemStack, new AspectList());
|
||||
portableNode = addCrucibleRecipe(
|
||||
@@ -1078,58 +1070,54 @@ public class EMTRecipes {
|
||||
|
||||
/** IC2 Stuff related recipes **/
|
||||
|
||||
final boolean isDreamcraftNotLoaded = !Loader.isModLoaded("dreamcraft");
|
||||
/* Ore Clusters Macerator Recipes */
|
||||
ItemStack ironClusterRecipe = IC2Items.getItem("smallIronDust").copy();
|
||||
ironClusterRecipe.stackSize = 22;
|
||||
((BasicMachineRecipeManager) Recipes.macerator).addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 16)),
|
||||
null,
|
||||
true,
|
||||
ironClusterRecipe);
|
||||
|
||||
if (isDreamcraftNotLoaded) {
|
||||
/* Ore Clusters Macerator Recipes */
|
||||
ItemStack ironClusterRecipe = IC2Items.getItem("smallIronDust").copy();
|
||||
ironClusterRecipe.stackSize = 22;
|
||||
((BasicMachineRecipeManager) Recipes.macerator).addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 16)),
|
||||
null,
|
||||
true,
|
||||
ironClusterRecipe);
|
||||
ItemStack goldClusterRecipe = IC2Items.getItem("smallGoldDust").copy();
|
||||
goldClusterRecipe.stackSize = 22;
|
||||
((BasicMachineRecipeManager) Recipes.macerator).addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 31)),
|
||||
null,
|
||||
true,
|
||||
goldClusterRecipe);
|
||||
|
||||
ItemStack goldClusterRecipe = IC2Items.getItem("smallGoldDust").copy();
|
||||
goldClusterRecipe.stackSize = 22;
|
||||
((BasicMachineRecipeManager) Recipes.macerator).addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 31)),
|
||||
null,
|
||||
true,
|
||||
goldClusterRecipe);
|
||||
ItemStack copperClusterRecipe = IC2Items.getItem("smallCopperDust").copy();
|
||||
copperClusterRecipe.stackSize = 22;
|
||||
((BasicMachineRecipeManager) Recipes.macerator).addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 17)),
|
||||
null,
|
||||
true,
|
||||
copperClusterRecipe);
|
||||
|
||||
ItemStack copperClusterRecipe = IC2Items.getItem("smallCopperDust").copy();
|
||||
copperClusterRecipe.stackSize = 22;
|
||||
((BasicMachineRecipeManager) Recipes.macerator).addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 17)),
|
||||
null,
|
||||
true,
|
||||
copperClusterRecipe);
|
||||
ItemStack tinClusterRecipe = IC2Items.getItem("smallTinDust").copy();
|
||||
tinClusterRecipe.stackSize = 22;
|
||||
((BasicMachineRecipeManager) Recipes.macerator).addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 18)),
|
||||
null,
|
||||
true,
|
||||
tinClusterRecipe);
|
||||
|
||||
ItemStack tinClusterRecipe = IC2Items.getItem("smallTinDust").copy();
|
||||
tinClusterRecipe.stackSize = 22;
|
||||
((BasicMachineRecipeManager) Recipes.macerator).addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 18)),
|
||||
null,
|
||||
true,
|
||||
tinClusterRecipe);
|
||||
ItemStack silverClusterRecipe = IC2Items.getItem("smallSilverDust").copy();
|
||||
silverClusterRecipe.stackSize = 22;
|
||||
((BasicMachineRecipeManager) Recipes.macerator).addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 19)),
|
||||
null,
|
||||
true,
|
||||
silverClusterRecipe);
|
||||
|
||||
ItemStack silverClusterRecipe = IC2Items.getItem("smallSilverDust").copy();
|
||||
silverClusterRecipe.stackSize = 22;
|
||||
((BasicMachineRecipeManager) Recipes.macerator).addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 19)),
|
||||
null,
|
||||
true,
|
||||
silverClusterRecipe);
|
||||
|
||||
ItemStack leadClusterRecipe = IC2Items.getItem("smallLeadDust").copy();
|
||||
leadClusterRecipe.stackSize = 22;
|
||||
((BasicMachineRecipeManager) Recipes.macerator).addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 20)),
|
||||
null,
|
||||
true,
|
||||
leadClusterRecipe);
|
||||
}
|
||||
ItemStack leadClusterRecipe = IC2Items.getItem("smallLeadDust").copy();
|
||||
leadClusterRecipe.stackSize = 22;
|
||||
((BasicMachineRecipeManager) Recipes.macerator).addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 20)),
|
||||
null,
|
||||
true,
|
||||
leadClusterRecipe);
|
||||
|
||||
/* Thaumium Plates Recipes */
|
||||
thaumiumPlate = GameRegistry.addShapedRecipe(
|
||||
@@ -1143,79 +1131,76 @@ public class EMTRecipes {
|
||||
new ItemStack(IC2Items.getItem("ForgeHammer").getItem(), 1, OreDictionary.WILDCARD_VALUE),
|
||||
'Z',
|
||||
new ItemStack(Blocks.obsidian));
|
||||
Recipes.metalformerRolling.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemResource, 1, 2)),
|
||||
null,
|
||||
new ItemStack(EMTItems.itemEMTItems, 1, 5));
|
||||
|
||||
if (isDreamcraftNotLoaded) {
|
||||
Recipes.metalformerRolling.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigItems.itemResource, 1, 2)),
|
||||
null,
|
||||
new ItemStack(EMTItems.itemEMTItems, 1, 5));
|
||||
|
||||
/* Ore Processing for Amber and Cinnabar */
|
||||
if (EMTConfigHandler.removeAmberAndCinnabarMacerating) {
|
||||
for (Iterator<IRecipeInput> it = Recipes.macerator.getRecipes().keySet().iterator(); it.hasNext();) {
|
||||
IRecipeInput input = it.next();
|
||||
if (input.matches(new ItemStack(ConfigBlocks.blockCustomOre, 1, 7))) {
|
||||
it.remove();
|
||||
EMT.LOGGER.info("Removing conflicting amber macerating recipe(s)");
|
||||
}
|
||||
}
|
||||
|
||||
for (Iterator<IRecipeInput> it = Recipes.macerator.getRecipes().keySet().iterator(); it.hasNext();) {
|
||||
IRecipeInput input = it.next();
|
||||
if (input.matches(new ItemStack(ConfigBlocks.blockCustomOre, 1, 0))) {
|
||||
it.remove();
|
||||
EMT.LOGGER.info("Removing Conflicting cinnabar macerating recipe(s)");
|
||||
}
|
||||
/* Ore Processing for Amber and Cinnabar */
|
||||
if (EMTConfigHandler.removeAmberAndCinnabarMacerating) {
|
||||
for (Iterator<IRecipeInput> it = Recipes.macerator.getRecipes().keySet().iterator(); it.hasNext();) {
|
||||
IRecipeInput input = it.next();
|
||||
if (input.matches(new ItemStack(ConfigBlocks.blockCustomOre, 1, 7))) {
|
||||
it.remove();
|
||||
EMT.LOGGER.info("Removing conflicting amber macerating recipe(s)");
|
||||
}
|
||||
}
|
||||
ItemStack crushedAmberRecipe = new ItemStack(EMTItems.itemEMTItems, 1, 1);
|
||||
crushedAmberRecipe.stackSize = 2;
|
||||
Recipes.macerator.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigBlocks.blockCustomOre, 1, 7)),
|
||||
null,
|
||||
crushedAmberRecipe);
|
||||
|
||||
ItemStack crushedCinnabarRecipe = new ItemStack(EMTItems.itemEMTItems, 1, 3);
|
||||
crushedCinnabarRecipe.stackSize = 2;
|
||||
Recipes.macerator.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigBlocks.blockCustomOre, 1, 0)),
|
||||
null,
|
||||
crushedCinnabarRecipe);
|
||||
|
||||
NBTTagCompound waterAmount = new NBTTagCompound();
|
||||
waterAmount.setInteger("amount", 1000);
|
||||
|
||||
ItemStack smallCopperDust = IC2Items.getItem("smallCopperDust");
|
||||
smallCopperDust.stackSize = 2;
|
||||
ItemStack smallTinDust = IC2Items.getItem("smallTinDust");
|
||||
smallCopperDust.stackSize = 2;
|
||||
|
||||
Recipes.oreWashing.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(EMTItems.itemEMTItems, 1, 1)),
|
||||
waterAmount,
|
||||
new ItemStack(EMTItems.itemEMTItems, 1, 2),
|
||||
smallCopperDust,
|
||||
IC2Items.getItem("stoneDust"));
|
||||
Recipes.oreWashing.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(EMTItems.itemEMTItems, 1, 3)),
|
||||
waterAmount,
|
||||
new ItemStack(EMTItems.itemEMTItems, 1, 4),
|
||||
smallTinDust,
|
||||
IC2Items.getItem("stoneDust"));
|
||||
|
||||
NBTTagCompound heatAmount = new NBTTagCompound();
|
||||
heatAmount.setInteger("minHeat", 1000);
|
||||
|
||||
Recipes.centrifuge.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(EMTItems.itemEMTItems, 1, 2)),
|
||||
heatAmount,
|
||||
IC2Items.getItem("smallCopperDust"),
|
||||
new ItemStack(ConfigItems.itemResource, 1, 6));
|
||||
Recipes.centrifuge.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(EMTItems.itemEMTItems, 1, 4)),
|
||||
heatAmount,
|
||||
IC2Items.getItem("smallTinDust"),
|
||||
new ItemStack(ConfigItems.itemResource, 1, 3));
|
||||
for (Iterator<IRecipeInput> it = Recipes.macerator.getRecipes().keySet().iterator(); it.hasNext();) {
|
||||
IRecipeInput input = it.next();
|
||||
if (input.matches(new ItemStack(ConfigBlocks.blockCustomOre, 1, 0))) {
|
||||
it.remove();
|
||||
EMT.LOGGER.info("Removing Conflicting cinnabar macerating recipe(s)");
|
||||
}
|
||||
}
|
||||
}
|
||||
ItemStack crushedAmberRecipe = new ItemStack(EMTItems.itemEMTItems, 1, 1);
|
||||
crushedAmberRecipe.stackSize = 2;
|
||||
Recipes.macerator.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigBlocks.blockCustomOre, 1, 7)),
|
||||
null,
|
||||
crushedAmberRecipe);
|
||||
|
||||
ItemStack crushedCinnabarRecipe = new ItemStack(EMTItems.itemEMTItems, 1, 3);
|
||||
crushedCinnabarRecipe.stackSize = 2;
|
||||
Recipes.macerator.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(ConfigBlocks.blockCustomOre, 1, 0)),
|
||||
null,
|
||||
crushedCinnabarRecipe);
|
||||
|
||||
NBTTagCompound waterAmount = new NBTTagCompound();
|
||||
waterAmount.setInteger("amount", 1000);
|
||||
|
||||
ItemStack smallCopperDust = IC2Items.getItem("smallCopperDust");
|
||||
smallCopperDust.stackSize = 2;
|
||||
ItemStack smallTinDust = IC2Items.getItem("smallTinDust");
|
||||
smallCopperDust.stackSize = 2;
|
||||
|
||||
Recipes.oreWashing.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(EMTItems.itemEMTItems, 1, 1)),
|
||||
waterAmount,
|
||||
new ItemStack(EMTItems.itemEMTItems, 1, 2),
|
||||
smallCopperDust,
|
||||
IC2Items.getItem("stoneDust"));
|
||||
Recipes.oreWashing.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(EMTItems.itemEMTItems, 1, 3)),
|
||||
waterAmount,
|
||||
new ItemStack(EMTItems.itemEMTItems, 1, 4),
|
||||
smallTinDust,
|
||||
IC2Items.getItem("stoneDust"));
|
||||
|
||||
NBTTagCompound heatAmount = new NBTTagCompound();
|
||||
heatAmount.setInteger("minHeat", 1000);
|
||||
|
||||
Recipes.centrifuge.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(EMTItems.itemEMTItems, 1, 2)),
|
||||
heatAmount,
|
||||
IC2Items.getItem("smallCopperDust"),
|
||||
new ItemStack(ConfigItems.itemResource, 1, 6));
|
||||
Recipes.centrifuge.addRecipe(
|
||||
new RecipeInputItemStack(new ItemStack(EMTItems.itemEMTItems, 1, 4)),
|
||||
heatAmount,
|
||||
IC2Items.getItem("smallTinDust"),
|
||||
new ItemStack(ConfigItems.itemResource, 1, 3));
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,13 @@ package emt.init;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import thaumcraft.api.research.ResearchCategories;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTResearchAspects;
|
||||
import emt.util.EMTResearchItem;
|
||||
import ic2.api.item.IC2Items;
|
||||
import thaumcraft.api.research.ResearchCategories;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
|
||||
public class EMTResearches {
|
||||
|
||||
@@ -19,9 +19,9 @@ public class EMTResearches {
|
||||
}
|
||||
|
||||
public static void addResearchTab() {
|
||||
ResourceLocation background = new ResourceLocation(EMT.RESOURCE_PATH, "textures/misc/background.png");
|
||||
ResourceLocation background = new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/background.png");
|
||||
ResearchCategories
|
||||
.registerCategory("EMT", new ResourceLocation(EMT.RESOURCE_PATH, "textures/misc/emt.png"), background);
|
||||
.registerCategory("EMT", new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png"), background);
|
||||
}
|
||||
|
||||
public static void addResearch() {
|
||||
@@ -31,7 +31,7 @@ public class EMTResearches {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
new ResourceLocation(EMT.RESOURCE_PATH, "textures/misc/emt.png")).setRound().setAutoUnlock()
|
||||
new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png")).setRound().setAutoUnlock()
|
||||
.registerResearchItem().setPages(new ResearchPage(""));
|
||||
new EMTResearchItem("Diamond Chainsaw", 5, -6, 0, new ItemStack(EMTItems.diamondChainsaw)).setRound()
|
||||
.setAutoUnlock().registerResearchItem()
|
||||
@@ -54,6 +54,10 @@ public class EMTResearches {
|
||||
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 **/
|
||||
@@ -225,7 +229,7 @@ public class EMTResearches {
|
||||
}
|
||||
}
|
||||
|
||||
if (Registry.enableGTCompat && !EMTConfigHandler.potentiaGeneratorResearch) {
|
||||
if (!EMTConfigHandler.potentiaGeneratorResearch) {
|
||||
new EMTResearchItem(
|
||||
"Potentia Generator",
|
||||
EMTResearchAspects.potentiaGeneratorResearch,
|
||||
@@ -235,7 +239,9 @@ public class EMTResearches {
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 0)).setParents("Electric Magic Tools").setConcealed()
|
||||
.registerResearchItem()
|
||||
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.potentiaGenerator));
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.potentiaGeneratorResearch) {
|
||||
if (!EMTConfigHandler.ignisGeneratorResearch) {
|
||||
new EMTResearchItem(
|
||||
"Ignis Generator",
|
||||
@@ -247,7 +253,9 @@ public class EMTResearches {
|
||||
.setConcealed().registerResearchItem()
|
||||
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.ignisGenerator));
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.potentiaGeneratorResearch) {
|
||||
if (!EMTConfigHandler.auramGeneratorResearch) {
|
||||
new EMTResearchItem(
|
||||
"Auram Generator",
|
||||
@@ -259,7 +267,9 @@ public class EMTResearches {
|
||||
.setConcealed().registerResearchItem()
|
||||
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.auramGenerator));
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.potentiaGeneratorResearch) {
|
||||
if (!EMTConfigHandler.arborGeneratorResearch) {
|
||||
new EMTResearchItem(
|
||||
"Arbor Generator",
|
||||
@@ -271,7 +281,9 @@ public class EMTResearches {
|
||||
.setConcealed().registerResearchItem()
|
||||
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.arborGenerator));
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.potentiaGeneratorResearch) {
|
||||
if (!EMTConfigHandler.lucrumGeneratorResearch) {
|
||||
new EMTResearchItem(
|
||||
"Lucrum Generator",
|
||||
@@ -283,7 +295,9 @@ public class EMTResearches {
|
||||
.setConcealed().registerResearchItem()
|
||||
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.lucrumGenerator));
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.potentiaGeneratorResearch) {
|
||||
if (!EMTConfigHandler.aerGeneratorResearch) {
|
||||
new EMTResearchItem(
|
||||
"Aer Generator",
|
||||
@@ -294,20 +308,23 @@ public class EMTResearches {
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 4)).setSecondary().setParents("Potentia Generator")
|
||||
.setConcealed().registerResearchItem()
|
||||
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.aerGenerator));
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.potentiaGeneratorResearch) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.thaumiumChainsawResearch) {
|
||||
if (!EMTConfigHandler.streamChainsawResearch) {
|
||||
new EMTResearchItem(
|
||||
@@ -371,7 +388,7 @@ public class EMTResearches {
|
||||
}
|
||||
}
|
||||
|
||||
if (Registry.enableGTCompat && !EMTConfigHandler.compressedSolarsResearch) {
|
||||
if (!EMTConfigHandler.compressedSolarsResearch) {
|
||||
new EMTResearchItem(
|
||||
"Compressed Solars",
|
||||
EMTResearchAspects.compressedSolars,
|
||||
@@ -384,6 +401,9 @@ public class EMTResearches {
|
||||
new ResearchPage(EMTRecipes.compressedSolar),
|
||||
new ResearchPage(EMTRecipes.doubleCompressedSolar),
|
||||
new ResearchPage(EMTRecipes.tripleCompressedSolar));
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.compressedSolarsResearch) {
|
||||
if (!EMTConfigHandler.solarHelmetResearch) {
|
||||
new EMTResearchItem(
|
||||
"Solar Helmet of Revealing",
|
||||
@@ -396,6 +416,7 @@ public class EMTResearches {
|
||||
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.solarHelmetRevealing));
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.electricBootsResearch) {
|
||||
new EMTResearchItem(
|
||||
"Electric Boots of the Traveller",
|
||||
@@ -462,7 +483,7 @@ public class EMTResearches {
|
||||
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.etheralProcessor));
|
||||
}
|
||||
|
||||
if (Registry.enableGTCompat && !EMTConfigHandler.compressedSolarsResearch) {
|
||||
if (!EMTConfigHandler.compressedSolarsResearch) {
|
||||
if (!EMTConfigHandler.waterSolarsResearch) {
|
||||
new EMTResearchItem(
|
||||
"Water Infused Solar Panels",
|
||||
@@ -477,7 +498,9 @@ public class EMTResearches {
|
||||
new ResearchPage(EMTRecipes.doubleWaterSolar),
|
||||
new ResearchPage(EMTRecipes.tripleWaterSolar));
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.compressedSolarsResearch) {
|
||||
if (!EMTConfigHandler.darkSolarsResearch) {
|
||||
new EMTResearchItem(
|
||||
"Entropy Infused Solar Panels",
|
||||
@@ -492,7 +515,9 @@ public class EMTResearches {
|
||||
new ResearchPage(EMTRecipes.doubleDarkSolar),
|
||||
new ResearchPage(EMTRecipes.tripleDarkSolar));
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.compressedSolarsResearch) {
|
||||
if (!EMTConfigHandler.orderSolarsResearch) {
|
||||
new EMTResearchItem(
|
||||
"Order Infused Solar Panels",
|
||||
@@ -507,7 +532,9 @@ public class EMTResearches {
|
||||
new ResearchPage(EMTRecipes.doubleOrderSolar),
|
||||
new ResearchPage(EMTRecipes.tripleOrderSolar));
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.compressedSolarsResearch) {
|
||||
if (!EMTConfigHandler.fireSolarsResearch) {
|
||||
new EMTResearchItem(
|
||||
"Fire Infused Solar Panels",
|
||||
@@ -522,7 +549,9 @@ public class EMTResearches {
|
||||
new ResearchPage(EMTRecipes.doubleFireSolar),
|
||||
new ResearchPage(EMTRecipes.tripleFireSolar));
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.compressedSolarsResearch) {
|
||||
if (!EMTConfigHandler.airSolarsResearch) {
|
||||
new EMTResearchItem(
|
||||
"Air Infused Solar Panels",
|
||||
@@ -537,7 +566,9 @@ public class EMTResearches {
|
||||
new ResearchPage(EMTRecipes.doubleAirSolar),
|
||||
new ResearchPage(EMTRecipes.tripleAirSolar));
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.compressedSolarsResearch) {
|
||||
if (!EMTConfigHandler.earthSolarsResearch) {
|
||||
new EMTResearchItem(
|
||||
"Earth Infused Solar Panels",
|
||||
@@ -617,17 +648,6 @@ public class EMTResearches {
|
||||
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.chargeFocus));
|
||||
}
|
||||
|
||||
if (Registry.enableGTCompat && !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) {
|
||||
new EMTResearchItem(
|
||||
"Wand Focus: Wand Charging",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package emt.init;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import emt.gthandler.common.implementations.automation.EssentiaFiller;
|
||||
import emt.tile.TileElectricCloud;
|
||||
import emt.tile.TileEntityEtherealMacerator;
|
||||
import emt.tile.TileEntityIndustrialWandRecharge;
|
||||
@@ -12,50 +13,49 @@ public class EMTTiles {
|
||||
|
||||
public static void registerTileEntities() {
|
||||
|
||||
if (Registry.enableGTCompat) {
|
||||
// Essentia Gens
|
||||
// legacy support
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitypotentiagenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityignisgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityauramgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityarborgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityaergenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitylucrumgenerator");
|
||||
// Essentia Gens
|
||||
// legacy support
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitypotentiagenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityignisgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityauramgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityarborgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentityaergenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "tileentitylucrumgenerator");
|
||||
|
||||
// new TEs will be called TileEntityEssentiaGenerator
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "TileEntityEssentiaGenerator");
|
||||
|
||||
// Solars
|
||||
// legacy support
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitycompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublecompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplecompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitywatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublewatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplewatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydarksolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubledarksolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripledarksolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityordersolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleordersolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleordersolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityfiresolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublefiresolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplefiresolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityairsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleairsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleairsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityearthsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleearthsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleearthsolar");
|
||||
|
||||
// new TEs will be called TileEntityXCompressedSolar
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "TileEntityXCompressedSolar");
|
||||
}
|
||||
// new TEs will be called TileEntityEssentiaGenerator
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "TileEntityEssentiaGenerator");
|
||||
|
||||
// Machinery
|
||||
GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge");
|
||||
GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
|
||||
GameRegistry.registerTileEntity(EssentiaFiller.class, "EssentiaFillerTE");
|
||||
|
||||
// Solars
|
||||
// legacy support
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitycompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublecompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplecompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitywatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublewatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplewatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydarksolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubledarksolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripledarksolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityordersolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleordersolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleordersolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityfiresolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoublefiresolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytriplefiresolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityairsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleairsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleairsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentityearthsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitydoubleearthsolar");
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "tileentitytripleearthsolar");
|
||||
|
||||
// new TEs will be called TileEntityXCompressedSolar
|
||||
GameRegistry.registerTileEntity(TileEntitySolarBase.class, "TileEntityXCompressedSolar");
|
||||
|
||||
// Random Stuff
|
||||
GameRegistry.registerTileEntity(TileEntityPortableNode.class, "tileentityportablenode");
|
||||
|
||||
@@ -0,0 +1,267 @@
|
||||
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 thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.crafting.CrucibleRecipe;
|
||||
import thaumcraft.api.crafting.IArcaneRecipe;
|
||||
import thaumcraft.api.crafting.InfusionRecipe;
|
||||
import thaumcraft.api.crafting.ShapedArcaneRecipe;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTResearchItem;
|
||||
import gregtech.api.enums.ItemList;
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.enums.OrePrefixes;
|
||||
import gregtech.api.util.GT_OreDictUnificator;
|
||||
import gregtech.api.util.GT_Utility;
|
||||
|
||||
public class EMT_GTNH_Recipes_And_Researches implements Runnable {
|
||||
|
||||
private static LinkedHashMap<String, IArcaneRecipe> arcaneRecipeLinkedHashMap = new LinkedHashMap<>();
|
||||
private static LinkedHashMap<String, InfusionRecipe> infusionRecipeLinkedHashMap = new LinkedHashMap<>();
|
||||
private static LinkedHashMap<String, CrucibleRecipe> cruciblRecipeLinkedHashMap = new LinkedHashMap<>();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
// ItemStack glue =new ItemStack(EMTItems.itemEMTItems,1,8);
|
||||
// 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,
|
||||
// Collections.singletonList(GT_ModHandler.getModItem("TConstruct", "materials", 2, 36))));
|
||||
// for ( ShapelessRecipes sr : recipesHashSet)
|
||||
// CraftingManager.getInstance().getRecipeList().add(sr);
|
||||
//
|
||||
// //Rubber ball recipes
|
||||
//
|
||||
// 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);
|
||||
//
|
||||
// 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();
|
||||
runArcaneRecipes();
|
||||
runResreaches();
|
||||
}
|
||||
|
||||
private void runInfusionRecipes() {}
|
||||
|
||||
private void runKettleRecipes() {}
|
||||
|
||||
private void runArcaneRecipes() {
|
||||
arcaneRecipeLinkedHashMap.put(
|
||||
"DiamondChainsaw",
|
||||
new ShapedArcaneRecipe(
|
||||
"DiamondChainsaw",
|
||||
new ItemStack(EMTItems.diamondChainsaw),
|
||||
getPrimals(35),
|
||||
"sts",
|
||||
"pmp",
|
||||
"pbp",
|
||||
's',
|
||||
GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Diamond, 1),
|
||||
'p',
|
||||
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Diamond, 1),
|
||||
't',
|
||||
GT_OreDictUnificator.get(OrePrefixes.toolHeadChainsaw, Materials.Thaumium, 1),
|
||||
'b',
|
||||
ItemList.Battery_RE_LV_Sodium.get(1),
|
||||
'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()) {
|
||||
ThaumcraftApi.getCraftingRecipes().add(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
private void runResreaches() {
|
||||
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(
|
||||
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);
|
||||
}
|
||||
|
||||
class ShapedArcaneRecipeIgnoresNBT extends ShapedArcaneRecipe {
|
||||
|
||||
protected String research;
|
||||
protected ItemStack result;
|
||||
protected AspectList aspects;
|
||||
protected Object[] recipe;
|
||||
protected LinkedHashMap<Character, Object> translation = new LinkedHashMap<>();
|
||||
int[] rowcolm;
|
||||
|
||||
public ShapedArcaneRecipeIgnoresNBT(String research, ItemStack result, AspectList aspects, Object... recipe) {
|
||||
super(research, result, aspects, recipe);
|
||||
this.research = research;
|
||||
this.result = result;
|
||||
this.aspects = aspects;
|
||||
this.recipe = recipe;
|
||||
int rows = 0;
|
||||
int colums = 0;
|
||||
if (!(recipe[0] instanceof String)) throw new UnsupportedOperationException(
|
||||
"The Recipe must start with at least one String for the first row!");
|
||||
int i = 0;
|
||||
rowcolm = new int[3];
|
||||
do {
|
||||
rows++;
|
||||
colums = Math.max(colums, ((String) recipe[i]).length());
|
||||
rowcolm[i] = colums;
|
||||
i = rows;
|
||||
} while (recipe[i] instanceof String);
|
||||
if (rows > 3 || colums > 3)
|
||||
throw new UnsupportedOperationException("The Recipe must fit in a 3x3 crafting field!");
|
||||
rowcolm = Arrays.copyOf(rowcolm, rows);
|
||||
|
||||
int k = 0;
|
||||
for (int j = i; j < recipe.length; j += 2) {
|
||||
k++;
|
||||
if (recipe[j] instanceof Character) translation.put((Character) recipe[j], recipe[j + 1]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(IInventory inv, World world, EntityPlayer player) {
|
||||
if (this.research.length() > 0
|
||||
&& !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), this.research))
|
||||
return false;
|
||||
else {
|
||||
for (int y = 0; y < rowcolm.length; y++) {
|
||||
String rowAsString = ((String) recipe[y]);
|
||||
for (int x = 0; x < rowcolm[y]; x++) {
|
||||
Object itemReplacement = translation.get(rowAsString.toCharArray()[x]);
|
||||
ItemStack slot = ThaumcraftApiHelper.getStackInRowAndColumn(inv, x, y);
|
||||
if (itemReplacement != null && slot == null) {
|
||||
return false;
|
||||
} else if (itemReplacement instanceof String) {
|
||||
if (!GT_Utility.areStacksEqual(
|
||||
GT_OreDictUnificator.getFirstOre(itemReplacement, 1),
|
||||
GT_OreDictUnificator.get(slot),
|
||||
true))
|
||||
if (!OreDictionary.getOres((String) itemReplacement).contains(slot)) return false;
|
||||
} else if (itemReplacement instanceof ItemStack) {
|
||||
if (!GT_Utility.isStackValid(itemReplacement)) {
|
||||
return false;
|
||||
}
|
||||
if (!GT_Utility.areStacksEqual((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))
|
||||
return false;
|
||||
} else if (itemReplacement instanceof Collection) {
|
||||
boolean hit = false;
|
||||
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))
|
||||
hit = true;
|
||||
}
|
||||
if (!hit) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(IInventory iInventory) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return recipe.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getAspects() {
|
||||
return aspects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getAspects(IInventory iInventory) {
|
||||
return aspects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getResearch() {
|
||||
return research;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,31 @@
|
||||
package emt.init;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import emt.gthandler.common.loader.EMT_GT_Loader;
|
||||
import emt.tile.solar.Solars;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
|
||||
public class Registry {
|
||||
|
||||
public static boolean enableGTCompat;
|
||||
private static final EMT_GT_Loader gtloader = new EMT_GT_Loader();
|
||||
|
||||
public static void registerPreInit() {
|
||||
enableGTCompat = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
|
||||
public static void registerPreInit() {}
|
||||
|
||||
public static void registerInit() {
|
||||
EMTBlocks.registerBlocks();
|
||||
EMTItems.registerItems();
|
||||
EMTTiles.registerTileEntities();
|
||||
}
|
||||
|
||||
public static void registerInit() {
|
||||
gtloader.run();
|
||||
EMTRecipes.registerEarlyRecipes();
|
||||
}
|
||||
|
||||
public static void registerLate() {
|
||||
EMTEssentiasOutputs.addOutputs();
|
||||
EMTBlocks.addAspects();
|
||||
if (enableGTCompat) {
|
||||
EMT_GT_Loader.runlate();
|
||||
}
|
||||
gtloader.runlate();
|
||||
EMTRecipes.registerLateRecipes();
|
||||
// new EMT_GTNH_Recipes_And_Researches().run();
|
||||
EMTRecipes.registerUUMInfusionRecipes();
|
||||
EMTResearches.register();
|
||||
if (enableGTCompat) {
|
||||
Solars.registerReverseRecipes();
|
||||
}
|
||||
Solars.registerReverseRecipes();
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ public class ItemBase extends Item {
|
||||
public ItemBase(String unlocName, String textureName) {
|
||||
super();
|
||||
setUnlocalizedName(EMT.MOD_ID + unlocName);
|
||||
setTextureName(EMT.RESOURCE_PATH + ":" + textureName);
|
||||
setTextureName(EMT.TEXTURE_PATH + ":" + textureName);
|
||||
setCreativeTab(EMT.TAB);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import thaumcraft.api.IScribeTools;
|
||||
import thaumcraft.common.items.ItemInkwell;
|
||||
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.common.items.ItemInkwell;
|
||||
|
||||
public class ItemElectricScribingTools extends ItemInkwell implements IElectricItem, IScribeTools {
|
||||
|
||||
@@ -26,8 +26,9 @@ public class ItemElectricScribingTools extends ItemInkwell implements IElectricI
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||
}
|
||||
|
||||
@@ -52,7 +53,7 @@ public class ItemElectricScribingTools extends ItemInkwell implements IElectricI
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -19,7 +20,6 @@ import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
|
||||
public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
|
||||
|
||||
@@ -57,8 +57,8 @@ public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ri) {
|
||||
this.icon[0] = ri.registerIcon(EMT.RESOURCE_PATH + ":armoreumaker");
|
||||
this.icon[1] = ri.registerIcon(EMT.RESOURCE_PATH + ":inventoryeumaker");
|
||||
this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":armoreumaker");
|
||||
this.icon[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":inventoryeumaker");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -67,7 +67,7 @@ public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
|
||||
list.add(new ItemStack(this, 1, 0));
|
||||
list.add(new ItemStack(this, 1, 1));
|
||||
}
|
||||
|
||||
@@ -12,21 +12,17 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||
|
||||
import thaumcraft.common.config.Config;
|
||||
import thaumcraft.common.lib.utils.InventoryUtils;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import thaumcraft.common.config.Config;
|
||||
import thaumcraft.common.lib.utils.InventoryUtils;
|
||||
|
||||
public class ItemMaterials extends Item {
|
||||
|
||||
@@ -111,39 +107,36 @@ public class ItemMaterials extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> result, boolean advanced) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List result, boolean advanced) {
|
||||
switch (stack.getItemDamage()) {
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
case 19:
|
||||
result.add(EnumChatFormatting.RED + "[DEPRECATED] Please put in the crafting table to get back!");
|
||||
result.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("tooltip.EMT.draconicSchematic"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ri) {
|
||||
this.icon[0] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/clusteruranium");
|
||||
this.icon[1] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/crushedamber");
|
||||
this.icon[2] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/purifiedamber");
|
||||
this.icon[3] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/crushedcinnabar");
|
||||
this.icon[4] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/purifiedcinnabar");
|
||||
this.icon[5] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/thaumiumplate");
|
||||
this.icon[6] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/lightningsummoner");
|
||||
this.icon[7] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/feathermesh");
|
||||
this.icon[8] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/glue");
|
||||
this.icon[9] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/ducttape");
|
||||
this.icon[10] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/rubberball");
|
||||
this.icon[11] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/cardboard");
|
||||
this.icon[12] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/cardboardsheet");
|
||||
this.icon[13] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/taintedfeather");
|
||||
this.icon[14] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/thaumiumWing");
|
||||
this.icon[15] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/uumatterdrop");
|
||||
this.icon[16] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/draconicSchematic");
|
||||
this.icon[17] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/wyvernSchematic");
|
||||
this.icon[18] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/awakenedSchematic");
|
||||
this.icon[19] = ri.registerIcon(EMT.RESOURCE_PATH + ":materials/chaoticSchematic");
|
||||
this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/clusteruranium");
|
||||
this.icon[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/crushedamber");
|
||||
this.icon[2] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/purifiedamber");
|
||||
this.icon[3] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/crushedcinnabar");
|
||||
this.icon[4] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/purifiedcinnabar");
|
||||
this.icon[5] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/thaumiumplate");
|
||||
this.icon[6] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/lightningsummoner");
|
||||
this.icon[7] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/feathermesh");
|
||||
this.icon[8] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/glue");
|
||||
this.icon[9] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/ducttape");
|
||||
this.icon[10] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/rubberball");
|
||||
this.icon[11] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/cardboard");
|
||||
this.icon[12] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/cardboardsheet");
|
||||
this.icon[13] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/taintedfeather");
|
||||
this.icon[14] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/thaumiumWing");
|
||||
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)
|
||||
@@ -152,7 +145,7 @@ public class ItemMaterials extends Item {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
|
||||
for (int i = 1; i <= 19; i++) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
@@ -170,8 +163,8 @@ public class ItemMaterials extends Item {
|
||||
- player.yOffset;
|
||||
double playerZ = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
|
||||
Vec3 playerLoc = Vec3.createVectorHelper(playerX, playerY, playerZ);
|
||||
float f3 = MathHelper.cos((-f2 * 0.01745329F) - (float) Math.PI);
|
||||
float f4 = MathHelper.sin((-f2 * 0.01745329F) - (float) Math.PI);
|
||||
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
|
||||
float f6 = MathHelper.sin(-f1 * 0.01745329F);
|
||||
float f7 = f4 * f5;
|
||||
|
||||
@@ -16,15 +16,15 @@ import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
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.IWarpingGear;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
|
||||
public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRunicArmor {
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
|
||||
String colourCode = "" + EnumChatFormatting.DARK_RED;
|
||||
list.add(
|
||||
colourCode
|
||||
@@ -72,7 +72,7 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ri) {
|
||||
this.icon[0] = ri.registerIcon(EMT.RESOURCE_PATH + ":onering");
|
||||
this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":onering");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -81,7 +81,7 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> list) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
|
||||
list.add(new ItemStack(this, 1, 0));
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,11 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.items.armor.Hover;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -30,16 +33,9 @@ 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.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.items.armor.Hover;
|
||||
import thaumicboots.api.IBoots;
|
||||
|
||||
@Interface(iface = "thaumicboots.api.IBoots", modid = "thaumicboots")
|
||||
public class ItemElectricBootsTraveller extends ItemArmor
|
||||
implements IRunicArmor, IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor, IBoots {
|
||||
implements IRunicArmor, IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor {
|
||||
|
||||
public int maxCharge = 100000;
|
||||
public int energyPerDamage = 1000;
|
||||
@@ -54,11 +50,11 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
@@ -73,7 +69,7 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/boots_electric");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/boots_electric");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,8 +108,9 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
||||
return 0.15D;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||
list.add(EMTTextHelper.PURPLE + EMTTextHelper.localize("tooltip.EMT.visDiscount") + ": " + visDiscount + "%");
|
||||
}
|
||||
@@ -125,29 +122,15 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
if (getIntertialState(itemStack) && player.moveForward == 0
|
||||
&& player.moveStrafing == 0
|
||||
&& player.capabilities.isFlying) {
|
||||
player.motionX *= 0.5;
|
||||
player.motionZ *= 0.5;
|
||||
}
|
||||
boolean omniMode = false;
|
||||
if (EMT.isBootsActive) {
|
||||
omniMode = isOmniEnabled(itemStack);
|
||||
if ((player.moveForward == 0F && player.moveStrafing == 0F && omniMode)
|
||||
|| (player.moveForward <= 0F && !omniMode)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (player.moveForward != 0.0F || player.moveStrafing != 0.0F) {
|
||||
if (!player.capabilities.isFlying && player.moveForward > 0.0F) {
|
||||
if (player.worldObj.isRemote && !player.isSneaking()) {
|
||||
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(player.getEntityId())) {
|
||||
Thaumcraft.instance.entityEventHandler.prevStep.put(player.getEntityId(), player.stepHeight);
|
||||
}
|
||||
player.stepHeight = 1.0F;
|
||||
}
|
||||
float speedMod = (float) getSpeedModifier(itemStack);
|
||||
if (player.onGround || player.isOnLadder() || player.capabilities.isFlying) {
|
||||
|
||||
if (player.onGround) {
|
||||
float bonus = speedBonus;
|
||||
if (player.isInWater()) {
|
||||
bonus /= 4.0F;
|
||||
@@ -156,35 +139,29 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
||||
if (player.isSneaking()) {
|
||||
bonus /= 2.0F;
|
||||
}
|
||||
bonus *= speedMod;
|
||||
if (EMT.isBootsActive) {
|
||||
applyOmniState(player, bonus, itemStack);
|
||||
} else if (player.moveForward > 0.0) {
|
||||
player.moveFlying(0.0F, player.moveForward, bonus);
|
||||
}
|
||||
|
||||
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
|
||||
* speedMod;
|
||||
* jumpBonus;
|
||||
} else {
|
||||
player.jumpMovementFactor = 0.05F
|
||||
/ ((ItemElectricBootsTraveller) EMTItems.electricBootsTraveller).jumpBonus
|
||||
* jumpBonus
|
||||
* speedMod;
|
||||
* jumpBonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "thaumicboots")
|
||||
public void applyOmniState(EntityPlayer player, float bonus, ItemStack itemStack) {
|
||||
if (player.moveForward != 0.0) {
|
||||
player.moveFlying(0.0F, player.moveForward, bonus);
|
||||
}
|
||||
if (player.moveStrafing != 0.0 && getOmniState(itemStack)) {
|
||||
player.moveFlying(player.moveStrafing, 0.0F, bonus);
|
||||
@SubscribeEvent
|
||||
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
|
||||
|
||||
if (hasArmor) player.motionY += jumpBonus;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,9 +174,39 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
||||
return 4.0f;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingFall(LivingFallEvent event) {
|
||||
if ((EMT.instance.isSimulating()) && ((event.entity instanceof EntityLivingBase))) {
|
||||
if (event.entity instanceof EntityPlayer) {
|
||||
EntityPlayer entity = (EntityPlayer) event.entity;
|
||||
if ((entity.inventory.armorInventory[0] != null)
|
||||
&& (entity.inventory.armorInventory[0].getItem() instanceof ItemElectricBootsTraveller)) {
|
||||
ItemElectricBootsTraveller tUsedBoots = (ItemElectricBootsTraveller) entity.inventory.armorInventory[0]
|
||||
.getItem();
|
||||
ItemStack stack = entity.inventory.armorInventory[0];
|
||||
|
||||
// Check if we dropped the minimum amount; To cover the jump-boost bonus without penalty
|
||||
if (tUsedBoots.getMinimumDropDist() > event.distance) {
|
||||
event.setCanceled(true);
|
||||
} else {
|
||||
float tEnergyDemand = tUsedBoots.energyPerDamage
|
||||
* (((event.distance > tUsedBoots.getMaxHealthyDropDist()) ? event.distance * 3
|
||||
: event.distance) - 4.0F);
|
||||
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() ));
|
||||
ElectricItem.manager.discharge(stack, tEnergyDemand, Integer.MAX_VALUE, true, false, false);
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return EMT.RESOURCE_PATH + ":textures/models/electricboots.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/electricboots.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -270,79 +277,4 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
||||
public int getRunicCharge(ItemStack itemStack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Avoid NSM Exception when ThaumicBoots is not present.
|
||||
public double getSpeedModifier(ItemStack stack) {
|
||||
if (stack.stackTagCompound != null) {
|
||||
return stack.stackTagCompound.getDouble("speed");
|
||||
}
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
public double getJumpModifier(ItemStack stack) {
|
||||
if (stack.stackTagCompound != null) {
|
||||
return stack.stackTagCompound.getDouble("jump");
|
||||
}
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
public boolean getOmniState(ItemStack stack) {
|
||||
if (stack.stackTagCompound != null) {
|
||||
return stack.stackTagCompound.getBoolean("omni");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean getIntertialState(ItemStack stack) {
|
||||
if (stack.stackTagCompound != null) {
|
||||
return stack.stackTagCompound.getBoolean("inertiacanceling");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
ItemStack boots = player.getCurrentArmor(0);
|
||||
boolean hasArmor = boots != null && boots.getItem() == ItemElectricBootsTraveller.this;
|
||||
|
||||
if (hasArmor) player.motionY += jumpBonus * (float) getJumpModifier(boots);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingFall(LivingFallEvent event) {
|
||||
if ((EMT.instance.isSimulating()) && ((event.entity instanceof EntityLivingBase))) {
|
||||
if (event.entity instanceof EntityPlayer) {
|
||||
EntityPlayer entity = (EntityPlayer) event.entity;
|
||||
if ((entity.inventory.armorInventory[0] != null)
|
||||
&& (entity.inventory.armorInventory[0].getItem() instanceof ItemElectricBootsTraveller)) {
|
||||
ItemElectricBootsTraveller tUsedBoots = (ItemElectricBootsTraveller) entity.inventory.armorInventory[0]
|
||||
.getItem();
|
||||
ItemStack stack = entity.inventory.armorInventory[0];
|
||||
|
||||
// Check if we dropped the minimum amount; To cover the jump-boost bonus without penalty
|
||||
if (tUsedBoots.getMinimumDropDist() > event.distance) {
|
||||
event.setCanceled(true);
|
||||
} else {
|
||||
float tEnergyDemand = tUsedBoots.energyPerDamage
|
||||
* (((event.distance > tUsedBoots.getMaxHealthyDropDist()) ? event.distance * 3
|
||||
: event.distance) - 4.0F);
|
||||
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() ));
|
||||
ElectricItem.manager
|
||||
.discharge(stack, tEnergyDemand, Integer.MAX_VALUE, true, false, false);
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,16 +4,12 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import gregtech.api.hazards.Hazard;
|
||||
import gregtech.api.hazards.IHazardProtector;
|
||||
|
||||
@Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh")
|
||||
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller implements IHazardProtector {
|
||||
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller {
|
||||
|
||||
public ItemNanoBootsTraveller(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
@@ -48,17 +44,11 @@ public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller implement
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/boots_nano");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/boots_nano");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return EMT.RESOURCE_PATH + ":textures/models/nanobootstravel.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "gregtech_nh")
|
||||
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
|
||||
return true;
|
||||
return EMT.TEXTURE_PATH + ":textures/models/nanobootstravel.png";
|
||||
}
|
||||
}
|
||||
@@ -4,16 +4,12 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import gregtech.api.hazards.Hazard;
|
||||
import gregtech.api.hazards.IHazardProtector;
|
||||
|
||||
@Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh")
|
||||
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller implements IHazardProtector {
|
||||
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller {
|
||||
|
||||
public ItemQuantumBootsTraveller(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
@@ -48,17 +44,11 @@ public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller implem
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/boots_quantum");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/boots_quantum");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return EMT.RESOURCE_PATH + ":textures/models/quantumbootstravel.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "gregtech_nh")
|
||||
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
|
||||
return true;
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantumbootstravel.png";
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -29,8 +29,6 @@ import emt.EMT;
|
||||
import emt.client.model.ModelSpecialArmor;
|
||||
import emt.init.EMTItems;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import gregtech.api.hazards.Hazard;
|
||||
import gregtech.api.hazards.IHazardProtector;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.core.IC2;
|
||||
@@ -39,10 +37,8 @@ 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;
|
||||
|
||||
@Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh")
|
||||
public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements IRunicArmor, IHazardProtector {
|
||||
public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements IRunicArmor {
|
||||
|
||||
public static AudioSource audioSource;
|
||||
protected static ArrayList<Integer> potionRemovalCost = new ArrayList<Integer>();
|
||||
@@ -60,18 +56,18 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
|
||||
|
||||
public ItemInfusedQuantumChestplate(InternalName internalName, int armorType) {
|
||||
super(internalName, InternalName.quantum, armorType, 20000000D, 18000.0D, 4);
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
iconNONE = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/armor_quantum_chest");
|
||||
iconJETPACK = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/armor_quantum_chest_jetpack");
|
||||
iconTHAUMIUM = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/armor_quantum_chest_wing_t");
|
||||
iconNANO = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/armor_quantum_chest_wing_n");
|
||||
iconQUANTUM = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/armor_quantum_chest_wing_q");
|
||||
iconNONE = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest");
|
||||
iconJETPACK = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_jetpack");
|
||||
iconTHAUMIUM = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_wing_t");
|
||||
iconNANO = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_wing_n");
|
||||
iconQUANTUM = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_wing_q");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,6 +79,24 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
|
||||
return (StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityLivingFallEvent(LivingFallEvent event) {
|
||||
if (IC2.platform.isSimulating() && (event.entity instanceof EntityLivingBase)) {
|
||||
EntityLivingBase entity = (EntityLivingBase) event.entity;
|
||||
ItemStack armor = entity.getEquipmentInSlot(1);
|
||||
|
||||
if ((armor != null) && (armor.getItem() == this)) {
|
||||
int fallDamage = Math.max((int) event.distance - 10, 0);
|
||||
double energyCost = getEnergyPerDamage() * fallDamage;
|
||||
|
||||
if (energyCost <= ElectricItem.manager.getCharge(armor)) {
|
||||
ElectricItem.manager.discharge(armor, energyCost, Integer.MAX_VALUE, true, false, false);
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1D;
|
||||
@@ -356,15 +370,15 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
|
||||
|
||||
switch (wing) {
|
||||
case JETPACK:
|
||||
return EMT.RESOURCE_PATH + ":textures/models/quantum_jetpack.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum_jetpack.png";
|
||||
case THAUMIUM:
|
||||
return EMT.RESOURCE_PATH + ":textures/models/quantum_wings_t.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_t.png";
|
||||
case NANO:
|
||||
return EMT.RESOURCE_PATH + ":textures/models/quantum_wings_n.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_n.png";
|
||||
case QUANTUM:
|
||||
return EMT.RESOURCE_PATH + ":textures/models/quantum_wings_q.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_q.png";
|
||||
default:
|
||||
return EMT.RESOURCE_PATH + ":textures/models/quantum.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantum.png";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,29 +390,27 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
|
||||
if (entity instanceof EntityPlayer && stack != null && stack.stackTagCompound != null) {
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
if (wing == JETPACK) {
|
||||
ModelSpecialArmor.getInstance().type = 1;
|
||||
} else if (wing != 0) {
|
||||
ModelSpecialArmor.getInstance().type = 2;
|
||||
if (stack.stackTagCompound.hasKey("isJumping")) {
|
||||
ModelSpecialArmor.getInstance().isJumping = stack.stackTagCompound.getBoolean("isJumping");
|
||||
try {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
if (wing == JETPACK) {
|
||||
ModelSpecialArmor mbm = new ModelSpecialArmor(1, 1);
|
||||
return mbm;
|
||||
} else if (wing != 0) {
|
||||
ModelSpecialArmor mbm = new ModelSpecialArmor(1, 2);
|
||||
mbm.isJumping = stack.stackTagCompound.getBoolean("isJumping");
|
||||
return mbm;
|
||||
}
|
||||
} else {
|
||||
ModelSpecialArmor.getInstance().type = 0;
|
||||
}
|
||||
} else {
|
||||
ModelSpecialArmor.getInstance().type = 0;
|
||||
} catch (NullPointerException e) {
|
||||
new ModelSpecialArmor(1, 0);
|
||||
}
|
||||
|
||||
return ModelSpecialArmor.getInstance();
|
||||
return new ModelSpecialArmor(1, 0);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, @SuppressWarnings("rawtypes") 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)));
|
||||
}
|
||||
|
||||
@@ -520,7 +532,6 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
|
||||
|
||||
if (isJumping && !player.onGround && player.motionY < 0) {
|
||||
player.motionY *= f1;
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) {
|
||||
@@ -542,6 +553,9 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
|
||||
|
||||
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
|
||||
player.motionY *= 0.6;
|
||||
}
|
||||
|
||||
if (player.fallDistance > 0.0F) {
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
@@ -550,31 +564,4 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I
|
||||
public int getRunicCharge(ItemStack itemStack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "gregtech_nh")
|
||||
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityLivingFallEvent(LivingFallEvent event) {
|
||||
if (IC2.platform.isSimulating() && (event.entity instanceof EntityLivingBase)) {
|
||||
EntityLivingBase entity = (EntityLivingBase) event.entity;
|
||||
ItemStack armor = entity.getEquipmentInSlot(1);
|
||||
|
||||
if ((armor != null) && (armor.getItem() == ItemInfusedQuantumChestplate.this)) {
|
||||
int fallDamage = Math.max((int) event.distance - 10, 0);
|
||||
double energyCost = getEnergyPerDamage() * fallDamage;
|
||||
|
||||
if (energyCost <= ElectricItem.manager.getCharge(armor)) {
|
||||
ElectricItem.manager.discharge(armor, energyCost, Integer.MAX_VALUE, true, false, false);
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,11 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
@@ -23,11 +28,6 @@ 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.IRunicArmor;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
|
||||
public class ItemElectricGoggles extends ItemArmor
|
||||
implements IRunicArmor, IElectricItem, IVisDiscountGear, IGoggles, IRevealer, IMetalArmor, ISpecialArmor {
|
||||
@@ -43,25 +43,22 @@ public class ItemElectricGoggles extends ItemArmor
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int damage) {}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/goggles_electric");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/goggles_electric");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return EMT.RESOURCE_PATH + ":textures/models/electricgoggles.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/electricgoggles.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
@@ -139,8 +136,9 @@ public class ItemElectricGoggles extends ItemArmor
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||
list.add(EMTTextHelper.PURPLE + EMTTextHelper.localize("tooltip.EMT.visDiscount") + ": " + visDiscount + "%");
|
||||
}
|
||||
|
||||
@@ -6,16 +6,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import gregtech.api.hazards.Hazard;
|
||||
import gregtech.api.hazards.IHazardProtector;
|
||||
import ic2.api.item.IC2Items;
|
||||
|
||||
@Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh")
|
||||
public class ItemNanoGoggles extends ItemElectricGoggles implements IHazardProtector {
|
||||
public class ItemNanoGoggles extends ItemElectricGoggles {
|
||||
|
||||
public ItemNanoGoggles(ArmorMaterial material, int renderIndex, int armorType) {
|
||||
super(material, renderIndex, armorType);
|
||||
@@ -32,12 +28,12 @@ public class ItemNanoGoggles extends ItemElectricGoggles implements IHazardProte
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/goggles_nano");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/goggles_nano");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return EMT.RESOURCE_PATH + ":textures/models/thaumicnanohelmet.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/thaumicnanohelmet.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,10 +50,4 @@ public class ItemNanoGoggles extends ItemElectricGoggles implements IHazardProte
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
IC2Items.getItem("nightvisionGoggles").getItem().onArmorTick(world, player, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "gregtech_nh")
|
||||
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import ic2.core.util.Keyboard;
|
||||
|
||||
public class ItemQuantumGoggles extends ItemNanoGoggles {
|
||||
|
||||
private static final Map<Integer, Integer> potionCost = new HashMap<>();
|
||||
private static final Map<Integer, Integer> potionCost = new HashMap();
|
||||
|
||||
public ItemQuantumGoggles(ArmorMaterial material, int renderIndex, int armorType) {
|
||||
super(material, renderIndex, armorType);
|
||||
@@ -42,12 +42,12 @@ public class ItemQuantumGoggles extends ItemNanoGoggles {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/goggles_quantum");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/goggles_quantum");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return EMT.RESOURCE_PATH + ":textures/models/thaumicquantumhelmet.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/thaumicquantumhelmet.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,14 +67,13 @@ public class ItemQuantumGoggles extends ItemNanoGoggles {
|
||||
Field f;
|
||||
f = Keyboard.class.getDeclaredField("playerKeys");
|
||||
f.setAccessible(true);
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<EntityPlayer, Set<Enum<?>>> playerKeys = (Map<EntityPlayer, Set<Enum<?>>>) f.get(IC2.keyboard);
|
||||
Map<EntityPlayer, Set<Enum>> playerKeys = (Map<EntityPlayer, Set<Enum>>) f.get(IC2.keyboard);
|
||||
|
||||
Enum<?> hub = null;
|
||||
Set<Enum<?>> set = playerKeys.get(player);
|
||||
Enum hub = null;
|
||||
Set<Enum> set = playerKeys.get(player);
|
||||
|
||||
if (set != null) {
|
||||
for (Enum<?> e : set) {
|
||||
for (Enum e : set) {
|
||||
if (e.ordinal() == 6) {
|
||||
hub = e;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import ic2.api.item.IElectricItem;
|
||||
|
||||
public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
|
||||
|
||||
private static final Map<Integer, Integer> potionCost = new HashMap<>();
|
||||
private static final Map potionCost = new HashMap();
|
||||
/*
|
||||
* private int ticker; private int generating; private boolean sunIsUp; private boolean skyIsVisible; private
|
||||
* boolean noSunWorld; private boolean dampPlace;
|
||||
@@ -26,6 +26,7 @@ public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
|
||||
private int genDay;
|
||||
private int genNight;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public ItemSolarHelmetRevealing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxDamage(27);
|
||||
@@ -48,12 +49,12 @@ public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/goggles_solar");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/goggles_solar");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layerType) {
|
||||
return EMT.RESOURCE_PATH + ":textures/models/solarrevealinghelmet.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/solarrevealinghelmet.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
@@ -18,7 +19,6 @@ import emt.util.EMTConfigHandler;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.core.IC2;
|
||||
import ic2.core.util.StackUtil;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
|
||||
public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
|
||||
|
||||
@@ -39,25 +39,28 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/wing_feather");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/wing_feather");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return EMT.RESOURCE_PATH + ":textures/models/featherwing.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/featherwing.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
|
||||
if (entity instanceof EntityPlayer && stack != null
|
||||
&& stack.stackTagCompound != null
|
||||
&& stack.stackTagCompound.hasKey("isJumping")) {
|
||||
ModelWings.getInstance().isJumping = stack.stackTagCompound.getBoolean("isJumping");
|
||||
try {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
ModelWings mw = new ModelWings();
|
||||
mw.isJumping = stack.stackTagCompound.getBoolean("isJumping");
|
||||
return mw;
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
return new ModelWings();
|
||||
}
|
||||
|
||||
return ModelWings.getInstance();
|
||||
return new ModelWings();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,12 +72,12 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
|
||||
int amount) {
|
||||
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||
|
||||
boolean isJumping = nbtData.getBoolean("isJumping");
|
||||
boolean isJmuping = nbtData.getBoolean("isJumping");
|
||||
boolean isHolding = nbtData.getBoolean("isHolding");
|
||||
|
||||
nbtData.setBoolean("isJumping", IC2.keyboard.isJumpKeyDown(player));
|
||||
|
||||
if (isJumping) {
|
||||
if (isJmuping) {
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", true);
|
||||
if (IC2.keyboard.isSneakKeyDown(player)) nbtData.setByte("f", (byte) (0));
|
||||
@@ -105,9 +108,8 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
|
||||
nbtData.setByte("f", (byte) 0);
|
||||
}
|
||||
|
||||
if (isJumping && !player.onGround && player.motionY < 0) {
|
||||
if (isJmuping && !player.onGround && player.motionY < 0) {
|
||||
player.motionY *= f1;
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) {
|
||||
@@ -125,7 +127,6 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
|
||||
|
||||
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
|
||||
player.motionY *= 0.6;
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,20 +14,15 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import gregtech.api.hazards.Hazard;
|
||||
import gregtech.api.hazards.IHazardProtector;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import ic2.api.item.IMetalArmor;
|
||||
|
||||
@Optional.Interface(iface = "gregtech.api.hazards.IHazardProtector", modid = "gregtech_nh")
|
||||
public class ItemNanoWing extends ItemThaumiumReinforcedWing
|
||||
implements IElectricItem, ISpecialArmor, IMetalArmor, IHazardProtector {
|
||||
public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectricItem, ISpecialArmor, IMetalArmor {
|
||||
|
||||
public static int maxCharge = 1000000;
|
||||
public int tier = 3;
|
||||
@@ -50,11 +45,11 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/wing_nano");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/wing_nano");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
@@ -69,7 +64,7 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return EMT.RESOURCE_PATH + ":textures/models/nanowing.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/nanowing.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -137,8 +132,9 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||
}
|
||||
|
||||
@@ -181,10 +177,4 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "gregtech_nh")
|
||||
public boolean protectsAgainst(ItemStack itemStack, Hazard hazard) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -33,13 +33,13 @@ public class ItemQuantumWing extends ItemNanoWing {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/wing_quantum");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/wing_quantum");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return EMT.RESOURCE_PATH + ":textures/models/quantumwing.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/quantumwing.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,13 +8,13 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.IRepairable;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
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.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisDiscountGear, IRepairable {
|
||||
|
||||
@@ -40,17 +40,18 @@ public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisD
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":armor/wing_thaumium");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/wing_thaumium");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return EMT.RESOURCE_PATH + ":textures/models/thaumiumwing.png";
|
||||
return EMT.TEXTURE_PATH + ":textures/models/thaumiumwing.png";
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(EMTTextHelper.PURPLE + EMTTextHelper.localize("tooltip.EMT.visDiscount") + ": " + visDiscount + "%");
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ItemBlockElectricCloud extends ItemBlock {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
icon = ir.registerIcon(EMT.RESOURCE_PATH + ":" + "electric_cloud");
|
||||
icon = ir.registerIcon(EMT.TEXTURE_PATH + ":" + "electric_cloud");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,10 +10,11 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import emt.util.EMTTextHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
|
||||
public class ItemBlockEssentiaGenerators extends ItemBlock {
|
||||
|
||||
@@ -56,11 +57,11 @@ public class ItemBlockEssentiaGenerators extends ItemBlock {
|
||||
}
|
||||
|
||||
private long getOutputAmperage(double EU) {
|
||||
return 1L + (long) (EU * 1.953125e-5); // EU/(20 * 20 * 128)
|
||||
return (long) (1L + (EU / 20.0D / 20.0D / GT_Values.V[2]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List<String> list, boolean flag) {
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List list, boolean flag) {
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
|
||||
switch (is.getItemDamage()) {
|
||||
case 0:
|
||||
|
||||
@@ -46,8 +46,7 @@ public class ItemBlockMachines extends ItemBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List<String> p_77624_3_,
|
||||
boolean p_77624_4_) {
|
||||
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
|
||||
switch (p_77624_1_.getItemDamage()) {
|
||||
case 2: {
|
||||
p_77624_3_.add("Connects between Essentia Hatches and the Pipe Network");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package emt.item.block;
|
||||
|
||||
import static emt.util.EMTTextHelper.localize;
|
||||
import static gregtech.api.util.GTUtility.formatNumbers;
|
||||
import static gregtech.api.util.GT_Utility.formatNumbers;
|
||||
|
||||
import java.io.StringReader;
|
||||
import java.util.List;
|
||||
@@ -51,8 +51,7 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List<String> list,
|
||||
boolean advancedItemTooltips) {
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean advancedItemTooltips) {
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
|
||||
TileEntitySolarBase te = Solars.getTileEntitySolarBase(instance, itemstack.getItemDamage());
|
||||
if (instance == 0) {
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
package emt.item.focus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
|
||||
public abstract class ItemBaseFocus extends ItemFocusBasic {
|
||||
|
||||
@@ -31,7 +35,21 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon(EMT.RESOURCE_PATH + ":" + "focus_" + textureName);
|
||||
this.icon = ir.registerIcon(EMT.TEXTURE_PATH + ":" + "focus_" + textureName);
|
||||
}
|
||||
|
||||
boolean hasDepth() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor(ItemStack stack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemTool(ItemStack par1ItemStack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,10 +67,18 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
|
||||
return new AspectList();
|
||||
}
|
||||
|
||||
public boolean isUseItem(ItemStack stack) {
|
||||
return isVisCostPerTick(stack);
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer,
|
||||
MovingObjectPosition paramMovingObjectPosition) {
|
||||
if (isVisCostPerTick(paramItemStack)) paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE);
|
||||
if (isUseItem(paramItemStack)) paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE);
|
||||
return paramItemStack;
|
||||
}
|
||||
|
||||
@@ -62,9 +88,30 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
|
||||
@Override
|
||||
public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) {}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "00";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onFocusBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
AspectList cost = getVisCost(stack);
|
||||
if (cost != null && cost.size() > 0) {
|
||||
list.add(StatCollector.translateToLocal(isVisCostPerTick() ? "item.Focus.cost2" : "item.Focus.cost1"));
|
||||
for (Aspect aspect : cost.getAspectsSorted()) {
|
||||
float amount = cost.getAmount(aspect) / 100.0F;
|
||||
list.add(" " + '\u00a7' + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,19 @@
|
||||
package emt.item.focus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
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.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
|
||||
public class ItemChargeFocus extends ItemBaseFocus {
|
||||
|
||||
@@ -37,27 +35,32 @@ public class ItemChargeFocus extends ItemBaseFocus {
|
||||
for (Entry<Aspect, Integer> e : visCost.aspects.entrySet()) actualCost.add(
|
||||
e.getKey(),
|
||||
(int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency))));
|
||||
return actualCost;
|
||||
return visCost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "WANDCHARGING" + super.getSortingHelper(itemstack);
|
||||
return "WANDCHARGING";
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
|
||||
}
|
||||
|
||||
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player,
|
||||
MovingObjectPosition movingobjectposition) {
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
if (player.capabilities.isCreativeMode
|
||||
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, false)) {
|
||||
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||
if (!world.isRemote) {
|
||||
|
||||
int energyLeft = getChargeRate(itemstack);
|
||||
int energyLeft = (int) (EMTConfigHandler.chargeFocusProduction
|
||||
* Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
|
||||
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
|
||||
if (energyLeft > 0) {
|
||||
if ((player.inventory.armorInventory[i] != null)
|
||||
@@ -86,16 +89,4 @@ public class ItemChargeFocus extends ItemBaseFocus {
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
private int getChargeRate(ItemStack itemstack) {
|
||||
return (int) (EMTConfigHandler.chargeFocusProduction
|
||||
* Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
list.add(StatCollector.translateToLocal("item.EMT.focus.EU.cost.info"));
|
||||
list.add(StatCollector.translateToLocalFormatted("item.EMT.focus.EU.cost.once", getChargeRate(stack)));
|
||||
super.addInformation(stack, player, list, par4);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
public class ItemChristmasFocus extends ItemBaseFocus {
|
||||
@@ -31,12 +30,7 @@ public class ItemChristmasFocus extends ItemBaseFocus {
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "CHRISTMAS" + super.getSortingHelper(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
return "CHRISTMAS";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,7 +42,7 @@ public class ItemChristmasFocus extends ItemBaseFocus {
|
||||
int y = mop.blockY + 1;
|
||||
int z = mop.blockZ;
|
||||
if (player.capabilities.isCreativeMode
|
||||
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, false)) {
|
||||
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||
if (!world.isRemote) {
|
||||
EntitySnowman snowman;
|
||||
snowman = new EntitySnowman(world);
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package emt.item.focus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import emt.entity.EntityEnergyBall;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
|
||||
public class ItemEnergyBallFocus extends ItemBaseFocus {
|
||||
|
||||
@@ -26,12 +22,7 @@ public class ItemEnergyBallFocus extends ItemBaseFocus {
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "ENERGYBALL" + super.getSortingHelper(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
return "ENERGYBALL";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,10 +36,9 @@ public class ItemEnergyBallFocus extends ItemBaseFocus {
|
||||
return stack;
|
||||
}
|
||||
|
||||
int cost = getCost(stack);
|
||||
double val = ElectricItem.manager.discharge(armor, cost, 4, true, false, false);
|
||||
double val = ElectricItem.manager.discharge(armor, 5120, 4, true, false, false);
|
||||
|
||||
if (val < cost) {
|
||||
if (val < 5120) {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@@ -61,18 +51,4 @@ public class ItemEnergyBallFocus extends ItemBaseFocus {
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Base cost of 5120 with a 10% discount per level of frugal.
|
||||
*/
|
||||
private int getCost(ItemStack stack) {
|
||||
return (int) (5120 * (1.0 - (0.1 * getUpgradeLevel(stack, FocusUpgradeType.frugal))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
list.add(StatCollector.translateToLocal("item.EMT.focus.EU.cost.info"));
|
||||
list.add(StatCollector.translateToLocalFormatted("item.EMT.focus.EU.cost.once", getCost(stack)));
|
||||
this.addFocusInformation(stack, player, list, par4);
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,11 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import emt.entity.EntityLaser;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import emt.entity.EntityLaser;
|
||||
|
||||
public class ItemExplosionFocus extends ItemBaseFocus {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ItemExplosionFocus extends ItemBaseFocus {
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "EXPLOSION" + super.getSortingHelper(itemstack);
|
||||
return "EXPLOSION";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,7 +39,7 @@ public class ItemExplosionFocus extends ItemBaseFocus {
|
||||
MovingObjectPosition movingobjectposition) {
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
if (player.capabilities.isCreativeMode
|
||||
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, false)) {
|
||||
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||
if (!world.isRemote) {
|
||||
EntityLaser laser;
|
||||
laser = new EntityLaser(world, player, 1);
|
||||
@@ -54,4 +54,12 @@ public class ItemExplosionFocus extends ItemBaseFocus {
|
||||
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" 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) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package emt.item.focus;
|
||||
|
||||
import static emt.EMT.RESOURCE_PATH;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
|
||||
import gregtech.api.metatileentity.BaseMetaTileEntity;
|
||||
import gregtech.api.metatileentity.implementations.MTEHatchMaintenance;
|
||||
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);
|
||||
|
||||
private static final ResourceLocation focusMaintenanceSound = new ResourceLocation(
|
||||
RESOURCE_PATH,
|
||||
"maintenance.MaintenanceWandFocus");
|
||||
|
||||
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" + super.getSortingHelper(itemstack);
|
||||
}
|
||||
|
||||
@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 MTEHatchMaintenance) {
|
||||
MTEHatchMaintenance hatch = (MTEHatchMaintenance) hatchCandidateMetaTile;
|
||||
if (player.capabilities.isCreativeMode
|
||||
|| wand.consumeAllVis(itemStack, player, getVisCost(itemStack), true, false)) {
|
||||
hatch.mCrowbar = true;
|
||||
hatch.mScrewdriver = true;
|
||||
hatch.mHardHammer = true;
|
||||
hatch.mSolderingTool = true;
|
||||
hatch.mWrench = true;
|
||||
hatch.mSoftMallet = true;
|
||||
hatch.setMaintenanceSound(focusMaintenanceSound, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
player.swingItem();
|
||||
return itemStack;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package emt.item.focus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -9,12 +8,11 @@ import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import emt.entity.EntityShield;
|
||||
import ic2.core.IC2;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import emt.entity.EntityShield;
|
||||
import ic2.core.IC2;
|
||||
|
||||
public class ItemShieldFocus extends ItemBaseFocus {
|
||||
|
||||
@@ -37,28 +35,22 @@ public class ItemShieldFocus extends ItemBaseFocus {
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "SHIELD" + super.getSortingHelper(itemstack);
|
||||
return "SHIELD";
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisCostPerTick(ItemStack stack) {
|
||||
public boolean isUseItem(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) {
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
List<PotionEffect> potionEffects = new ArrayList<>(player.getActivePotionEffects());
|
||||
for (PotionEffect effect : potionEffects) {
|
||||
for (PotionEffect effect : new LinkedList<PotionEffect>(player.getActivePotionEffects())) {
|
||||
IC2.platform.removePotion(player, effect.getPotionID());
|
||||
}
|
||||
if (!player.capabilities.isCreativeMode
|
||||
&& !wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, false)) {
|
||||
&& !wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||
player.stopUsingItem();
|
||||
}
|
||||
}
|
||||
@@ -69,7 +61,7 @@ public class ItemShieldFocus extends ItemBaseFocus {
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
player.setItemInUse(itemstack, Integer.MAX_VALUE);
|
||||
if (!world.isRemote && (player.capabilities.isCreativeMode
|
||||
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, false))) {
|
||||
|| wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true))) {
|
||||
EntityShield shield = new EntityShield(world, player);
|
||||
world.spawnEntityInWorld(shield);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
package emt.item.focus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.item.ElectricItem;
|
||||
|
||||
public class ItemWandChargingFocus extends ItemBaseFocus {
|
||||
|
||||
@@ -30,7 +28,7 @@ public class ItemWandChargingFocus extends ItemBaseFocus {
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "ELECTRICCHARGING" + super.getSortingHelper(itemstack);
|
||||
return "ELECTRICCHARGING";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,63 +42,38 @@ public class ItemWandChargingFocus extends ItemBaseFocus {
|
||||
for (Entry<Aspect, Integer> e : visCost.aspects.entrySet()) actualCost.add(
|
||||
e.getKey(),
|
||||
(int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency))));
|
||||
return actualCost;
|
||||
return visCost;
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
|
||||
}
|
||||
|
||||
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int integer) {
|
||||
|
||||
if (!player.worldObj.isRemote) {
|
||||
ItemWandCasting wandItem = (ItemWandCasting) itemstack.getItem();
|
||||
if (wandIsFull(itemstack, wandItem)) {
|
||||
return;
|
||||
}
|
||||
|
||||
int cost = getCost(itemstack) / 4;
|
||||
for (ItemStack stack : player.inventory.armorInventory) {
|
||||
if (stack == null || ElectricItem.manager.getCharge(stack) < cost) {
|
||||
return;
|
||||
ItemStack armor = player.inventory.armorInventory[1];
|
||||
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)))) {
|
||||
int amount = (int) (100 * Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
|
||||
wandItem.addRealVis(itemstack, Aspect.ORDER, amount, true);
|
||||
wandItem.addRealVis(itemstack, Aspect.FIRE, amount, true);
|
||||
wandItem.addRealVis(itemstack, Aspect.ENTROPY, amount, true);
|
||||
wandItem.addRealVis(itemstack, Aspect.WATER, amount, true);
|
||||
wandItem.addRealVis(itemstack, Aspect.EARTH, amount, true);
|
||||
wandItem.addRealVis(itemstack, Aspect.AIR, amount, true);
|
||||
}
|
||||
}
|
||||
for (ItemStack stack : player.inventory.armorInventory) {
|
||||
ElectricItem.manager.use(stack, cost, player);
|
||||
}
|
||||
int amount = (int) (100 * Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
|
||||
wandItem.addRealVis(itemstack, Aspect.ORDER, amount, true);
|
||||
wandItem.addRealVis(itemstack, Aspect.FIRE, amount, true);
|
||||
wandItem.addRealVis(itemstack, Aspect.ENTROPY, amount, true);
|
||||
wandItem.addRealVis(itemstack, Aspect.WATER, amount, true);
|
||||
wandItem.addRealVis(itemstack, Aspect.EARTH, amount, true);
|
||||
wandItem.addRealVis(itemstack, Aspect.AIR, amount, true);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean wandIsFull(ItemStack itemstack, ItemWandCasting wandItem) {
|
||||
int size = wandItem.getMaxVis(itemstack);
|
||||
for (Aspect a : Aspect.getPrimalAspects()) {
|
||||
if (wandItem.getVis(itemstack, a) < size) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Base cost from config with a 10% discount per level of frugal.
|
||||
*/
|
||||
private int getCost(ItemStack stack) {
|
||||
return (int) (EMTConfigHandler.wandChargeFocusCost
|
||||
* (1.0 - (0.1 * getUpgradeLevel(stack, FocusUpgradeType.frugal))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
list.add(StatCollector.translateToLocal("item.EMT.focus.EU.cost.info"));
|
||||
list.add(StatCollector.translateToLocalFormatted("item.EMT.focus.EU.cost.tick", getCost(stack)));
|
||||
super.addInformation(stack, player, list, par4);
|
||||
}
|
||||
}
|
||||
@@ -13,15 +13,15 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.blocks.BlockCustomPlant;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.lib.utils.Utils;
|
||||
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.blocks.BlockCustomPlant;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.lib.utils.Utils;
|
||||
|
||||
public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
|
||||
|
||||
@@ -39,11 +39,11 @@ public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.icon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":tools/hoe_growth");
|
||||
this.icon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/hoe_growth");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
@@ -118,8 +118,9 @@ public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
|
||||
return did;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||
}
|
||||
|
||||
|
||||
@@ -41,11 +41,12 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":hammer/electricthorhammer");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":hammer/electricthorhammer");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
@@ -65,8 +66,9 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> 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(
|
||||
EMTTextHelper.localize("tooltip.EMT.hammer.electric")
|
||||
|
||||
@@ -16,11 +16,11 @@ import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.IRepairable;
|
||||
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 {
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ItemThorHammer extends ItemSword implements IRepairable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":hammer/thorhammer");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":hammer/thorhammer");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,8 +46,8 @@ public class ItemThorHammer extends ItemSword implements IRepairable {
|
||||
double d1 = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
|
||||
double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
|
||||
Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2);
|
||||
float f3 = MathHelper.cos((-f2 * 0.01745329F) - (float) Math.PI);
|
||||
float f4 = MathHelper.sin((-f2 * 0.01745329F) - (float) Math.PI);
|
||||
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
|
||||
float f6 = MathHelper.sin(-f1 * 0.01745329F);
|
||||
float f7 = f4 * f5;
|
||||
@@ -87,7 +87,7 @@ public class ItemThorHammer extends ItemSword implements IRepairable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.The Hammer of Thor"));
|
||||
}
|
||||
}
|
||||
@@ -12,12 +12,12 @@ import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import thaumcraft.api.IRepairable;
|
||||
import thaumcraft.common.entities.projectile.EntityAlumentum;
|
||||
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.common.entities.projectile.EntityAlumentum;
|
||||
|
||||
public class ItemThorHammerBroken extends ItemSword implements IRepairable {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ItemThorHammerBroken extends ItemSword implements IRepairable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":hammer/taintedthorhammer");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":hammer/taintedthorhammer");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,7 +57,7 @@ public class ItemThorHammerBroken extends ItemSword implements IRepairable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer entityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer entityPlayer, List list, boolean par4) {
|
||||
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.thor"));
|
||||
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.danger"));
|
||||
if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":tools/chainsaw_diamond");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/chainsaw_diamond");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,7 +93,7 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
@@ -270,8 +270,9 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
|
||||
return EMTConfigHandler.enchanting;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package emt.item.tool.chainsaw;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -10,19 +10,19 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
import thaumcraft.common.lib.network.fx.PacketFXBlockBubble;
|
||||
import thaumcraft.common.lib.utils.BlockUtils;
|
||||
import thaumcraft.common.lib.utils.Utils;
|
||||
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.fx.PacketFXBlockBubble;
|
||||
import thaumcraft.common.lib.utils.BlockUtils;
|
||||
import thaumcraft.common.lib.utils.Utils;
|
||||
|
||||
public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
|
||||
|
||||
public static ArrayList<?> oreDictLogs = new ArrayList<>();
|
||||
public static ArrayList oreDictLogs = new ArrayList();
|
||||
boolean alternateServer;
|
||||
boolean alternateClient;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":tools/chainsaw_stream");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/chainsaw_stream");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ItemThaumiumChainsaw extends ItemDiamondChainsaw {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":tools/chainsaw_thaumium");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/chainsaw_thaumium");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -22,14 +23,14 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.entities.EntityFollowingItem;
|
||||
import thaumcraft.common.lib.utils.BlockUtils;
|
||||
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.entities.EntityFollowingItem;
|
||||
import thaumcraft.common.lib.utils.BlockUtils;
|
||||
|
||||
public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
||||
|
||||
@@ -62,7 +63,7 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":tools/drill_rockbreaker");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/drill_rockbreaker");
|
||||
}
|
||||
|
||||
private boolean isEffectiveAgainst(Block block) {
|
||||
@@ -125,7 +126,7 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
||||
}
|
||||
int fortune = EnchantmentHelper.getFortuneModifier(entityLiving);
|
||||
world.setBlockToAir(x + xx, y + yy, z + zz);
|
||||
ArrayList<ItemStack> 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;
|
||||
if ((entityLiving instanceof EntityPlayer)
|
||||
&& ((EntityPlayer) entityLiving).capabilities.isCreativeMode) {
|
||||
@@ -135,7 +136,7 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
||||
continue;
|
||||
}
|
||||
ItemStack is;
|
||||
for (Iterator<ItemStack> i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(
|
||||
for (Iterator i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(
|
||||
new EntityFollowingItem(
|
||||
world,
|
||||
(double) x + (double) xx + 0.5D,
|
||||
@@ -144,7 +145,7 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
||||
is,
|
||||
entityLiving,
|
||||
3))) {
|
||||
is = i$.next();
|
||||
is = (ItemStack) i$.next();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,6 +193,7 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
||||
0.2F + world.rand.nextFloat() * 0.2F);
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, xOffset, zOffset);
|
||||
}
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Thaumcraft.instance.renderEventHandler.startScan(player, x, y, z, System.currentTimeMillis() + 5000L, 1);
|
||||
player.swingItem();
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
|
||||
@@ -43,11 +43,11 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":tools/drill_thaumium");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/drill_thaumium");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
@@ -115,8 +115,9 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
||||
return EMTConfigHandler.enchanting;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ItemOmnitoolDiamond extends ItemOmnitoolIron {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":tools/omnitool_diamond");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/omnitool_diamond");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,11 +46,11 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":tools/omnitool_iron");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/omnitool_iron");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
@@ -156,8 +156,9 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
||||
return EMTConfigHandler.enchanting;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + getTier(new ItemStack(this)));
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.RESOURCE_PATH + ":tools/omnitool_thaumium");
|
||||
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/omnitool_thaumium");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
package emt.nei;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import emt.EMT;
|
||||
import emt.init.EMTItems;
|
||||
|
||||
public class NEI_Config implements IConfigureNEI {
|
||||
|
||||
public static boolean isAdded = true;
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
API.hideItem(new ItemStack(EMTItems.itemEMTItems, 1, 16));
|
||||
API.hideItem(new ItemStack(EMTItems.itemEMTItems, 1, 17));
|
||||
API.hideItem(new ItemStack(EMTItems.itemEMTItems, 1, 18));
|
||||
API.hideItem(new ItemStack(EMTItems.itemEMTItems, 1, 19));
|
||||
NEI_Config.isAdded = false;
|
||||
NEI_Config.isAdded = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -26,4 +25,35 @@ public class NEI_Config implements IConfigureNEI {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package emt.network;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.tile.GT_MetaTileEntity_ResearchCompleter;
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketNodeInfo implements IMessage, IMessageHandler<PacketNodeInfo, IMessage> {
|
||||
|
||||
private int mBlockX, mBlockY, mBlockZ, mDim, nodeDistance, nodeColor;
|
||||
|
||||
public PacketNodeInfo() {}
|
||||
|
||||
public PacketNodeInfo(int mBlockX, int mBlockY, int mBlockZ, int mDim, int nodeDistance, int nodeColor) {
|
||||
this.mBlockX = mBlockX;
|
||||
this.mBlockY = mBlockY;
|
||||
this.mBlockZ = mBlockZ;
|
||||
this.mDim = mDim;
|
||||
this.nodeDistance = nodeDistance;
|
||||
this.nodeColor = nodeColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
mBlockX = buf.readInt();
|
||||
mBlockY = buf.readInt();
|
||||
mBlockZ = buf.readInt();
|
||||
mDim = buf.readInt();
|
||||
nodeDistance = buf.readInt();
|
||||
nodeColor = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(mBlockX);
|
||||
buf.writeInt(mBlockY);
|
||||
buf.writeInt(mBlockZ);
|
||||
buf.writeInt(mDim);
|
||||
buf.writeInt(nodeDistance);
|
||||
buf.writeInt(nodeColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IMessage onMessage(PacketNodeInfo message, MessageContext ctx) {
|
||||
WorldClient world = Minecraft.getMinecraft().theWorld;
|
||||
if (world != null) {
|
||||
if (world.blockExists(message.mBlockX, message.mBlockY, message.mBlockZ)) {
|
||||
TileEntity tileEntity = world.getTileEntity(message.mBlockX, message.mBlockY, message.mBlockZ);
|
||||
if (tileEntity instanceof IGregTechTileEntity) {
|
||||
IGregTechTileEntity gtTile = (IGregTechTileEntity) tileEntity;
|
||||
if (gtTile.getMetaTileEntity() instanceof GT_MetaTileEntity_ResearchCompleter) {
|
||||
GT_MetaTileEntity_ResearchCompleter researchCompleter = (GT_MetaTileEntity_ResearchCompleter) gtTile
|
||||
.getMetaTileEntity();
|
||||
researchCompleter.setNodeValues(message.nodeDistance, message.nodeColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package emt.tile;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
|
||||
public class DefinitelyNotAIC2Source {
|
||||
|
||||
@@ -13,7 +14,7 @@ public class DefinitelyNotAIC2Source {
|
||||
protected long energyStored;
|
||||
|
||||
public DefinitelyNotAIC2Source(TileEntity parent1, long capacity1, int tier1) {
|
||||
long power = 8L << (2 * tier1);
|
||||
long power = GT_Values.V[tier1];
|
||||
this.parent = parent1;
|
||||
this.capacity = capacity1 < power ? power : capacity1;
|
||||
this.tier = (byte) tier1;
|
||||
|
||||
@@ -0,0 +1,377 @@
|
||||
package emt.tile;
|
||||
|
||||
import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
|
||||
import static gregtech.api.enums.Textures.BlockIcons.*;
|
||||
import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchCategories;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumcraft.common.lib.research.ResearchManager;
|
||||
import thaumcraft.common.lib.research.ResearchNoteData;
|
||||
import thaumcraft.common.tiles.TileNode;
|
||||
|
||||
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
|
||||
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import emt.EMT;
|
||||
import emt.network.PacketNodeInfo;
|
||||
import gregtech.api.GregTech_API;
|
||||
import gregtech.api.enums.Textures;
|
||||
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_Utility;
|
||||
|
||||
public class GT_MetaTileEntity_ResearchCompleter
|
||||
extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_ResearchCompleter> {
|
||||
|
||||
private static final int CASING_INDEX = 184;
|
||||
private static final int MAX_LENGTH = 13;
|
||||
private static final int RECIPE_LENGTH = 1200;
|
||||
private static final int RECIPE_EUT = 120;
|
||||
private static final float NODE_COST_MULTIPLIER = 1.0f;
|
||||
|
||||
private int recipeAspectCost;
|
||||
private int aspectsAbsorbed;
|
||||
|
||||
protected int mLength;
|
||||
protected int mCasing;
|
||||
protected boolean endFound;
|
||||
|
||||
// For displaying beam
|
||||
private int lastNodeDistance;
|
||||
private int lastNodeColor;
|
||||
private int syncTimer;
|
||||
|
||||
private static final String STRUCTURE_PIECE_FIRST = "first";
|
||||
private static final String STRUCTURE_PIECE_LATER = "later";
|
||||
private static final String STRUCTURE_PIECE_LAST = "last";
|
||||
private static final String STRUCTURE_PIECE_LATER_HINT = "laterHint";
|
||||
private static final IStructureDefinition<GT_MetaTileEntity_ResearchCompleter> STRUCTURE_DEFINITION = StructureDefinition
|
||||
.<GT_MetaTileEntity_ResearchCompleter>builder()
|
||||
.addShape(STRUCTURE_PIECE_FIRST, transpose(new String[][] { { "ccc" }, { "g~g" }, { "ccc" }, }))
|
||||
.addShape(STRUCTURE_PIECE_LATER, transpose(new String[][] { { "c c" }, { "gxg" }, { "c c" }, }))
|
||||
.addShape(STRUCTURE_PIECE_LAST, transpose(new String[][] { { "c" }, { "g" }, { "c" }, }))
|
||||
.addShape(STRUCTURE_PIECE_LATER_HINT, transpose(new String[][] { { "c c" }, { "g g" }, { "c c" }, }))
|
||||
.addElement(
|
||||
'c',
|
||||
ofChain( // Magical machine casing or hatch
|
||||
ofHatchAdder(
|
||||
GT_MetaTileEntity_ResearchCompleter::addEnergyInputToMachineList,
|
||||
CASING_INDEX,
|
||||
1),
|
||||
ofHatchAdder(GT_MetaTileEntity_ResearchCompleter::addInputToMachineList, CASING_INDEX, 1),
|
||||
ofHatchAdder(GT_MetaTileEntity_ResearchCompleter::addOutputToMachineList, CASING_INDEX, 1),
|
||||
ofHatchAdder(
|
||||
GT_MetaTileEntity_ResearchCompleter::addMaintenanceToMachineList,
|
||||
CASING_INDEX,
|
||||
1),
|
||||
onElementPass(
|
||||
GT_MetaTileEntity_ResearchCompleter::onCasingFound,
|
||||
ofBlock(GregTech_API.sBlockCasings8, 8))))
|
||||
.addElement(
|
||||
'x',
|
||||
ofChain( // Check for the end but otherwise treat as a skipped spot
|
||||
onElementPass(
|
||||
GT_MetaTileEntity_ResearchCompleter::onEndFound,
|
||||
ofBlock(ConfigBlocks.blockCosmeticOpaque, 2)),
|
||||
isAir(), // Forgive me
|
||||
notAir()))
|
||||
.addElement('g', ofBlock(ConfigBlocks.blockCosmeticOpaque, 2)) // Warded glass
|
||||
.build();
|
||||
|
||||
public GT_MetaTileEntity_ResearchCompleter(int aID, String aName, String aNameRegional) {
|
||||
super(aID, aName, aNameRegional);
|
||||
}
|
||||
|
||||
public GT_MetaTileEntity_ResearchCompleter(String aName) {
|
||||
super(aName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveNBTData(NBTTagCompound aNBT) {
|
||||
aNBT.setInteger("recipeAspectCost", recipeAspectCost);
|
||||
aNBT.setInteger("aspectsAbsorbed", aspectsAbsorbed);
|
||||
aNBT.setInteger("mLength", mLength);
|
||||
|
||||
super.saveNBTData(aNBT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadNBTData(NBTTagCompound aNBT) {
|
||||
recipeAspectCost = aNBT.getInteger("recipeAspectCost");
|
||||
aspectsAbsorbed = aNBT.getInteger("aspectsAbsorbed");
|
||||
mLength = aNBT.getInteger("mLength");
|
||||
|
||||
super.loadNBTData(aNBT);
|
||||
}
|
||||
|
||||
// For client beam animation
|
||||
public void setNodeValues(int nodeDistance, int nodeColor) {
|
||||
this.lastNodeDistance = nodeDistance;
|
||||
this.lastNodeColor = nodeColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
|
||||
if (aBaseMetaTileEntity.isClientSide()) {
|
||||
if (aBaseMetaTileEntity.isActive()) {
|
||||
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
|
||||
int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY;
|
||||
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
|
||||
double xCoord = aBaseMetaTileEntity.getXCoord() + 0.5;
|
||||
double yCoord = aBaseMetaTileEntity.getYCoord() + 0.5;
|
||||
double zCoord = aBaseMetaTileEntity.getZCoord() + 0.5;
|
||||
Thaumcraft.proxy.beam(
|
||||
aBaseMetaTileEntity.getWorld(),
|
||||
xCoord + 0.5 * xDir,
|
||||
yCoord + 0.5 * yDir,
|
||||
zCoord + 0.5 * zDir,
|
||||
xCoord + xDir * lastNodeDistance,
|
||||
yCoord + yDir * lastNodeDistance,
|
||||
zCoord + zDir * lastNodeDistance,
|
||||
3,
|
||||
lastNodeColor,
|
||||
true,
|
||||
2,
|
||||
1);
|
||||
} else {
|
||||
lastNodeDistance = 0;
|
||||
lastNodeColor = 0;
|
||||
}
|
||||
}
|
||||
|
||||
super.onPostTick(aBaseMetaTileEntity, aTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onRunningTick(ItemStack aStack) {
|
||||
float progressAmount = ((float) this.mProgresstime) / this.mMaxProgresstime;
|
||||
int requiredVis = (int) Math.ceil(progressAmount * recipeAspectCost - aspectsAbsorbed);
|
||||
syncTimer--;
|
||||
|
||||
IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
|
||||
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
|
||||
int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY;
|
||||
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
|
||||
int i = 1;
|
||||
|
||||
// Loop through node spaces and drain them from front to back
|
||||
while (i < this.mLength - 1 && requiredVis > 0) {
|
||||
int nodeX = aBaseMetaTileEntity.getXCoord() + xDir * i;
|
||||
int nodeY = aBaseMetaTileEntity.getYCoord() + yDir * i;
|
||||
int nodeZ = aBaseMetaTileEntity.getZCoord() + zDir * i;
|
||||
TileEntity tileEntity = aBaseMetaTileEntity.getWorld().getTileEntity(nodeX, nodeY, nodeZ);
|
||||
|
||||
if (tileEntity instanceof TileNode) {
|
||||
TileNode aNode = (TileNode) tileEntity;
|
||||
AspectList aspectsBase = aNode.getAspectsBase();
|
||||
|
||||
for (Aspect aspect : aspectsBase.getAspects()) {
|
||||
int aspectAmount = aspectsBase.getAmount(aspect);
|
||||
int drainAmount = Math.min(requiredVis, aspectAmount);
|
||||
aNode.setNodeVisBase(aspect, (short) (aspectAmount - drainAmount));
|
||||
aNode.takeFromContainer(aspect, drainAmount);
|
||||
requiredVis -= drainAmount;
|
||||
aspectsAbsorbed += drainAmount;
|
||||
|
||||
if (requiredVis <= 0) {
|
||||
if (i != lastNodeDistance || aspect.getColor() != lastNodeColor)
|
||||
sendClientAnimationUpdate(aBaseMetaTileEntity, i, aspect.getColor());
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (aspectsBase.visSize() <= 0) aBaseMetaTileEntity.getWorld().setBlockToAir(nodeX, nodeY, nodeZ);
|
||||
else {
|
||||
aNode.markDirty();
|
||||
aBaseMetaTileEntity.getWorld().markBlockForUpdate(nodeX, nodeY, nodeZ);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (syncTimer <= 0) sendClientAnimationUpdate(aBaseMetaTileEntity, lastNodeDistance, lastNodeColor);
|
||||
|
||||
if (requiredVis > 0) this.criticalStopMachine();
|
||||
|
||||
return super.onRunningTick(aStack);
|
||||
}
|
||||
|
||||
private void sendClientAnimationUpdate(IGregTechTileEntity aBaseMetaTileEntity, int nodeDistance, int nodeColor) {
|
||||
int xCoord = aBaseMetaTileEntity.getXCoord();
|
||||
int yCoord = aBaseMetaTileEntity.getYCoord();
|
||||
int zCoord = aBaseMetaTileEntity.getZCoord();
|
||||
int dim = aBaseMetaTileEntity.getWorld().provider.dimensionId;
|
||||
|
||||
PacketNodeInfo packet = new PacketNodeInfo(xCoord, yCoord, zCoord, dim, nodeDistance, nodeColor);
|
||||
EMT.INSTANCE.sendToAllAround(packet, new NetworkRegistry.TargetPoint(dim, xCoord, yCoord, zCoord, 128));
|
||||
|
||||
lastNodeDistance = nodeDistance;
|
||||
lastNodeColor = nodeColor;
|
||||
syncTimer = 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCorrectMachinePart(ItemStack itemStack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkRecipe(ItemStack itemStack) {
|
||||
ArrayList<ItemStack> tInputList = this.getStoredInputs();
|
||||
|
||||
for (ItemStack stack : tInputList) {
|
||||
if (GT_Utility.isStackValid(stack) && stack.stackSize > 0) {
|
||||
if (stack.getItem() == ConfigItems.itemResearchNotes
|
||||
&& !stack.stackTagCompound.getBoolean("complete")) {
|
||||
ResearchNoteData noteData = ResearchManager.getData(stack);
|
||||
if (noteData == null) continue;
|
||||
ResearchItem researchItem = ResearchCategories.getResearch(noteData.key);
|
||||
if (researchItem == null) continue;
|
||||
|
||||
this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
|
||||
this.mEfficiencyIncrease = 10000;
|
||||
this.calculateOverclockedNessMulti(RECIPE_EUT, RECIPE_LENGTH, 1, this.getMaxInputVoltage());
|
||||
if (this.mMaxProgresstime == 2147483646 && this.mEUt == 2147483646) {
|
||||
return false;
|
||||
}
|
||||
if (this.mEUt > 0) {
|
||||
this.mEUt = -this.mEUt;
|
||||
}
|
||||
|
||||
// Create a completed version of the note to output
|
||||
this.mOutputItems = new ItemStack[] { GT_Utility.copyAmount(1L, stack) };
|
||||
this.mOutputItems[0].stackTagCompound.setBoolean("complete", true);
|
||||
this.mOutputItems[0].setItemDamage(64);
|
||||
stack.stackSize -= 1;
|
||||
this.aspectsAbsorbed = 0;
|
||||
this.recipeAspectCost = (int) Math.ceil(researchItem.tags.visSize() * NODE_COST_MULTIPLIER);
|
||||
|
||||
this.lastNodeDistance = 0;
|
||||
this.lastNodeColor = 0;
|
||||
|
||||
this.sendLoopStart((byte) 20);
|
||||
this.updateSlots();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
|
||||
mLength = 1;
|
||||
mCasing = 0;
|
||||
endFound = false;
|
||||
|
||||
// check front
|
||||
if (!checkPiece(STRUCTURE_PIECE_FIRST, 1, 1, 0)) return false;
|
||||
|
||||
// check middle pieces
|
||||
while (!endFound && mLength++ < MAX_LENGTH) {
|
||||
if (!checkPiece(STRUCTURE_PIECE_LATER, 1, 1, -(mLength - 1))) return false;
|
||||
}
|
||||
|
||||
return endFound && mLength >= 3
|
||||
&& checkPiece(STRUCTURE_PIECE_LAST, 0, 1, -(mLength - 1))
|
||||
&& mCasing >= mLength * 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEfficiency(ItemStack itemStack) {
|
||||
return 10000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPollutionPerTick(ItemStack itemStack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageToComponent(ItemStack itemStack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean explodesOnComponentBreak(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
|
||||
return new GT_MetaTileEntity_ResearchCompleter(this.mName);
|
||||
}
|
||||
|
||||
protected void onCasingFound() {
|
||||
mCasing++;
|
||||
}
|
||||
|
||||
protected void onEndFound() {
|
||||
endFound = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
|
||||
boolean aActive, boolean aRedstone) {
|
||||
if (aSide == aFacing) {
|
||||
if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
|
||||
TextureFactory.builder().addIcon(OVERLAY_FRONT_RESEARCH_COMPLETER_ACTIVE).extFacing().build(),
|
||||
TextureFactory.builder().addIcon(OVERLAY_FRONT_RESEARCH_COMPLETER_ACTIVE_GLOW).extFacing().glow()
|
||||
.build() };
|
||||
return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
|
||||
TextureFactory.builder().addIcon(OVERLAY_FRONT_RESEARCH_COMPLETER).extFacing().build(),
|
||||
TextureFactory.builder().addIcon(OVERLAY_FRONT_RESEARCH_COMPLETER_GLOW).extFacing().glow()
|
||||
.build() };
|
||||
}
|
||||
return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public IStructureDefinition<GT_MetaTileEntity_ResearchCompleter> getStructureDefinition() {
|
||||
return STRUCTURE_DEFINITION;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GT_Multiblock_Tooltip_Builder createTooltip() {
|
||||
GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
|
||||
tt.addMachineType("Research Completer").addInfo("Controller block for the Research Completer")
|
||||
.addInfo("Completes Thaumcraft research notes using EU and Thaumcraft nodes")
|
||||
.addInfo("Place nodes in the center row").addSeparator()
|
||||
.beginVariableStructureBlock(3, 3, 3, 3, 3, MAX_LENGTH, true).addController("Front center")
|
||||
.addOtherStructurePart("Magical machine casing", "Top and bottom layers outside. 3 x L minimum")
|
||||
.addOtherStructurePart("Warded glass", "Middle layer outside").addEnergyHatch("Any casing")
|
||||
.addMaintenanceHatch("Any casing").addInputBus("Any casing").addOutputBus("Any casing")
|
||||
.toolTipFinisher("Electro-Magic Tools");
|
||||
return tt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void construct(ItemStack stackSize, boolean hintsOnly) {
|
||||
buildPiece(STRUCTURE_PIECE_FIRST, stackSize, hintsOnly, 1, 1, 0);
|
||||
int tTotalLength = Math.min(MAX_LENGTH, stackSize.stackSize + 2);
|
||||
for (int i = 1; i < tTotalLength; i++) {
|
||||
buildPiece(STRUCTURE_PIECE_LATER_HINT, stackSize, hintsOnly, 1, 1, -i);
|
||||
}
|
||||
buildPiece(STRUCTURE_PIECE_LAST, stackSize, hintsOnly, 0, 1, -(tTotalLength - 1));
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,13 @@ package emt.tile;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
|
||||
public class TileElectricCloud extends TileEntity {
|
||||
|
||||
|
||||
@@ -8,8 +8,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
import com.gtnewhorizons.modularui.api.ModularUITextures;
|
||||
import com.gtnewhorizons.modularui.api.drawable.UITexture;
|
||||
import com.gtnewhorizons.modularui.api.forge.InvWrapper;
|
||||
import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI;
|
||||
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
|
||||
@@ -21,13 +22,12 @@ import com.gtnewhorizons.modularui.common.widget.TextWidget;
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTTextHelper;
|
||||
import gregtech.api.gui.modularui.GT_UITextures;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
public class TileEntityEtherealMacerator extends TileEntityEMT
|
||||
implements ISidedInventory, IWrenchable, ITileWithModularUI {
|
||||
|
||||
private static final UITexture PROGRESSBAR_MACERATE = UITexture.fullImage("gregtech", "gui/progressbar/macerate");
|
||||
private static final int[] slots_top = new int[] { 0 };
|
||||
private static final int[] slots_bottom = new int[] { 2, 1 };
|
||||
private static final int[] slots_sides = new int[] { 1 };
|
||||
@@ -307,7 +307,7 @@ public class TileEntityEtherealMacerator extends TileEntityEMT
|
||||
.setPos(115, 25))
|
||||
.widget(new SlotWidget(invWrapper, 1).setAccess(true, false).setPos(115, 52))
|
||||
.widget(
|
||||
new ProgressBar().setTexture(PROGRESSBAR_MACERATE, 20)
|
||||
new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_MACERATE, 20)
|
||||
.setProgress(() -> (float) cookTime / maceratingSpeed).setPos(81, 36).setSize(20, 18))
|
||||
.widget(new TextWidget(EMTTextHelper.localize("gui.EMT.etherealMacerator.title")).setPos(6, 6));
|
||||
|
||||
|
||||
@@ -8,6 +8,10 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
import com.gtnewhorizons.modularui.api.ModularUITextures;
|
||||
import com.gtnewhorizons.modularui.api.forge.InvWrapper;
|
||||
import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI;
|
||||
@@ -23,9 +27,6 @@ import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTTextHelper;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
public class TileEntityIndustrialWandRecharge extends TileEntityEMT
|
||||
implements IInventory, IWrenchable, IEnergySink, ITileWithModularUI {
|
||||
@@ -152,9 +153,9 @@ public class TileEntityIndustrialWandRecharge extends TileEntityEMT
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
super.readFromNBT(compound);
|
||||
NBTTagList nbttaglist = compound.getTagList("Items", 10);
|
||||
public void readFromNBT(NBTTagCompound p_145839_1_) {
|
||||
super.readFromNBT(p_145839_1_);
|
||||
NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10);
|
||||
this.ItemStacks = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
@@ -167,13 +168,13 @@ public class TileEntityIndustrialWandRecharge extends TileEntityEMT
|
||||
}
|
||||
|
||||
if (this.energyStored == 0) {
|
||||
this.energyStored = compound.getDouble("Energy");
|
||||
this.energyStored = p_145839_1_.getDouble("Energy");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound) {
|
||||
super.writeToNBT(compound);
|
||||
public void writeToNBT(NBTTagCompound p_145841_1_) {
|
||||
super.writeToNBT(p_145841_1_);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < this.ItemStacks.length; ++i) {
|
||||
@@ -185,8 +186,8 @@ public class TileEntityIndustrialWandRecharge extends TileEntityEMT
|
||||
}
|
||||
}
|
||||
|
||||
compound.setTag("Items", nbttaglist);
|
||||
compound.setDouble("Energy", this.energyStored);
|
||||
p_145841_1_.setTag("Items", nbttaglist);
|
||||
p_145841_1_.setDouble("Energy", this.energyStored);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,8 +13,12 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.*;
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
import thaumcraft.common.lib.network.fx.PacketFXEssentiaSource;
|
||||
|
||||
import com.gtnewhorizons.modularui.api.ModularUITextures;
|
||||
import com.gtnewhorizons.modularui.api.NumberFormatMUI;
|
||||
import com.gtnewhorizons.modularui.api.drawable.Text;
|
||||
import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI;
|
||||
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
|
||||
@@ -29,20 +33,13 @@ import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import gregtech.api.enums.GTValues;
|
||||
import emt.util.EMTTextHelper;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.interfaces.tileentity.IBasicEnergyContainer;
|
||||
import gregtech.api.interfaces.tileentity.IEnergyConnected;
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
|
||||
import gregtech.common.data.GTBlockEventTracker;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IAspectContainer;
|
||||
import thaumcraft.api.aspects.IAspectSource;
|
||||
import thaumcraft.api.aspects.IEssentiaTransport;
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
import thaumcraft.common.lib.network.fx.PacketFXEssentiaSource;
|
||||
import gregtech.api.net.GT_Packet_Block_Event;
|
||||
|
||||
public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory, IAspectContainer, IEssentiaTransport,
|
||||
IHasWorldObjectAndCoords, IEnergyConnected, IBasicEnergyContainer, ITileWithModularUI {
|
||||
@@ -56,21 +53,14 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
public int storage;
|
||||
public short mpshownstroage;
|
||||
public int maxstorage;
|
||||
public byte maxfuel = 64;
|
||||
public byte fuel = 0;
|
||||
// The amount to pull from jars (through the air like the runic matrix) when empty.
|
||||
// Values above 1 do not work with essentia mirrors.
|
||||
public byte refuel = 1;
|
||||
// Used to make the generator sleep between failed attempts to draw essentia from nearby jars.
|
||||
public int timer = 0;
|
||||
// The number of ticks to wait after failing to draw essentia.
|
||||
public final int refuelSleepTime = 40;
|
||||
public byte maxfuel;
|
||||
public byte fuel;
|
||||
public byte refuel;
|
||||
public long timer = 0L;
|
||||
public boolean dead = true;
|
||||
public byte color = -1;
|
||||
public byte color;
|
||||
private boolean side;
|
||||
|
||||
protected static final NumberFormatMUI numberFormat = new NumberFormatMUI();
|
||||
|
||||
public TileEntityBaseGenerator(int aspect) {
|
||||
this();
|
||||
switch (aspect) {
|
||||
@@ -99,17 +89,18 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
public TileEntityBaseGenerator() {
|
||||
this.energySource.setCapacity(EMTConfigHandler.EssentiaGeneratorStorage);
|
||||
this.maxstorage = ((int) this.energySource.getCapacity());
|
||||
this.maxfuel = 64;
|
||||
this.fuel = 0;
|
||||
this.refuel = 1;
|
||||
this.color = -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
this.side = !this.worldObj.isRemote;
|
||||
this.dead = false;
|
||||
this.timer--;
|
||||
if (this.timer <= Integer.MIN_VALUE + 1) this.timer = 0;
|
||||
if (this.fuel + this.refuel > this.maxfuel) {
|
||||
this.timer = refuelSleepTime;
|
||||
}
|
||||
this.timer += 1L;
|
||||
if (this.timer <= Long.MAX_VALUE - 1) this.timer = 0L;
|
||||
storeFuel();
|
||||
fillfrompipe();
|
||||
createEnergy();
|
||||
@@ -117,61 +108,64 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
public void storeFuel() {
|
||||
if (this.timer > 0 || !side) {
|
||||
return;
|
||||
}
|
||||
boolean stored = false;
|
||||
for (int x = this.xCoord - 4; x < this.xCoord + 4; x++) {
|
||||
for (int y = this.yCoord - 4; y < this.yCoord + 4; y++) {
|
||||
for (int z = this.zCoord - 4; z < this.zCoord + 4; z++) {
|
||||
TileEntity tile = this.worldObj.getTileEntity(x, y, z);
|
||||
if (tile instanceof IAspectSource as && as.takeFromContainer(this.aspect, this.refuel)) {
|
||||
PacketHandler.INSTANCE.sendToAllAround(
|
||||
new PacketFXEssentiaSource(
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
(byte) (this.xCoord - x),
|
||||
(byte) (this.yCoord - y),
|
||||
(byte) (this.zCoord - z),
|
||||
this.aspect.getColor()),
|
||||
new NetworkRegistry.TargetPoint(
|
||||
getWorldObj().provider.dimensionId,
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
32.0D));
|
||||
addToContainer(this.aspect, this.refuel);
|
||||
if (this.fuel + this.refuel > this.maxfuel) {
|
||||
return;
|
||||
if (!side) return;
|
||||
|
||||
if (this.fuel < this.maxfuel) {
|
||||
for (int x = this.xCoord - 4; x < this.xCoord + 4; x++) {
|
||||
for (int y = this.yCoord - 4; y < this.yCoord + 4; y++) {
|
||||
for (int z = this.zCoord - 4; z < this.zCoord + 4; z++) {
|
||||
TileEntity tile = this.worldObj.getTileEntity(x, y, z);
|
||||
if (tile instanceof IAspectSource) {
|
||||
IAspectSource as = (IAspectSource) tile;
|
||||
if ((as.doesContainerContainAmount(this.aspect, this.refuel))
|
||||
&& (as.takeFromContainer(this.aspect, this.refuel))) {
|
||||
PacketHandler.INSTANCE.sendToAllAround(
|
||||
new PacketFXEssentiaSource(
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
(byte) (this.xCoord - x),
|
||||
(byte) (this.yCoord - y),
|
||||
(byte) (this.zCoord - z),
|
||||
this.aspect.getColor()),
|
||||
new NetworkRegistry.TargetPoint(
|
||||
getWorldObj().provider.dimensionId,
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
32.0D));
|
||||
addToContainer(this.aspect, this.refuel);
|
||||
}
|
||||
}
|
||||
stored = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!stored) {
|
||||
this.timer = refuelSleepTime;
|
||||
}
|
||||
}
|
||||
|
||||
public void fillfrompipe() {
|
||||
if (this.fuel >= this.maxfuel || !side) return;
|
||||
if (!side) return;
|
||||
|
||||
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
|
||||
TileEntity pipeTE = ThaumcraftApiHelper
|
||||
.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, direction);
|
||||
if (pipeTE != null) {
|
||||
IEssentiaTransport pipe = (IEssentiaTransport) pipeTE;
|
||||
if (!pipe.canOutputTo(direction)) {
|
||||
continue;
|
||||
if (this.fuel == this.maxfuel) return;
|
||||
|
||||
TileEntity[] te = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length];
|
||||
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]);
|
||||
if (te[i] != null) {
|
||||
IEssentiaTransport pipe = (IEssentiaTransport) te[i];
|
||||
if (!pipe.canOutputTo(ForgeDirection.VALID_DIRECTIONS[i])) {
|
||||
return;
|
||||
}
|
||||
if ((pipe.getEssentiaType(direction) != null) && (pipe.getEssentiaType(direction).equals(this.aspect))
|
||||
&& (pipe.getSuctionAmount(direction) < getSuctionAmount(direction))) {
|
||||
addToContainer(this.aspect, pipe.takeEssentia(this.aspect, 1, direction));
|
||||
if (this.fuel >= this.maxfuel) {
|
||||
return;
|
||||
}
|
||||
if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]) != null)
|
||||
&& (pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]).equals(this.aspect))
|
||||
&& (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i])
|
||||
< getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) {
|
||||
addToContainer(this.aspect, pipe.takeEssentia(this.aspect, 1, ForgeDirection.VALID_DIRECTIONS[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -240,17 +234,17 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int index, int count) {
|
||||
public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int index) {
|
||||
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int index, ItemStack stack) {}
|
||||
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
@@ -263,7 +257,7 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -403,7 +397,7 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
|
||||
if (isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) {
|
||||
long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this);
|
||||
drainEnergyUnits(ForgeDirection.DOWN, getOutputVoltage(), tEU);
|
||||
drainEnergyUnits((byte) 0, getOutputVoltage(), tEU);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -435,18 +429,18 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
|
||||
@Override
|
||||
public long getOutputAmperage() {
|
||||
if (this.generating / 20.0D / 20.0D <= GTValues.V[this.energySource.getSourceTier()]) {
|
||||
if (this.generating / 20.0D / 20.0D <= GT_Values.V[this.energySource.getSourceTier()]) {
|
||||
return 1L;
|
||||
}
|
||||
if (this.generating / 20.0D / 20.0D % GTValues.V[this.energySource.getSourceTier()] == 0.0D) {
|
||||
return (long) (this.generating / 20.0D / 20.0D / GTValues.V[this.energySource.getSourceTier()]);
|
||||
if (this.generating / 20.0D / 20.0D % GT_Values.V[this.energySource.getSourceTier()] == 0.0D) {
|
||||
return (long) (this.generating / 20.0D / 20.0D / GT_Values.V[this.energySource.getSourceTier()]);
|
||||
}
|
||||
return (long) (1L + (this.generating / 20.0D / 20.0D / GTValues.V[this.energySource.getSourceTier()]));
|
||||
return (long) (1L + (this.generating / 20.0D / 20.0D / GT_Values.V[this.energySource.getSourceTier()]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getOutputVoltage() {
|
||||
return GTValues.V[this.energySource.getSourceTier()];
|
||||
return GT_Values.V[this.energySource.getSourceTier()];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -475,7 +469,7 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean drainEnergyUnits(ForgeDirection side, long aVoltage, long aAmperage) {
|
||||
public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
|
||||
return decreaseStoredEnergyUnits(
|
||||
aVoltage * aAmperage,
|
||||
this.energySource.getEnergyStored() > aVoltage * aAmperage);
|
||||
@@ -512,17 +506,22 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public long injectEnergyUnits(ForgeDirection side, long aVoltage, long aAmperage) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inputEnergyFrom(ForgeDirection side) {
|
||||
public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outputsEnergyTo(ForgeDirection side) {
|
||||
public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inputEnergyFrom(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outputsEnergyTo(byte aSide) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -576,22 +575,22 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntityAtSide(ForgeDirection side) {
|
||||
if (side == ForgeDirection.UNKNOWN) {
|
||||
public TileEntity getTileEntityAtSide(byte aSide) {
|
||||
if ((aSide < 0) || (aSide >= 6)) {
|
||||
return null;
|
||||
}
|
||||
int tX = getOffsetX(side, 1);
|
||||
int tY = getOffsetY(side, 1);
|
||||
int tZ = getOffsetZ(side, 1);
|
||||
int tX = getOffsetX(aSide, 1);
|
||||
int tY = getOffsetY(aSide, 1);
|
||||
int tZ = getOffsetZ(aSide, 1);
|
||||
return this.worldObj.getTileEntity(tX, tY, tZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntityAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getTileEntityAtSide(side);
|
||||
return getTileEntityAtSide(aSide);
|
||||
}
|
||||
return getTileEntity(getOffsetX(side, aDistance), getOffsetY(side, aDistance), getOffsetZ(side, aDistance));
|
||||
return getTileEntity(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -605,12 +604,12 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getIInventoryAtSide(ForgeDirection side) {
|
||||
public IInventory getIInventoryAtSide(byte aSide) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getIInventoryAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -625,12 +624,12 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidHandler getITankContainerAtSide(ForgeDirection side) {
|
||||
public IFluidHandler getITankContainerAtSide(byte aSide) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidHandler getITankContainerAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -649,8 +648,8 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSide(ForgeDirection side) {
|
||||
TileEntity tTileEntity = getTileEntityAtSide(side);
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide) {
|
||||
TileEntity tTileEntity = getTileEntityAtSide(aSide);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
return (IGregTechTileEntity) tTileEntity;
|
||||
}
|
||||
@@ -658,8 +657,8 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
TileEntity tTileEntity = getTileEntityAtSideAndDistance(side, aDistance);
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
TileEntity tTileEntity = getTileEntityAtSideAndDistance(aSide, aDistance);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
return (IGregTechTileEntity) tTileEntity;
|
||||
}
|
||||
@@ -677,48 +676,48 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlockAtSide(ForgeDirection side) {
|
||||
if (side == ForgeDirection.UNKNOWN) {
|
||||
public Block getBlockAtSide(byte aSide) {
|
||||
if ((aSide < 0) || (aSide >= 6)) {
|
||||
return null;
|
||||
}
|
||||
int tX = getOffsetX(side, 1);
|
||||
int tY = getOffsetY(side, 1);
|
||||
int tZ = getOffsetZ(side, 1);
|
||||
int tX = getOffsetX(aSide, 1);
|
||||
int tY = getOffsetY(aSide, 1);
|
||||
int tZ = getOffsetZ(aSide, 1);
|
||||
return this.worldObj.getBlock(tX, tY, tZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlockAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public Block getBlockAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getBlockAtSide(side);
|
||||
return getBlockAtSide(aSide);
|
||||
}
|
||||
return getBlock(getOffsetX(side, aDistance), getOffsetY(side, aDistance), getOffsetZ(side, aDistance));
|
||||
return getBlock(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaID(int aX, int aY, int aZ) {
|
||||
public byte getMetaID(int aX, int aY, int aZ) {
|
||||
return (byte) this.worldObj.getBlockMetadata(aX, aY, aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaIDOffset(int aX, int aY, int aZ) {
|
||||
public byte getMetaIDOffset(int aX, int aY, int aZ) {
|
||||
return getMetaID(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaIDAtSide(ForgeDirection side) {
|
||||
int tX = getOffsetX(side, 1);
|
||||
int tY = getOffsetY(side, 1);
|
||||
int tZ = getOffsetZ(side, 1);
|
||||
public byte getMetaIDAtSide(byte aSide) {
|
||||
int tX = getOffsetX(aSide, 1);
|
||||
int tY = getOffsetY(aSide, 1);
|
||||
int tZ = getOffsetZ(aSide, 1);
|
||||
return (byte) this.worldObj.getBlockMetadata(tX, tY, tZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaIDAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getMetaIDAtSide(side);
|
||||
return getMetaIDAtSide(aSide);
|
||||
}
|
||||
return getMetaID(getOffsetX(side, aDistance), getOffsetY(side, aDistance), getOffsetZ(side, aDistance));
|
||||
return getMetaID(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -732,12 +731,12 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getLightLevelAtSide(ForgeDirection side) {
|
||||
public byte getLightLevelAtSide(byte aSide) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getLightLevelAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public byte getLightLevelAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -752,12 +751,12 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOpacityAtSide(ForgeDirection side) {
|
||||
public boolean getOpacityAtSide(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOpacityAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public boolean getOpacityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -778,12 +777,12 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSkyAtSide(ForgeDirection side) {
|
||||
public boolean getSkyAtSide(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSkyAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public boolean getSkyAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -798,13 +797,13 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAirAtSide(ForgeDirection side) {
|
||||
return getAirAtSideAndDistance(side, 1);
|
||||
public boolean getAirAtSide(byte aSide) {
|
||||
return getAirAtSideAndDistance(aSide, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAirAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
return getAir(getOffsetX(side, aDistance), getOffsetY(side, aDistance), getOffsetZ(side, aDistance));
|
||||
public boolean getAirAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return getAir(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -818,18 +817,18 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffsetX(ForgeDirection side, int aMultiplier) {
|
||||
return this.xCoord + side.offsetX * aMultiplier;
|
||||
public int getOffsetX(byte aSide, int aMultiplier) {
|
||||
return this.xCoord + ForgeDirection.getOrientation(aSide).offsetX * aMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getOffsetY(ForgeDirection side, int aMultiplier) {
|
||||
return (short) (this.yCoord + side.offsetY * aMultiplier);
|
||||
public short getOffsetY(byte aSide, int aMultiplier) {
|
||||
return (short) (this.yCoord + ForgeDirection.getOrientation(aSide).offsetY * aMultiplier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffsetZ(ForgeDirection side, int aMultiplier) {
|
||||
return this.zCoord + side.offsetZ * aMultiplier;
|
||||
public int getOffsetZ(byte aSide, int aMultiplier) {
|
||||
return this.zCoord + ForgeDirection.getOrientation(aSide).offsetZ * aMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -839,7 +838,11 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
|
||||
@Override
|
||||
public void sendBlockEvent(byte aID, byte aValue) {
|
||||
GTBlockEventTracker.enqueue(worldObj, xCoord, yCoord, zCoord, aID, aValue);
|
||||
GT_Values.NW.sendPacketToAllPlayersInRange(
|
||||
this.worldObj,
|
||||
new GT_Packet_Block_Event(this.xCoord, (short) this.yCoord, this.zCoord, aID, aValue),
|
||||
this.xCoord,
|
||||
this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -856,12 +859,12 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outputsEnergyTo(ForgeDirection side, boolean b1) {
|
||||
public boolean outputsEnergyTo(byte b, boolean b1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inputEnergyFrom(ForgeDirection side, boolean b1) {
|
||||
public boolean inputEnergyFrom(byte b, boolean b1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -884,35 +887,33 @@ public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory
|
||||
.setProgress(() -> (float) fuel / this.maxfuel).setSynced(false, false).setPos(9, 43)
|
||||
.setSize(25, 11))
|
||||
.widget(
|
||||
new TextWidget().setStringSupplier(
|
||||
() -> StatCollector.translateToLocal("emt.Storage") + " "
|
||||
+ numberFormat.formatWithSuffix(storage)
|
||||
+ "/"
|
||||
+ numberFormat.formatWithSuffix(maxstorage)
|
||||
+ " EU")
|
||||
.setDefaultColor(0).setPos(36, 22))
|
||||
TextWidget
|
||||
.dynamicString(
|
||||
() -> StatCollector.translateToLocal("emt.Storage")
|
||||
+ EMTTextHelper.formatNumber(storage)
|
||||
+ "/"
|
||||
+ EMTTextHelper.formatNumber(maxstorage)
|
||||
+ "EU")
|
||||
.setSynced(false).setDefaultColor(0).setPos(36, 22))
|
||||
.widget(new FakeSyncWidget.IntegerSyncer(() -> storage, val -> storage = val))
|
||||
.widget(
|
||||
new TextWidget().setStringSupplier(
|
||||
() -> StatCollector.translateToLocal("emt.Generating") + " "
|
||||
+ numberFormat.formatWithSuffix(isActive ? (long) (generating / 20 / 20) : 0)
|
||||
TextWidget.dynamicString(
|
||||
() -> StatCollector.translateToLocal("emt.Generating")
|
||||
+ (isActive ? generating / 20 / 20 : 0)
|
||||
+ " EU/t")
|
||||
.setDefaultColor(0).setPos(36, 35))
|
||||
.setSynced(false).setDefaultColor(0).setPos(36, 35))
|
||||
.widget(new FakeSyncWidget.DoubleSyncer(() -> generating, val -> generating = val))
|
||||
.widget(new FakeSyncWidget.BooleanSyncer(() -> isActive, val -> isActive = val))
|
||||
.widget(
|
||||
new TextWidget()
|
||||
.setStringSupplier(
|
||||
() -> StatCollector.translateToLocal("emt.Fuel") + ": "
|
||||
+ numberFormat.formatWithSuffix(fuel))
|
||||
.setDefaultColor(0).setPos(36, 48))
|
||||
TextWidget.dynamicString(() -> StatCollector.translateToLocal("emt.Fuel") + ": " + fuel)
|
||||
.setSynced(false).setDefaultColor(0).setPos(36, 48))
|
||||
.widget(new FakeSyncWidget.ByteSyncer(() -> fuel, val -> fuel = val))
|
||||
.widget(
|
||||
new TextWidget()
|
||||
.setStringSupplier(
|
||||
() -> StatCollector.translateToLocal("emt.remaining_second") + " "
|
||||
+ numberFormat.format(((fuel * 20 * 20) - tick) / 20))
|
||||
.setDefaultColor(0).setPos(36, 63))
|
||||
TextWidget
|
||||
.dynamicString(
|
||||
() -> StatCollector.translateToLocal("emt.remaining_second")
|
||||
+ ((fuel * 20 * 20) - tick) / 20)
|
||||
.setSynced(false).setDefaultColor(0).setPos(36, 63))
|
||||
.widget(new FakeSyncWidget.IntegerSyncer(() -> tick, val -> tick = val));
|
||||
|
||||
return builder.build();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public abstract class TileEntityCompressedGenerator extends TileEntityBaseGenerator {
|
||||
|
||||
|
||||
@@ -1,25 +1,18 @@
|
||||
package emt.tile.solar;
|
||||
|
||||
import static gregtech.api.recipe.RecipeMaps.chemicalBathRecipes;
|
||||
import static gregtech.api.util.GTRecipeBuilder.SECONDS;
|
||||
import static thaumcraft.api.aspects.Aspect.*;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import emt.block.BlockSolars;
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.item.block.ItemBlockSolars;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import gregtech.api.enums.GTValues;
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.enums.TierEU;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.enums.Materials;
|
||||
|
||||
// Solar Factory
|
||||
public enum Solars {
|
||||
@@ -140,14 +133,20 @@ public enum Solars {
|
||||
public static void registerReverseRecipes() {
|
||||
for (Solars s : Solars.values()) {
|
||||
if (s.aspect != null) {
|
||||
GTValues.RA.stdBuilder().itemInputs(new ItemStack(EMTBlocks.solars[s.instance], 1, s.meta))
|
||||
.fluidInputs(Materials.Chlorine.getGas(1000))
|
||||
.itemOutputs(
|
||||
new ItemStack(
|
||||
EMTBlocks.solars[getBaseSolar(s.output).instance],
|
||||
1,
|
||||
getBaseSolar(s.output).meta))
|
||||
.duration(2 * SECONDS).eut(TierEU.RECIPE_LV).addTo(chemicalBathRecipes);
|
||||
// ItemStack aInput, FluidStack aBathingFluid, ItemStack aOutput1, ItemStack aOutput2, ItemStack
|
||||
// aOutput3, int[] aChances, int aDuration, int aEUt
|
||||
GT_Values.RA.addChemicalBathRecipe(
|
||||
new ItemStack(EMTBlocks.solars[s.instance], 1, s.meta),
|
||||
Materials.Chlorine.getGas(1000),
|
||||
new ItemStack(
|
||||
EMTBlocks.solars[getBaseSolar(s.output).instance],
|
||||
1,
|
||||
getBaseSolar(s.output).meta),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
30,
|
||||
30);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,18 +205,4 @@ public enum Solars {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Block[] registerBlocks() {
|
||||
Block[] solars = new Block[getCountOfInstances()];
|
||||
for (int i = 0; i < solars.length; i++) {
|
||||
if (i == 0) {
|
||||
solars[i] = new BlockSolars("solar", Solars.getCountOfMetas(i), i);
|
||||
GameRegistry.registerBlock(solars[i], ItemBlockSolars.class, "EMTSolars");
|
||||
} else {
|
||||
solars[i] = new BlockSolars("solar" + (i + 1), Solars.getCountOfMetas(i), i);
|
||||
GameRegistry.registerBlock(solars[i], ItemBlockSolars.class, "EMTSolars" + (i + 1));
|
||||
}
|
||||
}
|
||||
return solars;
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,10 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.visnet.VisNetHandler;
|
||||
|
||||
import com.gtnewhorizons.modularui.api.ModularUITextures;
|
||||
import com.gtnewhorizons.modularui.api.NumberFormatMUI;
|
||||
import com.gtnewhorizons.modularui.api.drawable.Text;
|
||||
import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI;
|
||||
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
|
||||
@@ -29,15 +31,14 @@ import emt.client.gui.EMT_UITextures;
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import gregtech.api.enums.GTValues;
|
||||
import emt.util.EMTTextHelper;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.interfaces.tileentity.IBasicEnergyContainer;
|
||||
import gregtech.api.interfaces.tileentity.IEnergyConnected;
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
|
||||
import gregtech.common.data.GTBlockEventTracker;
|
||||
import gregtech.api.net.GT_Packet_Block_Event;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.visnet.VisNetHandler;
|
||||
|
||||
public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IWrenchable, IHasWorldObjectAndCoords,
|
||||
IEnergyConnected, IBasicEnergyContainer, ITileWithModularUI {
|
||||
@@ -68,8 +69,6 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
protected boolean side;
|
||||
private int instance, meta;
|
||||
|
||||
protected static NumberFormatMUI numberFormat = new NumberFormatMUI();
|
||||
|
||||
public TileEntitySolarBase(double output, Aspect aspect, String guiname, int instance, int meta) {
|
||||
this.tick = 10;
|
||||
this.storage = 0;
|
||||
@@ -102,10 +101,10 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
private int getTierFromCapacity(long capacity) {
|
||||
for (int i = 0; i < GTValues.V.length; i++) {
|
||||
if (capacity / 1000 < GTValues.V[i]) return i;
|
||||
for (int i = 0; i < GT_Values.V.length; i++) {
|
||||
if (capacity / 1000 < GT_Values.V[i]) return i;
|
||||
}
|
||||
return GTValues.V.length - 1;
|
||||
return GT_Values.V.length - 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -162,7 +161,9 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
case AQUA: {
|
||||
if (worldObj.isThundering()) return 6F;
|
||||
else if (worldObj.isRaining()) return 3F;
|
||||
else if (worldObj.getBlock(xCoord, yCoord + 1, zCoord).equals(Blocks.water)) return 2F;
|
||||
else if (!worldObj.isThundering() && !worldObj.isRaining()
|
||||
&& worldObj.getBlock(xCoord, yCoord + 1, zCoord).equals(Blocks.water))
|
||||
return 2F;
|
||||
else return 1F;
|
||||
}
|
||||
case IGNIS: {
|
||||
@@ -191,7 +192,7 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
this.isActive = true;
|
||||
if (side) {
|
||||
this.generating = output * calc_multi();
|
||||
this.energySource.addEnergy(this.generating);
|
||||
this.energySource.addEnergy(this.output * calc_multi());
|
||||
}
|
||||
} else {
|
||||
isActive = false;
|
||||
@@ -308,17 +309,17 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int index, int count) {
|
||||
public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int index) {
|
||||
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int index, ItemStack stack) {}
|
||||
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
@@ -336,7 +337,7 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -351,7 +352,7 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int index, ItemStack stack) {
|
||||
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -388,7 +389,7 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
|
||||
if (isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) {
|
||||
long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this);
|
||||
drainEnergyUnits(ForgeDirection.DOWN, getOutputVoltage(), tEU);
|
||||
drainEnergyUnits((byte) 0, getOutputVoltage(), tEU);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,11 +423,11 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
long[] voltAmp = new long[2];
|
||||
voltAmp[0] = getOutputVoltage();
|
||||
long generating = (long) Math.floor(output * getMaxMulti());
|
||||
if (generating <= GTValues.V[energySource.getSourceTier()]) {
|
||||
if (generating <= GT_Values.V[energySource.getSourceTier()]) {
|
||||
voltAmp[1] = 1L;
|
||||
} else if (generating % GTValues.V[energySource.getSourceTier()] == 0.0D) {
|
||||
voltAmp[1] = (generating / GTValues.V[energySource.getSourceTier()]);
|
||||
} else voltAmp[1] = (1L + (generating / GTValues.V[energySource.getSourceTier()]));
|
||||
} else if (generating % GT_Values.V[energySource.getSourceTier()] == 0.0D) {
|
||||
voltAmp[1] = (generating / GT_Values.V[energySource.getSourceTier()]);
|
||||
} else voltAmp[1] = (1L + (generating / GT_Values.V[energySource.getSourceTier()]));
|
||||
return voltAmp;
|
||||
}
|
||||
|
||||
@@ -435,28 +436,28 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
return calculateMaxVoltAmp()[1];
|
||||
// long ret;
|
||||
// if (this.energySource.getSourceTier() <= 4) {
|
||||
// if (this.generating <= GTValues.V[this.energySource.getSourceTier() - 2]) {
|
||||
// if (this.generating <= GT_Values.V[this.energySource.getSourceTier() - 2]) {
|
||||
// ret = 1L;
|
||||
// }
|
||||
// if (this.generating % GTValues.V[this.energySource.getSourceTier() - 2] == 0.0D) {
|
||||
// ret = (long) (this.generating / GTValues.V[this.energySource.getSourceTier() - 2]);
|
||||
// if (this.generating % GT_Values.V[this.energySource.getSourceTier() - 2] == 0.0D) {
|
||||
// ret = (long) (this.generating / GT_Values.V[this.energySource.getSourceTier() - 2]);
|
||||
// } else
|
||||
// ret = (long) (1L + (this.generating / GTValues.V[this.energySource.getSourceTier() - 2]));
|
||||
// ret = (long) (1L + (this.generating / GT_Values.V[this.energySource.getSourceTier() - 2]));
|
||||
// } else {
|
||||
// if (this.generating <= GTValues.V[this.energySource.getSourceTier() - 1]) {
|
||||
// if (this.generating <= GT_Values.V[this.energySource.getSourceTier() - 1]) {
|
||||
// ret = 1L;
|
||||
// }
|
||||
// if (this.generating % GTValues.V[this.energySource.getSourceTier()] == 0.0D) {
|
||||
// ret = (long) (this.generating / GTValues.V[this.energySource.getSourceTier() - 1]);
|
||||
// if (this.generating % GT_Values.V[this.energySource.getSourceTier()] == 0.0D) {
|
||||
// ret = (long) (this.generating / GT_Values.V[this.energySource.getSourceTier() - 1]);
|
||||
// } else
|
||||
// ret = (long) (1L + (this.generating / GTValues.V[this.energySource.getSourceTier() - 1]));
|
||||
// ret = (long) (1L + (this.generating / GT_Values.V[this.energySource.getSourceTier() - 1]));
|
||||
// }
|
||||
// return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getOutputVoltage() {
|
||||
return GTValues.V[this.energySource.getSourceTier()];
|
||||
return GT_Values.V[this.energySource.getSourceTier()];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -485,7 +486,7 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean drainEnergyUnits(ForgeDirection side, long aVoltage, long aAmperage) {
|
||||
public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
|
||||
return decreaseStoredEnergyUnits(
|
||||
aVoltage * aAmperage,
|
||||
this.energySource.getEnergyStored() > aVoltage * aAmperage);
|
||||
@@ -527,17 +528,17 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public long injectEnergyUnits(ForgeDirection side, long aVoltage, long aAmperage) {
|
||||
public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inputEnergyFrom(ForgeDirection side) {
|
||||
public boolean inputEnergyFrom(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outputsEnergyTo(ForgeDirection side) {
|
||||
public boolean outputsEnergyTo(byte aSide) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -591,22 +592,22 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntityAtSide(ForgeDirection side) {
|
||||
if (side == ForgeDirection.UNKNOWN) {
|
||||
public TileEntity getTileEntityAtSide(byte aSide) {
|
||||
if ((aSide < 0) || (aSide >= 6)) {
|
||||
return null;
|
||||
}
|
||||
int tX = getOffsetX(side, 1);
|
||||
int tY = getOffsetY(side, 1);
|
||||
int tZ = getOffsetZ(side, 1);
|
||||
int tX = getOffsetX(aSide, 1);
|
||||
int tY = getOffsetY(aSide, 1);
|
||||
int tZ = getOffsetZ(aSide, 1);
|
||||
return this.worldObj.getTileEntity(tX, tY, tZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntityAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getTileEntityAtSide(side);
|
||||
return getTileEntityAtSide(aSide);
|
||||
}
|
||||
return getTileEntity(getOffsetX(side, aDistance), getOffsetY(side, aDistance), getOffsetZ(side, aDistance));
|
||||
return getTileEntity(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -620,12 +621,12 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getIInventoryAtSide(ForgeDirection side) {
|
||||
public IInventory getIInventoryAtSide(byte aSide) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getIInventoryAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -640,12 +641,12 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidHandler getITankContainerAtSide(ForgeDirection side) {
|
||||
public IFluidHandler getITankContainerAtSide(byte aSide) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidHandler getITankContainerAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -664,8 +665,8 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSide(ForgeDirection side) {
|
||||
TileEntity tTileEntity = getTileEntityAtSide(side);
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide) {
|
||||
TileEntity tTileEntity = getTileEntityAtSide(aSide);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
return (IGregTechTileEntity) tTileEntity;
|
||||
}
|
||||
@@ -673,8 +674,8 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
TileEntity tTileEntity = getTileEntityAtSideAndDistance(side, aDistance);
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
TileEntity tTileEntity = getTileEntityAtSideAndDistance(aSide, aDistance);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
return (IGregTechTileEntity) tTileEntity;
|
||||
}
|
||||
@@ -692,48 +693,48 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlockAtSide(ForgeDirection side) {
|
||||
if (side == ForgeDirection.UNKNOWN) {
|
||||
public Block getBlockAtSide(byte aSide) {
|
||||
if ((aSide < 0) || (aSide >= 6)) {
|
||||
return null;
|
||||
}
|
||||
int tX = getOffsetX(side, 1);
|
||||
int tY = getOffsetY(side, 1);
|
||||
int tZ = getOffsetZ(side, 1);
|
||||
int tX = getOffsetX(aSide, 1);
|
||||
int tY = getOffsetY(aSide, 1);
|
||||
int tZ = getOffsetZ(aSide, 1);
|
||||
return this.worldObj.getBlock(tX, tY, tZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlockAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public Block getBlockAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getBlockAtSide(side);
|
||||
return getBlockAtSide(aSide);
|
||||
}
|
||||
return getBlock(getOffsetX(side, aDistance), getOffsetY(side, aDistance), getOffsetZ(side, aDistance));
|
||||
return getBlock(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaID(int aX, int aY, int aZ) {
|
||||
public byte getMetaID(int aX, int aY, int aZ) {
|
||||
return (byte) this.worldObj.getBlockMetadata(aX, aY, aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaIDOffset(int aX, int aY, int aZ) {
|
||||
public byte getMetaIDOffset(int aX, int aY, int aZ) {
|
||||
return getMetaID(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaIDAtSide(ForgeDirection side) {
|
||||
int tX = getOffsetX(side, 1);
|
||||
int tY = getOffsetY(side, 1);
|
||||
int tZ = getOffsetZ(side, 1);
|
||||
public byte getMetaIDAtSide(byte aSide) {
|
||||
int tX = getOffsetX(aSide, 1);
|
||||
int tY = getOffsetY(aSide, 1);
|
||||
int tZ = getOffsetZ(aSide, 1);
|
||||
return (byte) this.worldObj.getBlockMetadata(tX, tY, tZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaIDAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getMetaIDAtSide(side);
|
||||
return getMetaIDAtSide(aSide);
|
||||
}
|
||||
return getMetaID(getOffsetX(side, aDistance), getOffsetY(side, aDistance), getOffsetZ(side, aDistance));
|
||||
return getMetaID(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -747,12 +748,12 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getLightLevelAtSide(ForgeDirection side) {
|
||||
public byte getLightLevelAtSide(byte aSide) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getLightLevelAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public byte getLightLevelAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -767,12 +768,12 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOpacityAtSide(ForgeDirection side) {
|
||||
public boolean getOpacityAtSide(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOpacityAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public boolean getOpacityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -793,12 +794,12 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSkyAtSide(ForgeDirection side) {
|
||||
public boolean getSkyAtSide(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSkyAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
public boolean getSkyAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -813,13 +814,13 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAirAtSide(ForgeDirection side) {
|
||||
return getAirAtSideAndDistance(side, 1);
|
||||
public boolean getAirAtSide(byte aSide) {
|
||||
return getAirAtSideAndDistance(aSide, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAirAtSideAndDistance(ForgeDirection side, int aDistance) {
|
||||
return getAir(getOffsetX(side, aDistance), getOffsetY(side, aDistance), getOffsetZ(side, aDistance));
|
||||
public boolean getAirAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return getAir(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -833,18 +834,18 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffsetX(ForgeDirection side, int aMultiplier) {
|
||||
return this.xCoord + side.offsetX * aMultiplier;
|
||||
public int getOffsetX(byte aSide, int aMultiplier) {
|
||||
return this.xCoord + ForgeDirection.getOrientation(aSide).offsetX * aMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getOffsetY(ForgeDirection side, int aMultiplier) {
|
||||
return (short) (this.yCoord + side.offsetY * aMultiplier);
|
||||
public short getOffsetY(byte aSide, int aMultiplier) {
|
||||
return (short) (this.yCoord + ForgeDirection.getOrientation(aSide).offsetY * aMultiplier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffsetZ(ForgeDirection side, int aMultiplier) {
|
||||
return this.zCoord + side.offsetZ * aMultiplier;
|
||||
public int getOffsetZ(byte aSide, int aMultiplier) {
|
||||
return this.zCoord + ForgeDirection.getOrientation(aSide).offsetZ * aMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -854,7 +855,11 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
|
||||
@Override
|
||||
public void sendBlockEvent(byte aID, byte aValue) {
|
||||
GTBlockEventTracker.enqueue(this.worldObj, this.xCoord, this.yCoord, this.zCoord, aID, aValue);
|
||||
GT_Values.NW.sendPacketToAllPlayersInRange(
|
||||
this.worldObj,
|
||||
new GT_Packet_Block_Event(this.xCoord, (short) this.yCoord, this.zCoord, aID, aValue),
|
||||
this.xCoord,
|
||||
this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -871,12 +876,12 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outputsEnergyTo(ForgeDirection b, boolean b1) {
|
||||
public boolean outputsEnergyTo(byte b, boolean b1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inputEnergyFrom(ForgeDirection b, boolean b1) {
|
||||
public boolean inputEnergyFrom(byte b, boolean b1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -899,20 +904,16 @@ public class TileEntitySolarBase extends TileEntityEMT implements IInventory, IW
|
||||
.setProgress(() -> generating > 9 ? 1f : 0f).setSynced(false, false).setPos(9, 43)
|
||||
.setSize(11, 11))
|
||||
.widget(
|
||||
new TextWidget().setStringSupplier(
|
||||
() -> StatCollector.translateToLocal("emt.Storage") + " "
|
||||
+ numberFormat.formatWithSuffix(storage)
|
||||
+ "/"
|
||||
+ numberFormat.formatWithSuffix(maxstorage)
|
||||
+ " EU")
|
||||
.setDefaultColor(0).setPos(36, 22))
|
||||
TextWidget.dynamicString(
|
||||
() -> StatCollector.translateToLocal("emt.Storage") + EMTTextHelper
|
||||
.formatNumber(storage) + "/" + EMTTextHelper.formatNumber(maxstorage) + "EU")
|
||||
.setSynced(false).setDefaultColor(0).setPos(36, 22))
|
||||
.widget(new FakeSyncWidget.LongSyncer(() -> storage, val -> storage = val))
|
||||
.widget(
|
||||
new TextWidget().setStringSupplier(
|
||||
() -> StatCollector.translateToLocal("emt.Generating") + " "
|
||||
+ numberFormat.formatWithSuffix((long) generating)
|
||||
+ " EU/t")
|
||||
.setDefaultColor(0).setPos(36, 35))
|
||||
TextWidget
|
||||
.dynamicString(
|
||||
() -> StatCollector.translateToLocal("emt.Generating") + generating + " EU/t")
|
||||
.setSynced(false).setDefaultColor(0).setPos(36, 35))
|
||||
.widget(new FakeSyncWidget.DoubleSyncer(() -> generating, val -> generating = val));
|
||||
|
||||
return builder.build();
|
||||
|
||||
@@ -7,6 +7,9 @@ import java.util.List;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import emt.gthandler.common.loader.EMT_GT_Loader;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
|
||||
/**
|
||||
* TODO: Need to rewrite...
|
||||
**/
|
||||
@@ -52,7 +55,6 @@ public class EMTConfigHandler {
|
||||
public static double quantumBootsMaxDrop;
|
||||
|
||||
public static double EssentiaGeneratorStorage;
|
||||
public static int aIDoffset;
|
||||
|
||||
/**
|
||||
* Essentias
|
||||
@@ -105,7 +107,6 @@ public class EMTConfigHandler {
|
||||
public static boolean christmasFocusResearch;
|
||||
public static boolean energyBallFocusResearch;
|
||||
public static boolean shieldFocusResearch;
|
||||
public static boolean maintenanceFocusResearch;
|
||||
public static boolean shieldBlockResearch;
|
||||
public static boolean potentiaGeneratorResearch;
|
||||
public static boolean ignisGeneratorResearch;
|
||||
@@ -233,11 +234,14 @@ public class EMTConfigHandler {
|
||||
"This is the number you have to modify if you want to change the size of the "
|
||||
+ "internal buffer of the Essentia Generator")
|
||||
.getDouble(EssentiaGeneratorStorage);
|
||||
aIDoffset = config.get(
|
||||
VALUES,
|
||||
"aID offset for Gregetch Machinery",
|
||||
12983,
|
||||
"This Mod will use 17 IDs, do not change if you dont know what you are doing!").getInt();
|
||||
EMT_GT_Loader.aIDoffset = config
|
||||
.get(
|
||||
VALUES,
|
||||
"aID offset for Gregetch Machinery",
|
||||
(13000 - GT_Values.VN.length - 1),
|
||||
"This Mod will use " + Integer.toString(GT_Values.VN.length + 1)
|
||||
+ " IDs, do not change if you dont know what you are doing!")
|
||||
.getInt(13000 - GT_Values.VN.length - 1);
|
||||
|
||||
wandChargerConsumption = config
|
||||
.get(
|
||||
@@ -386,8 +390,6 @@ public class EMTConfigHandler {
|
||||
christmasFocusResearch = config.get(RESEARCH, "Kris-tmas Focus", false).getBoolean(christmasFocusResearch);
|
||||
energyBallFocusResearch = config.get(RESEARCH, "EnergyBall Focus", false).getBoolean(christmasFocusResearch);
|
||||
shieldFocusResearch = config.get(RESEARCH, "Shield Focus", false).getBoolean(shieldFocusResearch);
|
||||
maintenanceFocusResearch = config.get(RESEARCH, "Maintenance Focus", false)
|
||||
.getBoolean(maintenanceFocusResearch);
|
||||
shieldBlockResearch = config.get(RESEARCH, "Shield Block", false).getBoolean(shieldBlockResearch);
|
||||
potentiaGeneratorResearch = config.get(RESEARCH, "Potentia Generator", false)
|
||||
.getBoolean(potentiaGeneratorResearch);
|
||||
|
||||
@@ -83,8 +83,6 @@ public class EMTCraftingAspects {
|
||||
.add(Aspect.MECHANISM, 32);
|
||||
public static AspectList wandChargeFocus = new AspectList().add(Aspect.ENERGY, 48).add(Aspect.AURA, 32)
|
||||
.add(Aspect.EXCHANGE, 48).add(Aspect.GREED, 64);
|
||||
public static AspectList maintenanceFocus = new AspectList().add(Aspect.CRAFT, 32).add(Aspect.EXCHANGE, 48)
|
||||
.add(Aspect.TOOL, 64).add(Aspect.MAGIC, 64).add(Aspect.MECHANISM, 32).add(Aspect.ENERGY, 32);
|
||||
public static AspectList inventoryChargingRing = new AspectList().add(Aspect.ENERGY, 64).add(Aspect.CRYSTAL, 32)
|
||||
.add(Aspect.MAGIC, 48);
|
||||
public static AspectList armorChargingRing = new AspectList().add(Aspect.ENERGY, 64).add(Aspect.ARMOR, 32)
|
||||
@@ -98,4 +96,8 @@ public class EMTCraftingAspects {
|
||||
public static AspectList aerGenerator = new AspectList().add(Aspect.EXCHANGE, 16).add(Aspect.AIR, 8);
|
||||
public static AspectList uuMatterCrystal = new AspectList().add(Aspect.CRYSTAL, 8).add(Aspect.COLD, 8)
|
||||
.add(Aspect.MAGIC, 8);
|
||||
public static AspectList researchCompleter = new AspectList().add(Aspect.FIRE, 50).add(Aspect.WATER, 50)
|
||||
.add(Aspect.AIR, 50).add(Aspect.EARTH, 50).add(Aspect.ORDER, 50).add(Aspect.ENTROPY, 50);
|
||||
public static AspectList magicalMachineCasing = new AspectList().add(Aspect.FIRE, 8).add(Aspect.AIR, 8)
|
||||
.add(Aspect.ORDER, 8);
|
||||
}
|
||||
@@ -12,6 +12,8 @@ import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.entities.monster.EntityTaintChicken;
|
||||
import baubles.api.BaublesApi;
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -22,16 +24,9 @@ import emt.init.EMTBlocks;
|
||||
import emt.init.EMTItems;
|
||||
import emt.item.armor.wings.ItemFeatherWing;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.entities.monster.EntityTaintChicken;
|
||||
|
||||
public class EMTEventHandler {
|
||||
|
||||
/**
|
||||
* Intercept the onLivingHurt event so that we can mitigate fall damage with feather wings
|
||||
*
|
||||
* @param e Entity that is being damaged
|
||||
*/
|
||||
@SubscribeEvent
|
||||
public void onLivingHurt(LivingHurtEvent e) {
|
||||
if (!(e.entityLiving instanceof EntityPlayer) || e.source != DamageSource.fall) return;
|
||||
|
||||
@@ -25,8 +25,6 @@ public class EMTResearchAspects {
|
||||
.add(Aspect.LIFE, 6);
|
||||
public static AspectList shieldFocusResearch = new AspectList().add(Aspect.ARMOR, 5).add(Aspect.AIR, 2)
|
||||
.add(Aspect.CRYSTAL, 3).add(Aspect.TRAP, 2);
|
||||
public static AspectList maintenanceFocus = new AspectList().add(Aspect.MECHANISM, 5).add(Aspect.FIRE, 3)
|
||||
.add(Aspect.ORDER, 3).add(Aspect.ENERGY, 5).add(Aspect.MAGIC, 5).add(Aspect.TOOL, 5);
|
||||
public static AspectList electricGogglesResearch = new AspectList().add(Aspect.ARMOR, 8).add(Aspect.ENERGY, 5)
|
||||
.add(Aspect.SENSES, 6);
|
||||
public static AspectList potentiaGeneratorResearch = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.EXCHANGE, 4)
|
||||
@@ -94,4 +92,6 @@ public class EMTResearchAspects {
|
||||
public static AspectList quantumWing = new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.AIR, 5)
|
||||
.add(Aspect.MECHANISM, 8).add(Aspect.ENERGY, 4);
|
||||
public static AspectList aerGenerator = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.AIR, 3);
|
||||
public static AspectList researchCompleter = new AspectList().add(Aspect.MIND, 8).add(Aspect.MECHANISM, 5)
|
||||
.add(Aspect.EXCHANGE, 5).add(Aspect.AURA, 4);
|
||||
}
|
||||
@@ -3,12 +3,12 @@ package emt.util;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.api.research.ResearchPage.PageType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class EMTResearchItem extends ResearchItem {
|
||||
|
||||
|
||||
@@ -42,4 +42,16 @@ public class EMTTextHelper {
|
||||
public static String localize(String key) {
|
||||
return StatCollector.translateToLocal(key);
|
||||
}
|
||||
|
||||
public static String formatNumber(long number) {
|
||||
if (number < 10_000) {
|
||||
return String.valueOf(number);
|
||||
} else if (number < 10_000_000) {
|
||||
return (number / 1000) + "k";
|
||||
} else if (number < 1_000_000_000) {
|
||||
return (number / 1_000_000) + "M";
|
||||
} else {
|
||||
return (number / 1_000_000_000) + "G";
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 117 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user