mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 09:34:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aad9c092b1 | ||
|
|
f8c56939cd | ||
|
|
e2e22d6103 | ||
|
|
a798d2146d | ||
|
|
e829c4168b | ||
|
|
b1f8d99da9 | ||
|
|
304fdef5ec | ||
|
|
1f05312ded | ||
|
|
eb88b1cfe0 | ||
|
|
d4256bda6e | ||
|
|
bda8902709 | ||
|
|
63971381cc | ||
|
|
09238b09ef | ||
|
|
32556e078e | ||
|
|
ace514f628 | ||
|
|
0102b89c33 | ||
|
|
b65afde754 | ||
|
|
4a0a427186 | ||
|
|
e04e2e3411 | ||
|
|
316db4bd77 | ||
|
|
f43936c29a | ||
|
|
c6471ed6b0 | ||
|
|
654b95da1a | ||
|
|
d70263f3af | ||
|
|
c10f74486b | ||
|
|
c7db2c4840 | ||
|
|
948a021f3e | ||
|
|
346bbf4e53 | ||
|
|
5769ebe3cb | ||
|
|
4558f194be | ||
|
|
e12142890e | ||
|
|
e6ebb5dfec | ||
|
|
1d4f6831dd | ||
|
|
726ce46475 | ||
|
|
d01de95e8e | ||
|
|
b15d357f1a | ||
|
|
0fbf6f05ba | ||
|
|
bf9c2cd2c7 | ||
|
|
51b4c4e74c | ||
|
|
cf6b678dd9 | ||
|
|
6c205150b1 | ||
|
|
e39a1e1eb6 | ||
|
|
4a94c1ba90 | ||
|
|
0fc382dd13 | ||
|
|
04964e15e4 | ||
|
|
085ccc9d21 | ||
|
|
1903589e29 | ||
|
|
46971bbe0e | ||
|
|
4ccecf7bc0 | ||
|
|
92fb58f0c6 | ||
|
|
54c6db0afc | ||
|
|
84d9dcaf00 | ||
|
|
af923d1977 | ||
|
|
efb918fc6d | ||
|
|
6447ffb4d5 | ||
|
|
fb4c9bde59 | ||
|
|
bd47a39c83 | ||
|
|
43d74c9a7a | ||
|
|
6d3a631bb0 | ||
|
|
ccdef03296 | ||
|
|
56e163c234 | ||
|
|
8ecec5b096 | ||
|
|
4e3fbc7667 | ||
|
|
845f277497 | ||
|
|
94fb952cb0 | ||
|
|
29554c6a40 | ||
|
|
fc5cba342c | ||
|
|
05d31b2e70 | ||
|
|
5265340e3c | ||
|
|
37e239ae81 | ||
|
|
a725ebf120 | ||
|
|
6affe75674 | ||
|
|
19f19d348b | ||
|
|
3154d03b4f | ||
|
|
9e84167012 | ||
|
|
d1a1bf1ed5 | ||
|
|
c1309fa37d | ||
|
|
6a0785e1da | ||
|
|
6a4d655c71 | ||
|
|
3639ade571 | ||
|
|
95daa9b035 | ||
|
|
f249fd2973 | ||
|
|
9f3f8243f9 | ||
|
|
23a5484ee8 | ||
|
|
4b5837cac2 | ||
|
|
1251427388 | ||
|
|
3e7d69f460 | ||
|
|
88725a144d | ||
|
|
123f22f20e | ||
|
|
0b0f7a4f1a | ||
|
|
b00c5996f7 | ||
|
|
83f52d15c7 | ||
|
|
287c4498d2 | ||
|
|
2470e81f0e | ||
|
|
1af6fcae0b | ||
|
|
f44111da96 |
No files matched your search
@@ -27,3 +27,4 @@ whitelist.json
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
layout.json
|
||||
+2
-1621
File diff suppressed because it is too large.
Load diff
+17
-13
@@ -1,26 +1,30 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:EnderCore:0.2.17:dev')
|
||||
implementation('com.github.GTNewHorizons:ForestryMC:4.6.14:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.4.3-GTNH:dev')
|
||||
implementation("com.github.GTNewHorizons:GTNHLib:0.0.13:dev")
|
||||
api('com.github.GTNewHorizons:BuildCraft:7.1.36:dev')
|
||||
api('com.github.GTNewHorizons:EnderCore:0.4.8:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.11:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.52-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.31:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.43:dev')
|
||||
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
|
||||
shadowImplementation('cglib:cglib-nodep:3.3.0')
|
||||
api("com.github.GTNewHorizons:TinkersConstruct:1.13.35-GTNH:dev")
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.6.0:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-259-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.16:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.30:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.0:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.12.0-GTNH:api') {transitive = false}
|
||||
implementation('com.github.GTNewHorizons:Chisel:2.11.4-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.17-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.8.7:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-632-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.339:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.2.15-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.16.30:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.1.2-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.16.4-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.16-GTNH:api') {transitive = false}
|
||||
compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('curse.maven:ee3-65509:2305023') // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
|
||||
compileOnly(rfg.deobf('curse.maven:computercraft-67504:2269339')) // https://www.curseforge.com/minecraft/mc-mods/computercraft/files/2269339
|
||||
compileOnly(rfg.deobf('curse.maven:mekanism-268560:2475797')) // https://www.curseforge.com/minecraft/mc-mods/mekanism/files/2475797
|
||||
compileOnly(rfg.deobf('maven.modrinth:immibis-microblocks:59.1.2')) // https://modrinth.com/mod/immibis-microblocks/version/59.1.2
|
||||
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta46:api') {transitive = false}
|
||||
}
|
||||
+161
-28
@@ -1,63 +1,109 @@
|
||||
# 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 = Ender IO
|
||||
|
||||
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
|
||||
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
|
||||
# Conventionally lowercase.
|
||||
modId = EnderIO
|
||||
|
||||
# Root package of the mod, used to find various classes in other properties,
|
||||
# mcmod.info substitution, enabling assertions in run tasks, etc.
|
||||
modGroup = crazypants.enderio
|
||||
|
||||
# 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/
|
||||
# Whether to use modGroup as the maven publishing group.
|
||||
# When false, com.github.GTNewHorizons is used.
|
||||
useModGroupForPublishing = false
|
||||
|
||||
# Will update your build.gradle automatically whenever an update is available
|
||||
# Updates your build.gradle and settings.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 a MCP channel and mappings version for dependency deobfuscation and the deobfParams task.
|
||||
# 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
|
||||
|
||||
# Define other MCP mappings for dependency deobfuscation
|
||||
remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
|
||||
# Defines other MCP mappings for dependency deobfuscation.
|
||||
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
|
||||
|
||||
# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name 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
|
||||
# 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.
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Define a source file of your project with:
|
||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
# The string's content will be replaced with your mods 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 = EnderIO.java
|
||||
# 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 = crazypants.enderio.Tags
|
||||
|
||||
# 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 =
|
||||
gradleTokenVersion = GRADLETOKEN_VERSION
|
||||
|
||||
# [DEPRECATED] Mod Group replacement token.
|
||||
gradleTokenGroupName =
|
||||
|
||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise you can
|
||||
# [DEPRECATED]
|
||||
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
|
||||
# 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 =
|
||||
|
||||
# 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 = api
|
||||
|
||||
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
|
||||
# Example value: mymodid_at.cfg
|
||||
accessTransformersFile =
|
||||
# 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
|
||||
accessTransformersFile = enderio_at.cfg
|
||||
|
||||
# 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 compatability only
|
||||
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
||||
# This parameter is for legacy compatibility only
|
||||
# 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
|
||||
@@ -65,6 +111,93 @@ 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 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
|
||||
# responsibility check the licence and request permission for distribution, if required.
|
||||
# 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.
|
||||
usesShadowedDependencies = true
|
||||
|
||||
# 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: GTNH Mixins 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
|
||||
# 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
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -83,7 +85,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# 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
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -130,10 +133,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
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.
|
||||
|
||||
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.
|
||||
@@ -141,7 +147,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=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -149,7 +155,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=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -198,11 +204,11 @@ fi
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
# 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.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
|
||||
Vendored
+12
-10
@@ -13,6 +13,8 @@
|
||||
@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 ##########################################################################
|
||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
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.
|
||||
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
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
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.
|
||||
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
|
||||
|
||||
goto fail
|
||||
|
||||
|
||||
+5
-10
@@ -4,10 +4,10 @@ pluginManagement {
|
||||
maven {
|
||||
// RetroFuturaGradle
|
||||
name "GTNH Maven"
|
||||
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
allowInsecureProtocol = true
|
||||
url "https://nexus.gtnewhorizons.com/repository/public/"
|
||||
mavenContent {
|
||||
includeGroup("com.gtnewhorizons.retrofuturagradle")
|
||||
includeGroup("com.gtnewhorizons")
|
||||
includeGroupByRegex("com\\.gtnewhorizons\\..+")
|
||||
}
|
||||
}
|
||||
gradlePluginPortal()
|
||||
@@ -17,12 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.diffplug.blowdryerSetup' version '1.6.0'
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.38'
|
||||
}
|
||||
|
||||
blowdryerSetup {
|
||||
repoSubfolder 'gtnhShared'
|
||||
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
|
||||
//devLocal '.' // Use this when testing config updates locally
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -30,39 +27,29 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.BlockConduitBundle;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.TileConduitBundle;
|
||||
import crazypants.enderio.conduit.facade.FacadeRenderer;
|
||||
import crazypants.enderio.conduit.gas.GasConduit;
|
||||
import crazypants.enderio.conduit.gas.GasConduitRenderer;
|
||||
import crazypants.enderio.conduit.gas.GasUtil;
|
||||
import crazypants.enderio.conduit.item.ItemConduit;
|
||||
import crazypants.enderio.conduit.liquid.AbstractEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.AdvancedLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.AdvancedLiquidConduitRenderer;
|
||||
import crazypants.enderio.conduit.liquid.CrystallineEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.CrystallinePinkSlimeEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.EnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.EnderLiquidConduitRenderer;
|
||||
import crazypants.enderio.conduit.liquid.LiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.LiquidConduitRenderer;
|
||||
import crazypants.enderio.conduit.liquid.MelodicEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.liquid.StellarEnderLiquidConduit;
|
||||
import crazypants.enderio.conduit.me.MEConduit;
|
||||
import crazypants.enderio.conduit.me.MEUtil;
|
||||
import crazypants.enderio.conduit.oc.OCConduit;
|
||||
import crazypants.enderio.conduit.oc.OCConduitRenderer;
|
||||
import crazypants.enderio.conduit.oc.OCUtil;
|
||||
import crazypants.enderio.conduit.power.PowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduitRenderer;
|
||||
import crazypants.enderio.conduit.power.endergy.PowerConduitEndergy;
|
||||
import crazypants.enderio.conduit.redstone.InsulatedRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.InsulatedRedstoneConduitRenderer;
|
||||
import crazypants.enderio.conduit.redstone.RedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.RedstoneSwitch;
|
||||
import crazypants.enderio.conduit.redstone.RedstoneSwitchRenderer;
|
||||
import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.ItemConduitRenderer;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.enderface.EnderIoRenderer;
|
||||
@@ -116,11 +103,8 @@ import crazypants.enderio.machine.painter.BlockPaintedFenceGateRenderer;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedGlowstone;
|
||||
import crazypants.enderio.machine.painter.PaintedBlockRenderer;
|
||||
import crazypants.enderio.machine.painter.PaintedItemRenderer;
|
||||
import crazypants.enderio.machine.power.BlockCapacitorBank;
|
||||
import crazypants.enderio.machine.power.CapBankRenderer2;
|
||||
import crazypants.enderio.machine.power.CapacitorBankRenderer;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.machine.ranged.RangeRenerer;
|
||||
import crazypants.enderio.machine.ranged.RangeRenderer;
|
||||
import crazypants.enderio.machine.reservoir.ReservoirRenderer;
|
||||
import crazypants.enderio.machine.reservoir.TileReservoir;
|
||||
import crazypants.enderio.machine.solar.BlockSolarPanel;
|
||||
@@ -166,10 +150,6 @@ public class ClientProxy extends CommonProxy {
|
||||
};
|
||||
// @formatter:on
|
||||
|
||||
private final List<ConduitRenderer> conduitRenderers = new ArrayList<ConduitRenderer>();
|
||||
|
||||
private final DefaultConduitRenderer dcr = new DefaultConduitRenderer();
|
||||
|
||||
private ConduitBundleRenderer cbr;
|
||||
|
||||
private boolean checkedNei = false;
|
||||
@@ -338,13 +318,6 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCapBank.class, newCbr);
|
||||
}
|
||||
|
||||
CapacitorBankRenderer capr = new CapacitorBankRenderer();
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockCapacitorBank), capr);
|
||||
|
||||
BlockCapacitorBank.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
CapBankRenderer2 cbr2 = new CapBankRenderer2();
|
||||
RenderingRegistry.registerBlockHandler(cbr2);
|
||||
|
||||
BlockVacuumChest.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
VacuumChestRenderer vcr = new VacuumChestRenderer();
|
||||
RenderingRegistry.registerBlockHandler(vcr);
|
||||
@@ -394,7 +367,6 @@ public class ClientProxy extends CommonProxy {
|
||||
cbr = new ConduitBundleRenderer((float) Config.conduitScale);
|
||||
BlockConduitBundle.rendererId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(cbr);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileConduitBundle.class, cbr);
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTravelAnchor.class, new TravelEntitySpecialRenderer());
|
||||
|
||||
@@ -403,20 +375,6 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerBlockHandler(esk);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockEndermanSkull), esk);
|
||||
|
||||
conduitRenderers.add(RedstoneSwitchRenderer.getInstance());
|
||||
conduitRenderers.add(new AdvancedLiquidConduitRenderer());
|
||||
conduitRenderers.add(LiquidConduitRenderer.create());
|
||||
conduitRenderers.add(new PowerConduitRenderer());
|
||||
conduitRenderers.add(new InsulatedRedstoneConduitRenderer());
|
||||
conduitRenderers.add(new EnderLiquidConduitRenderer());
|
||||
conduitRenderers.add(new crazypants.enderio.conduit.item.ItemConduitRenderer());
|
||||
if (GasUtil.isGasConduitEnabled()) {
|
||||
conduitRenderers.add(new GasConduitRenderer());
|
||||
}
|
||||
if (OCUtil.isOCEnabled()) {
|
||||
conduitRenderers.add(new OCConduitRenderer());
|
||||
}
|
||||
|
||||
EnderIoRenderer eior = new EnderIoRenderer();
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEnderIO.class, eior);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockEnderIo), eior);
|
||||
@@ -451,7 +409,7 @@ public class ClientProxy extends CommonProxy {
|
||||
FMLCommonHandler.instance().bus().register(KeyTracker.instance);
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(SoundEntity.class, new SoundRenderer());
|
||||
RenderingRegistry.registerEntityRenderingHandler(RangeEntity.class, new RangeRenerer());
|
||||
RenderingRegistry.registerEntityRenderingHandler(RangeEntity.class, new RangeRenderer());
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(SoundDetector.instance);
|
||||
FMLCommonHandler.instance().bus().register(SoundDetector.instance);
|
||||
@@ -480,12 +438,7 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public ConduitRenderer getRendererForConduit(IConduit conduit) {
|
||||
for (ConduitRenderer renderer : conduitRenderers) {
|
||||
if (renderer.isRendererForConduit(conduit)) {
|
||||
return renderer;
|
||||
}
|
||||
}
|
||||
return dcr;
|
||||
return conduit.getRenderer();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,6 +34,7 @@ public class CommonProxy {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public ConduitRenderer getRendererForConduit(IConduit conduit) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
import static crazypants.enderio.EnderIO.*;
|
||||
import static crazypants.enderio.EnderIO.MODID;
|
||||
import static crazypants.enderio.EnderIO.MOD_NAME;
|
||||
import static crazypants.enderio.EnderIO.VERSION;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
@@ -60,6 +62,7 @@ import crazypants.enderio.conduit.item.ItemItemConduit;
|
||||
import crazypants.enderio.conduit.item.filter.ItemBasicItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemBigItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemExistingItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemLimitedItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemModItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemPowerItemFilter;
|
||||
import crazypants.enderio.conduit.liquid.ItemLiquidConduit;
|
||||
@@ -129,7 +132,6 @@ import crazypants.enderio.machine.painter.BlockPaintedStair;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedWall;
|
||||
import crazypants.enderio.machine.painter.BlockPainter;
|
||||
import crazypants.enderio.machine.painter.PaintSourceValidator;
|
||||
import crazypants.enderio.machine.power.BlockCapacitorBank;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.machine.reservoir.BlockReservoir;
|
||||
import crazypants.enderio.machine.slicensplice.BlockSliceAndSplice;
|
||||
@@ -179,18 +181,24 @@ import crazypants.enderio.thaumcraft.ThaumcraftCompat;
|
||||
import crazypants.enderio.tool.EnderIOCrashCallable;
|
||||
import crazypants.util.EE3Util;
|
||||
|
||||
@Mod(
|
||||
modid = MODID,
|
||||
name = MOD_NAME,
|
||||
version = VERSION,
|
||||
dependencies = "after:endercore;after:MineFactoryReloaded;after:Forestry;after:Waila@[1.5.8,);after:Thaumcraft;after:appliedenergistics2@[rv2-beta-8,);after:chisel",
|
||||
guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
|
||||
@Mod(modid = MODID, name = MOD_NAME, version = VERSION, dependencies = """
|
||||
required-after:CoFHLib@[1.7.10R1.0.3B3,);\
|
||||
required-after:endercore;\
|
||||
required-after:gtnhlib@[0.2.10,);\
|
||||
after:MineFactoryReloaded;\
|
||||
after:Forestry;\
|
||||
after:Waila@[1.5.8,);\
|
||||
after:Thaumcraft;\
|
||||
after:appliedenergistics2@[rv2-beta-8,);\
|
||||
after:chisel;\
|
||||
after:Railcraft@[9.16.7,)\
|
||||
""", guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
|
||||
public class EnderIO {
|
||||
|
||||
public static final String MODID = "EnderIO";
|
||||
public static final String DOMAIN = MODID.toLowerCase(Locale.US);
|
||||
public static final String MOD_NAME = "Ender IO";
|
||||
public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
public static final String VERSION = Tags.VERSION;
|
||||
|
||||
@Instance(MODID)
|
||||
public static EnderIO instance;
|
||||
@@ -205,7 +213,7 @@ public class EnderIO {
|
||||
public static final Lang lang = new Lang("enderio");
|
||||
|
||||
public static final boolean hasLwjgl3 = Loader.isModLoaded("lwjgl3ify");
|
||||
public static final boolean hasGT5 = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi_post");
|
||||
public static final boolean hasGT5 = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
|
||||
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
@@ -262,6 +270,7 @@ public class EnderIO {
|
||||
public static ItemBasicItemFilter itemBasicFilterUpgrade;
|
||||
public static ItemBigItemFilter itemBigFilterUpgrade;
|
||||
public static ItemExistingItemFilter itemExistingItemFilter;
|
||||
public static ItemLimitedItemFilter itemLimitedItemFilter;
|
||||
public static ItemModItemFilter itemModItemFilter;
|
||||
public static ItemPowerItemFilter itemPowerItemFilter;
|
||||
public static ItemExtractSpeedUpgrade itemExtractSpeedUpgrade;
|
||||
@@ -276,7 +285,6 @@ public class EnderIO {
|
||||
public static BlockSolarPanel blockSolarPanel;
|
||||
public static BlockReservoir blockReservoir;
|
||||
public static BlockAlloySmelter blockAlloySmelter;
|
||||
public static BlockCapacitorBank blockCapacitorBank;
|
||||
public static BlockCapBank blockCapBank;
|
||||
public static BlockWirelessCharger blockWirelessCharger;
|
||||
public static BlockCrusher blockCrusher;
|
||||
@@ -386,7 +394,6 @@ public class EnderIO {
|
||||
|
||||
blockCrusher = BlockCrusher.create();
|
||||
blockAlloySmelter = BlockAlloySmelter.create();
|
||||
blockCapacitorBank = BlockCapacitorBank.create();
|
||||
blockCapBank = BlockCapBank.create();
|
||||
|
||||
blockPainter = BlockPainter.create();
|
||||
@@ -467,6 +474,7 @@ public class EnderIO {
|
||||
itemBasicFilterUpgrade = ItemBasicItemFilter.create();
|
||||
itemBigFilterUpgrade = ItemBigItemFilter.create();
|
||||
itemExistingItemFilter = ItemExistingItemFilter.create();
|
||||
itemLimitedItemFilter = ItemLimitedItemFilter.create();
|
||||
itemModItemFilter = ItemModItemFilter.create();
|
||||
itemPowerItemFilter = ItemPowerItemFilter.create();
|
||||
itemExtractSpeedUpgrade = ItemExtractSpeedUpgrade.create();
|
||||
@@ -805,7 +813,6 @@ public class EnderIO {
|
||||
return Config.xpJuiceName;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void addModIntegration() {
|
||||
|
||||
if (Loader.isModLoaded("TConstruct")) {
|
||||
@@ -816,6 +823,7 @@ public class EnderIO {
|
||||
|
||||
Class<?> modFluxClass = Class.forName("tconstruct.modifiers.tools.ModFlux");
|
||||
Field batteriesField = modFluxClass.getField("batteries");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<ItemStack> batteries = (List<ItemStack>) batteriesField.get(modFluxInst);
|
||||
batteries.add(new ItemStack(blockCapBank));
|
||||
Log.info("Registered Capacitor Banks as Tinkers Construct Flux Upgrades");
|
||||
|
||||
@@ -18,6 +18,7 @@ public enum ModObject {
|
||||
itemBasicFilterUpgrade,
|
||||
itemBigFilterUpgrade,
|
||||
itemExistingItemFilter,
|
||||
itemLimitedItemFilter,
|
||||
itemModItemFilter,
|
||||
itemPowerItemFilter,
|
||||
itemExtractSpeedUpgrade,
|
||||
@@ -54,7 +55,6 @@ public enum ModObject {
|
||||
blockReservoir,
|
||||
blockAlloySmelter,
|
||||
blockSolarPanel,
|
||||
blockCapacitorBank,
|
||||
blockCapBank,
|
||||
blockSagMill,
|
||||
blockHyperCube,
|
||||
|
||||
@@ -81,7 +81,7 @@ public enum TravelSource {
|
||||
return 0;
|
||||
}
|
||||
|
||||
TravelSource source = TravelController.instance.getTravelItemTravelSource(player);
|
||||
TravelSource source = TravelController.instance.getTravelItemTravelSource(player, false);
|
||||
if (source == null) {
|
||||
return TravelSource.BLOCK.getMaxDistanceTravelledSq();
|
||||
} else {
|
||||
|
||||
@@ -148,10 +148,9 @@ public class BlockDarkSteelPressurePlate extends BlockPressurePlate
|
||||
return super.colorMultiplier(world, x, y, z);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item arg0, CreativeTabs arg1, List items) {
|
||||
public void getSubBlocks(Item arg0, CreativeTabs arg1, List<ItemStack> items) {
|
||||
items.add(new ItemStack(this, 1, 0));
|
||||
items.add(new ItemStack(this, 1, 1));
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ public class ContainerDarkSteelAnvil extends ContainerRepair {
|
||||
private final Field _materialCost = ReflectionHelper
|
||||
.findField(ContainerRepair.class, "materialCost", "stackSizeToBeUsedInRepair", "field_82856_l");
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public ContainerDarkSteelAnvil(InventoryPlayer playerInv, final World world, final int x, final int y, final int z,
|
||||
EntityPlayer player) {
|
||||
super(playerInv, world, x, y, z, player);
|
||||
|
||||
@@ -153,7 +153,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
}
|
||||
|
||||
protected ConnectionMode getDefaultConnectionMode() {
|
||||
return ConnectionMode.INPUT;
|
||||
return ConnectionMode.IN_OUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -67,7 +67,6 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
if (MicroblocksUtil.supportMicroblocks() && tryAddToMicroblocks(stack, player, world, x, y, z, side)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
BlockCoord placeAt = Util.canPlaceItem(stack, EnderIO.blockConduitBundle, player, world, x, y, z, side);
|
||||
if (placeAt != null) {
|
||||
if (!world.isRemote) {
|
||||
@@ -84,9 +83,7 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
stack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.values()[side];
|
||||
int placeX = x + dir.offsetX;
|
||||
int placeY = y + dir.offsetY;
|
||||
@@ -116,7 +113,6 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -162,8 +158,7 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
System.out.println("AbstractItemConduit.onItemUse: Conduit null.");
|
||||
return false;
|
||||
}
|
||||
bundle.removeConduit(existingConduit);
|
||||
bundle.addConduit(newConduit);
|
||||
bundle.replaceConduit(existingConduit, newConduit);
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
stack.stackSize--;
|
||||
for (ItemStack drop : existingConduit.getDrops()) {
|
||||
@@ -195,9 +190,8 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for (int j = 0; j < subtypes.length; ++j) {
|
||||
par3List.add(new ItemStack(this, 1, j));
|
||||
}
|
||||
|
||||
@@ -641,8 +641,8 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
@Override
|
||||
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) {
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if (!player.isSneaking() || equipped == null || equipped.getItem() != EnderIO.itemYetaWench) {
|
||||
ITool tool = ToolUtil.getEquippedTool(player);
|
||||
if (!player.isSneaking() || tool == null || !tool.canUse(player.getCurrentEquippedItem(), player, x, y, z)) {
|
||||
return;
|
||||
}
|
||||
ConduitUtil.openConduitGui(world, x, y, z, player);
|
||||
@@ -923,7 +923,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axisalignedbb,
|
||||
@SuppressWarnings("rawtypes") List arraylist, Entity par7Entity) {
|
||||
List<AxisAlignedBB> arraylist, Entity par7Entity) {
|
||||
|
||||
if (MicroblocksUtil.supportMicroblocks()) {
|
||||
IM__addCollisionBoxesToList(world, x, y, z, axisalignedbb, arraylist, par7Entity);
|
||||
@@ -1261,9 +1261,8 @@ public class BlockConduitBundle extends BlockEio
|
||||
return IMultipartSystem.instance.hook_collisionRayTrace(cur, world, x, y, z, src, dst);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private void IM__addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list,
|
||||
Entity entity) {
|
||||
private void IM__addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask,
|
||||
List<AxisAlignedBB> list, Entity entity) {
|
||||
IMultipartSystem.instance.hook_addCollisionBoxesToList(world, x, y, z, mask, list, entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import static crazypants.enderio.gui.IconEIO.*;
|
||||
import static crazypants.enderio.gui.IconEIO.CROSS;
|
||||
import static crazypants.enderio.gui.IconEIO.TICK;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_FLUID;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_FLUID_OFF;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_ITEM;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_ITEM_OFF;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_POWER;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_POWER_OFF;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_REDSTONE;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_REDSTONE_OFF;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import static crazypants.enderio.ModObject.blockPainter;
|
||||
import static crazypants.enderio.material.Alloy.*;
|
||||
import static crazypants.enderio.material.Alloy.CONDUCTIVE_IRON;
|
||||
import static crazypants.enderio.material.Alloy.ELECTRICAL_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.END_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY;
|
||||
import static crazypants.enderio.material.Alloy.PHASED_GOLD;
|
||||
import static crazypants.enderio.material.Alloy.REDSTONE_ALLOY;
|
||||
import static crazypants.enderio.material.Material.CONDUIT_BINDER;
|
||||
import static crazypants.enderio.material.Material.PHASED_IRON_NUGGET;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.*;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.CRUDE_STEEL;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.CRYSTALLINE_ALLOY;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.CRYSTALLINE_PINK_SLIME;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.ENERGETIC_SILVER;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.MELODIC_ALLOY;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.STELLAR_ALLOY;
|
||||
import static crazypants.util.RecipeUtil.addShaped;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -591,6 +601,9 @@ public class ConduitRecipes {
|
||||
'f',
|
||||
advFilter);
|
||||
|
||||
ItemStack limitedFilter = new ItemStack(EnderIO.itemLimitedItemFilter, 1, 0);
|
||||
addShaped(limitedFilter, " ", "cfc", " ", 'c', new ItemStack(Items.comparator, 1, 0), 'f', advFilter);
|
||||
|
||||
ItemStack powerFilt = new ItemStack(EnderIO.itemPowerItemFilter);
|
||||
addShaped(powerFilt, " p ", "pcp", " p ", 'p', Items.paper, 'c', EnderIO.itemConduitProbe);
|
||||
|
||||
@@ -675,7 +688,7 @@ public class ConduitRecipes {
|
||||
String fluix = "crystalFluix";
|
||||
String pureFluix = "crystalPureFluix";
|
||||
|
||||
ItemStack quartzFiber = AEApi.instance().parts().partQuartzFiber.stack(1).copy();
|
||||
ItemStack quartzFiber = AEApi.instance().definitions().parts().quartzFiber().maybeStack(1).get().copy();
|
||||
ItemStack conduitBinder = new ItemStack(EnderIO.itemMaterial, 1, Material.CONDUIT_BINDER.ordinal());
|
||||
ItemStack res = new ItemStack(EnderIO.itemMEConduit, Config.numConduitsPerRecipe / 2);
|
||||
|
||||
@@ -684,10 +697,6 @@ public class ConduitRecipes {
|
||||
|
||||
res.stackSize = 1;
|
||||
ItemStack resDense = new ItemStack(EnderIO.itemMEConduit, 1, 1);
|
||||
ItemStack resUltra = new ItemStack(EnderIO.itemMEConduit, 1, 2);
|
||||
addShaped(resDense, "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', res);
|
||||
if (Config.enableMEUltraDenseConduits) {
|
||||
addShaped(resUltra, "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', resDense);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class ConduitUtil {
|
||||
|
||||
public static final Random RANDOM = new Random();
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void ensureValidNetwork(IConduit conduit) {
|
||||
TileEntity te = conduit.getBundle().getEntity();
|
||||
World world = te.getWorldObj();
|
||||
@@ -54,13 +54,15 @@ public class ConduitUtil {
|
||||
return;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
AbstractConduitNetwork res = conduit.createNetworkForType();
|
||||
res.init(conduit.getBundle(), connections, world);
|
||||
return;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SuppressWarnings("unchecked")
|
||||
private static boolean reuseNetwork(IConduit con, Collection<? extends IConduit> connections, World world) {
|
||||
@SuppressWarnings("rawtypes")
|
||||
AbstractConduitNetwork network = null;
|
||||
for (IConduit conduit : connections) {
|
||||
if (network == null) {
|
||||
@@ -158,7 +160,7 @@ public class ConduitUtil {
|
||||
}
|
||||
|
||||
public static boolean isFacadeHidden(IConduitBundle bundle, EntityPlayer player) {
|
||||
return bundle.getFacadeId() != null && shouldHeldItemHideFacades(player);
|
||||
return bundle != null && bundle.getFacadeId() != null && shouldHeldItemHideFacades(player);
|
||||
}
|
||||
|
||||
public static ConduitDisplayMode getDisplayMode(EntityPlayer player) {
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.conduit.geom.CollidableCache.CacheKey;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
|
||||
public interface IConduit {
|
||||
|
||||
@@ -141,4 +142,6 @@ public interface IConduit {
|
||||
* Should the texture of the conduit connectors be mirrored around the conduit node?
|
||||
*/
|
||||
boolean shouldMirrorTexture();
|
||||
|
||||
ConduitRenderer getRenderer();
|
||||
}
|
||||
@@ -49,6 +49,8 @@ public interface IConduitBundle extends IInternalPowerHandler, IFluidHandler, II
|
||||
|
||||
void addConduit(IConduit conduit);
|
||||
|
||||
void replaceConduit(IConduit original, IConduit replacement);
|
||||
|
||||
void removeConduit(IConduit conduit);
|
||||
|
||||
Collection<IConduit> getConduits();
|
||||
|
||||
@@ -25,6 +25,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.gtnewhorizon.gtnhlib.concurrent.cas.CasList;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AECableType;
|
||||
@@ -66,7 +67,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
public static final short NBT_VERSION = 1;
|
||||
|
||||
private final List<IConduit> conduits = new ArrayList<IConduit>();
|
||||
private final List<IConduit> conduits = new CasList<>();
|
||||
|
||||
private Block facadeId = null;
|
||||
private int facadeMeta = 0;
|
||||
@@ -74,9 +75,9 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
private boolean facadeChanged;
|
||||
|
||||
private final List<CollidableComponent> cachedCollidables = new ArrayList<CollidableComponent>();
|
||||
private final List<CollidableComponent> cachedCollidables = new ArrayList<>();
|
||||
|
||||
private final List<CollidableComponent> cachedConnectors = new ArrayList<CollidableComponent>();
|
||||
private final List<CollidableComponent> cachedConnectors = new ArrayList<>();
|
||||
|
||||
private boolean conduitsDirty = true;
|
||||
private boolean collidablesDirty = true;
|
||||
@@ -404,6 +405,29 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
dirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceConduit(IConduit original, IConduit replacement) {
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
// If you're wondering why I am not using conduit.writeToNBT, it is because there is some data that should not
|
||||
// persist, some of which causes crashes with energy conduits.
|
||||
NBTTagCompound[] originalData = new NBTTagCompound[ForgeDirection.values().length];
|
||||
for (ForgeDirection conduitConnection : original.getExternalConnections()) {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
original.writeConnectionSettingsToNBT(conduitConnection, tag);
|
||||
originalData[conduitConnection.ordinal()] = tag;
|
||||
}
|
||||
removeConduit(original);
|
||||
addConduit(replacement);
|
||||
for (int i = 0; i < originalData.length; i++) {
|
||||
NBTTagCompound nbt = originalData[i];
|
||||
if (nbt != null) {
|
||||
replacement.readConduitSettingsFromNBT(ForgeDirection.values()[i], nbt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeConduit(IConduit conduit) {
|
||||
if (conduit != null) {
|
||||
@@ -428,7 +452,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
List<IConduit> copy = new ArrayList<IConduit>(conduits);
|
||||
List<IConduit> copy = new ArrayList<>(conduits);
|
||||
for (IConduit con : copy) {
|
||||
removeConduit(con, false);
|
||||
}
|
||||
@@ -513,11 +537,12 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
@Override
|
||||
public List<CollidableComponent> getConnectors() {
|
||||
List<CollidableComponent> result = new ArrayList<CollidableComponent>();
|
||||
List<CollidableComponent> result = new ArrayList<>();
|
||||
addConnectors(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void addConnectors(List<CollidableComponent> result) {
|
||||
|
||||
if (conduits.isEmpty()) {
|
||||
@@ -941,7 +966,6 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
return (IGridNode) node;
|
||||
}
|
||||
|
||||
@SuppressWarnings("cast")
|
||||
@Override
|
||||
@Method(modid = "appliedenergistics2")
|
||||
public void setGridNode(Object node) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.machine.painter.IPaintedBlock;
|
||||
|
||||
public class BlockConduitFacade extends BlockEio implements IPaintedBlock {
|
||||
public class BlockConduitFacade extends BlockEio implements IPaintedBlock, Cloneable {
|
||||
|
||||
public static BlockConduitFacade create() {
|
||||
BlockConduitFacade result = new BlockConduitFacade();
|
||||
@@ -24,6 +24,10 @@ public class BlockConduitFacade extends BlockEio implements IPaintedBlock {
|
||||
return result;
|
||||
}
|
||||
|
||||
public BlockConduitFacade clone() throws CloneNotSupportedException {
|
||||
return (BlockConduitFacade) super.clone();
|
||||
}
|
||||
|
||||
private Block blockOverride;
|
||||
|
||||
private BlockConduitFacade() {
|
||||
@@ -105,7 +109,6 @@ public class BlockConduitFacade extends BlockEio implements IPaintedBlock {
|
||||
}
|
||||
|
||||
Block block = cb.getFacadeId();
|
||||
int meta = cb.getFacadeMetadata();
|
||||
if (block == null || block == this) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -65,10 +65,9 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
GameRegistry.registerItem(this, ModObject.itemConduitFacade.unlocalisedName);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs p_150895_2_, List list) {
|
||||
public void getSubItems(Item item, CreativeTabs p_150895_2_, List<ItemStack> list) {
|
||||
for (FacadeType t : FacadeType.values()) {
|
||||
list.add(new ItemStack(item, 1, t.ordinal()));
|
||||
}
|
||||
@@ -171,10 +170,9 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
public void addInformation(ItemStack item, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
super.addInformation(item, par2EntityPlayer, list, par4);
|
||||
}
|
||||
|
||||
@@ -183,15 +181,13 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
if (PainterUtil.getSourceBlock(itemstack) == null) {
|
||||
list.add(EnderIO.lang.localize("item.itemConduitFacade.tooltip.notpainted"));
|
||||
} else {
|
||||
@@ -199,10 +195,9 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(list, itemstack);
|
||||
if (itemstack.getItemDamage() == FacadeType.HARDENED.ordinal()) {
|
||||
list.add("");
|
||||
|
||||
@@ -10,7 +10,6 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -20,6 +19,7 @@ import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.config.Config;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
@@ -34,7 +34,12 @@ public class GasConduit extends AbstractGasTankConduit {
|
||||
public static final String ICON_INSERT_KEY = "enderio:gasConduitOutput";
|
||||
public static final String ICON_EMPTY_EDGE = "enderio:gasConduitEdge";
|
||||
|
||||
static final Map<String, IIcon> ICONS = new HashMap<String, IIcon>();
|
||||
static final Map<String, IIcon> ICONS = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public ConduitRenderer getRenderer() {
|
||||
return GasConduitRenderer.instance.get();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void initIcons() {
|
||||
@@ -82,7 +87,6 @@ public class GasConduit extends AbstractGasTankConduit {
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
if (!hasConnectionMode(ConnectionMode.INPUT)) {
|
||||
return;
|
||||
}
|
||||
@@ -97,7 +101,6 @@ public class GasConduit extends AbstractGasTankConduit {
|
||||
return;
|
||||
}
|
||||
|
||||
Gas f = tank.getGas() == null ? null : tank.getGas().getGas();
|
||||
for (ForgeDirection dir : externalConnections) {
|
||||
if (autoExtractForDir(dir)) {
|
||||
if (network.extractFrom(this, dir, MAX_EXTRACT_PER_TICK)) {
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import static com.enderio.core.client.render.CubeRenderer.addVecWithUV;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.CubeRenderer;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
import com.enderio.core.common.vecmath.Vertex;
|
||||
@@ -22,15 +20,13 @@ import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConnectionModeGeometry;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public boolean isRendererForConduit(IConduit conduit) {
|
||||
return conduit instanceof GasConduit;
|
||||
}
|
||||
public static final ThreadLocal<ConduitRenderer> instance = ThreadLocal.withInitial(GasConduitRenderer::new);
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x,
|
||||
@@ -58,6 +54,8 @@ public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
@Override
|
||||
protected void renderConduit(IIcon tex, IConduit conduit, CollidableComponent component, float brightness) {
|
||||
super.renderConduit(tex, conduit, component, brightness);
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
int i;
|
||||
|
||||
if (isNSEWUD(component.dir)) {
|
||||
GasConduit lc = (GasConduit) conduit;
|
||||
@@ -103,15 +101,17 @@ public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
List<Vertex> corners = bb.getCornersWithUvForFace(d, minU, maxU, minV, maxV);
|
||||
moveEdgeCorners(corners, vDir, width);
|
||||
moveEdgeCorners(corners, component.dir.getOpposite(), sideScale);
|
||||
for (Vertex c : corners) {
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
for (i = 0; i < corners.size(); i++) {
|
||||
final Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
|
||||
corners = bb.getCornersWithUvForFace(d, minU, maxU, minV, maxV);
|
||||
moveEdgeCorners(corners, vDir.getOpposite(), width);
|
||||
moveEdgeCorners(corners, component.dir.getOpposite(), sideScale);
|
||||
for (Vertex c : corners) {
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
for (i = 0; i < corners.size(); i++) {
|
||||
final Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,14 +124,15 @@ public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV());
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
for (Vertex c : corners) {
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
|
||||
for (i = 0; i < corners.size(); i++) {
|
||||
final Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
// back face
|
||||
for (int i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
for (i = corners.size() - 1; i >= 0; i--) {
|
||||
final Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,15 +56,15 @@ public class ItemGasConduit extends AbstractItemConduit implements IAdvancedTool
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
String gpt = " " + EnderIO.lang.localize("gas.gasTick");
|
||||
int extractRate = Config.gasConduitExtractRate;
|
||||
int maxIo = Config.gasConduitMaxIoRate;
|
||||
|
||||
@@ -103,8 +103,6 @@ public class GasSettings extends BaseSettingsPanel {
|
||||
protected void renderCustomOptions(int top, float par1, int par2, int par3) {
|
||||
boolean isInput = isInput();
|
||||
if (isInput) {
|
||||
int x = gui.getGuiLeft() + gap + gui.getFontRenderer().getStringWidth(autoExtractStr) + gap + 2;
|
||||
int y = customTop;
|
||||
gui.getFontRenderer().drawString(autoExtractStr, left, top, ColorUtil.getRGB(Color.DARK_GRAY));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class BasicItemFilterGui implements IItemFilterGui {
|
||||
useNbtB.setPaintSelectedBorder(false);
|
||||
|
||||
x += 16;
|
||||
fuzzyB = new CycleButton(gui, ID_FUZZY + buttonIdOffset, x, y, FuzzyMode.class);
|
||||
fuzzyB = new CycleButton<>(gui, ID_FUZZY + buttonIdOffset, x, y, FuzzyMode.class);
|
||||
}
|
||||
|
||||
public void createFilterSlots() {
|
||||
|
||||
@@ -92,7 +92,7 @@ public class BigItemFilterGui implements IItemFilterGui {
|
||||
useNbtB.setPaintSelectedBorder(false);
|
||||
|
||||
x += 16;
|
||||
fuzzyB = new CycleButton(gui, ID_FUZZY + buttonIdOffset, x, y, FuzzyMode.class);
|
||||
fuzzyB = new CycleButton<>(gui, ID_FUZZY + buttonIdOffset, x, y, FuzzyMode.class);
|
||||
|
||||
x += 16;
|
||||
stickyB = new ToggleButton(
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
package crazypants.enderio.conduit.gui.item;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.CycleButton;
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.item.filter.FuzzyMode;
|
||||
import crazypants.enderio.conduit.item.filter.ItemFilter;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
|
||||
public class LimitedItemFilterGui implements IItemFilterGui {
|
||||
|
||||
private static final int ID_WHITELIST = GuiExternalConnection.nextButtonId();
|
||||
private static final int ID_NBT = GuiExternalConnection.nextButtonId();
|
||||
private static final int ID_META = GuiExternalConnection.nextButtonId();
|
||||
private static final int ID_ORE_DICT = GuiExternalConnection.nextButtonId();
|
||||
private static final int ID_STICKY = GuiExternalConnection.nextButtonId();
|
||||
private static final int ID_FUZZY = GuiExternalConnection.nextButtonId();
|
||||
|
||||
private final GuiContainerBaseEIO gui;
|
||||
|
||||
private final ToggleButton useMetaB;
|
||||
private final ToggleButton useNbtB;
|
||||
private final IconButton whiteListB;
|
||||
private final ToggleButton useOreDictB;
|
||||
private final ToggleButton stickyB;
|
||||
private final CycleButton<FuzzyMode> fuzzyB;
|
||||
|
||||
private final IItemFilterContainer filterContainer;
|
||||
private final ItemFilter filter;
|
||||
private int buttonIdOffset;
|
||||
private int xOffset;
|
||||
private int yOffset;
|
||||
final boolean isStickyModeAvailable;
|
||||
private boolean isInput;
|
||||
|
||||
public LimitedItemFilterGui(GuiContainerBaseEIO gui, IItemFilterContainer filterContainer,
|
||||
boolean isStickyModeAvailable, boolean isInput) {
|
||||
this(gui, filterContainer, isStickyModeAvailable, isInput, isInput ? 104 : 6, 96, isInput ? 0 : 256);
|
||||
}
|
||||
|
||||
public LimitedItemFilterGui(GuiContainerBaseEIO gui, IItemFilterContainer filterContainer,
|
||||
boolean isStickyModeAvailable, boolean isInput, int xOffset, int yOffset, int buttonIdOffset) {
|
||||
this.gui = gui;
|
||||
this.isStickyModeAvailable = isStickyModeAvailable;
|
||||
this.filterContainer = filterContainer;
|
||||
this.xOffset = xOffset;
|
||||
this.yOffset = yOffset;
|
||||
this.buttonIdOffset = buttonIdOffset;
|
||||
this.isInput = isInput;
|
||||
|
||||
filter = filterContainer.getItemFilter();
|
||||
|
||||
int butLeft = xOffset;
|
||||
int x = butLeft;
|
||||
int y = yOffset + 40;
|
||||
whiteListB = new IconButton(gui, ID_WHITELIST + buttonIdOffset, x, y, IconEIO.FILTER_WHITELIST);
|
||||
whiteListB.setToolTip(getWhitelistTooltips(false));
|
||||
|
||||
x += 16;
|
||||
useMetaB = new ToggleButton(gui, ID_META + buttonIdOffset, x, y, IconEIO.FILTER_META_OFF, IconEIO.FILTER_META);
|
||||
useMetaB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.matchMetaData"));
|
||||
useMetaB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.ignoreMetaData"));
|
||||
useMetaB.setPaintSelectedBorder(false);
|
||||
|
||||
x += 16;
|
||||
stickyB = new ToggleButton(
|
||||
gui,
|
||||
ID_STICKY + buttonIdOffset,
|
||||
x,
|
||||
y,
|
||||
IconEIO.FILTER_STICKY_OFF,
|
||||
IconEIO.FILTER_STICKY);
|
||||
stickyB.setSelectedToolTip(EnderIO.lang.localizeList("gui.conduit.item.stickyEnabled"));
|
||||
stickyB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.stickyDisbaled"));
|
||||
stickyB.setPaintSelectedBorder(false);
|
||||
|
||||
if (isStickyModeAvailable) x += 16;
|
||||
useOreDictB = new ToggleButton(
|
||||
gui,
|
||||
ID_ORE_DICT + buttonIdOffset,
|
||||
x,
|
||||
y,
|
||||
IconEIO.FILTER_ORE_DICT_OFF,
|
||||
IconEIO.FILTER_ORE_DICT);
|
||||
useOreDictB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.oreDicEnabled"));
|
||||
useOreDictB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.oreDicDisabled"));
|
||||
useOreDictB.setPaintSelectedBorder(false);
|
||||
|
||||
x += 16;
|
||||
useNbtB = new ToggleButton(gui, ID_NBT + buttonIdOffset, x, y, IconEIO.FILTER_NBT_OFF, IconEIO.FILTER_NBT);
|
||||
useNbtB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.matchNBT"));
|
||||
useNbtB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.ignoreNBT"));
|
||||
useNbtB.setPaintSelectedBorder(false);
|
||||
|
||||
x += 16;
|
||||
fuzzyB = new CycleButton<>(gui, ID_FUZZY + buttonIdOffset, x, y, FuzzyMode.class);
|
||||
}
|
||||
|
||||
public void createFilterSlots() {
|
||||
filter.createGhostSlots(gui.getGhostSlots(), xOffset + 1, yOffset + 1, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
sendFilterChange();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int x, int y, int par3) {}
|
||||
|
||||
@Override
|
||||
public void updateButtons() {
|
||||
ItemFilter activeFilter = filter;
|
||||
|
||||
useNbtB.onGuiInit();
|
||||
useNbtB.setSelected(activeFilter.isMatchNBT());
|
||||
|
||||
useOreDictB.onGuiInit();
|
||||
useOreDictB.setSelected(activeFilter.isUseOreDict());
|
||||
|
||||
if (isStickyModeAvailable) {
|
||||
stickyB.onGuiInit();
|
||||
stickyB.setSelected(activeFilter.isSticky());
|
||||
}
|
||||
|
||||
fuzzyB.onGuiInit();
|
||||
fuzzyB.setMode(activeFilter.getFuzzyMode());
|
||||
|
||||
useMetaB.onGuiInit();
|
||||
useMetaB.setSelected(activeFilter.isMatchMeta());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton guiButton) {
|
||||
|
||||
if (guiButton.id == ID_META + buttonIdOffset) {
|
||||
filter.setMatchMeta(useMetaB.isSelected());
|
||||
sendFilterChange();
|
||||
} else if (guiButton.id == ID_NBT + buttonIdOffset) {
|
||||
filter.setMatchNBT(useNbtB.isSelected());
|
||||
sendFilterChange();
|
||||
} else if (guiButton.id == ID_STICKY + buttonIdOffset) {
|
||||
filter.setSticky(stickyB.isSelected());
|
||||
sendFilterChange();
|
||||
} else if (guiButton.id == ID_ORE_DICT + buttonIdOffset) {
|
||||
filter.setUseOreDict(useOreDictB.isSelected());
|
||||
sendFilterChange();
|
||||
} else if (guiButton.id == ID_FUZZY + buttonIdOffset) {
|
||||
filter.setFuzzyMode(fuzzyB.getMode());
|
||||
sendFilterChange();
|
||||
} else if (guiButton.id == ID_WHITELIST + buttonIdOffset) {
|
||||
filter.setBlacklist(!filter.isBlacklist());
|
||||
sendFilterChange();
|
||||
}
|
||||
}
|
||||
|
||||
private void sendFilterChange() {
|
||||
updateButtons();
|
||||
filterContainer.onFilterChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deactivate() {
|
||||
useNbtB.detach();
|
||||
useMetaB.detach();
|
||||
useOreDictB.detach();
|
||||
whiteListB.detach();
|
||||
stickyB.detach();
|
||||
fuzzyB.detach();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderCustomOptions(int top, float par1, int par2, int par3) {
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
gui.bindGuiTexture(1);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + xOffset, gui.getGuiTop() + yOffset, 0, 238, 18 * 5, 18);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + xOffset, gui.getGuiTop() + yOffset + 20, 0, 238, 18 * 5, 18);
|
||||
|
||||
}
|
||||
|
||||
private String[] getWhitelistTooltips(boolean isBlacklist) {
|
||||
if (isBlacklist) {
|
||||
return new String[] { EnderIO.lang.localize("gui.conduit.item.blacklist"),
|
||||
EnderIO.lang.localize("gui.conduit.item.blacklist.tooltip.0"),
|
||||
EnderIO.lang.localize("gui.conduit.item.blacklist.tooltip.1") };
|
||||
} else {
|
||||
return new String[] { EnderIO.lang.localize("gui.conduit.item.whitelist"),
|
||||
EnderIO.lang.localize("gui.conduit.item.whitelist.tooltip.0"),
|
||||
EnderIO.lang.localize("gui.conduit.item.whitelist.tooltip.1") };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,15 @@ import cofh.api.transport.IItemDuct;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IExtractor;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
|
||||
public interface IItemConduit extends IConduit, IItemDuct, IExtractor {
|
||||
|
||||
@Override
|
||||
default ConduitRenderer getRenderer() {
|
||||
return ItemConduitRenderer.instance.get();
|
||||
}
|
||||
|
||||
IIcon getTextureForInputMode();
|
||||
|
||||
IIcon getTextureForOutputMode();
|
||||
|
||||
@@ -600,6 +600,11 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConnectionMode getDefaultConnectionMode() {
|
||||
return ConnectionMode.INPUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends IConduit> getBaseConduitType() {
|
||||
return IItemConduit.class;
|
||||
|
||||
@@ -13,17 +13,12 @@ import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.geom.ConnectionModeGeometry;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
|
||||
public class ItemConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public boolean isRendererForConduit(IConduit conduit) {
|
||||
if (conduit instanceof IItemConduit) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static final ThreadLocal<ConduitRenderer> instance = ThreadLocal.withInitial(ItemConduitRenderer::new);
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x,
|
||||
|
||||
@@ -64,9 +64,8 @@ public class ItemExtractSpeedUpgrade extends Item implements IResourceTooltipPro
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for (int j = 0; j < UPGRADES.length; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
|
||||
@@ -64,9 +64,8 @@ public class ItemFunctionUpgrade extends Item implements IResourceTooltipProvide
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for (int j = 0; j < UPGRADES.length; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.enderio.core.common.util.RoundRobinIterator;
|
||||
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemFilterLimited;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.invpanel.TileInventoryPanel;
|
||||
|
||||
@@ -155,6 +156,7 @@ public class NetworkedInventory {
|
||||
int numSlots = slotIndices.length;
|
||||
ItemStack extractItem = null;
|
||||
int maxExtracted = con.getMaximumExtracted(conDir);
|
||||
final IItemFilter filter = con.getInputFilter(conDir);
|
||||
|
||||
int slot = -1;
|
||||
int slotChecksPerTick = Math.min(numSlots, ItemConduitNetwork.MAX_SLOT_CHECK_PER_TICK);
|
||||
@@ -162,12 +164,23 @@ public class NetworkedInventory {
|
||||
int index = nextSlot(numSlots);
|
||||
slot = slotIndices[index];
|
||||
ItemStack item = getInventory().getStackInSlot(slot);
|
||||
if (canExtractItem(item)) {
|
||||
extractItem = item.copy();
|
||||
if (getInventory().canExtractItem(slot, extractItem, inventorySide)) {
|
||||
if (doTransfer(extractItem, slot, maxExtracted)) {
|
||||
setNextStartingSlot(slot);
|
||||
return true;
|
||||
if (item != null) {
|
||||
if (filter != null && filter.isLimited()) {
|
||||
final int count = ((ItemFilterLimited) filter).getInsertLimitInv(getInventory(), item);
|
||||
if (count <= 0) {
|
||||
continue;
|
||||
} else if (count < item.stackSize) {
|
||||
item = item.copy();
|
||||
item.stackSize = count;
|
||||
}
|
||||
}
|
||||
if (canExtractItem(item)) {
|
||||
extractItem = item.copy();
|
||||
if (getInventory().canExtractItem(slot, extractItem, inventorySide)) {
|
||||
if (doTransfer(extractItem, slot, maxExtracted)) {
|
||||
setNextStartingSlot(slot);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,7 +196,11 @@ public class NetworkedInventory {
|
||||
if (filter == null) {
|
||||
return true;
|
||||
}
|
||||
return filter.doesItemPassFilter(this, itemStack);
|
||||
if (filter.isLimited()) {
|
||||
return filter.isValid() && ((ItemFilterLimited) filter).doesItemPassFilterInv(this, itemStack);
|
||||
} else {
|
||||
return filter.doesItemPassFilter(this, itemStack);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean doTransfer(ItemStack extractedItem, int slot, int maxExtract) {
|
||||
@@ -278,7 +295,20 @@ public class NetworkedInventory {
|
||||
}
|
||||
IItemFilter filter = con.getOutputFilter(conDir);
|
||||
if (filter != null) {
|
||||
if (!filter.doesItemPassFilter(this, item)) {
|
||||
if (filter.isLimited()) {
|
||||
final int count = filter.getMaxCountThatCanPassFilter(item);
|
||||
if (count <= 0) {
|
||||
return 0;
|
||||
} else {
|
||||
final int maxInsert = ((ItemFilterLimited) filter).getInsertLimit(getInventory(), item);
|
||||
if (maxInsert <= 0) {
|
||||
return 0;
|
||||
} else if (maxInsert < item.stackSize) {
|
||||
item = item.copy();
|
||||
item.stackSize = maxInsert;
|
||||
}
|
||||
}
|
||||
} else if (!filter.doesItemPassFilter(this, item)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,10 +41,18 @@ public interface IItemFilter {
|
||||
|
||||
boolean isValid();
|
||||
|
||||
default boolean isLimited() {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean isSticky();
|
||||
|
||||
void createGhostSlots(List<GhostSlot> slots, int xOffset, int yOffset, Runnable cb);
|
||||
|
||||
default int getMaxCountThatCanPassFilter(ItemStack item) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int getSlotCount();
|
||||
|
||||
default String getUnlocalizedName() {
|
||||
|
||||
@@ -82,9 +82,8 @@ public class ItemBasicItemFilter extends Item implements IItemFilterUpgrade {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for (int j = 0; j < 2; ++j) {
|
||||
par3List.add(new ItemStack(this, 1, j));
|
||||
}
|
||||
@@ -92,7 +91,8 @@ public class ItemBasicItemFilter extends Item implements IItemFilterUpgrade {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
if (FilterRegister.isFilterSet(par1ItemStack)) {
|
||||
if (!SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
par3List.add(EnderIO.lang.localize("itemConduitFilterUpgrade"));
|
||||
|
||||
@@ -89,7 +89,8 @@ public class ItemExistingItemFilter extends Item implements IItemFilterUpgrade,
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
if (FilterRegister.isFilterSet(par1ItemStack)) {
|
||||
if (SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
par3List.add(EnumChatFormatting.ITALIC + EnderIO.lang.localize("itemConduitFilterUpgrade.configured"));
|
||||
|
||||
@@ -91,14 +91,13 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
return doesItemPassFilter(item);
|
||||
}
|
||||
|
||||
@SuppressWarnings("SimplifiableConditionalExpression")
|
||||
public boolean doesItemPassFilter(ItemStack item) {
|
||||
boolean allow = isValid() && itemMatched(item);
|
||||
|
||||
return isBlacklist ? !allow : allow;
|
||||
return isBlacklist ^ allow;
|
||||
}
|
||||
|
||||
private boolean itemMatched(ItemStack item) {
|
||||
protected boolean itemMatched(ItemStack item) {
|
||||
if (item == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -145,7 +144,7 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
return matched;
|
||||
}
|
||||
|
||||
private boolean isOreDicMatch(int filterItemIndex, ItemStack item) {
|
||||
protected boolean isOreDicMatch(int filterItemIndex, ItemStack item) {
|
||||
int[] ids1 = getCachedIds(filterItemIndex);
|
||||
if (ids1 == null || ids1.length == 0) {
|
||||
return false;
|
||||
@@ -164,8 +163,9 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isNBTMatch(ItemStack filter, ItemStack item) {
|
||||
if (filter.stackTagCompound == null && item.stackTagCompound == null) return true;
|
||||
protected boolean isNBTMatch(ItemStack filter, ItemStack item) {
|
||||
if (filter.stackTagCompound == null && (item.stackTagCompound == null || item.stackTagCompound.hasNoTags()))
|
||||
return true;
|
||||
if (filter.stackTagCompound == null || item.stackTagCompound == null) return false;
|
||||
if (!filter.getTagCompound().hasKey("GEN")) return filter.stackTagCompound.equals(item.stackTagCompound);
|
||||
NBTTagCompound filterTag = (NBTTagCompound) filter.getTagCompound().copy();
|
||||
@@ -202,7 +202,7 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
return !isItemListEmpty();
|
||||
}
|
||||
|
||||
private boolean isItemListEmpty() {
|
||||
protected boolean isItemListEmpty() {
|
||||
for (ItemStack item : items) {
|
||||
if (item != null) {
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
package crazypants.enderio.conduit.item.filter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import com.enderio.core.client.gui.widget.GhostSlot;
|
||||
|
||||
import cofh.lib.util.helpers.MathHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.gui.item.IItemFilterGui;
|
||||
import crazypants.enderio.conduit.gui.item.ItemConduitFilterContainer;
|
||||
import crazypants.enderio.conduit.gui.item.LimitedItemFilterGui;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.NetworkedInventory;
|
||||
|
||||
public class ItemFilterLimited extends ItemFilter {
|
||||
|
||||
public ItemFilterLimited() {
|
||||
this(10, true);
|
||||
}
|
||||
|
||||
public ItemFilterLimited(int numItems, boolean isAdvanced) {
|
||||
super(numItems, isAdvanced);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Limited Item Filter";
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IItemFilterGui getGui(GuiExternalConnection gui, IItemConduit itemConduit, boolean isInput) {
|
||||
ItemConduitFilterContainer cont = new ItemConduitFilterContainer(itemConduit, gui.getDir(), isInput);
|
||||
LimitedItemFilterGui limitedItemFilterGui = new LimitedItemFilterGui(gui, cont, !isInput, isInput);
|
||||
limitedItemFilterGui.createFilterSlots();
|
||||
return limitedItemFilterGui;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createGhostSlots(List<GhostSlot> slots, int xOffset, int yOffset, Runnable cb) {
|
||||
int index = 0;
|
||||
int numRows = (int) (double) (items.length / 5);
|
||||
for (int row = 0; row < numRows; ++row) {
|
||||
for (int col = 0; col < 5; ++col) {
|
||||
int x = xOffset + col * 18;
|
||||
int y = yOffset + row * 20;
|
||||
slots.add(new ItemFilterGhostSlot(index, x, y, cb));
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCountThatCanPassFilter(ItemStack item) {
|
||||
if (item == null || item.getItem() == null) {
|
||||
return 0;
|
||||
}
|
||||
int count = 0;
|
||||
for (int i = 0; i < items.length; i++) {
|
||||
ItemStack invStack = items[i];
|
||||
if (invStack != null && itemStackMatched(invStack, item, i)) {
|
||||
count += invStack.stackSize;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLimited() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getInsertLimit(ISidedInventory inv, ItemStack item) {
|
||||
if (item == null || item.getItem() == null) {
|
||||
return 0;
|
||||
}
|
||||
int count = 0;
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack invStack = inv.getStackInSlot(i);
|
||||
if (invStack != null && itemStackMatched(invStack, item, i)) {
|
||||
count += invStack.stackSize;
|
||||
}
|
||||
}
|
||||
return getMaxCountThatCanPassFilter(item) - count;
|
||||
}
|
||||
|
||||
public int getInsertLimitInv(ISidedInventory inv, ItemStack item) {
|
||||
return -getInsertLimit(inv, item);
|
||||
}
|
||||
|
||||
public boolean doesCountPassFilter(int maxCount) {
|
||||
return maxCount > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesItemPassFilter(NetworkedInventory inv, ItemStack item) {
|
||||
return isValid() && itemMatched(item) && doesCountPassFilter(getInsertLimit(inv.getInventory(), item));
|
||||
|
||||
}
|
||||
|
||||
// Filter in extract slot
|
||||
public boolean doesItemPassFilterInv(NetworkedInventory inv, ItemStack item) {
|
||||
return isValid() && itemMatched(item) && doesCountPassFilter(getInsertLimitInv(inv.getInventory(), item));
|
||||
}
|
||||
|
||||
protected boolean itemStackMatched(ItemStack item, ItemStack filter, int slot) {
|
||||
if (item == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean checkDamage = fuzzyMode != FuzzyMode.DISABLED;
|
||||
boolean damageMatched = false;
|
||||
if (checkDamage && item.getItem().isDamageable()) {
|
||||
damageMatched = fuzzyMode.compare(item);
|
||||
}
|
||||
|
||||
if (isItemListEmpty()) {
|
||||
if (checkDamage) {
|
||||
return damageMatched;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
boolean matched = false;
|
||||
|
||||
if (filter != null && item.getItem() == filter.getItem()) {
|
||||
matched = true;
|
||||
|
||||
if (checkDamage && !damageMatched) {
|
||||
matched = false;
|
||||
} else if (matchMeta && item.getItemDamage() != filter.getItemDamage()) {
|
||||
matched = false;
|
||||
} else if (matchNBT && !isNBTMatch(item, filter)) {
|
||||
matched = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!matched && useOreDict && isOreDicMatch(filter, item)) {
|
||||
matched = true;
|
||||
}
|
||||
return matched;
|
||||
}
|
||||
|
||||
public boolean isOreDicMatch(ItemStack filter, ItemStack item) {
|
||||
int[] id_filter = OreDictionary.getOreIDs(filter);
|
||||
if (id_filter.length == 0) {
|
||||
return false;
|
||||
}
|
||||
int[] id_item = OreDictionary.getOreIDs(item);
|
||||
if (id_item.length == 0) {
|
||||
return false;
|
||||
}
|
||||
for (int id1 : id_filter) {
|
||||
for (int id2 : id_item) {
|
||||
if (id1 == id2) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int fromSlot, int amount) {
|
||||
if ((fromSlot < 0) || (fromSlot >= items.length)) {
|
||||
return null;
|
||||
}
|
||||
oreIds.set(fromSlot, null);
|
||||
ItemStack item = items[fromSlot];
|
||||
items[fromSlot] = null;
|
||||
return item.splitStack(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Limited" + super.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return "gui.limited_item_filter";
|
||||
}
|
||||
|
||||
class ItemFilterGhostSlot extends GhostSlot {
|
||||
|
||||
private final int slot;
|
||||
private final Runnable cb;
|
||||
|
||||
private final int adjustOnShift;
|
||||
|
||||
ItemFilterGhostSlot(int slot, int x, int y, Runnable cb) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.slot = slot;
|
||||
this.cb = cb;
|
||||
this.displayStdOverlay = true;
|
||||
this.stackSizeLimit = 64;
|
||||
this.adjustOnShift = 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putStack(ItemStack stack) {
|
||||
if (stack != null) {
|
||||
stack = stack.copy();
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
|
||||
if (Mouse.isButtonDown(0) || Mouse.getEventDWheel() > 0) {
|
||||
if (stack.stackSize - 1 == 1) {
|
||||
stack.stackSize += adjustOnShift - 2;
|
||||
} else {
|
||||
stack.stackSize = MathHelper
|
||||
.clamp(stack.stackSize + adjustOnShift - 1, 1, stack.getMaxStackSize());
|
||||
}
|
||||
} else if (Mouse.isButtonDown(1) || Mouse.getEventDWheel() < 0) {
|
||||
if (stack.stackSize + 1 == 1) {
|
||||
stack.stackSize++;
|
||||
} else {
|
||||
stack.stackSize = MathHelper
|
||||
.clamp(stack.stackSize - adjustOnShift + 1, 1, stack.getMaxStackSize());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
items[slot] = stack;
|
||||
cb.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
return items[slot];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package crazypants.enderio.conduit.item.filter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
|
||||
import com.enderio.core.client.handlers.SpecialTooltipHandler;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.item.FilterRegister;
|
||||
|
||||
public class ItemLimitedItemFilter extends Item implements IItemFilterUpgrade, IResourceTooltipProvider {
|
||||
|
||||
public static ItemLimitedItemFilter create() {
|
||||
ItemLimitedItemFilter result = new ItemLimitedItemFilter();
|
||||
result.init();
|
||||
return result;
|
||||
}
|
||||
|
||||
protected ItemLimitedItemFilter() {
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
setUnlocalizedName(ModObject.itemLimitedItemFilter.unlocalisedName);
|
||||
setMaxDamage(0);
|
||||
setMaxStackSize(64);
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, ModObject.itemLimitedItemFilter.unlocalisedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemFilter createFilterFromStack(ItemStack stack) {
|
||||
IItemFilter filter = new ItemFilterLimited();
|
||||
if (stack.stackTagCompound != null && stack.stackTagCompound.hasKey("filter")) {
|
||||
filter.readFromNBT(stack.stackTagCompound.getCompoundTag("filter"));
|
||||
}
|
||||
return filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
itemIcon = IIconRegister.registerIcon("enderio:limitedItemFilter");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameForTooltip(ItemStack stack) {
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
if (FilterRegister.isFilterSet(par1ItemStack)) {
|
||||
if (SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
par3List.add(EnumChatFormatting.ITALIC + EnderIO.lang.localize("itemConduitFilterUpgrade.configured"));
|
||||
par3List.add(
|
||||
EnumChatFormatting.ITALIC
|
||||
+ EnderIO.lang.localize("itemConduitFilterUpgrade.clearConfigMethod"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,8 @@ public class ItemModItemFilter extends Item implements IItemFilterUpgrade, IReso
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
if (FilterRegister.isFilterSet(par1ItemStack)) {
|
||||
if (SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
par3List.add(EnumChatFormatting.ITALIC + EnderIO.lang.localize("itemConduitFilterUpgrade.configured"));
|
||||
|
||||
@@ -34,6 +34,7 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.RaytraceResult;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.item.ItemConduit;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
@@ -46,9 +47,14 @@ public abstract class AbstractEnderLiquidConduit extends AbstractLiquidConduit {
|
||||
public static final String ICON_KEY_IN_OUT_OUT = ItemConduit.ICON_KEY_IN_OUT_OUT;
|
||||
public static final String ICON_KEY_IN_OUT_IN = ItemConduit.ICON_KEY_IN_OUT_IN;
|
||||
|
||||
static final Map<String, IIcon> ICONS = new HashMap<String, IIcon>();
|
||||
static final Map<String, IIcon> ICONS = new HashMap<>();
|
||||
private final Set<BlockCoord> filledFromThisTick = new HashSet<>();
|
||||
|
||||
@Override
|
||||
public ConduitRenderer getRenderer() {
|
||||
return EnderLiquidConduitRenderer.instance.get();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void initIcons() {
|
||||
IconUtil.addIconProvider(new IconUtil.IIconProvider() {
|
||||
@@ -302,7 +308,6 @@ public abstract class AbstractEnderLiquidConduit extends AbstractLiquidConduit {
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
if (!hasExtractableMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -157,11 +157,11 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
boolean res;
|
||||
if (mode == RedstoneControlMode.OFF) {
|
||||
// if checking for no signal, must be no signal from both
|
||||
res = mode.isConditionMet(mode, signal)
|
||||
res = RedstoneControlMode.isConditionMet(mode, signal)
|
||||
&& (col != DyeColor.RED || isConditionMetByExternalSignal(dir, mode, col));
|
||||
} else {
|
||||
// if checking for a signal, either is fine
|
||||
res = mode.isConditionMet(mode, signal)
|
||||
res = RedstoneControlMode.isConditionMet(mode, signal)
|
||||
|| (col == DyeColor.RED && isConditionMetByExternalSignal(dir, mode, col));
|
||||
}
|
||||
return res;
|
||||
@@ -180,7 +180,12 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
}
|
||||
}
|
||||
|
||||
return mode.isConditionMet(mode, externalSignal);
|
||||
return RedstoneControlMode.isConditionMet(mode, externalSignal);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConnectionMode getDefaultConnectionMode() {
|
||||
return ConnectionMode.INPUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,6 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -23,6 +22,7 @@ import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
|
||||
@@ -37,7 +37,12 @@ public class AdvancedLiquidConduit extends AbstractTankConduit {
|
||||
public static final String ICON_INSERT_KEY = "enderio:liquidConduitAdvancedOutput";
|
||||
public static final String ICON_EMPTY_EDGE = "enderio:liquidConduitAdvancedEdge";
|
||||
|
||||
static final Map<String, IIcon> ICONS = new HashMap<String, IIcon>();
|
||||
static final Map<String, IIcon> ICONS = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public ConduitRenderer getRenderer() {
|
||||
return AdvancedLiquidConduitRenderer.instance.get();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void initIcons() {
|
||||
@@ -86,7 +91,6 @@ public class AdvancedLiquidConduit extends AbstractTankConduit {
|
||||
}
|
||||
|
||||
private void doExtract() {
|
||||
BlockCoord loc = getLocation();
|
||||
// Extraction can happen on extract mode or in/out mode
|
||||
if (!hasExtractableMode()) {
|
||||
return;
|
||||
@@ -102,7 +106,6 @@ public class AdvancedLiquidConduit extends AbstractTankConduit {
|
||||
return;
|
||||
}
|
||||
|
||||
Fluid f = tank.getFluid() == null ? null : tank.getFluid().getFluid();
|
||||
for (ForgeDirection dir : externalConnections) {
|
||||
if (autoExtractForDir(dir)) {
|
||||
if (network.extractFrom(this, dir, MAX_EXTRACT_PER_TICK)) {
|
||||
|
||||
+17
-16
@@ -1,16 +1,14 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import static com.enderio.core.client.render.CubeRenderer.addVecWithUV;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.CubeRenderer;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
import com.enderio.core.common.vecmath.Vertex;
|
||||
@@ -23,14 +21,13 @@ import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConnectionModeGeometry;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
|
||||
public class AdvancedLiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public boolean isRendererForConduit(IConduit conduit) {
|
||||
return conduit instanceof AdvancedLiquidConduit;
|
||||
}
|
||||
public static final ThreadLocal<ConduitRenderer> instance = ThreadLocal
|
||||
.withInitial(AdvancedLiquidConduitRenderer::new);
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x,
|
||||
@@ -58,6 +55,8 @@ public class AdvancedLiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
@Override
|
||||
protected void renderConduit(IIcon tex, IConduit conduit, CollidableComponent component, float brightness) {
|
||||
super.renderConduit(tex, conduit, component, brightness);
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
int i;
|
||||
|
||||
if (isNSEWUD(component.dir)) {
|
||||
AdvancedLiquidConduit lc = (AdvancedLiquidConduit) conduit;
|
||||
@@ -106,15 +105,17 @@ public class AdvancedLiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
List<Vertex> corners = bb.getCornersWithUvForFace(d, minU, maxU, minV, maxV);
|
||||
moveEdgeCorners(corners, vDir, width);
|
||||
moveEdgeCorners(corners, component.dir.getOpposite(), sideScale);
|
||||
for (Vertex c : corners) {
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
for (i = 0; i < corners.size(); i++) {
|
||||
final Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
|
||||
corners = bb.getCornersWithUvForFace(d, minU, maxU, minV, maxV);
|
||||
moveEdgeCorners(corners, vDir.getOpposite(), width);
|
||||
moveEdgeCorners(corners, component.dir.getOpposite(), sideScale);
|
||||
for (Vertex c : corners) {
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
for (i = 0; i < corners.size(); i++) {
|
||||
final Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,14 +128,14 @@ public class AdvancedLiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV());
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
for (Vertex c : corners) {
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
for (i = 0; i < corners.size(); i++) {
|
||||
final Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
// back face
|
||||
for (int i = corners.size() - 1; i >= 0; i--) {
|
||||
for (i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public class ConduitTank implements IFluidTank {
|
||||
addAmount(-used);
|
||||
}
|
||||
|
||||
FluidStack drained = new FluidStack(fluid.getFluidID(), used);
|
||||
FluidStack drained = new FluidStack(fluid.getFluid(), used);
|
||||
|
||||
if (fluid.amount < 0) {
|
||||
fluid.amount = 0;
|
||||
|
||||
@@ -13,17 +13,13 @@ import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.geom.ConnectionModeGeometry;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
|
||||
public class EnderLiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public boolean isRendererForConduit(IConduit conduit) {
|
||||
if (conduit instanceof AbstractEnderLiquidConduit) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static final ThreadLocal<ConduitRenderer> instance = ThreadLocal
|
||||
.withInitial(EnderLiquidConduitRenderer::new);
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x,
|
||||
|
||||
@@ -77,15 +77,15 @@ public class ItemLiquidConduit extends AbstractItemConduit implements IAdvancedT
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
int extractRate;
|
||||
int maxIo;
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
|
||||
@@ -42,7 +43,12 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
public static final String ICON_INSERT_KEY = "enderio:liquidConduitInsert";
|
||||
public static final String ICON_EMPTY_INSERT_KEY = "enderio:emptyLiquidConduitInsert";
|
||||
|
||||
static final Map<String, IIcon> ICONS = new HashMap<String, IIcon>();
|
||||
static final Map<String, IIcon> ICONS = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public ConduitRenderer getRenderer() {
|
||||
return LiquidConduitRenderer.instance.get();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void initIcons() {
|
||||
@@ -137,7 +143,7 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
}
|
||||
}
|
||||
if (!foundFluid) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
FluidStack couldDrain = extTank.drain(dir.getOpposite(), MAX_EXTRACT_PER_TICK, false);
|
||||
@@ -354,7 +360,7 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
return false;
|
||||
}
|
||||
|
||||
AbstractTankConduitNetwork n = (AbstractTankConduitNetwork) network;
|
||||
AbstractTankConduitNetwork<?> n = (AbstractTankConduitNetwork<?>) network;
|
||||
if (tank.getFluid() == null) {
|
||||
tank.setLiquid(n.getFluidType() == null ? null : n.getFluidType().copy());
|
||||
} else if (n.getFluidType() == null) {
|
||||
|
||||
@@ -279,13 +279,11 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
loc.y,
|
||||
loc.z,
|
||||
ILiquidConduit.class);
|
||||
int numTargets = 0;
|
||||
for (ILiquidConduit n : connections) {
|
||||
LiquidConduit neighbour = (LiquidConduit) n;
|
||||
if (canFlowTo(con, neighbour)) { // can only flow within same network
|
||||
totalAmount += neighbour.getTank().getFluidAmount();
|
||||
totalCapacity += neighbour.getTank().getCapacity();
|
||||
numTargets++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -31,32 +31,22 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
|
||||
public class LiquidConduitRenderer extends DefaultConduitRenderer implements IResourceManagerReloadListener {
|
||||
|
||||
public static final ThreadLocal<ConduitRenderer> instance = ThreadLocal.withInitial(LiquidConduitRenderer::new);
|
||||
|
||||
private float downRatio;
|
||||
|
||||
private float flatRatio;
|
||||
|
||||
private float upRatio;
|
||||
|
||||
private LiquidConduitRenderer() {
|
||||
public LiquidConduitRenderer() {
|
||||
super();
|
||||
}
|
||||
|
||||
public static LiquidConduitRenderer create() {
|
||||
LiquidConduitRenderer result = new LiquidConduitRenderer();
|
||||
RenderUtil.registerReloadListener(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRendererForConduit(IConduit conduit) {
|
||||
if (conduit instanceof LiquidConduit) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
RenderUtil.registerReloadListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,10 +56,17 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
}
|
||||
|
||||
public void renderDynamicEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit,
|
||||
double x, double y, double z, float partialTick, float worldLight) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderConduit(IIcon tex, IConduit conduit, CollidableComponent component, float brightness) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
if (isNSEWUD(component.dir)) {
|
||||
LiquidConduit lc = (LiquidConduit) conduit;
|
||||
IIcon fluidTex = conduit.getTransmitionTextureForState(component);
|
||||
FluidStack fluid = lc.getFluidType();
|
||||
if (fluid != null) {
|
||||
renderFluidOutline(component, fluid);
|
||||
@@ -77,30 +74,40 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
BoundingBox[] cubes = toCubes(component.bound);
|
||||
for (BoundingBox cube : cubes) {
|
||||
drawSection(cube, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV(), component.dir, false);
|
||||
// This check is kinda broken, but whatever, it was like that when this was done in a TESR too
|
||||
if (lc.getTank().getFilledRatio() <= 0) {
|
||||
continue;
|
||||
}
|
||||
tessellator.setColorOpaque_F(0.7f, 0.7f, 0.7f);
|
||||
drawSection(
|
||||
cube,
|
||||
fluidTex.getMinU(),
|
||||
fluidTex.getMaxU(),
|
||||
fluidTex.getMinV(),
|
||||
fluidTex.getMaxV(),
|
||||
component.dir,
|
||||
true);
|
||||
}
|
||||
|
||||
} else {
|
||||
drawSection(
|
||||
component.bound,
|
||||
tex.getMinU(),
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV(),
|
||||
component.dir,
|
||||
true);
|
||||
}
|
||||
|
||||
if (conduit.getConnectionMode(component.dir) == ConnectionMode.DISABLED) {
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon(component.data);
|
||||
List<Vertex> corners = component.bound
|
||||
.getCornersWithUvForFace(component.dir, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV());
|
||||
for (Vertex c : corners) {
|
||||
CubeRenderer.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
// back face
|
||||
for (int i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
CubeRenderer.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
if (conduit.getConnectionMode(component.dir) == ConnectionMode.DISABLED) {
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
int i;
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon(component.data);
|
||||
List<Vertex> corners = component.bound.getCornersWithUvForFace(
|
||||
component.dir,
|
||||
tex.getMinU(),
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV());
|
||||
for (i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
// back face
|
||||
for (i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,27 +127,29 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<CollidableComponent, Map<Fluid, List<CachableRenderStatement>>> cache = new WeakHashMap<CollidableComponent, Map<Fluid, List<CachableRenderStatement>>>();
|
||||
private static final Map<CollidableComponent, Map<Fluid, List<CachableRenderStatement>>> cache = Collections
|
||||
.synchronizedMap(new WeakHashMap<>());
|
||||
|
||||
public static List<CachableRenderStatement> computeFluidOutlineToCache(CollidableComponent component, Fluid fluid,
|
||||
double scaleFactor, float outlineWidth) {
|
||||
|
||||
Map<Fluid, List<CachableRenderStatement>> cache0 = cache.get(component);
|
||||
if (cache0 == null) {
|
||||
cache0 = new HashMap<Fluid, List<CachableRenderStatement>>();
|
||||
cache.put(component, cache0);
|
||||
}
|
||||
// Only init once per component across all threads so the cache stays accurate.
|
||||
Map<Fluid, List<CachableRenderStatement>> cache0 = cache
|
||||
.computeIfAbsent(component, _k -> new ConcurrentHashMap<>());
|
||||
// The rest of this function 'should' be in a `computeIfAbsent` as well for:
|
||||
// `cache0.computeIfAbsent(fluid, _k -> ...)` but that won't cause a bug in this case,
|
||||
// just a bit more garbage.
|
||||
List<CachableRenderStatement> data = cache0.get(fluid);
|
||||
if (data != null) {
|
||||
return data;
|
||||
}
|
||||
data = new ArrayList<CachableRenderStatement>();
|
||||
cache0.put(fluid, data);
|
||||
data = new ArrayList<>();
|
||||
|
||||
IIcon texture = fluid.getStillIcon();
|
||||
if (texture == null) {
|
||||
texture = fluid.getIcon();
|
||||
if (texture == null) {
|
||||
cache0.put(fluid, data);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -199,6 +208,7 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
}
|
||||
}
|
||||
}
|
||||
cache0.put(fluid, data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -246,49 +256,6 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
// done in the dynamic section
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderDynamicEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit,
|
||||
double x, double y, double z, float partialTick, float worldLight) {
|
||||
|
||||
if (((LiquidConduit) conduit).getTank().getFilledRatio() <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Collection<CollidableComponent> components = conduit.getCollidableComponents();
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
calculateRatios((LiquidConduit) conduit);
|
||||
transmissionScaleFactor = conduit.getTransmitionGeometryScale();
|
||||
|
||||
IIcon tex;
|
||||
for (CollidableComponent component : components) {
|
||||
if (renderComponent(component)) {
|
||||
if (isNSEWUD(component.dir) && conduit.getTransmitionTextureForState(component) != null) {
|
||||
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
tex = conduit.getTransmitionTextureForState(component);
|
||||
|
||||
BoundingBox[] cubes = toCubes(component.bound);
|
||||
for (BoundingBox cube : cubes) {
|
||||
drawSection(
|
||||
cube,
|
||||
tex.getMinU(),
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV(),
|
||||
component.dir,
|
||||
true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setVerticesForTransmission(BoundingBox bound, ForgeDirection id) {
|
||||
|
||||
@@ -303,7 +270,7 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
float transY = (bound.sizeY() - sizeY) / 2;
|
||||
|
||||
Vector3d translation = new Vector3d(0, transY, 0);
|
||||
CubeRenderer.setupVertices(bound.translate(translation));
|
||||
CubeRenderer.get().setupVertices(bound.translate(translation));
|
||||
}
|
||||
|
||||
private void calculateRatios(LiquidConduit conduit) {
|
||||
|
||||
@@ -14,7 +14,5 @@ public interface IMEConduit extends IConduit {
|
||||
|
||||
boolean isDense();
|
||||
|
||||
boolean isDenseUltra();
|
||||
|
||||
int getChannelsInUse();
|
||||
}
|
||||
@@ -15,8 +15,7 @@ public class ItemMEConduit extends AbstractItemConduit {
|
||||
|
||||
private static ItemConduitSubtype[] subtypes = new ItemConduitSubtype[] {
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name(), "enderio:itemMeConduit"),
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "Dense", "enderio:itemMeConduitDense"),
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "DenseUltra", "enderio:itemMeConduitDenseUltra") };
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "Dense", "enderio:itemMeConduitDense") };
|
||||
|
||||
public static ItemMEConduit create() {
|
||||
ItemMEConduit result = new ItemMEConduit();
|
||||
|
||||
@@ -16,7 +16,6 @@ import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGridConnection;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -33,10 +32,17 @@ import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.RaytraceResult;
|
||||
import crazypants.enderio.conduit.TileConduitBundle;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
|
||||
public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Override
|
||||
public ConduitRenderer getRenderer() {
|
||||
return DefaultConduitRenderer.instance.get();
|
||||
}
|
||||
|
||||
protected MEConduitNetwork network;
|
||||
protected MEConduitGrid grid;
|
||||
|
||||
@@ -44,7 +50,6 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public static IIcon[] longTextures;
|
||||
|
||||
private boolean isDense;
|
||||
private boolean isDenseUltra;
|
||||
private int playerID = -1;
|
||||
|
||||
public MEConduit() {
|
||||
@@ -52,7 +57,6 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
}
|
||||
|
||||
public MEConduit(int itemDamage) {
|
||||
isDenseUltra = itemDamage == 2;
|
||||
isDense = itemDamage == 1;
|
||||
}
|
||||
|
||||
@@ -61,16 +65,14 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
coreTextures = new IIcon[3];
|
||||
longTextures = new IIcon[3];
|
||||
coreTextures = new IIcon[2];
|
||||
longTextures = new IIcon[2];
|
||||
|
||||
coreTextures[0] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCore");
|
||||
coreTextures[1] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCoreDense");
|
||||
coreTextures[2] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCoreDenseUltra");
|
||||
|
||||
longTextures[0] = register.registerIcon(EnderIO.DOMAIN + ":meConduit");
|
||||
longTextures[1] = register.registerIcon(EnderIO.DOMAIN + ":meConduitDense");
|
||||
longTextures[2] = register.registerIcon(EnderIO.DOMAIN + ":meConduitDenseUltra");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -80,10 +82,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
});
|
||||
}
|
||||
|
||||
public static int getDamageForState(boolean isDense, boolean isDenseUltra) {
|
||||
if (isDenseUltra) {
|
||||
return 2;
|
||||
}
|
||||
public static int getDamageForState(boolean isDense) {
|
||||
if (isDense) {
|
||||
return 1;
|
||||
}
|
||||
@@ -97,7 +96,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Override
|
||||
public ItemStack createItem() {
|
||||
return new ItemStack(EnderIO.itemMEConduit, 1, getDamageForState(isDense, isDenseUltra));
|
||||
return new ItemStack(EnderIO.itemMEConduit, 1, getDamageForState(isDense));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,7 +114,6 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public void writeToNBT(NBTTagCompound nbtRoot) {
|
||||
super.writeToNBT(nbtRoot);
|
||||
nbtRoot.setBoolean("isDense", isDense);
|
||||
nbtRoot.setBoolean("isDenseUltra", isDenseUltra);
|
||||
nbtRoot.setInteger("playerID", playerID);
|
||||
}
|
||||
|
||||
@@ -128,9 +126,6 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
} else {
|
||||
playerID = -1;
|
||||
}
|
||||
if (nbtRoot.hasKey("isDenseUltra")) {
|
||||
isDenseUltra = nbtRoot.getBoolean("isDenseUltra");
|
||||
}
|
||||
}
|
||||
|
||||
public void setPlayerID(int playerID) {
|
||||
@@ -201,22 +196,12 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Method(modid = "appliedenergistics2")
|
||||
private Boolean canConnectToGridNode(IGridNode node, ForgeDirection dir) {
|
||||
if (node.getGridBlock().getConnectableSides().contains(dir.getOpposite())) {
|
||||
if (isDenseUltra()) {
|
||||
return node.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY)
|
||||
|| ((node.hasFlag(GridFlags.DENSE_CAPACITY)) && !node.hasFlag(GridFlags.CANNOT_CARRY));
|
||||
} else if (isDense()) {
|
||||
return true;
|
||||
} else {
|
||||
return !node.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return node.getGridBlock().getConnectableSides().contains(dir.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForState(CollidableComponent component) {
|
||||
int state = getDamageForState(isDense, isDenseUltra);
|
||||
int state = getDamageForState(isDense);
|
||||
if (component.dir == ForgeDirection.UNKNOWN) {
|
||||
return coreTextures[state];
|
||||
} else {
|
||||
@@ -393,9 +378,4 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public boolean isDense() {
|
||||
return isDense;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDenseUltra() {
|
||||
return isDenseUltra;
|
||||
}
|
||||
}
|
||||
@@ -43,9 +43,6 @@ public class MEConduitGrid implements IGridBlock {
|
||||
|
||||
@Override
|
||||
public EnumSet<GridFlags> getFlags() {
|
||||
if (conduit.isDenseUltra()) {
|
||||
return EnumSet.of(GridFlags.ULTRA_DENSE_CAPACITY);
|
||||
}
|
||||
if (conduit.isDense()) {
|
||||
return EnumSet.of(GridFlags.DENSE_CAPACITY);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.enderio.core.common.util.DyeColor;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.InterfaceList;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
|
||||
@@ -14,11 +15,16 @@ import li.cil.oc.api.network.SidedEnvironment;
|
||||
@Interface(iface = "li.cil.oc.api.network.SidedEnvironment", modid = "OpenComputersAPI|Network") })
|
||||
public interface IOCConduit extends IConduit, Environment, SidedEnvironment {
|
||||
|
||||
public static final String COLOR_CONTROLLER_ID = "ColorController";
|
||||
String COLOR_CONTROLLER_ID = "ColorController";
|
||||
|
||||
@Override
|
||||
default ConduitRenderer getRenderer() {
|
||||
return OCConduitRenderer.instance.get();
|
||||
}
|
||||
|
||||
void invalidate();
|
||||
|
||||
public abstract void setSignalColor(ForgeDirection dir, DyeColor col);
|
||||
void setSignalColor(ForgeDirection dir, DyeColor col);
|
||||
|
||||
public abstract DyeColor getSignalColor(ForgeDirection dir);
|
||||
DyeColor getSignalColor(ForgeDirection dir);
|
||||
}
|
||||
@@ -7,14 +7,12 @@ import com.enderio.core.client.render.CubeRenderer;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
|
||||
public class OCConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public boolean isRendererForConduit(IConduit conduit) {
|
||||
return conduit instanceof IOCConduit;
|
||||
}
|
||||
public static final ThreadLocal<ConduitRenderer> instance = ThreadLocal.withInitial(OCConduitRenderer::new);
|
||||
|
||||
@Override
|
||||
protected void renderConduit(IIcon tex, IConduit conduit, CollidableComponent component, float selfIllum) {
|
||||
@@ -23,7 +21,7 @@ public class OCConduitRenderer extends DefaultConduitRenderer {
|
||||
int c = ((IOCConduit) conduit).getSignalColor(component.dir).getColor();
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setColorOpaque_I(c);
|
||||
CubeRenderer.render(component.bound, tex);
|
||||
CubeRenderer.get().render(component.bound, tex);
|
||||
tessellator.setColorOpaque(255, 255, 255);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -5,19 +5,25 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IExtractor;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.IInternalPowerHandler;
|
||||
import crazypants.enderio.power.IPowerInterface;
|
||||
|
||||
public interface IPowerConduit extends IConduit, IInternalPowerHandler, IExtractor {
|
||||
|
||||
public static final String ICON_KEY = "enderio:powerConduit";
|
||||
public static final String ICON_KEY_INPUT = "enderio:powerConduitInput";
|
||||
public static final String ICON_KEY_OUTPUT = "enderio:powerConduitOutput";
|
||||
public static final String ICON_CORE_KEY = "enderio:powerConduitCore";
|
||||
public static final String ICON_TRANSMISSION_KEY = "enderio:powerConduitTransmission";
|
||||
String ICON_KEY = "enderio:powerConduit";
|
||||
String ICON_KEY_INPUT = "enderio:powerConduitInput";
|
||||
String ICON_KEY_OUTPUT = "enderio:powerConduitOutput";
|
||||
String ICON_CORE_KEY = "enderio:powerConduitCore";
|
||||
String ICON_TRANSMISSION_KEY = "enderio:powerConduitTransmission";
|
||||
|
||||
public static final String COLOR_CONTROLLER_ID = "ColorController";
|
||||
String COLOR_CONTROLLER_ID = "ColorController";
|
||||
|
||||
@Override
|
||||
default ConduitRenderer getRenderer() {
|
||||
return PowerConduitRenderer.instance.get();
|
||||
}
|
||||
|
||||
IPowerInterface getExternalPowerReceptor(ForgeDirection direction);
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.AbstractItemConduit;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.ItemConduitSubtype;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class ItemPowerConduit extends AbstractItemConduit {
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ItemPowerConduit extends AbstractItemConduit {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
if (PREFIX == null) {
|
||||
POSTFIX = " " + PowerDisplayUtil.abrevation() + PowerDisplayUtil.perTickStr();
|
||||
PREFIX = EnderIO.lang.localize("power.maxOutput") + " ";
|
||||
|
||||
@@ -266,7 +266,6 @@ public class NetworkPowerManager {
|
||||
|
||||
float filledRatio = (float) energyStored / maxEnergyStored;
|
||||
int energyLeft = energyStored;
|
||||
int given = 0;
|
||||
for (IPowerConduit con : network.getConduits()) {
|
||||
if (energyLeft > 0) {
|
||||
// NB: use ceil to ensure we dont through away any energy due to
|
||||
@@ -276,7 +275,6 @@ public class NetworkPowerManager {
|
||||
give = Math.min(give, con.getMaxEnergyStored());
|
||||
give = Math.min(give, energyLeft);
|
||||
con.setEnergyStored(give);
|
||||
given += give;
|
||||
energyLeft -= give;
|
||||
} else {
|
||||
con.setEnergyStored(0);
|
||||
|
||||
@@ -137,7 +137,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
DyeColor col = DyeColor.getColorFromDye(player.getCurrentEquippedItem());
|
||||
if (ConduitUtil.isProbeEquipped(player)) {
|
||||
if (!player.worldObj.isRemote) {
|
||||
new PacketConduitProbe().sendInfoMessage(player, this);
|
||||
PacketConduitProbe.sendInfoMessage(player, this);
|
||||
}
|
||||
return true;
|
||||
} else if (col != null && res.component != null && isColorBandRendered(res.component.dir)) {
|
||||
@@ -283,7 +283,6 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
}
|
||||
|
||||
private boolean isRedstoneEnabled(ForgeDirection dir) {
|
||||
boolean result;
|
||||
RedstoneControlMode mode = getExtractionRedstoneMode(dir);
|
||||
if (mode == RedstoneControlMode.NEVER) {
|
||||
return false;
|
||||
@@ -298,10 +297,12 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
boolean res;
|
||||
if (mode == RedstoneControlMode.OFF) {
|
||||
// if checking for no signal, must be no signal from both
|
||||
res = mode.isConditionMet(mode, signal) && (col != DyeColor.RED || mode.isConditionMet(mode, exSig));
|
||||
res = RedstoneControlMode.isConditionMet(mode, signal)
|
||||
&& (col != DyeColor.RED || RedstoneControlMode.isConditionMet(mode, exSig));
|
||||
} else {
|
||||
// if checking for a signal, either is fine
|
||||
res = mode.isConditionMet(mode, signal) || (col == DyeColor.RED && mode.isConditionMet(mode, exSig));
|
||||
res = RedstoneControlMode.isConditionMet(mode, signal)
|
||||
|| (col == DyeColor.RED && RedstoneControlMode.isConditionMet(mode, exSig));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -17,15 +17,13 @@ import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConnectionModeGeometry;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
|
||||
public class PowerConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public boolean isRendererForConduit(IConduit conduit) {
|
||||
return conduit instanceof IPowerConduit;
|
||||
}
|
||||
public static final ThreadLocal<ConduitRenderer> instance = ThreadLocal.withInitial(PowerConduitRenderer::new);
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x,
|
||||
@@ -62,13 +60,12 @@ public class PowerConduitRenderer extends DefaultConduitRenderer {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setColorOpaque_I(c);
|
||||
|
||||
Offset offset = conduit.getBundle().getOffset(IPowerConduit.class, component.dir);
|
||||
BoundingBox bound = component.bound;
|
||||
if (conMode != ConnectionMode.IN_OUT) {
|
||||
Vector3d trans = ForgeDirectionOffsets.offsetScaled(component.dir, -0.075);
|
||||
bound = bound.translate(trans);
|
||||
}
|
||||
CubeRenderer.render(bound, tex);
|
||||
CubeRenderer.get().render(bound, tex);
|
||||
tessellator.setColorOpaque(255, 255, 255);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -13,8 +13,8 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.ItemConduitSubtype;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.ItemPowerConduit;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class ItemPowerConduitEndergy extends ItemPowerConduit {
|
||||
|
||||
@@ -75,7 +75,7 @@ public class ItemPowerConduitEndergy extends ItemPowerConduit {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
if (PREFIX == null) {
|
||||
POSTFIX = " " + PowerDisplayUtil.abrevation() + PowerDisplayUtil.perTickStr();
|
||||
PREFIX = EnderIO.lang.localize("power.maxOutput") + " ";
|
||||
|
||||
@@ -5,14 +5,20 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
|
||||
public interface IInsulatedRedstoneConduit extends IRedstoneConduit {
|
||||
|
||||
static final String KEY_INS_CONDUIT_ICON = "enderio:redstoneInsulatedConduit";
|
||||
static final String KEY_INS_CORE_OFF_ICON = "enderio:redstoneInsulatedConduitCoreOff";
|
||||
static final String KEY_INS_CORE_ON_ICON = "enderio:redstoneInsulatedConduitCoreOn";
|
||||
String KEY_INS_CONDUIT_ICON = "enderio:redstoneInsulatedConduit";
|
||||
String KEY_INS_CORE_OFF_ICON = "enderio:redstoneInsulatedConduitCoreOff";
|
||||
String KEY_INS_CORE_ON_ICON = "enderio:redstoneInsulatedConduitCoreOn";
|
||||
|
||||
public static final String COLOR_CONTROLLER_ID = "ColorController";
|
||||
String COLOR_CONTROLLER_ID = "ColorController";
|
||||
|
||||
@Override
|
||||
default ConduitRenderer getRenderer() {
|
||||
return InsulatedRedstoneConduitRenderer.instance.get();
|
||||
}
|
||||
|
||||
void onInputsChanged(ForgeDirection side, int[] inputValues);
|
||||
|
||||
|
||||
+4
-5
@@ -7,14 +7,13 @@ import com.enderio.core.client.render.CubeRenderer;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
|
||||
public class InsulatedRedstoneConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public boolean isRendererForConduit(IConduit conduit) {
|
||||
return conduit instanceof IInsulatedRedstoneConduit;
|
||||
}
|
||||
public static final ThreadLocal<ConduitRenderer> instance = ThreadLocal
|
||||
.withInitial(InsulatedRedstoneConduitRenderer::new);
|
||||
|
||||
@Override
|
||||
protected void renderConduit(IIcon tex, IConduit conduit, CollidableComponent component, float selfIllum) {
|
||||
@@ -24,7 +23,7 @@ public class InsulatedRedstoneConduitRenderer extends DefaultConduitRenderer {
|
||||
int c = ((IInsulatedRedstoneConduit) conduit).getSignalColor(component.dir).getColor();
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setColorOpaque_I(c);
|
||||
CubeRenderer.render(component.bound, tex);
|
||||
CubeRenderer.get().render(component.bound, tex);
|
||||
tessellator.setColorOpaque(255, 255, 255);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -33,12 +33,19 @@ import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
import dan200.computercraft.api.ComputerCraftAPI;
|
||||
import powercrystals.minefactoryreloaded.api.rednet.IRedNetOutputNode;
|
||||
|
||||
public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit {
|
||||
|
||||
static final Map<String, IIcon> ICONS = new HashMap<String, IIcon>();
|
||||
static final Map<String, IIcon> ICONS = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public ConduitRenderer getRenderer() {
|
||||
return DefaultConduitRenderer.instance.get();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void initIcons() {
|
||||
@@ -65,10 +72,9 @@ public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit
|
||||
|
||||
protected boolean neighbourDirty = true;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public RedstoneConduit() {
|
||||
for (ForgeDirection ignored : ForgeDirection.VALID_DIRECTIONS) {
|
||||
externalSignals.add(new HashSet<Signal>());
|
||||
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
|
||||
externalSignals.add(new HashSet<>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import crazypants.enderio.conduit.RaytraceResult;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitGeometryUtil;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
|
||||
public class RedstoneSwitch extends RedstoneConduit {
|
||||
|
||||
@@ -33,6 +34,11 @@ public class RedstoneSwitch extends RedstoneConduit {
|
||||
|
||||
private boolean isOn;
|
||||
|
||||
@Override
|
||||
public ConduitRenderer getRenderer() {
|
||||
return RedstoneSwitchRenderer.instance.get();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void initIcons() {
|
||||
IconUtil.addIconProvider(new IconUtil.IIconProvider() {
|
||||
@@ -97,7 +103,7 @@ public class RedstoneSwitch extends RedstoneConduit {
|
||||
Vector3d trans = ConduitGeometryUtil.instance.getTranslation(ForgeDirection.UNKNOWN, o);
|
||||
|
||||
List<CollidableComponent> result = super.getCollidableComponents();
|
||||
BoundingBox[] aabb = RedstoneSwitchBounds.getInstance().getAABB();
|
||||
BoundingBox[] aabb = RedstoneSwitchBounds.get().getAABB();
|
||||
|
||||
for (BoundingBox bb : aabb) {
|
||||
result.add(
|
||||
|
||||
@@ -9,13 +9,11 @@ import crazypants.enderio.config.Config;
|
||||
|
||||
public class RedstoneSwitchBounds {
|
||||
|
||||
private static RedstoneSwitchBounds instance;
|
||||
private static final ThreadLocal<RedstoneSwitchBounds> instance = ThreadLocal
|
||||
.withInitial(RedstoneSwitchBounds::new);
|
||||
|
||||
public static final RedstoneSwitchBounds getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new RedstoneSwitchBounds();
|
||||
}
|
||||
return instance;
|
||||
public static RedstoneSwitchBounds get() {
|
||||
return RedstoneSwitchBounds.instance.get();
|
||||
}
|
||||
|
||||
final VertexTransform[] xForms;
|
||||
|
||||
@@ -17,29 +17,21 @@ import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitConnectorType;
|
||||
import crazypants.enderio.conduit.geom.ConduitGeometryUtil;
|
||||
import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
|
||||
public class RedstoneSwitchRenderer extends DefaultConduitRenderer {
|
||||
|
||||
private static final RedstoneSwitchRenderer instance = new RedstoneSwitchRenderer();
|
||||
|
||||
public static RedstoneSwitchRenderer getInstance() {
|
||||
return instance;
|
||||
}
|
||||
public static final ThreadLocal<ConduitRenderer> instance = ThreadLocal.withInitial(RedstoneSwitchRenderer::new);
|
||||
|
||||
private final VertexTransform[] xForms;
|
||||
private final BoundingBox switchBounds;
|
||||
private final BoundingBox connectorBounds;
|
||||
|
||||
private RedstoneSwitchRenderer() {
|
||||
xForms = RedstoneSwitchBounds.getInstance().xForms;
|
||||
switchBounds = RedstoneSwitchBounds.getInstance().switchBounds;
|
||||
connectorBounds = RedstoneSwitchBounds.getInstance().connectorBounds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRendererForConduit(IConduit conduit) {
|
||||
return conduit.getClass() == RedstoneSwitch.class;
|
||||
public RedstoneSwitchRenderer() {
|
||||
xForms = RedstoneSwitchBounds.get().xForms;
|
||||
switchBounds = RedstoneSwitchBounds.get().switchBounds;
|
||||
connectorBounds = RedstoneSwitchBounds.get().connectorBounds;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,13 +41,15 @@ public class RedstoneSwitchRenderer extends DefaultConduitRenderer {
|
||||
super.renderEntity(conduitBundleRenderer, bundle, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
|
||||
RedstoneSwitch sw = (RedstoneSwitch) conduit;
|
||||
int i;
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
float selfIllum = Math.max(worldLight, conduit.getSelfIlluminationForState(null));
|
||||
tessellator.setColorOpaque_F(selfIllum, selfIllum, selfIllum);
|
||||
|
||||
IIcon[] icons = new IIcon[6];
|
||||
for (int i = 0; i < icons.length; i++) {
|
||||
for (i = 0; i < icons.length; i++) {
|
||||
icons[i] = EnderIO.blockConduitBundle.getConnectorIcon(ConduitConnectorType.INTERNAL);
|
||||
}
|
||||
icons[3] = sw.getSwitchIcon();
|
||||
@@ -65,12 +59,12 @@ public class RedstoneSwitchRenderer extends DefaultConduitRenderer {
|
||||
bundle.getOffset(IRedstoneConduit.class, ForgeDirection.UNKNOWN));
|
||||
BoundingBox bb = switchBounds.translate(trans);
|
||||
|
||||
for (VertexTransform tf : xForms) {
|
||||
CubeRenderer.render(bb, icons, tf, null);
|
||||
for (i = 0; i < xForms.length; i++) {
|
||||
cr.render(bb, icons, xForms[i], null);
|
||||
}
|
||||
bb = connectorBounds.translate(trans);
|
||||
for (VertexTransform tf : xForms) {
|
||||
CubeRenderer.render(bb, icons[0], tf);
|
||||
for (i = 0; i < xForms.length; i++) {
|
||||
cr.render(bb, icons[0], xForms[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -19,16 +18,13 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.CubeRenderer;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.IBlockAccessWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -51,59 +47,18 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.util.RenderPassHelper;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler {
|
||||
@ThreadSafeISBRH(perThread = false)
|
||||
public class ConduitBundleRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public ConduitBundleRenderer(float conduitScale) {}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTick) {
|
||||
IConduitBundle bundle = (IConduitBundle) te;
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
if (bundle.hasFacade() && bundle.getFacadeId().isOpaqueCube() && !ConduitUtil.isFacadeHidden(bundle, player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
float brightness = -1;
|
||||
for (IConduit con : bundle.getConduits()) {
|
||||
if (ConduitUtil.renderConduit(player, con)) {
|
||||
ConduitRenderer renderer = EnderIO.proxy.getRendererForConduit(con);
|
||||
if (renderer.isDynamic()) {
|
||||
if (brightness == -1) {
|
||||
BlockCoord loc = bundle.getLocation();
|
||||
brightness = bundle.getEntity().getWorldObj()
|
||||
.getLightBrightnessForSkyBlocks(loc.x, loc.y, loc.z, 0);
|
||||
|
||||
RenderUtil.bindBlockTexture();
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_LIGHTING_BIT);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
Tessellator.instance.startDrawingQuads();
|
||||
}
|
||||
renderer.renderDynamicEntity(this, bundle, con, x, y, z, partialTick, brightness);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (brightness != -1) {
|
||||
Tessellator.instance.draw();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
}
|
||||
public ConduitBundleRenderer() {}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks rb) {
|
||||
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
int pass = RenderPassHelper.getBlockRenderPass();
|
||||
if (pass == 1) {
|
||||
// If the MC renderer is told that an alpha pass is required ( see
|
||||
@@ -113,10 +68,10 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
// around is to ensure we always render something in this pass. Throwing
|
||||
// in a polygon with a 0 area does the job
|
||||
// See: https://github.com/MinecraftForge/MinecraftForge/issues/981
|
||||
Tessellator.instance.addVertexWithUV(x, y, z, 0, 0);
|
||||
Tessellator.instance.addVertexWithUV(x, y, z, 0, 0);
|
||||
Tessellator.instance.addVertexWithUV(x, y, z, 0, 0);
|
||||
Tessellator.instance.addVertexWithUV(x, y, z, 0, 0);
|
||||
tessellator.addVertexWithUV(x, y, z, 0, 0);
|
||||
tessellator.addVertexWithUV(x, y, z, 0, 0);
|
||||
tessellator.addVertexWithUV(x, y, z, 0, 0);
|
||||
tessellator.addVertexWithUV(x, y, z, 0, 0);
|
||||
}
|
||||
|
||||
IConduitBundle bundle = (IConduitBundle) world.getTileEntity(x, y, z);
|
||||
@@ -125,7 +80,7 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
boolean renderedFacade = renderFacade(x, y, z, pass, rb, bundle, player);
|
||||
boolean renderConduit = !renderedFacade || ConduitUtil.isFacadeHidden(bundle, player);
|
||||
|
||||
if (renderConduit && (pass == 0 || rb.overrideBlockTexture != null)) {
|
||||
if (bundle != null && renderConduit && (pass == 0 || rb.overrideBlockTexture != null)) {
|
||||
BlockCoord loc = bundle.getLocation();
|
||||
float brightness;
|
||||
if (!Config.updateLightingWhenHidingFacades && bundle.hasFacade()
|
||||
@@ -138,21 +93,34 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
return true;
|
||||
}
|
||||
|
||||
return renderedFacade || (bundle.hasFacade() && !bundle.getFacadeId().isOpaqueCube());
|
||||
return renderedFacade || (bundle != null && bundle.hasFacade() && !bundle.getFacadeId().isOpaqueCube());
|
||||
}
|
||||
|
||||
private static final ThreadLocal<BlockConduitFacade> facade = ThreadLocal.withInitial(() -> {
|
||||
try {
|
||||
return EnderIO.blockConduitFacade.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
private boolean renderFacade(int x, int y, int z, int pass, RenderBlocks rb, IConduitBundle bundle,
|
||||
EntityClientPlayerMP player) {
|
||||
boolean res = false;
|
||||
if (bundle == null) {
|
||||
return false;
|
||||
}
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
if (bundle.hasFacade()) {
|
||||
res = true;
|
||||
Block facadeId = bundle.getFacadeId();
|
||||
if (ConduitUtil.isFacadeHidden(bundle, player)) {
|
||||
Tessellator.instance.setColorOpaque_F(1, 1, 1);
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
bundle.setFacadeId(null, false);
|
||||
bundle.setFacadeRenderAs(FacadeRenderState.WIRE_FRAME);
|
||||
|
||||
BlockConduitFacade facb = EnderIO.blockConduitFacade;
|
||||
BlockConduitFacade facb = facade.get();
|
||||
facb.setBlockOverride(bundle);
|
||||
facb.setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
if (!rb.hasOverrideBlockTexture()) {
|
||||
@@ -192,20 +160,23 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
public void renderConduits(IConduitBundle bundle, double x, double y, double z, float partialTick, float brightness,
|
||||
RenderBlocks rb) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
if (bundle == null) return;
|
||||
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
tessellator.addTranslation((float) x, (float) y, (float) z);
|
||||
|
||||
// Conduits
|
||||
Set<ForgeDirection> externals = new HashSet<ForgeDirection>();
|
||||
Set<ForgeDirection> externals = new HashSet<>();
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
List<BoundingBox> wireBounds = new ArrayList<BoundingBox>();
|
||||
List<BoundingBox> wireBounds = new ArrayList<>();
|
||||
|
||||
for (IConduit con : bundle.getConduits()) {
|
||||
|
||||
if (ConduitUtil.renderConduit(player, con)) {
|
||||
ConduitRenderer renderer = EnderIO.proxy.getRendererForConduit(con);
|
||||
final ConduitRenderer renderer = con.getRenderer();
|
||||
renderer.renderEntity(this, bundle, con, x, y, z, partialTick, brightness, rb);
|
||||
Set<ForgeDirection> extCons = con.getExternalConnections();
|
||||
for (ForgeDirection dir : extCons) {
|
||||
@@ -225,7 +196,8 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
// Internal conectors between conduits
|
||||
List<CollidableComponent> connectors = bundle.getConnectors();
|
||||
List<CollidableComponent> rendered = Lists.newArrayList();
|
||||
for (CollidableComponent component : connectors) {
|
||||
for (int i = 0; i < connectors.size(); i++) {
|
||||
final CollidableComponent component = connectors.get(i);
|
||||
if (component.conduitType != null) {
|
||||
IConduit conduit = bundle.getConduit(component.conduitType);
|
||||
if (conduit != null) {
|
||||
@@ -243,12 +215,12 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
if (r.component.conduitType == component.conduitType
|
||||
&& !rendered.contains(r.component)) {
|
||||
rendered.add(r.component);
|
||||
CubeRenderer.render(component.bound, rb.overrideBlockTexture, true);
|
||||
cr.render(component.bound, rb.overrideBlockTexture, true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tessellator.setBrightness((int) (brightness));
|
||||
CubeRenderer.render(component.bound, conduit.getTextureForState(component), true);
|
||||
cr.render(component.bound, conduit.getTextureForState(component), true);
|
||||
}
|
||||
} else {
|
||||
wireBounds.add(component.bound);
|
||||
@@ -257,16 +229,18 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
|
||||
} else if (ConduitUtil.getDisplayMode(player) == ConduitDisplayMode.ALL && !rb.hasOverrideBlockTexture()) {
|
||||
IIcon tex = EnderIO.blockConduitBundle.getConnectorIcon(component.data);
|
||||
CubeRenderer.render(component.bound, tex);
|
||||
cr.render(component.bound, tex);
|
||||
}
|
||||
}
|
||||
// render these after the 'normal' conduits so help with proper blending
|
||||
for (BoundingBox wireBound : wireBounds) {
|
||||
Tessellator.instance.setColorRGBA_F(1, 1, 1, 0.25f);
|
||||
CubeRenderer.render(wireBound, EnderIO.blockConduitFacade.getIcon(0, 0));
|
||||
BlockConduitFacade facb = facade.get();
|
||||
for (int i = 0; i < wireBounds.size(); i++) {
|
||||
final BoundingBox wireBound = wireBounds.get(i);
|
||||
tessellator.setColorRGBA_F(1, 1, 1, 0.25f);
|
||||
cr.render(wireBound, facb.getIcon(0, 0));
|
||||
}
|
||||
|
||||
Tessellator.instance.setColorRGBA_F(1, 1, 1, 1f);
|
||||
tessellator.setColorRGBA_F(1, 1, 1, 1f);
|
||||
// External connection terminations
|
||||
if (rb.overrideBlockTexture == null) {
|
||||
for (ForgeDirection dir : externals) {
|
||||
@@ -279,8 +253,10 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
private void renderExternalConnection(ForgeDirection dir) {
|
||||
IIcon tex = EnderIO.blockConduitBundle.getConnectorIcon(ConduitConnectorType.EXTERNAL);
|
||||
BoundingBox[] bbs = ConduitGeometryUtil.instance.getExternalConnectorBoundingBoxes(dir);
|
||||
for (BoundingBox bb : bbs) {
|
||||
CubeRenderer.render(bb, tex, true);
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
for (int i = 0; i < bbs.length; i++) {
|
||||
final BoundingBox bb = bbs[i];
|
||||
cr.render(bb, tex, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,7 @@ import crazypants.enderio.conduit.IConduitBundle;
|
||||
|
||||
public interface ConduitRenderer {
|
||||
|
||||
boolean isRendererForConduit(IConduit conduit);
|
||||
|
||||
void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit con, double x, double y,
|
||||
double z, float partialTick, float worldLight, RenderBlocks rb);
|
||||
|
||||
boolean isDynamic();
|
||||
|
||||
void renderDynamicEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit con, double x,
|
||||
double y, double z, float partialTick, float worldLight);
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
package crazypants.enderio.conduit.render;
|
||||
|
||||
import static com.enderio.core.client.render.CubeRenderer.*;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.DOWN;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.EAST;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.NORTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.UP;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.WEST;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -12,6 +16,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.CubeRenderer;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.vecmath.Vertex;
|
||||
|
||||
@@ -23,12 +28,9 @@ import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
|
||||
public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
|
||||
protected float transmissionScaleFactor;
|
||||
public static final ThreadLocal<ConduitRenderer> instance = ThreadLocal.withInitial(DefaultConduitRenderer::new);
|
||||
|
||||
@Override
|
||||
public boolean isRendererForConduit(IConduit conduit) {
|
||||
return true;
|
||||
}
|
||||
protected float transmissionScaleFactor;
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x,
|
||||
@@ -61,11 +63,8 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderDynamicEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit con,
|
||||
double x, double y, double z, float partialTick, float worldLight) {}
|
||||
|
||||
protected void renderConduit(IIcon tex, IConduit conduit, CollidableComponent component, float brightness) {
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
|
||||
if (isNSEWUD(component.dir)) {
|
||||
|
||||
@@ -94,9 +93,8 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV());
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
for (Vertex c : corners) {
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
cr.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,12 +141,13 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
protected void drawSection(BoundingBox bound, float minU, float maxU, float minV, float maxV, ForgeDirection dir,
|
||||
boolean isTransmission, boolean mirrorTexture) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
|
||||
if (isTransmission) {
|
||||
setVerticesForTransmission(bound, dir);
|
||||
} else {
|
||||
setupVertices(bound);
|
||||
cr.setupVertices(bound);
|
||||
}
|
||||
|
||||
if (mirrorTexture && (dir == NORTH || dir == UP || dir == EAST)) {
|
||||
@@ -168,15 +167,15 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
tessellator.setColorOpaque_F(cm, cm, cm);
|
||||
}
|
||||
if (rotateSides) {
|
||||
addVecWithUV(verts[1], maxU, maxV);
|
||||
addVecWithUV(verts[0], maxU, minV);
|
||||
addVecWithUV(verts[3], minU, minV);
|
||||
addVecWithUV(verts[2], minU, maxV);
|
||||
cr.addVecWithUV(cr.verts[1], maxU, maxV);
|
||||
cr.addVecWithUV(cr.verts[0], maxU, minV);
|
||||
cr.addVecWithUV(cr.verts[3], minU, minV);
|
||||
cr.addVecWithUV(cr.verts[2], minU, maxV);
|
||||
} else {
|
||||
addVecWithUV(verts[1], minU, minV);
|
||||
addVecWithUV(verts[0], maxU, minV);
|
||||
addVecWithUV(verts[3], maxU, maxV);
|
||||
addVecWithUV(verts[2], minU, maxV);
|
||||
cr.addVecWithUV(cr.verts[1], minU, minV);
|
||||
cr.addVecWithUV(cr.verts[0], maxU, minV);
|
||||
cr.addVecWithUV(cr.verts[3], maxU, maxV);
|
||||
cr.addVecWithUV(cr.verts[2], minU, maxV);
|
||||
}
|
||||
if (dir == WEST || dir == EAST) {
|
||||
float tmp = minU;
|
||||
@@ -189,15 +188,15 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
tessellator.setColorOpaque_F(cm, cm, cm);
|
||||
}
|
||||
if (rotateSides) {
|
||||
addVecWithUV(verts[4], maxU, maxV);
|
||||
addVecWithUV(verts[5], maxU, minV);
|
||||
addVecWithUV(verts[6], minU, minV);
|
||||
addVecWithUV(verts[7], minU, maxV);
|
||||
cr.addVecWithUV(cr.verts[4], maxU, maxV);
|
||||
cr.addVecWithUV(cr.verts[5], maxU, minV);
|
||||
cr.addVecWithUV(cr.verts[6], minU, minV);
|
||||
cr.addVecWithUV(cr.verts[7], minU, maxV);
|
||||
} else {
|
||||
addVecWithUV(verts[4], minU, minV);
|
||||
addVecWithUV(verts[5], maxU, minV);
|
||||
addVecWithUV(verts[6], maxU, maxV);
|
||||
addVecWithUV(verts[7], minU, maxV);
|
||||
cr.addVecWithUV(cr.verts[4], minU, minV);
|
||||
cr.addVecWithUV(cr.verts[5], maxU, minV);
|
||||
cr.addVecWithUV(cr.verts[6], maxU, maxV);
|
||||
cr.addVecWithUV(cr.verts[7], minU, maxV);
|
||||
}
|
||||
if (dir == WEST || dir == EAST) {
|
||||
float tmp = minU;
|
||||
@@ -214,15 +213,15 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
tessellator.setColorOpaque_F(cm, cm, cm);
|
||||
}
|
||||
if (rotateTopBottom) {
|
||||
addVecWithUV(verts[6], maxU, maxV);
|
||||
addVecWithUV(verts[2], minU, maxV);
|
||||
addVecWithUV(verts[3], minU, minV);
|
||||
addVecWithUV(verts[7], maxU, minV);
|
||||
cr.addVecWithUV(cr.verts[6], maxU, maxV);
|
||||
cr.addVecWithUV(cr.verts[2], minU, maxV);
|
||||
cr.addVecWithUV(cr.verts[3], minU, minV);
|
||||
cr.addVecWithUV(cr.verts[7], maxU, minV);
|
||||
} else {
|
||||
addVecWithUV(verts[6], minU, minV);
|
||||
addVecWithUV(verts[2], minU, maxV);
|
||||
addVecWithUV(verts[3], maxU, maxV);
|
||||
addVecWithUV(verts[7], maxU, minV);
|
||||
cr.addVecWithUV(cr.verts[6], minU, minV);
|
||||
cr.addVecWithUV(cr.verts[2], minU, maxV);
|
||||
cr.addVecWithUV(cr.verts[3], maxU, maxV);
|
||||
cr.addVecWithUV(cr.verts[7], maxU, minV);
|
||||
}
|
||||
|
||||
tessellator.setNormal(0, -1, 0);
|
||||
@@ -231,15 +230,15 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
tessellator.setColorOpaque_F(cm, cm, cm);
|
||||
}
|
||||
if (rotateTopBottom) {
|
||||
addVecWithUV(verts[0], minU, minV);
|
||||
addVecWithUV(verts[1], minU, maxV);
|
||||
addVecWithUV(verts[5], maxU, maxV);
|
||||
addVecWithUV(verts[4], maxU, minV);
|
||||
cr.addVecWithUV(cr.verts[0], minU, minV);
|
||||
cr.addVecWithUV(cr.verts[1], minU, maxV);
|
||||
cr.addVecWithUV(cr.verts[5], maxU, maxV);
|
||||
cr.addVecWithUV(cr.verts[4], maxU, minV);
|
||||
} else {
|
||||
addVecWithUV(verts[0], maxU, maxV);
|
||||
addVecWithUV(verts[1], minU, maxV);
|
||||
addVecWithUV(verts[5], minU, minV);
|
||||
addVecWithUV(verts[4], maxU, minV);
|
||||
cr.addVecWithUV(cr.verts[0], maxU, maxV);
|
||||
cr.addVecWithUV(cr.verts[1], minU, maxV);
|
||||
cr.addVecWithUV(cr.verts[5], minU, minV);
|
||||
cr.addVecWithUV(cr.verts[4], maxU, minV);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,15 +250,15 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
tessellator.setColorOpaque_F(cm, cm, cm);
|
||||
}
|
||||
if (rotateSides) {
|
||||
addVecWithUV(verts[2], minU, maxV);
|
||||
addVecWithUV(verts[6], minU, minV);
|
||||
addVecWithUV(verts[5], maxU, minV);
|
||||
addVecWithUV(verts[1], maxU, maxV);
|
||||
cr.addVecWithUV(cr.verts[2], minU, maxV);
|
||||
cr.addVecWithUV(cr.verts[6], minU, minV);
|
||||
cr.addVecWithUV(cr.verts[5], maxU, minV);
|
||||
cr.addVecWithUV(cr.verts[1], maxU, maxV);
|
||||
} else {
|
||||
addVecWithUV(verts[2], minU, maxV);
|
||||
addVecWithUV(verts[6], maxU, maxV);
|
||||
addVecWithUV(verts[5], maxU, minV);
|
||||
addVecWithUV(verts[1], minU, minV);
|
||||
cr.addVecWithUV(cr.verts[2], minU, maxV);
|
||||
cr.addVecWithUV(cr.verts[6], maxU, maxV);
|
||||
cr.addVecWithUV(cr.verts[5], maxU, minV);
|
||||
cr.addVecWithUV(cr.verts[1], minU, minV);
|
||||
}
|
||||
|
||||
tessellator.setNormal(-1, 0, 0);
|
||||
@@ -268,15 +267,15 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
tessellator.setColorOpaque_F(cm, cm, cm);
|
||||
}
|
||||
if (rotateSides) {
|
||||
addVecWithUV(verts[0], maxU, maxV);
|
||||
addVecWithUV(verts[4], maxU, minV);
|
||||
addVecWithUV(verts[7], minU, minV);
|
||||
addVecWithUV(verts[3], minU, maxV);
|
||||
cr.addVecWithUV(cr.verts[0], maxU, maxV);
|
||||
cr.addVecWithUV(cr.verts[4], maxU, minV);
|
||||
cr.addVecWithUV(cr.verts[7], minU, minV);
|
||||
cr.addVecWithUV(cr.verts[3], minU, maxV);
|
||||
} else {
|
||||
addVecWithUV(verts[0], minU, minV);
|
||||
addVecWithUV(verts[4], maxU, minV);
|
||||
addVecWithUV(verts[7], maxU, maxV);
|
||||
addVecWithUV(verts[3], minU, maxV);
|
||||
cr.addVecWithUV(cr.verts[0], minU, minV);
|
||||
cr.addVecWithUV(cr.verts[4], maxU, minV);
|
||||
cr.addVecWithUV(cr.verts[7], maxU, maxV);
|
||||
cr.addVecWithUV(cr.verts[3], minU, maxV);
|
||||
}
|
||||
}
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
@@ -286,7 +285,7 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
float xs = dir.offsetX == 0 ? transmissionScaleFactor : 1;
|
||||
float ys = dir.offsetY == 0 ? transmissionScaleFactor : 1;
|
||||
float zs = dir.offsetZ == 0 ? transmissionScaleFactor : 1;
|
||||
setupVertices(bound.scale(xs, ys, zs));
|
||||
CubeRenderer.get().setupVertices(bound.scale(xs, ys, zs));
|
||||
}
|
||||
|
||||
// TODO: This is a really hacky, imprecise and slow way to do this
|
||||
@@ -345,8 +344,4 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
return new BoundingBox[] { bb };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -62,8 +62,9 @@ public class ItemConduitRenderer implements IItemRenderer {
|
||||
}
|
||||
|
||||
private void renderToInventory(ItemStack item, RenderBlocks renderBlocks) {
|
||||
Tessellator.instance.startDrawingQuads();
|
||||
CubeRenderer.render(bb, item.getItem().getIconFromDamage(item.getItemDamage()));
|
||||
Tessellator.instance.draw();
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
CubeRenderer.get().render(bb, item.getItem().getIconFromDamage(item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,6 @@ public final class Config {
|
||||
public static final Section sectionMobConfig = new Section("Mob Config", "mobconfig");
|
||||
public static final Section sectionRailConfig = new Section("Rail", "railconfig");
|
||||
public static final Section sectionEnchantments = new Section("Enchantments", "enchantments");
|
||||
public static final Section sectionWeather = new Section("Weather", "weather");
|
||||
public static final Section sectionTelepad = new Section("Telepad", "telepad");
|
||||
public static final Section sectionInventoryPanel = new Section("InventoryPanel", "inventorypanel");
|
||||
public static final Section sectionMisc = new Section("Misc", "misc");
|
||||
@@ -154,13 +153,17 @@ public final class Config {
|
||||
public static int travelStaffBlinkPauseTicks = 10;
|
||||
|
||||
public static boolean travelStaffEnabled = true;
|
||||
public static boolean travelStaffAllowInBaublesSlot = true;
|
||||
public static boolean travelStaffKeybindEnabled = true;
|
||||
public static boolean travelStaffBlinkEnabled = true;
|
||||
public static boolean travelStaffBlinkThroughSolidBlocksEnabled = true;
|
||||
public static boolean travelStaffBlinkThroughClearBlocksEnabled = true;
|
||||
public static boolean travelStaffBlinkThroughUnbreakableBlocksEnabled = false;
|
||||
public static String[] travelStaffBlinkBlackList = new String[] { "minecraft:bedrock", "Thaumcraft:blockWarded" };
|
||||
public static String travelStaffBaublesType = "UNIVERSAL";
|
||||
public static float travelAnchorZoomScale = 0.2f;
|
||||
public static boolean travelStaffSearchOptimize = true;
|
||||
public static boolean validateTravelEventServerside = true;
|
||||
|
||||
/** The max distance for travelling to a Travel Anchor. */
|
||||
public static int teleportStaffMaxDistance = 2048;
|
||||
@@ -171,6 +174,34 @@ public final class Config {
|
||||
*/
|
||||
public static int teleportStaffFailedBlinkDistance = 64;
|
||||
|
||||
/**
|
||||
* Sets the teleport staff right-click action.
|
||||
*
|
||||
* <p>
|
||||
* Values:
|
||||
* <ul>
|
||||
* <li><b>0:</b> Do nothing
|
||||
* <li><b>1:</b> Teleport to look
|
||||
* <li><b>2:</b> Teleport to anchor
|
||||
* <li><b>3:</b> Teleport to anchor, or to look if no anchor <em>(default)</em>
|
||||
* </ul>
|
||||
*/
|
||||
public static int teleportStaffAction = 3;
|
||||
|
||||
/**
|
||||
* Sets the teleport staff sneak right-click action.
|
||||
*
|
||||
* <p>
|
||||
* Values:
|
||||
* <ul>
|
||||
* <li><b>0:</b> Do nothing
|
||||
* <li><b>1:</b> Teleport to look <em>(default)</em>
|
||||
* <li><b>2:</b> Teleport to anchor
|
||||
* <li><b>3:</b> Teleport to anchor, or to look if no anchor
|
||||
* </ul>
|
||||
*/
|
||||
public static int teleportStaffSneakAction = 1;
|
||||
|
||||
public static int enderIoRange = 8;
|
||||
public static boolean enderIoMeAccessEnabled = true;
|
||||
|
||||
@@ -253,6 +284,8 @@ public final class Config {
|
||||
|
||||
public static int darkSteelApiaristArmorCost = 10;
|
||||
|
||||
public static int darkSteelTrackmanGogglesCost = 10;
|
||||
|
||||
public static int darkSteelSwimCost = 10;
|
||||
|
||||
public static int darkSteelNightVisionCost = 10;
|
||||
@@ -357,6 +390,8 @@ public final class Config {
|
||||
"TwilightForest:item.steeleafHoe", "TwilightForest:item.ironwoodHoe", "IC2:itemToolBronzeHoe" };
|
||||
public static List<ItemStack> farmHoes = new ArrayList<ItemStack>();
|
||||
public static int farmSaplingReserveAmount = 8;
|
||||
public static double farmParticlesMaxRange = 64;
|
||||
public static int farmParticlesCount = 15;
|
||||
|
||||
public static int magnetPowerUsePerSecondRF = 1;
|
||||
public static int magnetPowerCapacityRF = 100000;
|
||||
@@ -441,7 +476,6 @@ public final class Config {
|
||||
|
||||
public static boolean isGasConduitEnabled = true;
|
||||
public static boolean enableMEConduits = true;
|
||||
public static boolean enableMEUltraDenseConduits = false;
|
||||
public static boolean enableOCConduits = true;
|
||||
public static boolean enableOCConduitsAnimatedTexture = true;
|
||||
|
||||
@@ -509,10 +543,6 @@ public final class Config {
|
||||
public static boolean spawnGuardStopAllSlimesDebug = false;
|
||||
public static boolean spawnGuardStopAllSquidSpawning = false;
|
||||
|
||||
public static int weatherObeliskClearFluid = 2000;
|
||||
public static int weatherObeliskRainFluid = 500;
|
||||
public static int weatherObeliskThunderFluid = 1000;
|
||||
|
||||
// Loot Defaults
|
||||
public static boolean lootDarkSteel = true;
|
||||
public static boolean lootItemConduitProbe = true;
|
||||
@@ -565,6 +595,8 @@ public final class Config {
|
||||
|
||||
public static boolean strictTPItemChecking = true;
|
||||
|
||||
public static float fusedQuartzExplosionResistance = 2000.0f;
|
||||
|
||||
public static void load(FMLPreInitializationEvent event) {
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketConfigSync.class, PacketConfigSync.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
@@ -1165,6 +1197,19 @@ public final class Config {
|
||||
"travelStaffEnabled",
|
||||
travelAnchorEnabled,
|
||||
"If set to false: the travel staff will not be craftable.").getBoolean(travelStaffEnabled);
|
||||
travelStaffAllowInBaublesSlot = config
|
||||
.get(
|
||||
sectionStaff.name,
|
||||
"travelStaffAllowInBaublesSlot",
|
||||
travelStaffAllowInBaublesSlot,
|
||||
"If true the travel staff can be put into Baubles slots (requires Baubles to be installed)")
|
||||
.getBoolean(travelStaffAllowInBaublesSlot);
|
||||
travelStaffKeybindEnabled = config.get(
|
||||
sectionStaff.name,
|
||||
"travelStaffKeybindEnabled",
|
||||
travelStaffKeybindEnabled,
|
||||
"If set to false: the Travel Staff Blink keybind will not be useable. (keybind allows when staff is anywhere in inventory, might not be wanted)")
|
||||
.getBoolean(travelStaffKeybindEnabled);
|
||||
travelStaffBlinkEnabled = config
|
||||
.get(
|
||||
sectionStaff.name,
|
||||
@@ -1198,6 +1243,13 @@ public final class Config {
|
||||
sectionStaff.name,
|
||||
travelStaffBlinkBlackList,
|
||||
"Lists the blocks that cannot be teleported through in the form 'modID:blockName'");
|
||||
travelStaffBaublesType = config.get(
|
||||
sectionStaff.name,
|
||||
"travelStaffBaublesType",
|
||||
travelStaffBaublesType,
|
||||
"The BaublesType the Travel Staff should be, 'AMULET', 'RING', 'BELT', or 'UNIVERSAL' (requires Baubles to be installed and travelStaffAllowInBaublesSlot to be on)")
|
||||
.getString();
|
||||
|
||||
travelAnchorZoomScale = config.getFloat(
|
||||
"travelAnchorZoomScale",
|
||||
sectionStaff.name,
|
||||
@@ -1214,6 +1266,13 @@ public final class Config {
|
||||
+ "This config is experimental, so if you encounter any strange behavior, please report to GTNH developer.")
|
||||
.getBoolean(travelStaffSearchOptimize);
|
||||
|
||||
validateTravelEventServerside = config.get(
|
||||
sectionStaff.name,
|
||||
"validateTravelEventServerside",
|
||||
validateTravelEventServerside,
|
||||
"If set to true: Server will validate if player actually can teleport. False will allow hacking, but also allows Staff of Traveling Keybind mod to work.")
|
||||
.getBoolean(validateTravelEventServerside);
|
||||
|
||||
teleportStaffMaxDistance = config
|
||||
.get(
|
||||
sectionStaff.name,
|
||||
@@ -1238,6 +1297,27 @@ public final class Config {
|
||||
"Number of blocks teleported when no block is being looked at.")
|
||||
.getInt(teleportStaffFailedBlinkDistance);
|
||||
|
||||
teleportStaffAction = config.get(
|
||||
sectionStaff.name,
|
||||
"teleportStaffAction",
|
||||
teleportStaffAction,
|
||||
"Sets the action for right-click with the staff of teleportation. Values:\n" + " 0: Do nothing\n"
|
||||
+ " 1: Teleport to look\n"
|
||||
+ " 2: Teleport to anchor\n"
|
||||
+ " 3: Teleport to anchor, or look if no anchor (default)")
|
||||
.getInt(teleportStaffAction);
|
||||
|
||||
teleportStaffSneakAction = config.get(
|
||||
sectionStaff.name,
|
||||
"teleportStaffSneakAction",
|
||||
teleportStaffSneakAction,
|
||||
"Sets the action for sneak right-click with the staff of teleportation. Values:\n"
|
||||
+ " 0: Do nothing\n"
|
||||
+ " 1: Teleport to look (default)\n"
|
||||
+ " 2: Teleport to anchor\n"
|
||||
+ " 3: Teleport to anchor, or look if no anchor")
|
||||
.getInt(teleportStaffSneakAction);
|
||||
|
||||
enderIoRange = config.get(
|
||||
sectionEfficiency.name,
|
||||
"enderIoRange",
|
||||
@@ -1528,6 +1608,14 @@ public final class Config {
|
||||
darkSteelApiaristArmorCost,
|
||||
"Number of levels required for the Apiarist Armor upgrade.").getInt(darkSteelApiaristArmorCost);
|
||||
|
||||
darkSteelTrackmanGogglesCost = config
|
||||
.get(
|
||||
sectionDarkSteel.name,
|
||||
"darkSteelTrackmanGogglesCost",
|
||||
darkSteelTrackmanGogglesCost,
|
||||
"Number of levels required for the Trackman's Goggles upgrade.")
|
||||
.getInt(darkSteelTrackmanGogglesCost);
|
||||
|
||||
darkSteelTravelCost = config.get(
|
||||
sectionDarkSteel.name,
|
||||
"darkSteelTravelCost",
|
||||
@@ -2029,6 +2117,18 @@ public final class Config {
|
||||
+ "always shear all leaves.")
|
||||
.getInt(farmSaplingReserveAmount);
|
||||
|
||||
farmParticlesMaxRange = config.get(
|
||||
sectionFarm.name,
|
||||
"farmParticlesMaxRange",
|
||||
farmParticlesMaxRange,
|
||||
"The max range of the farm action particles.").getDouble(farmParticlesMaxRange);
|
||||
|
||||
farmParticlesCount = config.get(
|
||||
sectionFarm.name,
|
||||
"farmParticlesCount",
|
||||
farmParticlesCount,
|
||||
"The number of particles produces by farm action.").getInt(farmParticlesCount);
|
||||
|
||||
combustionGeneratorUseOpaqueModel = config
|
||||
.get(
|
||||
sectionAesthetic.name,
|
||||
@@ -2083,7 +2183,7 @@ public final class Config {
|
||||
sectionMagnet.name,
|
||||
"magnetAllowDeactivatedInBaublesSlot",
|
||||
magnetAllowDeactivatedInBaublesSlot,
|
||||
"If true the magnet can be put into the 'amulet' Baubles slot even if switched off (requires Baubles to be installed and magnetAllowInBaublesSlot to be on)")
|
||||
"If true the magnet can be put into a Baubles slot even if switched off (requires Baubles to be installed and magnetAllowInBaublesSlot to be on)")
|
||||
.getBoolean(magnetAllowDeactivatedInBaublesSlot);
|
||||
|
||||
magnetAllowPowerExtraction = config.get(
|
||||
@@ -2096,7 +2196,7 @@ public final class Config {
|
||||
sectionMagnet.name,
|
||||
"magnetBaublesType",
|
||||
magnetBaublesType,
|
||||
"The BaublesType the magnet should be, 'AMULET', 'RING' or 'BELT' (requires Baubles to be installed and magnetAllowInBaublesSlot to be on)")
|
||||
"The BaublesType the magnet should be, 'AMULET', 'RING', 'BELT', or UNIVERSAL (requires Baubles to be installed and magnetAllowInBaublesSlot to be on)")
|
||||
.getString();
|
||||
|
||||
useCombustionGenModel = config
|
||||
@@ -2321,11 +2421,6 @@ public final class Config {
|
||||
sectionItems.name,
|
||||
enableMEConduits,
|
||||
"Allows ME conduits. Only has an effect with AE2 installed.");
|
||||
enableMEUltraDenseConduits = config.getBoolean(
|
||||
"enableMEUltraDenseConduits",
|
||||
sectionItems.name,
|
||||
enableMEUltraDenseConduits,
|
||||
"Allows ME Ultra Dense conduits. Only has an effect with AE2 installed.");
|
||||
enableOCConduits = config.getBoolean(
|
||||
"enableOCConduits",
|
||||
sectionItems.name,
|
||||
@@ -2648,22 +2743,6 @@ public final class Config {
|
||||
spawnGuardStopAllSquidSpawning,
|
||||
"When true no squid will be spawned.");
|
||||
|
||||
weatherObeliskClearFluid = config.get(
|
||||
sectionWeather.name,
|
||||
"weatherObeliskClearFluid",
|
||||
weatherObeliskClearFluid,
|
||||
"The fluid required (in mB) to set the world to clear weather").getInt();
|
||||
weatherObeliskRainFluid = config.get(
|
||||
sectionWeather.name,
|
||||
"weatherObeliskRainFluid",
|
||||
weatherObeliskRainFluid,
|
||||
"The fluid required (in mB) to set the world to rainy weather").getInt();
|
||||
weatherObeliskThunderFluid = config.get(
|
||||
sectionWeather.name,
|
||||
"weatherObeliskThunderFluid",
|
||||
weatherObeliskThunderFluid,
|
||||
"The fluid required (in mB) to set the world to thundering weather").getInt();
|
||||
|
||||
// Loot Config
|
||||
lootDarkSteel = config.getBoolean(
|
||||
"lootDarkSteel",
|
||||
@@ -2892,6 +2971,13 @@ public final class Config {
|
||||
strictTPItemChecking,
|
||||
"If true, turn on strict checking of item energy checking. This might cause traveling tools from third party mods to fire fake security warnings on server side and not function correctly.")
|
||||
.getBoolean(strictTPItemChecking);
|
||||
fusedQuartzExplosionResistance = config.getFloat(
|
||||
"fusedQuartzExplosionResistance",
|
||||
sectionMisc.name,
|
||||
fusedQuartzExplosionResistance,
|
||||
0.0f,
|
||||
Float.MAX_VALUE,
|
||||
"How blast resistant the three Fused Quartz blocks should be.");
|
||||
}
|
||||
|
||||
public static void checkYetaAccess() {
|
||||
|
||||
@@ -27,6 +27,7 @@ public class PacketConfigSync implements IMessage, IMessageHandler<PacketConfigS
|
||||
buf.writeInt(Config.teleportStaffFailedBlinkDistance);
|
||||
buf.writeBoolean(Config.telepadLockCoords);
|
||||
buf.writeBoolean(Config.telepadLockDimension);
|
||||
buf.writeBoolean(Config.travelStaffKeybindEnabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,6 +47,7 @@ public class PacketConfigSync implements IMessage, IMessageHandler<PacketConfigS
|
||||
Config.teleportStaffFailedBlinkDistance = data.readInt();
|
||||
Config.telepadLockCoords = data.readBoolean();
|
||||
Config.telepadLockDimension = data.readBoolean();
|
||||
Config.travelStaffKeybindEnabled = data.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package crazypants.enderio.enderface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerWrapper extends net.minecraft.inventory.Container {
|
||||
|
||||
@@ -28,9 +31,8 @@ public class ContainerWrapper extends net.minecraft.inventory.Container {
|
||||
return wrapped.getSlot(arg0);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public java.util.List getInventory() {
|
||||
public List<ItemStack> getInventory() {
|
||||
return wrapped.getInventory();
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class EnderIoRenderer extends TileEntitySpecialRenderer implements IItemR
|
||||
}
|
||||
|
||||
public void render(double x, double y, double z, Matrix4d lookMat, int brightness) {
|
||||
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
|
||||
|
||||
@@ -111,8 +111,8 @@ public class EnderIoRenderer extends TileEntitySpecialRenderer implements IItemR
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
RenderUtil.bindBlockTexture();
|
||||
Tessellator.instance.startDrawingQuads();
|
||||
Tessellator.instance.setBrightness(brightness);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setBrightness(brightness);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -120,8 +120,8 @@ public class EnderIoRenderer extends TileEntitySpecialRenderer implements IItemR
|
||||
GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
|
||||
GL11.glPolygonOffset(-1.0f, -1.0f);
|
||||
|
||||
CubeRenderer.render(BoundingBox.UNIT_CUBE, EnderIO.blockEnderIo.frameIcon);
|
||||
Tessellator.instance.draw();
|
||||
CubeRenderer.get().render(BoundingBox.UNIT_CUBE, EnderIO.blockEnderIo.frameIcon);
|
||||
tessellator.draw();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
|
||||
|
||||
@@ -214,7 +214,7 @@ public class GuiEnderface extends GuiScreen {
|
||||
|
||||
if (hit != null) {
|
||||
Block block = world.getBlock(hit.blockX, hit.blockY, hit.blockZ);
|
||||
if (block == EnderIO.blockHyperCube || block == EnderIO.blockCapacitorBank) {
|
||||
if (block == EnderIO.blockHyperCube) {
|
||||
block.onBlockActivated(world, hit.blockX, hit.blockY, hit.blockZ, player, 0, 0, 0, 0);
|
||||
} else {
|
||||
openInterface(hit.blockX, hit.blockY, hit.blockZ, hit.sideHit, hit.hitVec);
|
||||
@@ -538,34 +538,13 @@ public class GuiEnderface extends GuiScreen {
|
||||
int h = gh;
|
||||
int left = guiLeft;
|
||||
int top = guiTop;
|
||||
int cx = left + w / 2;
|
||||
int cy = top + h / 2;
|
||||
|
||||
// black outline
|
||||
drawRect(left, top, left + w, top + h, 0xFF000000);
|
||||
left += 1;
|
||||
top += 1;
|
||||
w -= 2;
|
||||
h -= 2;
|
||||
|
||||
// border
|
||||
int topH = 0xFFFFFFFF;
|
||||
int botH = 0xFF555555;
|
||||
int rightH = 0xFF555555;
|
||||
int leftH = 0xFFFFFFFF;
|
||||
if (animateInX) {
|
||||
leftH = 0xFF555555;
|
||||
rightH = 0xFFFFFFFF;
|
||||
}
|
||||
if (animateInY) {
|
||||
topH = 0xFF555555;
|
||||
botH = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
left += 1;
|
||||
top += 1;
|
||||
w -= 2;
|
||||
h -= 2;
|
||||
left += 2;
|
||||
top += 2;
|
||||
w -= 4;
|
||||
h -= 4;
|
||||
drawRect(left, top, left + w, top + h, 0xFF00331C);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.machine.generator.stirling.StirlingGeneratorContainer;
|
||||
import crazypants.enderio.machine.generator.stirling.TileEntityStirlingGenerator;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class TooltipHandlerBurnTime implements ITooltipCallback {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.fluid.FluidFuelRegister;
|
||||
import crazypants.enderio.fluid.IFluidCoolant;
|
||||
import crazypants.enderio.fluid.IFluidFuel;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class TooltipHandlerFluid implements ITooltipCallback {
|
||||
|
||||
|
||||
@@ -97,7 +97,6 @@ public class ItemConduitProbe extends Item implements IResourceTooltipProvider,
|
||||
if (!(te instanceof IConduitBundle)) {
|
||||
return false;
|
||||
}
|
||||
IConduitBundle cb = (IConduitBundle) te;
|
||||
if (itemStack.getItemDamage() == 0) {
|
||||
if (PacketConduitProbe.canCreatePacket(world, x, y, z)) {
|
||||
if (world.isRemote) {
|
||||
|
||||
@@ -133,9 +133,8 @@ public class ItemEnderFood extends ItemFood implements IResourceTooltipProvider
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (EnderFood f : EnderFood.VALUES) {
|
||||
list.add(f.getStack());
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.util.BaublesUtil;
|
||||
|
||||
@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles|API")
|
||||
@@ -96,7 +96,7 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
setFull(is);
|
||||
par3List.add(is);
|
||||
@@ -108,7 +108,7 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List<String> list, boolean par4) {
|
||||
super.addInformation(itemStack, par2EntityPlayer, list, par4);
|
||||
String str = PowerDisplayUtil.formatPower(getEnergyStored(itemStack)) + "/"
|
||||
+ PowerDisplayUtil.formatPower(getMaxEnergyStored(itemStack))
|
||||
@@ -206,6 +206,7 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Baubles|API")
|
||||
public void onWornTick(ItemStack itemstack, EntityLivingBase player) {
|
||||
if (player instanceof EntityPlayer && isActive(itemstack)
|
||||
&& hasPower(itemstack)
|
||||
@@ -222,17 +223,21 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Baubles|API")
|
||||
public void onEquipped(ItemStack itemstack, EntityLivingBase player) {}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Baubles|API")
|
||||
public void onUnequipped(ItemStack itemstack, EntityLivingBase player) {}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Baubles|API")
|
||||
public boolean canEquip(ItemStack itemstack, EntityLivingBase player) {
|
||||
return Config.magnetAllowInBaublesSlot && (Config.magnetAllowDeactivatedInBaublesSlot || isActive(itemstack));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Baubles|API")
|
||||
public boolean canUnequip(ItemStack itemstack, EntityLivingBase player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
package crazypants.enderio.item;
|
||||
|
||||
import static crazypants.enderio.material.Alloy.*;
|
||||
import static crazypants.enderio.material.Alloy.CONDUCTIVE_IRON;
|
||||
import static crazypants.enderio.material.Alloy.DARK_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ELECTRICAL_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.END_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY;
|
||||
import static crazypants.enderio.material.Alloy.SOULARIUM;
|
||||
import static crazypants.enderio.material.Material.VIBRANT_CYSTAL;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.STELLAR_ALLOY;
|
||||
import static crazypants.util.RecipeUtil.addShaped;
|
||||
|
||||
@@ -367,7 +367,8 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
if (par1ItemStack != null) {
|
||||
String mobName = getMobTypeFromStack(par1ItemStack);
|
||||
if (mobName != null) {
|
||||
|
||||
@@ -190,18 +190,14 @@ public class ItemYetaWrench extends Item
|
||||
}
|
||||
|
||||
/* IAdvancedTooltipProvider */
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
ArrayList<String> tmp = new ArrayList<String>();
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(tmp, getUnlocalizedName());
|
||||
String keyName = Keyboard.getKeyName(KeyTracker.instance.getYetaWrenchMode().getKeyCode());
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
@@ -17,21 +18,26 @@ import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.api.teleport.IItemOfTravel;
|
||||
import crazypants.enderio.api.tool.IConduitControl;
|
||||
import crazypants.enderio.conduit.ConduitDisplayMode;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.PacketMagnetState.SlotType;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelController;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import crazypants.enderio.item.darksteel.ItemDarkSteelArmor;
|
||||
import crazypants.enderio.item.darksteel.PacketUpgradeState;
|
||||
import crazypants.enderio.item.darksteel.PacketUpgradeState.Type;
|
||||
import crazypants.enderio.item.darksteel.SoundDetector;
|
||||
import crazypants.enderio.item.darksteel.upgrade.JumpUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SoundDetectorUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpeedUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TrackmanGogglesUpgrade;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
import crazypants.enderio.thaumcraft.GogglesOfRevealingUpgrade;
|
||||
import crazypants.util.BaublesUtil;
|
||||
import mods.railcraft.api.core.items.IToolGoggles;
|
||||
|
||||
public class KeyTracker {
|
||||
|
||||
@@ -51,10 +57,16 @@ public class KeyTracker {
|
||||
|
||||
private final KeyBinding gogglesKey;
|
||||
|
||||
private final KeyBinding trackmansGogglesKey;
|
||||
|
||||
private final KeyBinding yetaWrenchMode;
|
||||
|
||||
private final KeyBinding magnetKey;
|
||||
|
||||
private final KeyBinding staffOfTravelingTPKey;
|
||||
|
||||
private static long lastBlinkTick = -1;
|
||||
|
||||
public KeyTracker() {
|
||||
glideKey = new KeyBinding(
|
||||
EnderIO.lang.localize("keybind.glidertoggle"),
|
||||
@@ -77,6 +89,12 @@ public class KeyTracker {
|
||||
EnderIO.lang.localize("category.darksteelarmor"));
|
||||
ClientRegistry.registerKeyBinding(gogglesKey);
|
||||
|
||||
trackmansGogglesKey = new KeyBinding(
|
||||
EnderIO.lang.localize("keybind.trackmansgoggles"),
|
||||
Keyboard.KEY_NONE,
|
||||
EnderIO.lang.localize("category.darksteelarmor"));
|
||||
ClientRegistry.registerKeyBinding(trackmansGogglesKey);
|
||||
|
||||
stepAssistKey = new KeyBinding(
|
||||
EnderIO.lang.localize("keybind.stepassist"),
|
||||
Keyboard.KEY_NONE,
|
||||
@@ -106,6 +124,12 @@ public class KeyTracker {
|
||||
Keyboard.KEY_NONE,
|
||||
EnderIO.lang.localize("category.tools"));
|
||||
ClientRegistry.registerKeyBinding(magnetKey);
|
||||
|
||||
staffOfTravelingTPKey = new KeyBinding(
|
||||
EnderIO.lang.localize("keybind.staffoftravelingtp"),
|
||||
Keyboard.KEY_NONE,
|
||||
EnderIO.lang.localize("category.tools"));
|
||||
ClientRegistry.registerKeyBinding(staffOfTravelingTPKey);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -115,10 +139,12 @@ public class KeyTracker {
|
||||
handleNightVision();
|
||||
handleYetaWrench();
|
||||
handleGoggles();
|
||||
handleTrackmanGoggles();
|
||||
handleStepAssist();
|
||||
handleSpeed();
|
||||
handleJump();
|
||||
handleMagnet();
|
||||
handleStaffOfTravelingTP();
|
||||
}
|
||||
|
||||
private void sendEnabledChatMessage(String messageBase, boolean isActive) {
|
||||
@@ -133,6 +159,38 @@ public class KeyTracker {
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketUpgradeState(type, isActive));
|
||||
}
|
||||
|
||||
private void handleStaffOfTravelingTP() {
|
||||
if (staffOfTravelingTPKey.isPressed()) {
|
||||
if (Config.travelStaffKeybindEnabled) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if (player != null) {
|
||||
ItemStack travelItem = player.getHeldItem();
|
||||
if (travelItem == null || travelItem.getItem() == null
|
||||
|| !(travelItem.getItem() instanceof IItemOfTravel)
|
||||
|| !((IItemOfTravel) travelItem.getItem()).isActive(player, travelItem)) {
|
||||
travelItem = TravelController.instance.findTravelItemInInventoryOrBaubles(player);
|
||||
}
|
||||
|
||||
if (travelItem != null && travelItem.getItem() != null) {
|
||||
long ticksSinceBlink = EnderIO.proxy.getTickCount() - lastBlinkTick;
|
||||
if (ticksSinceBlink < 0) {
|
||||
lastBlinkTick = -1;
|
||||
}
|
||||
if (ticksSinceBlink >= Config.travelStaffBlinkPauseTicks) {
|
||||
if (TravelController.instance.doBlink(travelItem, player)) {
|
||||
lastBlinkTick = EnderIO.proxy.getTickCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
TravelController.showMessage(
|
||||
Minecraft.getMinecraft().thePlayer,
|
||||
new ChatComponentTranslation("enderio.travelStaffKeybind.isDisabled"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void handleMagnet() {
|
||||
if (magnetKey.isPressed()) {
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
@@ -186,6 +244,22 @@ public class KeyTracker {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleTrackmanGoggles() {
|
||||
if (trackmansGogglesKey.isPressed()) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if (!TrackmanGogglesUpgrade.isUpgradeEquipped(player)) {
|
||||
return;
|
||||
}
|
||||
ItemStack helmet = player.getEquipmentInSlot(4);
|
||||
((ItemDarkSteelArmor) helmet.getItem()).incrementAura(helmet);
|
||||
IToolGoggles.displaySwitchMessage(
|
||||
Minecraft.getMinecraft().theWorld,
|
||||
Minecraft.getMinecraft().thePlayer,
|
||||
((ItemDarkSteelArmor) helmet.getItem()).getCurrentAura(helmet));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void handleGoggles() {
|
||||
if (gogglesKey.isPressed()) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
@@ -120,6 +120,7 @@ public class MagnetController {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<Entity> selectEntitiesWithinAABB(World world, AxisAlignedBB bb) {
|
||||
List<Entity> arraylist = null;
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.NetworkPowerManager;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork;
|
||||
import crazypants.enderio.conduit.power.PowerTracker;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.EnergyHandlerPI;
|
||||
import crazypants.enderio.power.IInternalPowerReceiver;
|
||||
import crazypants.enderio.power.IInternalPoweredTile;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketConduitProbe implements IMessage, IMessageHandler<PacketConduitProbe, IMessage> {
|
||||
|
||||
@@ -33,6 +33,7 @@ import crazypants.enderio.item.darksteel.upgrade.SoundDetectorUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpeedUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpoonUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SwimUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TrackmanGogglesUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.material.Alloy;
|
||||
import crazypants.enderio.material.endergy.AlloyEndergy;
|
||||
@@ -75,6 +76,9 @@ public class DarkSteelRecipeManager {
|
||||
upgrades.add(ApiaristArmorUpgrade.LEGS);
|
||||
upgrades.add(ApiaristArmorUpgrade.BOOTS);
|
||||
}
|
||||
if (Loader.isModLoaded("Railcraft")) {
|
||||
upgrades.add(TrackmanGogglesUpgrade.INSTANCE);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -140,8 +144,8 @@ public class DarkSteelRecipeManager {
|
||||
public static int getEnchantmentRepairCost(ItemStack itemStack) {
|
||||
// derived from ContainerRepair
|
||||
int res = 0;
|
||||
Map map1 = EnchantmentHelper.getEnchantments(itemStack);
|
||||
Iterator iter = map1.keySet().iterator();
|
||||
Map<Integer, Integer> map1 = EnchantmentHelper.getEnchantments(itemStack);
|
||||
Iterator<Integer> iter = map1.keySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
int i1 = ((Integer) iter.next()).intValue();
|
||||
Enchantment enchantment = Enchantment.enchantmentsList[i1];
|
||||
@@ -182,7 +186,8 @@ public class DarkSteelRecipeManager {
|
||||
return upgrades;
|
||||
}
|
||||
|
||||
public void addCommonTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addCommonTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list,
|
||||
boolean flag) {
|
||||
for (IDarkSteelUpgrade upgrade : upgrades) {
|
||||
if (upgrade.hasUpgrade(itemstack)) {
|
||||
upgrade.addCommonEntries(itemstack, entityplayer, list, flag);
|
||||
@@ -190,7 +195,8 @@ public class DarkSteelRecipeManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void addBasicTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list,
|
||||
boolean flag) {
|
||||
for (IDarkSteelUpgrade upgrade : upgrades) {
|
||||
if (upgrade.hasUpgrade(itemstack)) {
|
||||
upgrade.addBasicEntries(itemstack, entityplayer, list, flag);
|
||||
@@ -198,7 +204,8 @@ public class DarkSteelRecipeManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void addAdvancedTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addAdvancedTooltipEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list,
|
||||
boolean flag) {
|
||||
|
||||
List<IDarkSteelUpgrade> applyableUpgrades = new ArrayList<IDarkSteelUpgrade>();
|
||||
for (IDarkSteelUpgrade upgrade : upgrades) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
@@ -34,9 +35,13 @@ import crazypants.enderio.item.darksteel.upgrade.ApiaristArmorUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.IDarkSteelUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.NaturalistEyeUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TrackmanGogglesUpgrade;
|
||||
import crazypants.enderio.thaumcraft.GogglesOfRevealingUpgrade;
|
||||
import forestry.api.apiculture.IArmorApiarist;
|
||||
import forestry.api.core.IArmorNaturalist;
|
||||
import mods.railcraft.api.core.items.IToolGoggles;
|
||||
import mods.railcraft.common.core.RailcraftConfig;
|
||||
import mods.railcraft.common.items.ItemGoggles.GoggleAura;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
@@ -45,11 +50,12 @@ import thaumcraft.api.nodes.IRevealer;
|
||||
@InterfaceList({ @Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"),
|
||||
@Interface(iface = "thaumcraft.api.IVisDiscountGear", modid = "Thaumcraft"),
|
||||
@Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"),
|
||||
@Interface(iface = "mods.railcraft.api.core.items.IToolGoggles", modid = "Railcraft"),
|
||||
@Interface(iface = "forestry.api.apiculture.IArmorApiarist", modid = "Forestry"),
|
||||
@Interface(iface = "forestry.api.core.IArmorNaturalist", modid = "Forestry") })
|
||||
public class ItemDarkSteelArmor extends ItemArmor
|
||||
implements IEnergyContainerItem, ISpecialArmor, IAdvancedTooltipProvider, IDarkSteelItem, IGoggles, IRevealer,
|
||||
IVisDiscountGear, IArmorApiarist, IArmorNaturalist {
|
||||
IVisDiscountGear, IArmorApiarist, IArmorNaturalist, IToolGoggles {
|
||||
|
||||
public static final ArmorMaterial MATERIAL = EnumHelper
|
||||
.addArmorMaterial("darkSteel", 35, new int[] { 2, 6, 5, 2 }, 15);
|
||||
@@ -125,10 +131,9 @@ public class ItemDarkSteelArmor extends ItemArmor
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -163,17 +168,17 @@ public class ItemDarkSteelArmor extends ItemArmor
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
@@ -322,9 +327,45 @@ public class ItemDarkSteelArmor extends ItemArmor
|
||||
@Override
|
||||
@Method(modid = "Forestry")
|
||||
public boolean canSeePollination(EntityPlayer player, ItemStack armor, boolean doSee) {
|
||||
if (armor == null || DarkSteelItems.isArmorPart(armor.getItem(), 0)) {
|
||||
if (armor == null || !DarkSteelItems.isArmorPart(armor.getItem(), 0)) {
|
||||
return false;
|
||||
}
|
||||
return NaturalistEyeUpgrade.isUpgradeEquipped(player);
|
||||
}
|
||||
|
||||
// Railcraft
|
||||
|
||||
public void incrementAura(ItemStack goggles) {
|
||||
if (goggles != null && goggles.getItem() instanceof ItemDarkSteelArmor
|
||||
&& DarkSteelItems.isArmorPart(goggles.getItem(), 0)) {
|
||||
NBTTagCompound data = goggles.getTagCompound();
|
||||
if (data == null) {
|
||||
data = new NBTTagCompound();
|
||||
goggles.setTagCompound(data);
|
||||
}
|
||||
byte aura = data.getByte("aura");
|
||||
aura++;
|
||||
if (aura >= GoggleAura.VALUES.length) aura = 0;
|
||||
data.setByte("aura", aura);
|
||||
|
||||
if (this.getCurrentAura(goggles) == GoggleAura.TRACKING && !RailcraftConfig.isTrackingAuraEnabled()) {
|
||||
incrementAura(goggles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Railcraft")
|
||||
public GoggleAura getCurrentAura(ItemStack goggles) {
|
||||
if (TrackmanGogglesUpgrade.loadFromItem(goggles) != null) {
|
||||
NBTTagCompound data = goggles.getTagCompound();
|
||||
if (data != null) {
|
||||
return GoggleAura.VALUES[data.getByte("aura")];
|
||||
} else {
|
||||
return GoggleAura.NONE;
|
||||
}
|
||||
} else {
|
||||
return GoggleAura.NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -287,17 +287,17 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
@@ -328,7 +328,7 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
public int compare(BlockCoord arg0, BlockCoord arg1) {
|
||||
int d1 = refPoint.getDistSq(arg0);
|
||||
int d2 = refPoint.getDistSq(arg1);
|
||||
return compare(d1, d1);
|
||||
return compare(d1, d2);
|
||||
}
|
||||
|
||||
// NB: Copy of Integer.compare, which i sonly in Java 1.7+
|
||||
|
||||
@@ -34,7 +34,7 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpoonUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
|
||||
public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
@@ -83,7 +83,7 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -274,17 +274,17 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
@@ -163,6 +163,7 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
}
|
||||
};
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) {
|
||||
if (entity.worldObj.isRemote) {
|
||||
@@ -182,15 +183,15 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
entity.posX + Config.darkSteelShearsEntityAreaBoostWhenPowered,
|
||||
entity.posY + Config.darkSteelShearsEntityAreaBoostWhenPowered,
|
||||
entity.posZ + Config.darkSteelShearsEntityAreaBoostWhenPowered);
|
||||
List<Entity> sortedTargets = new ArrayList<Entity>(
|
||||
List<IShearable> sortedTargets = new ArrayList<>(
|
||||
entity.worldObj.selectEntitiesWithinAABB(IShearable.class, bb, selectShearable));
|
||||
entityComparator.refPoint = entity;
|
||||
Collections.sort(sortedTargets, entityComparator);
|
||||
Collections.sort((List<Entity>) (Object) sortedTargets, entityComparator);
|
||||
|
||||
boolean result = false;
|
||||
int maxSheep = Math.min(sortedTargets.size(), powerStored / Config.darkSteelShearsPowerUsePerDamagePoint);
|
||||
for (int i = 0; i < maxSheep; i++) {
|
||||
Entity entity2 = sortedTargets.get(i);
|
||||
Entity entity2 = (Entity) sortedTargets.get(i);
|
||||
if (entity2 instanceof EntityLivingBase
|
||||
&& super.itemInteractionForEntity(itemstack, player, (EntityLivingBase) entity2)) {
|
||||
result = true;
|
||||
@@ -264,17 +265,17 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addCommonTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
DarkSteelRecipeManager.instance.addBasicTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
if (!Config.addDurabilityTootip) {
|
||||
list.add(ItemUtil.getDurabilityString(itemstack));
|
||||
}
|
||||
|
||||
Loaded 100 of 330 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user