mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 17:45:08 +00:00
Compare commits
23
Commits
2.3.1.52-pre
...
2.4.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fd7ae7567 | ||
|
|
251fcc26b0 | ||
|
|
b22915cc9c | ||
|
|
0bf8d3f568 | ||
|
|
35e6667da5 | ||
|
|
73cb43a761 | ||
|
|
d32a8e88a3 | ||
|
|
447450d541 | ||
|
|
7f6a0a6a4c | ||
|
|
28df6fa938 | ||
|
|
1728809a8a | ||
|
|
0edabd4a9d | ||
|
|
b5752a8338 | ||
|
|
29b0d711f7 | ||
|
|
e41827fb69 | ||
|
|
628af062ba | ||
|
|
09661218a3 | ||
|
|
e9f9412cab | ||
|
|
378b32726b | ||
|
|
4fdfc808ad | ||
|
|
275d137ba8 | ||
|
|
8d02293e71 | ||
|
|
8612980782 |
No files matched your search
@@ -18,9 +18,5 @@ end_of_line = crlf
|
||||
[*.{dtd,json,info,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}]
|
||||
indent_size = 2
|
||||
|
||||
[*.java]
|
||||
indent_size = 2
|
||||
ij_java_space_before_if_parentheses = false
|
||||
|
||||
[*.lang]
|
||||
trim_trailing_whitespace = false
|
||||
@@ -0,0 +1,2 @@
|
||||
# Ignore spotlessApply reformat
|
||||
275d137ba8573454518c21bdcf4372362302ee82
|
||||
@@ -34,7 +34,6 @@
|
||||
*.[pP][sS][dD] binary
|
||||
*.[tT][tT][fF] binary
|
||||
*.[oO][tT][fF] binary
|
||||
*.[nN][bB][tT] binary
|
||||
|
||||
*.[pP][aA][tT][cC][hH] -text
|
||||
|
||||
|
||||
+906
-513
File diff suppressed because it is too large.
Load diff
+9
-9
@@ -1,20 +1,20 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile('com.github.GTNewHorizons:EnderCore:0.2.9:dev')
|
||||
compile('com.github.GTNewHorizons:ForestryMC:4.4.6:dev')
|
||||
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev')
|
||||
compile('com.github.GTNewHorizons:BuildCraft:7.1.27:dev')
|
||||
compile('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
|
||||
api('com.github.GTNewHorizons:EnderCore:0.2.13:dev')
|
||||
implementation('com.github.GTNewHorizons:ForestryMC:4.5.8:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.3.35-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:BuildCraft:7.1.27: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')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.5.19:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-85-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.5.23:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-168-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.14:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.13.6:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.11.13-GTNH:api') {transitive = false}
|
||||
compile('com.github.GTNewHorizons:Chisel:2.10.8-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.7.5.25-GTNH:api') {transitive = false}
|
||||
implementation('com.github.GTNewHorizons:Chisel:2.10.8-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.8.0.13-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
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,5 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -17,67 +17,101 @@
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
@@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
@@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
@@ -106,80 +140,105 @@ location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+9
-6
@@ -14,7 +14,7 @@
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@@ -25,7 +25,8 @@
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
@@ -1,26 +1,4 @@
|
||||
// Add any additional repositories for your dependencies here
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name 'GTNH Maven'
|
||||
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
|
||||
allowInsecureProtocol
|
||||
}
|
||||
maven {
|
||||
name 'ic2'
|
||||
url 'http://maven.ic2.player.to/'
|
||||
metadataSources {
|
||||
mavenPom()
|
||||
artifact()
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url 'https://cursemaven.com'
|
||||
content {
|
||||
includeGroup 'curse.maven'
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url = 'https://jitpack.io'
|
||||
}
|
||||
}
|
||||
+21
-3
@@ -1,10 +1,28 @@
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
// RetroFuturaGradle
|
||||
name "GTNH Maven"
|
||||
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
allowInsecureProtocol = true
|
||||
mavenContent {
|
||||
includeGroup("com.gtnewhorizons.retrofuturagradle")
|
||||
}
|
||||
}
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.diffplug.blowdryerSetup' version '1.6.0'
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
|
||||
}
|
||||
|
||||
apply plugin: 'com.diffplug.blowdryerSetup'
|
||||
|
||||
blowdryerSetup {
|
||||
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.1.4')
|
||||
repoSubfolder 'gtnhShared'
|
||||
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
|
||||
//devLocal '.' // Use this when testing config updates locally
|
||||
}
|
||||
@@ -1,15 +1,17 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
import com.enderio.core.common.BlockEnder;
|
||||
import crazypants.enderio.api.tool.ITool;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.BlockEnder;
|
||||
|
||||
import crazypants.enderio.api.tool.ITool;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
|
||||
public abstract class BlockEio extends BlockEnder {
|
||||
|
||||
protected BlockEio(String name, Class<? extends TileEntityEio> teClass) {
|
||||
@@ -23,8 +25,8 @@ public abstract class BlockEio extends BlockEnder {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float par7,
|
||||
float par8, float par9) {
|
||||
|
||||
if (shouldWrench(world, x, y, z, entityPlayer, side)
|
||||
&& ToolUtil.breakBlockWithTool(this, world, x, y, z, entityPlayer)) {
|
||||
@@ -33,8 +35,7 @@ public abstract class BlockEio extends BlockEnder {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
ITool tool = ToolUtil.getEquippedTool(entityPlayer);
|
||||
if (tool != null
|
||||
&& !entityPlayer.isSneaking()
|
||||
if (tool != null && !entityPlayer.isSneaking()
|
||||
&& tool.canUse(entityPlayer.getCurrentEquippedItem(), entityPlayer, x, y, z)) {
|
||||
if (te instanceof AbstractMachineEntity) {
|
||||
((AbstractMachineEntity) te).toggleIoModeForFace(ForgeDirection.getOrientation(side));
|
||||
|
||||
@@ -1,7 +1,26 @@
|
||||
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;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import com.enderio.core.client.handlers.SpecialTooltipHandler;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
@@ -132,22 +151,6 @@ import crazypants.enderio.teleport.telepad.TelePadRenderer;
|
||||
import crazypants.enderio.teleport.telepad.TelePadSpecialRenderer;
|
||||
import crazypants.enderio.teleport.telepad.TeleportEntityRenderHandler;
|
||||
import crazypants.enderio.teleport.telepad.TileTelePad;
|
||||
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;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ClientProxy extends CommonProxy {
|
||||
@@ -280,7 +283,8 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerBlockHandler(defaultObeliskRenderer);
|
||||
|
||||
ObeliskSpecialRenderer<TileAttractor> attRen = new ObeliskSpecialRenderer<TileAttractor>(
|
||||
new ItemStack(EnderIO.itemMaterial, 1, Material.ATTRACTOR_CRYSTAL.ordinal()), defaultObeliskRenderer);
|
||||
new ItemStack(EnderIO.itemMaterial, 1, Material.ATTRACTOR_CRYSTAL.ordinal()),
|
||||
defaultObeliskRenderer);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAttractor.class, attRen);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockAttractor), attRen);
|
||||
|
||||
@@ -289,18 +293,21 @@ public class ClientProxy extends CommonProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockSpawnGuard), sgr);
|
||||
|
||||
ObeliskSpecialRenderer<TileExperienceObelisk> eor = new ObeliskSpecialRenderer<TileExperienceObelisk>(
|
||||
new ItemStack(EnderIO.itemXpTransfer), defaultObeliskRenderer);
|
||||
new ItemStack(EnderIO.itemXpTransfer),
|
||||
defaultObeliskRenderer);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileExperienceObelisk.class, eor);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockExperianceOblisk), eor);
|
||||
|
||||
ObeliskSpecialRenderer<TileWeatherObelisk> twr =
|
||||
new WeatherObeliskSpecialRenderer(new ItemStack(Items.fireworks), defaultObeliskRenderer);
|
||||
ObeliskSpecialRenderer<TileWeatherObelisk> twr = new WeatherObeliskSpecialRenderer(
|
||||
new ItemStack(Items.fireworks),
|
||||
defaultObeliskRenderer);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileWeatherObelisk.class, twr);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockWeatherObelisk), twr);
|
||||
|
||||
BlockCombustionGenerator.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
TechneMachineRenderer<TileCombustionGenerator> cr = new TechneMachineRenderer<TileCombustionGenerator>(
|
||||
EnderIO.blockCombustionGenerator, "models/combustionGen");
|
||||
EnderIO.blockCombustionGenerator,
|
||||
"models/combustionGen");
|
||||
RenderingRegistry.registerBlockHandler(cr);
|
||||
|
||||
ZombieGeneratorRenderer zgr = new ZombieGeneratorRenderer();
|
||||
@@ -369,8 +376,8 @@ public class ClientProxy extends CommonProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockTravelPlatform), pir);
|
||||
|
||||
BlockPaintedGlowstone.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(
|
||||
new PaintedBlockRenderer(BlockPaintedGlowstone.renderId, Blocks.glowstone));
|
||||
RenderingRegistry
|
||||
.registerBlockHandler(new PaintedBlockRenderer(BlockPaintedGlowstone.renderId, Blocks.glowstone));
|
||||
|
||||
BlockTravelAnchor.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(
|
||||
@@ -414,8 +421,8 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEnderIO.class, eior);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockEnderIo), eior);
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(
|
||||
TileReservoir.class, new ReservoirRenderer(EnderIO.blockReservoir));
|
||||
ClientRegistry
|
||||
.bindTileEntitySpecialRenderer(TileReservoir.class, new ReservoirRenderer(EnderIO.blockReservoir));
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTank.class, new TankFluidRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockTank), new TankItemRenderer());
|
||||
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
@@ -7,12 +15,6 @@ import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import java.text.DecimalFormat;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
|
||||
@@ -4,9 +4,27 @@ 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;
|
||||
import java.io.FileWriter;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
import com.enderio.core.common.Lang;
|
||||
import com.enderio.core.common.util.EntityUtil;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
@@ -162,28 +180,12 @@ import crazypants.enderio.teleport.telepad.ItemCoordSelector;
|
||||
import crazypants.enderio.thaumcraft.ThaumcraftCompat;
|
||||
import crazypants.enderio.tool.EnderIOCrashCallable;
|
||||
import crazypants.util.EE3Util;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
@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",
|
||||
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")
|
||||
public class EnderIO {
|
||||
|
||||
@@ -204,6 +206,8 @@ public class EnderIO {
|
||||
|
||||
public static final Lang lang = new Lang("enderio");
|
||||
|
||||
public static final boolean hasLwjgl3 = Loader.isModLoaded("lwjgl3ify");
|
||||
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
public static ItemAlloy itemAlloy;
|
||||
@@ -518,11 +522,14 @@ public class EnderIO {
|
||||
Fluid f = new Fluid(Fluids.NUTRIENT_DISTILLATION).setDensity(1500).setViscosity(3000);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidNutrientDistillation = FluidRegistry.getFluid(f.getName());
|
||||
blockNutrientDistillation =
|
||||
BlockFluidEio.NutrientDistillation.create(fluidNutrientDistillation, Material.water);
|
||||
blockNutrientDistillation = BlockFluidEio.NutrientDistillation
|
||||
.create(fluidNutrientDistillation, Material.water);
|
||||
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketNutrientTank.class, PacketNutrientTank.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
PacketNutrientTank.class,
|
||||
PacketNutrientTank.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.CLIENT);
|
||||
|
||||
f = new Fluid(Fluids.HOOTCH).setDensity(900).setViscosity(1000);
|
||||
FluidRegistry.registerFluid(f);
|
||||
@@ -545,9 +552,7 @@ public class EnderIO {
|
||||
Fluids.ROCKET_FUEL + "@"
|
||||
+ (Config.rocketFuelPowerPerCycleRF / 10 * Config.rocketFuelPowerTotalBurnTime));
|
||||
|
||||
f = new Fluid(Fluids.FIRE_WATER)
|
||||
.setDensity(900)
|
||||
.setViscosity(1000)
|
||||
f = new Fluid(Fluids.FIRE_WATER).setDensity(900).setViscosity(1000)
|
||||
.setTemperature(FluidRegistry.LAVA.getTemperature() * 2);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidFireWater = FluidRegistry.getFluid(f.getName());
|
||||
@@ -571,22 +576,15 @@ public class EnderIO {
|
||||
f = new Fluid(Fluids.CLOUD_SEED_CONCENTRATED).setDensity(1000).setViscosity(1200);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidCloudSeedConcentrated = FluidRegistry.getFluid(f.getName());
|
||||
blockCloudSeedConcentrated =
|
||||
BlockFluidEio.CloudSeedConcentrated.create(fluidCloudSeedConcentrated, Material.water);
|
||||
blockCloudSeedConcentrated = BlockFluidEio.CloudSeedConcentrated
|
||||
.create(fluidCloudSeedConcentrated, Material.water);
|
||||
|
||||
f = new Fluid(Fluids.ENDER_DISTILLATION)
|
||||
.setDensity(200)
|
||||
.setViscosity(1000)
|
||||
.setTemperature(175);
|
||||
f = new Fluid(Fluids.ENDER_DISTILLATION).setDensity(200).setViscosity(1000).setTemperature(175);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidEnderDistillation = FluidRegistry.getFluid(f.getName());
|
||||
blockEnderDistillation = BlockFluidEio.create(fluidEnderDistillation, Material.water);
|
||||
|
||||
f = new Fluid(Fluids.VAPOR_OF_LEVITY)
|
||||
.setDensity(-10)
|
||||
.setViscosity(100)
|
||||
.setTemperature(5)
|
||||
.setGaseous(true);
|
||||
f = new Fluid(Fluids.VAPOR_OF_LEVITY).setDensity(-10).setViscosity(100).setTemperature(5).setGaseous(true);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidVapourOfLevity = FluidRegistry.getFluid(f.getName());
|
||||
blockVapourOfLevity = BlockFluidEio.VapourOfLevity.create(fluidVapourOfLevity, Material.water);
|
||||
@@ -594,10 +592,7 @@ public class EnderIO {
|
||||
|
||||
if (!Loader.isModLoaded("OpenBlocks")) {
|
||||
Log.info("XP Juice registered by Ender IO.");
|
||||
fluidXpJuice = new Fluid(Config.xpJuiceName)
|
||||
.setLuminosity(10)
|
||||
.setDensity(800)
|
||||
.setViscosity(1500)
|
||||
fluidXpJuice = new Fluid(Config.xpJuiceName).setLuminosity(10).setDensity(800).setViscosity(1500)
|
||||
.setUnlocalizedName("eio.xpjuice");
|
||||
FluidRegistry.registerFluid(fluidXpJuice);
|
||||
itemBucketXpJuice = ItemBucketEio.create(fluidXpJuice);
|
||||
@@ -624,16 +619,22 @@ public class EnderIO {
|
||||
instance = this;
|
||||
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketRedstoneMode.class, PacketRedstoneMode.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketRedstoneMode.class,
|
||||
PacketRedstoneMode.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandler);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
// Register Custom Dungeon Loot here
|
||||
if (Config.lootDarkSteel) {
|
||||
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST)
|
||||
.addItem(new WeightedRandomChestContent(
|
||||
new ItemStack(EnderIO.itemAlloy, 1, Alloy.DARK_STEEL.ordinal()), 1, 3, 15));
|
||||
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(
|
||||
new WeightedRandomChestContent(
|
||||
new ItemStack(EnderIO.itemAlloy, 1, Alloy.DARK_STEEL.ordinal()),
|
||||
1,
|
||||
3,
|
||||
15));
|
||||
}
|
||||
|
||||
if (Config.lootItemConduitProbe) {
|
||||
@@ -657,33 +658,48 @@ public class EnderIO {
|
||||
}
|
||||
|
||||
if (Config.lootElectricSteel) {
|
||||
ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH)
|
||||
.addItem(new WeightedRandomChestContent(
|
||||
new ItemStack(EnderIO.itemAlloy, 1, Alloy.ELECTRICAL_STEEL.ordinal()), 2, 6, 20));
|
||||
ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH).addItem(
|
||||
new WeightedRandomChestContent(
|
||||
new ItemStack(EnderIO.itemAlloy, 1, Alloy.ELECTRICAL_STEEL.ordinal()),
|
||||
2,
|
||||
6,
|
||||
20));
|
||||
}
|
||||
|
||||
if (Config.lootRedstoneAlloy) {
|
||||
ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH)
|
||||
.addItem(new WeightedRandomChestContent(
|
||||
new ItemStack(EnderIO.itemAlloy, 1, Alloy.REDSTONE_ALLOY.ordinal()), 3, 6, 35));
|
||||
ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH).addItem(
|
||||
new WeightedRandomChestContent(
|
||||
new ItemStack(EnderIO.itemAlloy, 1, Alloy.REDSTONE_ALLOY.ordinal()),
|
||||
3,
|
||||
6,
|
||||
35));
|
||||
}
|
||||
|
||||
if (Config.lootDarkSteel) {
|
||||
ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH)
|
||||
.addItem(new WeightedRandomChestContent(
|
||||
new ItemStack(EnderIO.itemAlloy, 1, Alloy.DARK_STEEL.ordinal()), 3, 6, 35));
|
||||
ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH).addItem(
|
||||
new WeightedRandomChestContent(
|
||||
new ItemStack(EnderIO.itemAlloy, 1, Alloy.DARK_STEEL.ordinal()),
|
||||
3,
|
||||
6,
|
||||
35));
|
||||
}
|
||||
|
||||
if (Config.lootPhasedIron) {
|
||||
ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH)
|
||||
.addItem(new WeightedRandomChestContent(
|
||||
new ItemStack(EnderIO.itemAlloy, 1, Alloy.PHASED_IRON.ordinal()), 1, 2, 10));
|
||||
ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH).addItem(
|
||||
new WeightedRandomChestContent(
|
||||
new ItemStack(EnderIO.itemAlloy, 1, Alloy.PHASED_IRON.ordinal()),
|
||||
1,
|
||||
2,
|
||||
10));
|
||||
}
|
||||
|
||||
if (Config.lootPhasedGold) {
|
||||
ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH)
|
||||
.addItem(new WeightedRandomChestContent(
|
||||
new ItemStack(EnderIO.itemAlloy, 1, Alloy.PHASED_GOLD.ordinal()), 1, 2, 5));
|
||||
ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH).addItem(
|
||||
new WeightedRandomChestContent(
|
||||
new ItemStack(EnderIO.itemAlloy, 1, Alloy.PHASED_GOLD.ordinal()),
|
||||
1,
|
||||
2,
|
||||
5));
|
||||
}
|
||||
|
||||
if (Config.lootTravelStaff) {
|
||||
@@ -770,8 +786,8 @@ public class EnderIO {
|
||||
|
||||
@EventHandler
|
||||
public void loadComplete(FMLLoadCompleteEvent event) {
|
||||
processImc(FMLInterModComms.fetchRuntimeMessages(
|
||||
this)); // Some mods send IMCs during PostInit, so we catch them here.
|
||||
processImc(FMLInterModComms.fetchRuntimeMessages(this)); // Some mods send IMCs during PostInit, so we catch
|
||||
// them here.
|
||||
}
|
||||
|
||||
private static String getXPJuiceName() {
|
||||
@@ -780,8 +796,7 @@ public class EnderIO {
|
||||
try {
|
||||
Field getField = Class.forName("openblocks.Config").getField("xpFluidId");
|
||||
openBlocksXPJuiceName = (String) getField.get(null);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
|
||||
if (openBlocksXPJuiceName != null && !Config.xpJuiceName.equals(openBlocksXPJuiceName)) {
|
||||
Log.info("Overwriting XP Juice name with '" + openBlocksXPJuiceName + "' taken from OpenBlocks' config");
|
||||
|
||||
@@ -2,11 +2,12 @@ package crazypants.enderio;
|
||||
|
||||
import static crazypants.enderio.EnderIO.MODID;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class EnderIOTab extends CreativeTabs {
|
||||
|
||||
public static final CreativeTabs tabEnderIO = new EnderIOTab();
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
public class GuiHandler implements IGuiHandler {
|
||||
|
||||
public static final int GUI_ID_ENDERFACE = 1;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
public enum ModObject {
|
||||
|
||||
// Enderface
|
||||
blockEnderIo,
|
||||
itemEnderface,
|
||||
|
||||
@@ -14,119 +14,103 @@ import crazypants.enderio.machine.vat.VatRecipeManager;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
|
||||
/**
|
||||
* This class provides the keys for the IMC messages supported by EIO and links
|
||||
* the the details of how the messages are processed. It is preferable not to
|
||||
* refer to these constants directly to avoid a dependence on this class.
|
||||
* This class provides the keys for the IMC messages supported by EIO and links the the details of how the messages are
|
||||
* processed. It is preferable not to refer to these constants directly to avoid a dependence on this class.
|
||||
*/
|
||||
public final class IMC {
|
||||
|
||||
/**
|
||||
* Key for a string message to add Vat recipes. Calls
|
||||
* {@link VatRecipeManager#addCustomRecipes(String)} with the string value of
|
||||
* the message.
|
||||
* Key for a string message to add Vat recipes. Calls {@link VatRecipeManager#addCustomRecipes(String)} with the
|
||||
* string value of the message.
|
||||
*/
|
||||
public static final String VAT_RECIPE = "recipe:vat";
|
||||
|
||||
/**
|
||||
* Key for a string message to add SAGMill recipes. Calls
|
||||
* {@link CrusherRecipeManager#addCustomRecipes(String)} with the string value
|
||||
* of the message.
|
||||
* Key for a string message to add SAGMill recipes. Calls {@link CrusherRecipeManager#addCustomRecipes(String)} with
|
||||
* the string value of the message.
|
||||
*/
|
||||
public static final String SAG_RECIPE = "recipe:sagmill";
|
||||
|
||||
/**
|
||||
* Key for a string message to add Alloy Smelter recipes. Calls
|
||||
* {@link AlloyRecipeManager#addCustomRecipes(String)} with the string value
|
||||
* of the message.
|
||||
* Key for a string message to add Alloy Smelter recipes. Calls {@link AlloyRecipeManager#addCustomRecipes(String)}
|
||||
* with the string value of the message.
|
||||
*/
|
||||
public static final String ALLOY_RECIPE = "recipe:alloysmelter";
|
||||
|
||||
/**
|
||||
* Key for a string message to add Enchanter recipes. Calls
|
||||
* {@link EnchanterRecipeManager#addCustomRecipes(String)} with the string
|
||||
* value of the message. The supplied xml is treated as if it was loaded from
|
||||
* Key for a string message to add Enchanter recipes. Calls {@link EnchanterRecipeManager#addCustomRecipes(String)}
|
||||
* with the string value of the message. The supplied xml is treated as if it was loaded from
|
||||
* EnchanterRecipes_User.xm.
|
||||
*/
|
||||
public static final String ENCHANTER_RECIPE = "recipe:enchanter";
|
||||
|
||||
/**
|
||||
* Key for a string message to add Slice'N'Splice recipes. Calls
|
||||
* {@link SliceAndSpliceRecipeManager#addCustomRecipes(String)} with the
|
||||
* string value of the message.
|
||||
* {@link SliceAndSpliceRecipeManager#addCustomRecipes(String)} with the string value of the message.
|
||||
*/
|
||||
public static final String SLINE_N_SPLICE_RECIPE = "recipe:slicensplice";
|
||||
|
||||
/**
|
||||
* Key for an NBT message to add Soul Binder recipes. Calls
|
||||
* {@link SoulBinderRecipeManager#addRecipeFromNBT(net.minecraft.nbt.NBTTagCompound)}
|
||||
* with the NBT value of the message.
|
||||
* {@link SoulBinderRecipeManager#addRecipeFromNBT(net.minecraft.nbt.NBTTagCompound)} with the NBT value of the
|
||||
* message.
|
||||
*/
|
||||
public static final String SOUL_BINDER_RECIPE = "recipe:soulbinder";
|
||||
|
||||
/**
|
||||
* Key for an ItemStack message to add an item to the Painters paint source
|
||||
* whitelist. Calls
|
||||
* Key for an ItemStack message to add an item to the Painters paint source whitelist. Calls
|
||||
* {@link PaintSourceValidator#addToWhitelist(net.minecraft.item.ItemStack)}
|
||||
*/
|
||||
public static final String PAINTER_WHITELIST_ADD = "painter:whitelist:add";
|
||||
|
||||
/**
|
||||
* Key for an ItemStack message to add an item to the Painters paint source
|
||||
* blacklist. Calls
|
||||
* Key for an ItemStack message to add an item to the Painters paint source blacklist. Calls
|
||||
* {@link PaintSourceValidator#addToBlacklist(net.minecraft.item.ItemStack)}
|
||||
*/
|
||||
public static final String PAINTER_BLACKLIST_ADD = "painter:blacklist:add";
|
||||
|
||||
/**
|
||||
* Key for a string message to add an entity to the Powered Spawner blacklist.
|
||||
* Calls {@link PoweredSpawnerConfig#addToBlacklist(String)} with the string
|
||||
* value of the message.
|
||||
* Key for a string message to add an entity to the Powered Spawner blacklist. Calls
|
||||
* {@link PoweredSpawnerConfig#addToBlacklist(String)} with the string value of the message.
|
||||
*/
|
||||
public static final String POWERED_SPAWNER_BLACKLIST_ADD = "poweredSpawner:blacklist:add";
|
||||
|
||||
/**
|
||||
* Key for an NBT message to specify a cost multiplier for spawning an entity
|
||||
* in the Powered Spawner. Calls
|
||||
* {@link PoweredSpawnerConfig#addEntityCostFromNBT(net.minecraft.nbt.NBTTagCompound)}
|
||||
* with the NBT value of the message.
|
||||
* Key for an NBT message to specify a cost multiplier for spawning an entity in the Powered Spawner. Calls
|
||||
* {@link PoweredSpawnerConfig#addEntityCostFromNBT(net.minecraft.nbt.NBTTagCompound)} with the NBT value of the
|
||||
* message.
|
||||
*/
|
||||
public static final String POWERED_SPAWNER_COST_MULTIPLIER = "poweredSpawner:costMultiplier";
|
||||
|
||||
/**
|
||||
* Key for a string message to add an entity to the Soul Vial blacklist. Calls
|
||||
* {@link ItemSoulVessel#addEntityToBlackList(String)} with the string value
|
||||
* of the message.
|
||||
* {@link ItemSoulVessel#addEntityToBlackList(String)} with the string value of the message.
|
||||
*/
|
||||
public static final String SOUL_VIAL_BLACKLIST = "soulVial:blacklist:add";
|
||||
|
||||
/**
|
||||
* Key for an NBT message to register a fluid fuel. Calls
|
||||
* {@link FluidFuelRegister#addFuel(net.minecraft.nbt.NBTTagCompound)} with
|
||||
* the NBT value of the message.
|
||||
* {@link FluidFuelRegister#addFuel(net.minecraft.nbt.NBTTagCompound)} with the NBT value of the message.
|
||||
*/
|
||||
public static final String FLUID_FUEL_ADD = "fluidFuel:add";
|
||||
|
||||
/**
|
||||
* Key for an NBT message to register a fluid coolant. Calls
|
||||
* {@link FluidFuelRegister#addCoolant(net.minecraft.nbt.NBTTagCompound)} with
|
||||
* the NBT value of the message.
|
||||
* {@link FluidFuelRegister#addCoolant(net.minecraft.nbt.NBTTagCompound)} with the NBT value of the message.
|
||||
*/
|
||||
public static final String FLUID_COOLANT_ADD = "fluidCoolant:add";
|
||||
|
||||
/**
|
||||
* Key for a string message to add a block to the list of blocks that cannot
|
||||
* be teleported through using the Staff of Travel or Dark Steel Travel
|
||||
* Upgrade. Value must be in the form: 'modid:blockName' Calls
|
||||
* {@link TravelController#addBlockToBlinkBlackList(String)} with the string
|
||||
* value of the message.
|
||||
* Key for a string message to add a block to the list of blocks that cannot be teleported through using the Staff
|
||||
* of Travel or Dark Steel Travel Upgrade. Value must be in the form: 'modid:blockName' Calls
|
||||
* {@link TravelController#addBlockToBlinkBlackList(String)} with the string value of the message.
|
||||
*/
|
||||
public static final String TELEPORT_BLACKLIST_ADD = "teleport:blacklist:add";
|
||||
|
||||
/**
|
||||
* Key for an NBT message to register a block or tile entity as connectable to
|
||||
* insulated redstone conduits. Calls
|
||||
* {@link InsulatedRedstoneConduit#addConnectableBlock(net.minecraft.nbt.NBTTagCompound)}
|
||||
* with the NBT value of the message.
|
||||
* Key for an NBT message to register a block or tile entity as connectable to insulated redstone conduits. Calls
|
||||
* {@link InsulatedRedstoneConduit#addConnectableBlock(net.minecraft.nbt.NBTTagCompound)} with the NBT value of the
|
||||
* message.
|
||||
*/
|
||||
public static final String REDSTONE_CONNECTABLE_ADD = "redstone:connectable:add";
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this on your Block or TileEntity to control whether insulated
|
||||
* restone conduits will automatically connect to your block.
|
||||
* Implement this on your Block or TileEntity to control whether insulated restone conduits will automatically connect
|
||||
* to your block.
|
||||
* <p>
|
||||
* Implementing on both is not recommended and will likely not work as expected.
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package crazypants.enderio.api.teleport;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
public interface IItemOfTravel extends IEnergyContainerItem {
|
||||
|
||||
boolean isActive(EntityPlayer ep, ItemStack equipped);
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package crazypants.enderio.api.teleport;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
public interface ITelePad extends ITravelAccessable {
|
||||
|
||||
/**
|
||||
* If this piece of the telepad is the master, meaning it is connected on all
|
||||
* 4 sides. This does <i>not</i> guarantee that it is in a connected state.
|
||||
* If this piece of the telepad is the master, meaning it is connected on all 4 sides. This does <i>not</i>
|
||||
* guarantee that it is in a connected state.
|
||||
*
|
||||
* @return True if this TE is the master TE, false otherwise.
|
||||
*/
|
||||
@@ -17,88 +19,74 @@ public interface ITelePad extends ITravelAccessable {
|
||||
/**
|
||||
* Gets the master telepad that this one is connected to.
|
||||
*
|
||||
* @return The master telepad TE. {@code null} if not in a network. Itself if
|
||||
* it is the master.
|
||||
* @return The master telepad TE. {@code null} if not in a network. Itself if it is the master.
|
||||
*/
|
||||
@Nullable
|
||||
ITelePad getMaster();
|
||||
|
||||
/**
|
||||
* If this telepad piece is in a network, meaning it is connected and in a
|
||||
* valid configuration.
|
||||
* If this telepad piece is in a network, meaning it is connected and in a valid configuration.
|
||||
*
|
||||
* @return True if this TE is in a network, false otherwise.
|
||||
*/
|
||||
boolean inNetwork();
|
||||
|
||||
/**
|
||||
* The X coordinate stored in this telepad network. Always 0 if this is
|
||||
* {@link #inNetwork()} returns false.
|
||||
* The X coordinate stored in this telepad network. Always 0 if this is {@link #inNetwork()} returns false.
|
||||
*
|
||||
* @return The target X coordinate.
|
||||
*/
|
||||
int getX();
|
||||
|
||||
/**
|
||||
* The Y coordinate stored in this telepad network. Always 0 if this is
|
||||
* {@link #inNetwork()} returns false.
|
||||
* The Y coordinate stored in this telepad network. Always 0 if this is {@link #inNetwork()} returns false.
|
||||
*
|
||||
* @return The target Y coordinate.
|
||||
*/
|
||||
int getY();
|
||||
|
||||
/**
|
||||
* The Z coordinate stored in this telepad network. Always 0 if this is
|
||||
* {@link #inNetwork()} returns false.
|
||||
* The Z coordinate stored in this telepad network. Always 0 if this is {@link #inNetwork()} returns false.
|
||||
*
|
||||
* @return The target Z coordinate.
|
||||
*/
|
||||
int getZ();
|
||||
|
||||
/**
|
||||
* The target dimension ID for the telepad. Defaults to the dimension the
|
||||
* block is placed in.
|
||||
* The target dimension ID for the telepad. Defaults to the dimension the block is placed in.
|
||||
*
|
||||
* @return An int dimension ID.
|
||||
*/
|
||||
int getTargetDim();
|
||||
|
||||
/**
|
||||
* Sets the target X coordinate of the network. Has no effect if
|
||||
* {@link #inNetwork()} returns false.
|
||||
* Sets the target X coordinate of the network. Has no effect if {@link #inNetwork()} returns false.
|
||||
*
|
||||
* @param x
|
||||
* The X coord.
|
||||
* @param x The X coord.
|
||||
* @return The master telepad TE. DOES NOT ALWAYS return itself.
|
||||
*/
|
||||
ITelePad setX(int x);
|
||||
|
||||
/**
|
||||
* Sets the target Y coordinate of the network. Has no effect if
|
||||
* {@link #inNetwork()} returns false.
|
||||
* Sets the target Y coordinate of the network. Has no effect if {@link #inNetwork()} returns false.
|
||||
*
|
||||
* @param y
|
||||
* The Y coord.
|
||||
* @param y The Y coord.
|
||||
* @return The master telepad TE. DOES NOT ALWAYS return itself.
|
||||
*/
|
||||
ITelePad setY(int y);
|
||||
|
||||
/**
|
||||
* Sets the target Z coordinate of the network. Has no effect if
|
||||
* {@link #inNetwork()} returns false.
|
||||
* Sets the target Z coordinate of the network. Has no effect if {@link #inNetwork()} returns false.
|
||||
*
|
||||
* @param z
|
||||
* The Z coord.
|
||||
* @param z The Z coord.
|
||||
* @return The master telepad TE. DOES NOT ALWAYS return itself.
|
||||
*/
|
||||
ITelePad setZ(int z);
|
||||
|
||||
/**
|
||||
* Sets the target dimension of the network. Has no effect if
|
||||
* {@link #inNetwork()} returns false.
|
||||
* Sets the target dimension of the network. Has no effect if {@link #inNetwork()} returns false.
|
||||
*
|
||||
* @param dimID
|
||||
* The dimension ID.
|
||||
* @param dimID The dimension ID.
|
||||
* @return The master telepad TE. DOES NOT ALWAYS return itself.
|
||||
*/
|
||||
ITelePad setTargetDim(int dimID);
|
||||
@@ -110,8 +98,7 @@ public interface ITelePad extends ITravelAccessable {
|
||||
* @see #setY(int)
|
||||
* @see #setZ(int)
|
||||
*
|
||||
* @param coords
|
||||
* The coords to set this telepad to.
|
||||
* @param coords The coords to set this telepad to.
|
||||
*/
|
||||
void setCoords(BlockCoord coords);
|
||||
|
||||
@@ -122,14 +109,12 @@ public interface ITelePad extends ITravelAccessable {
|
||||
* <li>There is sufficient power to perform the operation</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param entity
|
||||
* The entity to teleport
|
||||
* @param entity The entity to teleport
|
||||
*/
|
||||
void teleportSpecific(Entity entity);
|
||||
|
||||
/**
|
||||
* Teleports all entities in range (in no particular order) until either there
|
||||
* are none left or the power runs out.
|
||||
* Teleports all entities in range (in no particular order) until either there are none left or the power runs out.
|
||||
*/
|
||||
void teleportAll();
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
package crazypants.enderio.api.teleport;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import crazypants.util.UserIdent;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nonnull;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface ITravelAccessable {
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package crazypants.enderio.api.teleport;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraftforge.event.entity.EntityEvent;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
|
||||
/**
|
||||
* An event that can be used to respond to, edit, and prevent entity teleports.
|
||||
* <p>
|
||||
@@ -14,8 +15,7 @@ import net.minecraftforge.event.entity.EntityEvent;
|
||||
* <li>Telepad</li>
|
||||
* </ul>
|
||||
*
|
||||
* As well as any externally added teleports, assuming they fire this event
|
||||
* manually.
|
||||
* As well as any externally added teleports, assuming they fire this event manually.
|
||||
*
|
||||
*/
|
||||
@Cancelable
|
||||
@@ -31,14 +31,10 @@ public class TeleportEntityEvent extends EntityEvent {
|
||||
/**
|
||||
* Fired before an entity teleports to the given location.
|
||||
*
|
||||
* @param entity
|
||||
* The entity teleporting
|
||||
* @param x
|
||||
* The target X coord
|
||||
* @param y
|
||||
* The target Y coord
|
||||
* @param z
|
||||
* The target Z coord
|
||||
* @param entity The entity teleporting
|
||||
* @param x The target X coord
|
||||
* @param y The target Y coord
|
||||
* @param z The target Z coord
|
||||
*/
|
||||
public TeleportEntityEvent(Entity entity, TravelSource source, int x, int y, int z) {
|
||||
super(entity);
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
package crazypants.enderio.api.teleport;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public enum TravelSource {
|
||||
|
||||
BLOCK() {
|
||||
|
||||
@Override
|
||||
public int getMaxDistanceTravelled() {
|
||||
return Config.travelAnchorMaxDistance;
|
||||
}
|
||||
},
|
||||
STAFF() {
|
||||
|
||||
@Override
|
||||
public int getMaxDistanceTravelled() {
|
||||
return Config.travelStaffMaxDistance;
|
||||
@@ -27,6 +31,7 @@ public enum TravelSource {
|
||||
}
|
||||
},
|
||||
STAFF_BLINK() {
|
||||
|
||||
@Override
|
||||
public int getMaxDistanceTravelled() {
|
||||
return Config.travelStaffMaxBlinkDistance;
|
||||
@@ -39,6 +44,7 @@ public enum TravelSource {
|
||||
},
|
||||
|
||||
TELEPORT_STAFF() {
|
||||
|
||||
@Override
|
||||
public int getMaxDistanceTravelled() {
|
||||
return Config.teleportStaffMaxDistance;
|
||||
@@ -50,6 +56,7 @@ public enum TravelSource {
|
||||
}
|
||||
},
|
||||
TELEPORT_STAFF_BLINK() {
|
||||
|
||||
@Override
|
||||
public int getMaxDistanceTravelled() {
|
||||
return Config.teleportStaffMaxBlinkDistance;
|
||||
|
||||
@@ -9,15 +9,11 @@ import net.minecraft.item.ItemStack;
|
||||
public interface IConduitControl extends IHideFacades {
|
||||
|
||||
/**
|
||||
* Controls whether the overlay is shown and the player can change the display
|
||||
* mode.
|
||||
* Controls whether the overlay is shown and the player can change the display mode.
|
||||
*
|
||||
* @param stack
|
||||
* The itemstack
|
||||
* @param player
|
||||
* The player holding the itemstack
|
||||
* @return True if the overlay should be rendered and the player should be
|
||||
* able to change modes. False otherwise.
|
||||
* @param stack The itemstack
|
||||
* @param player The player holding the itemstack
|
||||
* @return True if the overlay should be rendered and the player should be able to change modes. False otherwise.
|
||||
*/
|
||||
boolean showOverlay(ItemStack stack, EntityPlayer player);
|
||||
}
|
||||
@@ -1,14 +1,5 @@
|
||||
package crazypants.enderio.block;
|
||||
|
||||
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
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.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import net.minecraft.block.BlockAnvil;
|
||||
import net.minecraft.client.gui.GuiRepair;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -19,9 +10,20 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
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.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
|
||||
public class BlockDarkSteelAnvil extends BlockAnvil implements IResourceTooltipProvider {
|
||||
|
||||
private static final String[] anvilIconNames = new String[] {"anvil_0", "anvil_1", "anvil_2"};
|
||||
private static final String[] anvilIconNames = new String[] { "anvil_0", "anvil_1", "anvil_2" };
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] anvilIcons;
|
||||
@@ -65,8 +67,8 @@ public class BlockDarkSteelAnvil extends BlockAnvil implements IResourceTooltipP
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY,
|
||||
float hitZ) {
|
||||
p.openGui(EnderIO.instance, GuiHandler.GUI_ID_ANVIL, w, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
package crazypants.enderio.block;
|
||||
|
||||
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLadder;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -14,6 +8,14 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
public class BlockDarkSteelLadder extends BlockLadder implements IResourceTooltipProvider {
|
||||
|
||||
public static BlockDarkSteelLadder create() {
|
||||
|
||||
@@ -1,23 +1,8 @@
|
||||
package crazypants.enderio.block;
|
||||
|
||||
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
|
||||
import com.enderio.core.common.util.Util;
|
||||
import com.google.common.collect.Lists;
|
||||
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.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.machine.painter.BasicPainterTemplate;
|
||||
import crazypants.enderio.machine.painter.IPaintedBlock;
|
||||
import crazypants.enderio.machine.painter.PaintSourceValidator;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.machine.painter.TileEntityPaintedBlock;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPressurePlate;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
@@ -33,6 +18,24 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
|
||||
import com.enderio.core.common.util.Util;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
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.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.machine.painter.BasicPainterTemplate;
|
||||
import crazypants.enderio.machine.painter.IPaintedBlock;
|
||||
import crazypants.enderio.machine.painter.PaintSourceValidator;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.machine.painter.TileEntityPaintedBlock;
|
||||
|
||||
public class BlockDarkSteelPressurePlate extends BlockPressurePlate
|
||||
implements IResourceTooltipProvider, ITileEntityProvider, IPaintedBlock {
|
||||
|
||||
@@ -52,12 +55,14 @@ public class BlockDarkSteelPressurePlate extends BlockPressurePlate
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerBlock(
|
||||
this, BlockItemDarkSteelPressurePlate.class, ModObject.blockDarkSteelPressurePlate.unlocalisedName);
|
||||
this,
|
||||
BlockItemDarkSteelPressurePlate.class,
|
||||
ModObject.blockDarkSteelPressurePlate.unlocalisedName);
|
||||
GameRegistry.registerTileEntity(
|
||||
TileEntityDarkSteelPressurePlate.class,
|
||||
ModObject.blockDarkSteelPressurePlate.unlocalisedName + "TileEntity");
|
||||
MachineRecipeRegistry.instance.registerRecipe(
|
||||
ModObject.blockPainter.unlocalisedName, new PainterTemplate(this));
|
||||
MachineRecipeRegistry.instance
|
||||
.registerRecipe(ModObject.blockPainter.unlocalisedName, new PainterTemplate(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -143,7 +148,7 @@ public class BlockDarkSteelPressurePlate extends BlockPressurePlate
|
||||
return super.colorMultiplier(world, x, y, z);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item arg0, CreativeTabs arg1, List items) {
|
||||
@@ -210,9 +215,10 @@ public class BlockDarkSteelPressurePlate extends BlockPressurePlate
|
||||
}
|
||||
ItemStack target = MachineRecipeInput.getInputForSlot(0, inputs);
|
||||
ItemStack resultStack = createItemStackForSourceBlock(
|
||||
Block.getBlockFromItem(paintSource.getItem()), paintSource.getItemDamage());
|
||||
Block.getBlockFromItem(paintSource.getItem()),
|
||||
paintSource.getItemDamage());
|
||||
resultStack.setItemDamage(target.getItemDamage());
|
||||
return new ResultStack[] {new ResultStack(resultStack)};
|
||||
return new ResultStack[] { new ResultStack(resultStack) };
|
||||
}
|
||||
|
||||
public static ItemStack createItemStackForSourceBlock(Block block, int damage) {
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package crazypants.enderio.block;
|
||||
|
||||
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.waila.IWailaInfoProvider;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -15,6 +11,13 @@ import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
|
||||
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.waila.IWailaInfoProvider;
|
||||
|
||||
public class BlockReinforcedObsidian extends BlockEio implements IResourceTooltipProvider, IWailaInfoProvider {
|
||||
|
||||
public static BlockReinforcedObsidian create() {
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package crazypants.enderio.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ContainerRepair;
|
||||
@@ -12,18 +10,22 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
public class ContainerDarkSteelAnvil extends ContainerRepair {
|
||||
|
||||
private int x, y, z;
|
||||
|
||||
private final Field _outputSlot = ReflectionHelper.findField(ContainerRepair.class, "outputSlot", "field_82852_f");
|
||||
private final Field _inputSlots = ReflectionHelper.findField(ContainerRepair.class, "inputSlots", "field_82853_g");
|
||||
private final Field _materialCost = ReflectionHelper.findField(
|
||||
ContainerRepair.class, "materialCost", "stackSizeToBeUsedInRepair", "field_82856_l");
|
||||
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) {
|
||||
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);
|
||||
|
||||
final IInventory outputSlot, inputSlots;
|
||||
@@ -49,7 +51,7 @@ public class ContainerDarkSteelAnvil extends ContainerRepair {
|
||||
|
||||
public boolean canTakeStack(EntityPlayer stack) {
|
||||
return (stack.capabilities.isCreativeMode
|
||||
|| stack.experienceLevel >= ContainerDarkSteelAnvil.this.maximumCost)
|
||||
|| stack.experienceLevel >= ContainerDarkSteelAnvil.this.maximumCost)
|
||||
&& ContainerDarkSteelAnvil.this.maximumCost > 0
|
||||
&& this.getHasStack();
|
||||
}
|
||||
@@ -76,8 +78,7 @@ public class ContainerDarkSteelAnvil extends ContainerRepair {
|
||||
|
||||
ContainerDarkSteelAnvil.this.maximumCost = 0;
|
||||
|
||||
if (!player.capabilities.isCreativeMode
|
||||
&& !world.isRemote
|
||||
if (!player.capabilities.isCreativeMode && !world.isRemote
|
||||
&& world.getBlock(x, y, z) == EnderIO.blockDarkSteelAnvil
|
||||
&& player.getRNG().nextFloat() < Config.darkSteelAnvilDamageChance) {
|
||||
int i1 = world.getBlockMetadata(x, y, z);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package crazypants.enderio.block;
|
||||
|
||||
import crazypants.enderio.machine.painter.TileEntityPaintedBlock;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import crazypants.enderio.machine.painter.TileEntityPaintedBlock;
|
||||
|
||||
public class TileEntityDarkSteelPressurePlate extends TileEntityPaintedBlock {
|
||||
|
||||
private boolean silent;
|
||||
|
||||
@@ -1,6 +1,30 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.gas.GasConduitNetwork;
|
||||
import crazypants.enderio.conduit.gas.IGasConduit;
|
||||
@@ -28,26 +52,6 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork;
|
||||
import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.RedstoneConduitNetwork;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
@@ -69,8 +73,8 @@ public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
protected List<CollidableComponent> collidables;
|
||||
|
||||
protected final EnumMap<ForgeDirection, ConnectionMode> conectionModes =
|
||||
new EnumMap<ForgeDirection, ConnectionMode>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, ConnectionMode> conectionModes = new EnumMap<ForgeDirection, ConnectionMode>(
|
||||
ForgeDirection.class);
|
||||
|
||||
protected boolean collidablesDirty = true;
|
||||
|
||||
@@ -80,6 +84,8 @@ public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
protected boolean connectionsDirty = true;
|
||||
|
||||
protected boolean needUpdateConnections = false;
|
||||
|
||||
protected AbstractConduit() {}
|
||||
|
||||
@Override
|
||||
@@ -275,8 +281,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
covers = conduit.getBundle().getCoverSystem();
|
||||
for (Part part : covers.getAllParts()) {
|
||||
if (part.type.getPartClass() == EnumPartClass.Panel) {
|
||||
return part.pos
|
||||
== EnumPosition.getFacePosition(direction.getOpposite().ordinal());
|
||||
return part.pos == EnumPosition.getFacePosition(direction.getOpposite().ordinal());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -458,7 +463,15 @@ public abstract class AbstractConduit implements IConduit {
|
||||
connectionsChanged();
|
||||
}
|
||||
|
||||
connectionsDirty = false;
|
||||
if (needUpdateConnections) {
|
||||
needUpdateConnections = false;
|
||||
} else {
|
||||
connectionsDirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected void needUpdateConnections() {
|
||||
needUpdateConnections = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -580,11 +593,13 @@ public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
@Override
|
||||
public Collection<CollidableComponent> createCollidables(CacheKey key) {
|
||||
return Collections.singletonList(new CollidableComponent(
|
||||
getCollidableType(),
|
||||
ConduitGeometryUtil.instance.getBoundingBox(getBaseConduitType(), key.dir, key.isStub, key.offset),
|
||||
key.dir,
|
||||
null));
|
||||
return Collections.singletonList(
|
||||
new CollidableComponent(
|
||||
getCollidableType(),
|
||||
ConduitGeometryUtil.instance
|
||||
.getBoundingBox(getBaseConduitType(), key.dir, key.isStub, key.offset),
|
||||
key.dir,
|
||||
null));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -623,7 +638,8 @@ public abstract class AbstractConduit implements IConduit {
|
||||
Class<? extends IConduit> type = getCollidableType();
|
||||
if (isConnectedTo(dir) && getConnectionMode(dir) != ConnectionMode.DISABLED) {
|
||||
return cc.getCollidables(
|
||||
cc.createKey(type, getBundle().getOffset(getBaseConduitType(), dir), dir, renderStub(dir)), this);
|
||||
cc.createKey(type, getBundle().getOffset(getBaseConduitType(), dir), dir, renderStub(dir)),
|
||||
this);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package crazypants.enderio.conduit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -47,8 +48,8 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
if (conduit != null && implClass.isAssignableFrom(conduit.getClass()) && conduit.setNetwork(this)) {
|
||||
addConduit(implClass.cast(conduit));
|
||||
TileEntity te = tile.getEntity();
|
||||
Collection<T> connections =
|
||||
ConduitUtil.getConnectedConduits(world, te.xCoord, te.yCoord, te.zCoord, getBaseConduitType());
|
||||
Collection<T> connections = ConduitUtil
|
||||
.getConnectedConduits(world, te.xCoord, te.yCoord, te.zCoord, getBaseConduitType());
|
||||
for (T con : connections) {
|
||||
if (con.getNetwork() == null) {
|
||||
setNetwork(world, con.getBundle());
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
import com.enderio.core.common.util.Util;
|
||||
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 java.util.List;
|
||||
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.IMicroblockSupporterTile;
|
||||
import mods.immibis.microblocks.api.MicroblockAPIUtils;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -26,6 +19,17 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
import com.enderio.core.common.util.Util;
|
||||
|
||||
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;
|
||||
|
||||
public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
|
||||
protected ModObject modObj;
|
||||
@@ -59,17 +63,8 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
if (MicroblocksUtil.supportMicroblocks() && tryAddToMicroblocks(stack, player, world, x, y, z, side)) {
|
||||
return true;
|
||||
}
|
||||
@@ -126,15 +121,15 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean tryAddToMicroblocks(
|
||||
ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
private boolean tryAddToMicroblocks(ItemStack stack, EntityPlayer player, World world, int x, int y, int z,
|
||||
int side) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te != null && te.getClass().getName().equals("mods.immibis.microblocks.TileMicroblockContainer")) {
|
||||
IMicroblockCoverSystem covers = ((IMicroblockSupporterTile) te).getCoverSystem();
|
||||
world.setBlock(x, y, z, EnderIO.blockConduitBundle);
|
||||
EnderIO.blockConduitBundle.onBlockActivated(world, x, y, z, player, side, 0, 0, 0);
|
||||
IMicroblockCoverSystem newCovers = MicroblockAPIUtils.createMicroblockCoverSystem(
|
||||
(IMicroblockSupporterTile) world.getTileEntity(x, y, z));
|
||||
IMicroblockCoverSystem newCovers = MicroblockAPIUtils
|
||||
.createMicroblockCoverSystem((IMicroblockSupporterTile) world.getTileEntity(x, y, z));
|
||||
for (Part p : covers.getAllParts()) {
|
||||
newCovers.addPart(p);
|
||||
}
|
||||
@@ -145,17 +140,8 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ) {
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
// Conduit replacement
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
@@ -210,7 +196,7 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < subtypes.length; ++j) {
|
||||
|
||||
@@ -1,8 +1,43 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import mods.immibis.core.api.multipart.IMultipartRenderingBlockMarker;
|
||||
import mods.immibis.core.api.multipart.IMultipartSystem;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
import net.minecraft.client.particle.EntityDiggingFX;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.sound.PlaySoundSourceEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
||||
|
||||
import powercrystals.minefactoryreloaded.api.rednet.IRedNetOmniNode;
|
||||
import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.Util;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
@@ -38,41 +73,14 @@ import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.util.IFacade;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import mods.immibis.core.api.multipart.IMultipartRenderingBlockMarker;
|
||||
import mods.immibis.core.api.multipart.IMultipartSystem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
import net.minecraft.client.particle.EntityDiggingFX;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.sound.PlaySoundSourceEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
||||
import powercrystals.minefactoryreloaded.api.rednet.IRedNetOmniNode;
|
||||
import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType;
|
||||
|
||||
@Optional.InterfaceList({
|
||||
@Interface(iface = "powercrystals.minefactoryreloaded.api.rednet.IRedNetOmniNode", modid = "MineFactoryReloaded"),
|
||||
@Interface(iface = "mods.immibis.core.api.multipart.IMultipartRenderingBlockMarker", modid = "ImmibisMicroblocks")
|
||||
})
|
||||
@Interface(
|
||||
iface = "powercrystals.minefactoryreloaded.api.rednet.IRedNetOmniNode",
|
||||
modid = "MineFactoryReloaded"),
|
||||
@Interface(
|
||||
iface = "mods.immibis.core.api.multipart.IMultipartRenderingBlockMarker",
|
||||
modid = "ImmibisMicroblocks") })
|
||||
public class BlockConduitBundle extends BlockEio
|
||||
implements IGuiHandler, IFacade, IRotatableFacade, IRedNetOmniNode, IMultipartRenderingBlockMarker {
|
||||
|
||||
@@ -84,25 +92,37 @@ public class BlockConduitBundle extends BlockEio
|
||||
MinecraftForge.EVENT_BUS.register(ConduitNetworkTickHandler.instance);
|
||||
FMLCommonHandler.instance().bus().register(ConduitNetworkTickHandler.instance);
|
||||
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketFluidLevel.class, PacketFluidLevel.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketExtractMode.class, PacketExtractMode.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketFluidLevel.class, PacketFluidLevel.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
PacketConnectionMode.class,
|
||||
PacketConnectionMode.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketExtractMode.class, PacketExtractMode.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketConnectionMode.class, PacketConnectionMode.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketItemConduitFilter.class, PacketItemConduitFilter.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketItemConduitFilter.class,
|
||||
PacketItemConduitFilter.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketExistingItemFilterSnapshot.class,
|
||||
PacketExistingItemFilterSnapshot.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketModItemFilter.class, PacketModItemFilter.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketModItemFilter.class,
|
||||
PacketModItemFilter.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketFluidFilter.class, PacketFluidFilter.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketFluidFilter.class, PacketFluidFilter.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketFluidChannel.class, PacketFluidChannel.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketFluidChannel.class,
|
||||
PacketFluidChannel.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketRedstoneConduitSignalColor.class,
|
||||
PacketRedstoneConduitSignalColor.class,
|
||||
@@ -114,16 +134,25 @@ public class BlockConduitBundle extends BlockEio
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketOpenConduitUI.class, PacketOpenConduitUI.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketOpenConduitUI.class,
|
||||
PacketOpenConduitUI.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketSlotVisibility.class, PacketSlotVisibility.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketSlotVisibility.class,
|
||||
PacketSlotVisibility.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketOCConduitSignalColor.class,
|
||||
PacketOCConduitSignalColor.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketRoundRobinMode.class, PacketRoundRobinMode.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketRoundRobinMode.class,
|
||||
PacketRoundRobinMode.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
|
||||
BlockConduitBundle result = new BlockConduitBundle();
|
||||
result.init();
|
||||
@@ -146,6 +175,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
setResistance(10.0f);
|
||||
setCreativeTab(null);
|
||||
this.stepSound = new SoundType("silence", 0, 0) {
|
||||
|
||||
@Override
|
||||
public String getBreakSound() {
|
||||
return "EnderIO:" + soundName + ".dig";
|
||||
@@ -208,8 +238,16 @@ public class BlockConduitBundle extends BlockEio
|
||||
double d2 = z + (l1 + 0.5D) / b0;
|
||||
int i2 = rand.nextInt(6);
|
||||
EntityDiggingFX fx = new EntityDiggingFX(
|
||||
world, d0, d1, d2, d0 - x - 0.5D, d1 - y - 0.5D, d2 - z - 0.5D, this, i2, 0)
|
||||
.applyColourMultiplier(x, y, z);
|
||||
world,
|
||||
d0,
|
||||
d1,
|
||||
d2,
|
||||
d0 - x - 0.5D,
|
||||
d1 - y - 0.5D,
|
||||
d2 - z - 0.5D,
|
||||
this,
|
||||
i2,
|
||||
0).applyColourMultiplier(x, y, z);
|
||||
fx.setParticleIcon(tex);
|
||||
effectRenderer.addEffect(fx);
|
||||
}
|
||||
@@ -219,19 +257,16 @@ public class BlockConduitBundle extends BlockEio
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void addBlockHitEffects(
|
||||
World world, EffectRenderer effectRenderer, int x, int y, int z, int side, IIcon tex) {
|
||||
private void addBlockHitEffects(World world, EffectRenderer effectRenderer, int x, int y, int z, int side,
|
||||
IIcon tex) {
|
||||
float f = 0.1F;
|
||||
double d0 = x
|
||||
+ rand.nextDouble() * (getBlockBoundsMaxX() - getBlockBoundsMinX() - f * 2.0F)
|
||||
double d0 = x + rand.nextDouble() * (getBlockBoundsMaxX() - getBlockBoundsMinX() - f * 2.0F)
|
||||
+ f
|
||||
+ getBlockBoundsMinX();
|
||||
double d1 = y
|
||||
+ rand.nextDouble() * (getBlockBoundsMaxY() - getBlockBoundsMinY() - f * 2.0F)
|
||||
double d1 = y + rand.nextDouble() * (getBlockBoundsMaxY() - getBlockBoundsMinY() - f * 2.0F)
|
||||
+ f
|
||||
+ getBlockBoundsMinY();
|
||||
double d2 = z
|
||||
+ rand.nextDouble() * (getBlockBoundsMaxZ() - getBlockBoundsMinZ() - f * 2.0F)
|
||||
double d2 = z + rand.nextDouble() * (getBlockBoundsMaxZ() - getBlockBoundsMinZ() - f * 2.0F)
|
||||
+ f
|
||||
+ getBlockBoundsMinZ();
|
||||
if (side == 0) {
|
||||
@@ -425,15 +460,8 @@ public class BlockConduitBundle extends BlockEio
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExplosionResistance(
|
||||
Entity par1Entity,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
double explosionX,
|
||||
double explosionY,
|
||||
double explosionZ) {
|
||||
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX,
|
||||
double explosionY, double explosionZ) {
|
||||
float resist = getExplosionResistance(par1Entity);
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
return te instanceof IConduitBundle && ((IConduitBundle) te).getFacadeType() == FacadeType.HARDENED
|
||||
@@ -507,8 +535,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
List<ItemStack> drop = new ArrayList<ItemStack>();
|
||||
if (ConduitUtil.isSolidFacadeRendered(te, player)) {
|
||||
breakBlock = false;
|
||||
ItemStack fac = new ItemStack(
|
||||
EnderIO.itemConduitFacade, 1, te.getFacadeType().ordinal());
|
||||
ItemStack fac = new ItemStack(EnderIO.itemConduitFacade, 1, te.getFacadeType().ordinal());
|
||||
PainterUtil.setSourceBlock(fac, te.getFacadeId(), te.getFacadeMetadata());
|
||||
drop.add(fac);
|
||||
ConduitUtil.playBreakSound(te.getFacadeId().stepSound, world, x, y, z);
|
||||
@@ -566,8 +593,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
List<IConduit> cons = new ArrayList<IConduit>(te.getConduits());
|
||||
boolean droppedUnconected = false;
|
||||
for (IConduit con : cons) {
|
||||
if (con.getConduitConnections().isEmpty()
|
||||
&& con.getExternalConnections().isEmpty()
|
||||
if (con.getConduitConnections().isEmpty() && con.getExternalConnections().isEmpty()
|
||||
&& ConduitUtil.renderConduit(player, con)) {
|
||||
te.removeConduit(con);
|
||||
drop.addAll(con.getDrops());
|
||||
@@ -619,8 +645,8 @@ public class BlockConduitBundle extends BlockEio
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World world, int x, int y, int z, EntityPlayer player, int side, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7,
|
||||
float par8, float par9) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (!(te instanceof IConduitBundle)) {
|
||||
@@ -712,8 +738,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
}
|
||||
} else {
|
||||
IConduit closestConduit = bundle.getConduit(closest.component.conduitType);
|
||||
if (closestConduit != null
|
||||
&& ConduitUtil.renderConduit(player, closestConduit)
|
||||
if (closestConduit != null && ConduitUtil.renderConduit(player, closestConduit)
|
||||
&& closestConduit.onBlockActivated(player, closest, all)) {
|
||||
bundle.getEntity().markDirty();
|
||||
return true;
|
||||
@@ -736,8 +761,8 @@ public class BlockConduitBundle extends BlockEio
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean handleConduitProbeClick(
|
||||
World world, int x, int y, int z, EntityPlayer player, IConduitBundle bundle, ItemStack stack) {
|
||||
private boolean handleConduitProbeClick(World world, int x, int y, int z, EntityPlayer player,
|
||||
IConduitBundle bundle, ItemStack stack) {
|
||||
if (stack.getItemDamage() != 1) {
|
||||
return false; // not in copy paste mode
|
||||
}
|
||||
@@ -748,8 +773,8 @@ public class BlockConduitBundle extends BlockEio
|
||||
return ItemConduitProbe.copyPasteSettings(player, stack, bundle, rr.component.dir);
|
||||
}
|
||||
|
||||
private boolean handleConduitClick(
|
||||
World world, int x, int y, int z, EntityPlayer player, IConduitBundle bundle, ItemStack stack) {
|
||||
private boolean handleConduitClick(World world, int x, int y, int z, EntityPlayer player, IConduitBundle bundle,
|
||||
ItemStack stack) {
|
||||
IConduitItem equipped = (IConduitItem) stack.getItem();
|
||||
if (!bundle.hasType(equipped.getBaseConduitType())) {
|
||||
if (!world.isRemote) {
|
||||
@@ -764,8 +789,8 @@ public class BlockConduitBundle extends BlockEio
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean handleFacadeClick(
|
||||
World world, int x, int y, int z, EntityPlayer player, int side, IConduitBundle bundle, ItemStack stack) {
|
||||
public boolean handleFacadeClick(World world, int x, int y, int z, EntityPlayer player, int side,
|
||||
IConduitBundle bundle, ItemStack stack) {
|
||||
if (MicroblocksUtil.supportMicroblocks() && hasMicroblocks(bundle)) {
|
||||
return false;
|
||||
}
|
||||
@@ -790,8 +815,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
return false;
|
||||
}
|
||||
if (!world.isRemote && !player.capabilities.isCreativeMode) {
|
||||
ItemStack fac = new ItemStack(
|
||||
EnderIO.itemConduitFacade, 1, bundle.getFacadeType().ordinal());
|
||||
ItemStack fac = new ItemStack(EnderIO.itemConduitFacade, 1, bundle.getFacadeType().ordinal());
|
||||
PainterUtil.setSourceBlock(fac, bundle.getFacadeId(), bundle.getFacadeMetadata());
|
||||
Util.dropItems(world, fac, x, y, z, false);
|
||||
}
|
||||
@@ -812,8 +836,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
}
|
||||
|
||||
private boolean facadeEquals(IConduitBundle bundle, Block facadeID, int facadeMeta, int facadeType) {
|
||||
return bundle.getFacadeId().equals(facadeID)
|
||||
&& bundle.getFacadeMetadata() == facadeMeta
|
||||
return bundle.getFacadeId().equals(facadeID) && bundle.getFacadeMetadata() == facadeMeta
|
||||
&& bundle.getFacadeType().ordinal() == facadeType;
|
||||
}
|
||||
|
||||
@@ -895,14 +918,8 @@ 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) {
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axisalignedbb,
|
||||
@SuppressWarnings("rawtypes") List arraylist, Entity par7Entity) {
|
||||
|
||||
if (MicroblocksUtil.supportMicroblocks()) {
|
||||
IM__addCollisionBoxesToList(world, x, y, z, axisalignedbb, arraylist, par7Entity);
|
||||
@@ -921,7 +938,12 @@ public class BlockConduitBundle extends BlockEio
|
||||
Collection<CollidableComponent> bounds = con.getCollidableComponents();
|
||||
for (CollidableComponent bnd : bounds) {
|
||||
setBlockBounds(
|
||||
bnd.bound.minX, bnd.bound.minY, bnd.bound.minZ, bnd.bound.maxX, bnd.bound.maxY, bnd.bound.maxZ);
|
||||
bnd.bound.minX,
|
||||
bnd.bound.minY,
|
||||
bnd.bound.minZ,
|
||||
bnd.bound.maxX,
|
||||
bnd.bound.maxY,
|
||||
bnd.bound.maxZ);
|
||||
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, arraylist, par7Entity);
|
||||
}
|
||||
|
||||
@@ -962,8 +984,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
// This is an ugly special case, TODO fix this
|
||||
for (RaytraceResult hit : results) {
|
||||
IInsulatedRedstoneConduit cond = con.getConduit(IInsulatedRedstoneConduit.class);
|
||||
if (cond != null
|
||||
&& hit.component != null
|
||||
if (cond != null && hit.component != null
|
||||
&& cond.getExternalConnections().contains(hit.component.dir)
|
||||
&& !cond.isSpecialConnection(hit.component.dir)
|
||||
&& hit.component.data == InsulatedRedstoneConduit.COLOR_CONTROLLER_ID) {
|
||||
@@ -998,7 +1019,12 @@ public class BlockConduitBundle extends BlockEio
|
||||
}
|
||||
|
||||
return AxisAlignedBB.getBoundingBox(
|
||||
x + minBB.minX, y + minBB.minY, z + minBB.minZ, x + minBB.maxX, y + minBB.maxY, z + minBB.maxZ);
|
||||
x + minBB.minX,
|
||||
y + minBB.minY,
|
||||
z + minBB.minZ,
|
||||
x + minBB.maxX,
|
||||
y + minBB.maxY,
|
||||
z + minBB.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1044,8 +1070,8 @@ public class BlockConduitBundle extends BlockEio
|
||||
return doRayTraceAll(world, x, y, z, origin, direction, entityPlayer);
|
||||
}
|
||||
|
||||
private RaytraceResult doRayTrace(
|
||||
World world, int x, int y, int z, Vec3 origin, Vec3 direction, EntityPlayer entityPlayer) {
|
||||
private RaytraceResult doRayTrace(World world, int x, int y, int z, Vec3 origin, Vec3 direction,
|
||||
EntityPlayer entityPlayer) {
|
||||
List<RaytraceResult> allHits = doRayTraceAll(world, x, y, z, origin, direction, entityPlayer);
|
||||
if (allHits == null) {
|
||||
return null;
|
||||
@@ -1053,8 +1079,8 @@ public class BlockConduitBundle extends BlockEio
|
||||
return RaytraceResult.getClosestHit(origin, allHits);
|
||||
}
|
||||
|
||||
protected List<RaytraceResult> doRayTraceAll(
|
||||
World world, int x, int y, int z, Vec3 origin, Vec3 direction, EntityPlayer player) {
|
||||
protected List<RaytraceResult> doRayTraceAll(World world, int x, int y, int z, Vec3 origin, Vec3 direction,
|
||||
EntityPlayer player) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (!(te instanceof IConduitBundle)) {
|
||||
@@ -1071,13 +1097,15 @@ public class BlockConduitBundle extends BlockEio
|
||||
setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
MovingObjectPosition hitPos = super.collisionRayTrace(world, x, y, z, origin, direction);
|
||||
if (hitPos != null) {
|
||||
hits.add(new RaytraceResult(
|
||||
new CollidableComponent(null, BoundingBox.UNIT_CUBE, ForgeDirection.UNKNOWN, null), hitPos));
|
||||
hits.add(
|
||||
new RaytraceResult(
|
||||
new CollidableComponent(null, BoundingBox.UNIT_CUBE, ForgeDirection.UNKNOWN, null),
|
||||
hitPos));
|
||||
}
|
||||
} else {
|
||||
ConduitDisplayMode mode = ConduitUtil.getDisplayMode(player);
|
||||
Collection<CollidableComponent> components =
|
||||
new ArrayList<CollidableComponent>(bundle.getCollidableComponents());
|
||||
Collection<CollidableComponent> components = new ArrayList<CollidableComponent>(
|
||||
bundle.getCollidableComponents());
|
||||
for (CollidableComponent component : components) {
|
||||
if ((component.conduitType != null || mode == ConduitDisplayMode.ALL)
|
||||
&& ConduitUtil.renderConduit(player, component.conduitType)) {
|
||||
@@ -1203,8 +1231,8 @@ public class BlockConduitBundle extends BlockEio
|
||||
return bundle.getConduit(IRedstoneConduit.class);
|
||||
}
|
||||
|
||||
public ItemStack getMicroblockPickBlock(
|
||||
MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
public ItemStack getMicroblockPickBlock(MovingObjectPosition target, World world, int x, int y, int z,
|
||||
EntityPlayer player) {
|
||||
return IMultipartSystem.instance.hook_getPickBlock(target, world, x, y, z, player);
|
||||
}
|
||||
|
||||
@@ -1224,19 +1252,19 @@ public class BlockConduitBundle extends BlockEio
|
||||
return IMultipartSystem.instance.hook_addHitEffects(worldObj, target, effectRenderer);
|
||||
}
|
||||
|
||||
private MovingObjectPosition IM__collisionRayTrace(
|
||||
MovingObjectPosition cur, World world, int x, int y, int z, Vec3 src, Vec3 dst) {
|
||||
private MovingObjectPosition IM__collisionRayTrace(MovingObjectPosition cur, World world, int x, int y, int z,
|
||||
Vec3 src, Vec3 dst) {
|
||||
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) {
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private void IM__addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list,
|
||||
Entity entity) {
|
||||
IMultipartSystem.instance.hook_addCollisionBoxesToList(world, x, y, z, mask, list, entity);
|
||||
}
|
||||
|
||||
private ArrayList<ItemStack> IM__getDrops(
|
||||
List<ItemStack> cur, World world, int x, int y, int z, int metadata, int fortune) {
|
||||
private ArrayList<ItemStack> IM__getDrops(List<ItemStack> cur, World world, int x, int y, int z, int metadata,
|
||||
int fortune) {
|
||||
return IMultipartSystem.instance.hook_getDrops(cur, world, x, y, z, metadata, fortune);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,20 +2,24 @@ package crazypants.enderio.conduit;
|
||||
|
||||
import static crazypants.enderio.gui.IconEIO.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import com.enderio.core.api.client.render.IWidgetIcon;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.FluentIterable;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import crazypants.enderio.api.tool.IConduitControl;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ConduitDisplayMode {
|
||||
|
||||
@@ -48,18 +52,14 @@ public class ConduitDisplayMode {
|
||||
private String overrideName = null;
|
||||
|
||||
/**
|
||||
* Use this constructor if you have custom display logic, it will use
|
||||
* {@code IConduit.class} as the conduitType, and the passed name as the
|
||||
* override name.
|
||||
* Use this constructor if you have custom display logic, it will use {@code IConduit.class} as the conduitType, and
|
||||
* the passed name as the override name.
|
||||
*
|
||||
* @see #ConduitDisplayMode(Class, IWidgetIcon, IWidgetIcon)
|
||||
*
|
||||
* @param name
|
||||
* The override name.
|
||||
* @param widgetSelected
|
||||
* The widget to render when this type is selected.
|
||||
* @param widgetUnselected
|
||||
* The widget to render when this type is unselected.
|
||||
* @param name The override name.
|
||||
* @param widgetSelected The widget to render when this type is selected.
|
||||
* @param widgetUnselected The widget to render when this type is unselected.
|
||||
*/
|
||||
public ConduitDisplayMode(String name, IWidgetIcon widgetSelected, IWidgetIcon widgetUnselected) {
|
||||
this(IConduit.class, widgetSelected, widgetUnselected);
|
||||
@@ -67,20 +67,16 @@ public class ConduitDisplayMode {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new display mode for any {@link IConduitControl} wrench. Contains
|
||||
* data about which conduit type this is for, and the icons to render while
|
||||
* holding the wrench. wrench.
|
||||
* Creates a new display mode for any {@link IConduitControl} wrench. Contains data about which conduit type this is
|
||||
* for, and the icons to render while holding the wrench. wrench.
|
||||
*
|
||||
* @param conduitType
|
||||
* The base class for your conduit type, typically an interface (e.g.
|
||||
* {@code IPowerConduit}).
|
||||
* @param widgetSelected
|
||||
* The widget to render when this type is selected.
|
||||
* @param widgetUnselected
|
||||
* The widget to render when this type is unselected.
|
||||
* @param conduitType The base class for your conduit type, typically an interface (e.g.
|
||||
* {@code IPowerConduit}).
|
||||
* @param widgetSelected The widget to render when this type is selected.
|
||||
* @param widgetUnselected The widget to render when this type is unselected.
|
||||
*/
|
||||
public ConduitDisplayMode(
|
||||
@Nonnull Class<? extends IConduit> conduitType, IWidgetIcon widgetSelected, IWidgetIcon widgetUnselected) {
|
||||
public ConduitDisplayMode(@Nonnull Class<? extends IConduit> conduitType, IWidgetIcon widgetSelected,
|
||||
IWidgetIcon widgetUnselected) {
|
||||
this.conduitType = conduitType;
|
||||
this.widgetSelected = widgetSelected;
|
||||
this.widgetUnselected = widgetUnselected;
|
||||
@@ -107,11 +103,9 @@ public class ConduitDisplayMode {
|
||||
}
|
||||
|
||||
/**
|
||||
* The name is null by default, and will use the simple class name of the
|
||||
* conduit type.
|
||||
* The name is null by default, and will use the simple class name of the conduit type.
|
||||
*
|
||||
* @param name
|
||||
* The override name to set.
|
||||
* @param name The override name to set.
|
||||
*/
|
||||
public void setName(@Nullable String name) {
|
||||
this.overrideName = name;
|
||||
@@ -195,6 +189,7 @@ public class ConduitDisplayMode {
|
||||
|
||||
public static Iterable<ConduitDisplayMode> getRenderableModes() {
|
||||
return FluentIterable.from(registrar).filter(new Predicate<ConduitDisplayMode>() {
|
||||
|
||||
@Override
|
||||
public boolean apply(ConduitDisplayMode input) {
|
||||
return input != ALL && input != NONE;
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import java.util.ArrayList;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class ConduitNetworkTickHandler {
|
||||
|
||||
public static final ConduitNetworkTickHandler instance = new ConduitNetworkTickHandler();
|
||||
|
||||
public static interface TickListener {
|
||||
|
||||
public void tickStart(TickEvent.ServerTickEvent evt);
|
||||
|
||||
public void tickEnd(TickEvent.ServerTickEvent evt);
|
||||
@@ -19,8 +21,7 @@ public class ConduitNetworkTickHandler {
|
||||
|
||||
private final List<TickListener> listeners = new ArrayList<TickListener>();
|
||||
|
||||
private final IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean> networks =
|
||||
new IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean>();
|
||||
private final IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean> networks = new IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean>();
|
||||
|
||||
public void addListener(TickListener listener) {
|
||||
listeners.add(listener);
|
||||
|
||||
@@ -6,6 +6,13 @@ import static crazypants.enderio.material.Material.*;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.*;
|
||||
import static crazypants.util.RecipeUtil.addShaped;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@@ -26,12 +33,6 @@ import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.material.BlockFusedQuartz;
|
||||
import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
public class ConduitRecipes {
|
||||
|
||||
@@ -59,10 +60,14 @@ public class ConduitRecipes {
|
||||
|
||||
String binder = CONDUIT_BINDER.oreDict;
|
||||
|
||||
ItemStack zombieController =
|
||||
new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.ZOMBIE_CONTROLLER.ordinal());
|
||||
ItemStack skeletalContractor =
|
||||
new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.SKELETAL_CONTRACTOR.ordinal());
|
||||
ItemStack zombieController = new ItemStack(
|
||||
EnderIO.itemFrankenSkull,
|
||||
1,
|
||||
FrankenSkull.ZOMBIE_CONTROLLER.ordinal());
|
||||
ItemStack skeletalContractor = new ItemStack(
|
||||
EnderIO.itemFrankenSkull,
|
||||
1,
|
||||
FrankenSkull.SKELETAL_CONTRACTOR.ordinal());
|
||||
|
||||
// Recipes
|
||||
addShaped(
|
||||
@@ -72,15 +77,16 @@ public class ConduitRecipes {
|
||||
"bbb",
|
||||
'b',
|
||||
binder);
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(EnderIO.itemConduitFacade, 1, FacadeType.HARDENED.ordinal()),
|
||||
" o ",
|
||||
"oFo",
|
||||
" o ",
|
||||
'F',
|
||||
EnderIO.itemConduitFacade,
|
||||
'o',
|
||||
"dustObsidian"));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
new ItemStack(EnderIO.itemConduitFacade, 1, FacadeType.HARDENED.ordinal()),
|
||||
" o ",
|
||||
"oFo",
|
||||
" o ",
|
||||
'F',
|
||||
EnderIO.itemConduitFacade,
|
||||
'o',
|
||||
"dustObsidian"));
|
||||
|
||||
int numConduits = Config.numConduitsPerRecipe;
|
||||
addShaped(
|
||||
@@ -245,8 +251,7 @@ public class ConduitRecipes {
|
||||
"ingotGold");
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, 3);
|
||||
|
||||
if (OreDictionary.doesOreNameExist("ingotCopper")
|
||||
&& OreDictionary.getOres("ingotCopper").size() > 0) {
|
||||
if (OreDictionary.doesOreNameExist("ingotCopper") && OreDictionary.getOres("ingotCopper").size() > 0) {
|
||||
addShaped(
|
||||
new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 4),
|
||||
"b#b",
|
||||
@@ -553,8 +558,8 @@ public class ConduitRecipes {
|
||||
ItemStack itemConduit = new ItemStack(EnderIO.itemItemConduit, numConduits, 0);
|
||||
addShaped(itemConduit, "bbb", "###", "bbb", 'b', binder, '#', phasedIronNugget);
|
||||
|
||||
MachineRecipeRegistry.instance.registerRecipe(
|
||||
blockPainter.unlocalisedName, EnderIO.itemConduitFacade.new FacadePainterRecipe());
|
||||
MachineRecipeRegistry.instance
|
||||
.registerRecipe(blockPainter.unlocalisedName, EnderIO.itemConduitFacade.new FacadePainterRecipe());
|
||||
|
||||
// Filter Recipes
|
||||
ItemStack basicFilter = new ItemStack(EnderIO.itemBasicFilterUpgrade, 1, 0);
|
||||
@@ -669,8 +674,7 @@ public class ConduitRecipes {
|
||||
String fluix = "crystalFluix";
|
||||
String pureFluix = "crystalPureFluix";
|
||||
|
||||
ItemStack quartzFiber =
|
||||
AEApi.instance().parts().partQuartzFiber.stack(1).copy();
|
||||
ItemStack quartzFiber = AEApi.instance().parts().partQuartzFiber.stack(1).copy();
|
||||
ItemStack conduitBinder = new ItemStack(EnderIO.itemMaterial, 1, Material.CONDUIT_BINDER.ordinal());
|
||||
ItemStack res = new ItemStack(EnderIO.itemMEConduit, Config.numConduitsPerRecipe / 2);
|
||||
|
||||
@@ -678,6 +682,11 @@ public class ConduitRecipes {
|
||||
addShaped(res.copy(), "bbb", "fqf", "bbb", 'b', conduitBinder, 'f', pureFluix, 'q', quartzFiber);
|
||||
|
||||
res.stackSize = 1;
|
||||
addShaped(new ItemStack(EnderIO.itemMEConduit, 1, 1), "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', res);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,27 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block.SoundType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -18,34 +38,17 @@ import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.Signal;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import net.minecraft.block.Block.SoundType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class ConduitUtil {
|
||||
|
||||
public static final Random RANDOM = new Random();
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public static void ensureValidNetwork(IConduit conduit) {
|
||||
TileEntity te = conduit.getBundle().getEntity();
|
||||
World world = te.getWorldObj();
|
||||
Collection<? extends IConduit> connections =
|
||||
ConduitUtil.getConnectedConduits(world, te.xCoord, te.yCoord, te.zCoord, conduit.getBaseConduitType());
|
||||
Collection<? extends IConduit> connections = ConduitUtil
|
||||
.getConnectedConduits(world, te.xCoord, te.yCoord, te.zCoord, conduit.getBaseConduitType());
|
||||
|
||||
if (reuseNetwork(conduit, connections, world)) {
|
||||
return;
|
||||
@@ -56,7 +59,7 @@ public class ConduitUtil {
|
||||
return;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
private static boolean reuseNetwork(IConduit con, Collection<? extends IConduit> connections, World world) {
|
||||
AbstractConduitNetwork network = null;
|
||||
for (IConduit conduit : connections) {
|
||||
@@ -80,16 +83,16 @@ public class ConduitUtil {
|
||||
public static <T extends IConduit> void disconectConduits(T con, ForgeDirection connDir) {
|
||||
con.conduitConnectionRemoved(connDir);
|
||||
BlockCoord loc = con.getLocation().getLocation(connDir);
|
||||
IConduit neighbour = ConduitUtil.getConduit(
|
||||
con.getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, con.getBaseConduitType());
|
||||
IConduit neighbour = ConduitUtil
|
||||
.getConduit(con.getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, con.getBaseConduitType());
|
||||
if (neighbour != null) {
|
||||
neighbour.conduitConnectionRemoved(connDir.getOpposite());
|
||||
if (neighbour.getNetwork() != null) {
|
||||
neighbour.getNetwork().destroyNetwork();
|
||||
}
|
||||
}
|
||||
if (con.getNetwork()
|
||||
!= null) { // this should have been destroyed when destroying the neighbours network but lets just make
|
||||
if (con.getNetwork() != null) { // this should have been destroyed when destroying the neighbours network but
|
||||
// lets just make
|
||||
// sure
|
||||
con.getNetwork().destroyNetwork();
|
||||
}
|
||||
@@ -101,10 +104,9 @@ public class ConduitUtil {
|
||||
|
||||
public static <T extends IConduit> boolean joinConduits(T con, ForgeDirection faceHit) {
|
||||
BlockCoord loc = con.getLocation().getLocation(faceHit);
|
||||
IConduit neighbour = ConduitUtil.getConduit(
|
||||
con.getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, con.getBaseConduitType());
|
||||
if (neighbour != null
|
||||
&& con.canConnectToConduit(faceHit, neighbour)
|
||||
IConduit neighbour = ConduitUtil
|
||||
.getConduit(con.getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, con.getBaseConduitType());
|
||||
if (neighbour != null && con.canConnectToConduit(faceHit, neighbour)
|
||||
&& neighbour.canConnectToConduit(faceHit.getOpposite(), con)) {
|
||||
con.conduitConnectionAdded(faceHit);
|
||||
neighbour.conduitConnectionAdded(faceHit.getOpposite());
|
||||
@@ -240,12 +242,12 @@ public class ConduitUtil {
|
||||
}
|
||||
|
||||
public static <T extends IConduit> T getConduit(World world, TileEntity te, ForgeDirection dir, Class<T> type) {
|
||||
return ConduitUtil.getConduit(
|
||||
world, te.xCoord + dir.offsetX, te.yCoord + dir.offsetY, te.zCoord + dir.offsetZ, type);
|
||||
return ConduitUtil
|
||||
.getConduit(world, te.xCoord + dir.offsetX, te.yCoord + dir.offsetY, te.zCoord + dir.offsetZ, type);
|
||||
}
|
||||
|
||||
public static <T extends IConduit> Collection<T> getConnectedConduits(
|
||||
World world, int x, int y, int z, Class<T> type) {
|
||||
public static <T extends IConduit> Collection<T> getConnectedConduits(World world, int x, int y, int z,
|
||||
Class<T> type) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (!(te instanceof IConduitBundle)) {
|
||||
return Collections.emptyList();
|
||||
@@ -318,8 +320,8 @@ public class ConduitUtil {
|
||||
int signalStrength = getInternalSignalForColor(bundle, col);
|
||||
if (signalStrength < 15 && DyeColor.RED == col && bundle != null && bundle.getEntity() != null) {
|
||||
TileEntity te = bundle.getEntity();
|
||||
signalStrength = Math.max(
|
||||
signalStrength, te.getWorldObj().getStrongestIndirectPower(te.xCoord, te.yCoord, te.zCoord));
|
||||
signalStrength = Math
|
||||
.max(signalStrength, te.getWorldObj().getStrongestIndirectPower(te.xCoord, te.yCoord, te.zCoord));
|
||||
}
|
||||
return RedstoneControlMode.isConditionMet(mode, signalStrength);
|
||||
}
|
||||
@@ -373,8 +375,7 @@ public class ConduitUtil {
|
||||
if (cons.size() == 1) {
|
||||
player.openGui(
|
||||
EnderIO.instance,
|
||||
GuiHandler.GUI_ID_EXTERNAL_CONNECTION_BASE
|
||||
+ cons.iterator().next().ordinal(),
|
||||
GuiHandler.GUI_ID_EXTERNAL_CONNECTION_BASE + cons.iterator().next().ordinal(),
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
@@ -399,8 +400,7 @@ public class ConduitUtil {
|
||||
}
|
||||
|
||||
private static void playClientBreakSound(SoundType snd) {
|
||||
FMLClientHandler.instance()
|
||||
.getClientPlayerEntity()
|
||||
FMLClientHandler.instance().getClientPlayerEntity()
|
||||
.playSound(snd.getBreakSound(), (snd.getVolume() + 1.0F) / 2.0F, snd.getPitch() * 0.8F);
|
||||
}
|
||||
|
||||
@@ -419,8 +419,7 @@ public class ConduitUtil {
|
||||
}
|
||||
|
||||
private static void playClientHitSound(SoundType snd) {
|
||||
FMLClientHandler.instance()
|
||||
.getClientPlayerEntity()
|
||||
FMLClientHandler.instance().getClientPlayerEntity()
|
||||
.playSound(snd.getStepResourcePath(), (snd.getVolume() + 1.0F) / 8.0F, snd.getPitch() * 0.5F);
|
||||
}
|
||||
|
||||
@@ -439,8 +438,7 @@ public class ConduitUtil {
|
||||
}
|
||||
|
||||
private static void playClientStepSound(SoundType snd) {
|
||||
FMLClientHandler.instance()
|
||||
.getClientPlayerEntity()
|
||||
FMLClientHandler.instance().getClientPlayerEntity()
|
||||
.playSound(snd.getStepResourcePath(), (snd.getVolume() + 1.0F) / 8.0F, snd.getPitch());
|
||||
}
|
||||
|
||||
@@ -459,8 +457,7 @@ public class ConduitUtil {
|
||||
}
|
||||
|
||||
private static void playClientPlaceSound(SoundType snd) {
|
||||
FMLClientHandler.instance()
|
||||
.getClientPlayerEntity()
|
||||
FMLClientHandler.instance().getClientPlayerEntity()
|
||||
.playSound(snd.func_150496_b(), (snd.getVolume() + 1.0F) / 8.0F, snd.getPitch());
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package crazypants.enderio.conduit;
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
public enum ConnectionMode {
|
||||
|
||||
IN_OUT("gui.conduit.ioMode.inOut"),
|
||||
INPUT("gui.conduit.ioMode.input"),
|
||||
OUTPUT("gui.conduit.ioMode.output"),
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import crazypants.enderio.conduit.geom.CollidableCache.CacheKey;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -15,6 +13,11 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.conduit.geom.CollidableCache.CacheKey;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
|
||||
public interface IConduit {
|
||||
|
||||
// Base functionality
|
||||
@@ -135,8 +138,7 @@ public interface IConduit {
|
||||
public AbstractConduitNetwork<?, ?> createNetworkForType();
|
||||
|
||||
/**
|
||||
* Should the texture of the conduit connectors be mirrored around the conduit
|
||||
* node?
|
||||
* Should the texture of the conduit connectors be mirrored around the conduit node?
|
||||
*/
|
||||
boolean shouldMirrorTexture();
|
||||
}
|
||||
@@ -1,8 +1,26 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import mods.immibis.microblocks.api.IMicroblockSupporterTile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import appeng.api.networking.IGridHost;
|
||||
import cofh.api.transport.IItemDuct;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.InterfaceList;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -11,36 +29,14 @@ import crazypants.enderio.conduit.facade.ItemConduitFacade.FacadeType;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.power.IInternalPowerHandler;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import mods.immibis.microblocks.api.IMicroblockSupporterTile;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
@InterfaceList({
|
||||
@Interface(iface = "appeng.api.networking.IGridHost", modid = "appliedenergistics2"),
|
||||
@Interface(iface = "mekanism.api.gas.IGasHandler", modid = "MekanismAPI|gas"),
|
||||
@Interface(iface = "mods.immibis.microblocks.api.IMicroblockSupporterTile", modid = "ImmibisMicroblocks"),
|
||||
@Interface(iface = "li.cil.oc.api.network.Environment", modid = "OpenComputersAPI|Network"),
|
||||
@Interface(iface = "li.cil.oc.api.network.SidedEnvironment", modid = "OpenComputersAPI|Network")
|
||||
})
|
||||
public interface IConduitBundle
|
||||
extends IInternalPowerHandler,
|
||||
IFluidHandler,
|
||||
IItemDuct,
|
||||
IGasHandler,
|
||||
IGridHost,
|
||||
IMicroblockSupporterTile,
|
||||
Environment,
|
||||
SidedEnvironment {
|
||||
@InterfaceList({ @Interface(iface = "appeng.api.networking.IGridHost", modid = "appliedenergistics2"),
|
||||
@Interface(iface = "mekanism.api.gas.IGasHandler", modid = "MekanismAPI|gas"),
|
||||
@Interface(iface = "mods.immibis.microblocks.api.IMicroblockSupporterTile", modid = "ImmibisMicroblocks"),
|
||||
@Interface(iface = "li.cil.oc.api.network.Environment", modid = "OpenComputersAPI|Network"),
|
||||
@Interface(iface = "li.cil.oc.api.network.SidedEnvironment", modid = "OpenComputersAPI|Network") })
|
||||
public interface IConduitBundle extends IInternalPowerHandler, IFluidHandler, IItemDuct, IGasHandler, IGridHost,
|
||||
IMicroblockSupporterTile, Environment, SidedEnvironment {
|
||||
|
||||
TileEntity getEntity();
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import crazypants.enderio.api.tool.IHideFacades;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import crazypants.enderio.api.tool.IHideFacades;
|
||||
|
||||
public interface IConduitItem extends IHideFacades {
|
||||
|
||||
Class<? extends IConduit> getBaseConduitType();
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IExtractor extends IConduit {
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MicroblocksUtil {
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
|
||||
public class RaytraceResult {
|
||||
|
||||
public static RaytraceResult getClosestHit(Vec3 origin, Collection<RaytraceResult> candidates) {
|
||||
@@ -32,6 +34,7 @@ public class RaytraceResult {
|
||||
return;
|
||||
}
|
||||
Collections.sort(toSort, new Comparator<RaytraceResult>() {
|
||||
|
||||
@Override
|
||||
public int compare(RaytraceResult o1, RaytraceResult o2) {
|
||||
return Double.compare(o1.getDistanceTo(origin), o2.getDistanceTo(origin));
|
||||
|
||||
@@ -1,8 +1,47 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import li.cil.oc.api.network.*;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.IMicroblockSystem;
|
||||
import mods.immibis.microblocks.api.MicroblockAPIUtils;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
import mods.immibis.microblocks.api.PartType;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AECableType;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -25,40 +64,6 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.InsulatedRedstoneConduit;
|
||||
import crazypants.enderio.config.Config;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import li.cil.oc.api.network.*;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.IMicroblockSystem;
|
||||
import mods.immibis.microblocks.api.MicroblockAPIUtils;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
import mods.immibis.microblocks.api.PartType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
@@ -104,8 +109,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
@Override
|
||||
public boolean shouldRenderInPass(int arg0) {
|
||||
if (facadeId != null
|
||||
&& facadeId.isOpaqueCube()
|
||||
if (facadeId != null && facadeId.isOpaqueCube()
|
||||
&& !ConduitUtil.isFacadeHidden(this, EnderIO.proxy.getClientPlayer())) {
|
||||
return false;
|
||||
}
|
||||
@@ -334,8 +338,8 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
markForUpdate = true;
|
||||
}
|
||||
} else { // can do the else as only need to update once
|
||||
ConduitDisplayMode curMode = ConduitDisplayMode.getDisplayMode(
|
||||
EnderIO.proxy.getClientPlayer().getCurrentEquippedItem());
|
||||
ConduitDisplayMode curMode = ConduitDisplayMode
|
||||
.getDisplayMode(EnderIO.proxy.getClientPlayer().getCurrentEquippedItem());
|
||||
if (curMode != lastMode) {
|
||||
markForUpdate = true;
|
||||
lastMode = curMode;
|
||||
@@ -583,8 +587,11 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
}
|
||||
if (bb != null) {
|
||||
bb = bb.scale(1.05, 1.05, 1.05);
|
||||
CollidableComponent cc =
|
||||
new CollidableComponent(null, bb, ForgeDirection.UNKNOWN, ConduitConnectorType.INTERNAL);
|
||||
CollidableComponent cc = new CollidableComponent(
|
||||
null,
|
||||
bb,
|
||||
ForgeDirection.UNKNOWN,
|
||||
ConduitConnectorType.INTERNAL);
|
||||
result.add(cc);
|
||||
cachedConnectors.add(cc);
|
||||
}
|
||||
@@ -605,7 +612,10 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
if (bb.getArea() > area * 1.5f) {
|
||||
bb = bb.scale(1.05, 1.05, 1.05);
|
||||
CollidableComponent cc = new CollidableComponent(
|
||||
null, bb, ForgeDirection.UNKNOWN, ConduitConnectorType.INTERNAL);
|
||||
null,
|
||||
bb,
|
||||
ForgeDirection.UNKNOWN,
|
||||
ConduitConnectorType.INTERNAL);
|
||||
result.add(cc);
|
||||
cachedConnectors.add(cc);
|
||||
}
|
||||
@@ -626,8 +636,11 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
}
|
||||
|
||||
if (conBB != null) {
|
||||
CollidableComponent cc =
|
||||
new CollidableComponent(null, conBB, ForgeDirection.UNKNOWN, ConduitConnectorType.INTERNAL);
|
||||
CollidableComponent cc = new CollidableComponent(
|
||||
null,
|
||||
conBB,
|
||||
ForgeDirection.UNKNOWN,
|
||||
ConduitConnectorType.INTERNAL);
|
||||
result.add(cc);
|
||||
cachedConnectors.add(cc);
|
||||
}
|
||||
@@ -659,23 +672,34 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
Class<? extends IConduit> type = con.getCollidableType();
|
||||
if (con.hasConnections()) {
|
||||
for (ForgeDirection dir : con.getExternalConnections()) {
|
||||
result.addAll(cc.getCollidables(
|
||||
cc.createKey(type, getOffset(con.getBaseConduitType(), dir), ForgeDirection.UNKNOWN, false),
|
||||
con));
|
||||
result.addAll(
|
||||
cc.getCollidables(
|
||||
cc.createKey(
|
||||
type,
|
||||
getOffset(con.getBaseConduitType(), dir),
|
||||
ForgeDirection.UNKNOWN,
|
||||
false),
|
||||
con));
|
||||
}
|
||||
for (ForgeDirection dir : con.getConduitConnections()) {
|
||||
result.addAll(cc.getCollidables(
|
||||
cc.createKey(type, getOffset(con.getBaseConduitType(), dir), ForgeDirection.UNKNOWN, false),
|
||||
con));
|
||||
result.addAll(
|
||||
cc.getCollidables(
|
||||
cc.createKey(
|
||||
type,
|
||||
getOffset(con.getBaseConduitType(), dir),
|
||||
ForgeDirection.UNKNOWN,
|
||||
false),
|
||||
con));
|
||||
}
|
||||
} else {
|
||||
result.addAll(cc.getCollidables(
|
||||
cc.createKey(
|
||||
type,
|
||||
getOffset(con.getBaseConduitType(), ForgeDirection.UNKNOWN),
|
||||
ForgeDirection.UNKNOWN,
|
||||
false),
|
||||
con));
|
||||
result.addAll(
|
||||
cc.getCollidables(
|
||||
cc.createKey(
|
||||
type,
|
||||
getOffset(con.getBaseConduitType(), ForgeDirection.UNKNOWN),
|
||||
ForgeDirection.UNKNOWN,
|
||||
false),
|
||||
con));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1029,8 +1053,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
super.onDataPacket(net, pkt);
|
||||
if (covers != null) {
|
||||
((IMicroblockCoverSystem) covers)
|
||||
.readDescriptionBytes(pkt.func_148857_g().getByteArray("C"), 0);
|
||||
((IMicroblockCoverSystem) covers).readDescriptionBytes(pkt.func_148857_g().getByteArray("C"), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
package crazypants.enderio.conduit.facade;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.machine.painter.IPaintedBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -15,6 +9,13 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.machine.painter.IPaintedBlock;
|
||||
|
||||
public class BlockConduitFacade extends BlockEio implements IPaintedBlock {
|
||||
|
||||
public static BlockConduitFacade create() {
|
||||
@@ -78,8 +79,7 @@ public class BlockConduitFacade extends BlockEio implements IPaintedBlock {
|
||||
if (blockOverride != null) {
|
||||
try { // work around for Issue #589
|
||||
return blockOverride.colorMultiplier(par1IBlockAccess, par2, par3, par4);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
return super.colorMultiplier(par1IBlockAccess, par2, par3, par4);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
package crazypants.enderio.conduit.facade;
|
||||
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
|
||||
public class FacadeRenderer implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return type == ItemRenderType.ENTITY
|
||||
|| type == ItemRenderType.EQUIPPED
|
||||
return type == ItemRenderType.ENTITY || type == ItemRenderType.EQUIPPED
|
||||
|| type == ItemRenderType.INVENTORY
|
||||
|| type == ItemRenderType.EQUIPPED_FIRST_PERSON;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
package crazypants.enderio.conduit.facade;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
|
||||
import com.enderio.core.client.handlers.SpecialTooltipHandler;
|
||||
import com.enderio.core.common.util.Util;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -19,20 +32,11 @@ import crazypants.enderio.machine.painter.BasicPainterTemplate;
|
||||
import crazypants.enderio.machine.painter.IPaintedBlock;
|
||||
import crazypants.enderio.machine.painter.PaintSourceValidator;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider, IResourceTooltipProvider {
|
||||
|
||||
public static enum FacadeType {
|
||||
|
||||
BASIC,
|
||||
HARDENED;
|
||||
|
||||
@@ -61,7 +65,7 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
GameRegistry.registerItem(this, ModObject.itemConduitFacade.unlocalisedName);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs p_150895_2_, List list) {
|
||||
@@ -105,17 +109,8 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack itemStack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float par8,
|
||||
float par9,
|
||||
float par10) {
|
||||
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float par8, float par9, float par10) {
|
||||
|
||||
if (world.isRemote) {
|
||||
return true;
|
||||
@@ -145,16 +140,15 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
} else {
|
||||
Block block = world.getBlock(placeX, placeY, placeZ);
|
||||
if (block == EnderIO.blockConduitBundle) {
|
||||
((BlockConduitBundle) block)
|
||||
.handleFacadeClick(
|
||||
world,
|
||||
placeX,
|
||||
placeY,
|
||||
placeZ,
|
||||
player,
|
||||
dir.getOpposite().ordinal(),
|
||||
(IConduitBundle) world.getTileEntity(placeX, placeY, placeZ),
|
||||
itemStack);
|
||||
((BlockConduitBundle) block).handleFacadeClick(
|
||||
world,
|
||||
placeX,
|
||||
placeY,
|
||||
placeZ,
|
||||
player,
|
||||
dir.getOpposite().ordinal(),
|
||||
(IConduitBundle) world.getTileEntity(placeX, placeY, placeZ),
|
||||
itemStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -194,7 +188,7 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
@@ -205,7 +199,7 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
|
||||
@@ -1,7 +1,20 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
@@ -10,30 +23,20 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.machine.reservoir.TileReservoir;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public abstract class AbstractGasConduit extends AbstractConduit implements IGasConduit {
|
||||
|
||||
protected final EnumMap<ForgeDirection, RedstoneControlMode> extractionModes =
|
||||
new EnumMap<ForgeDirection, RedstoneControlMode>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, DyeColor> extractionColors =
|
||||
new EnumMap<ForgeDirection, DyeColor>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, RedstoneControlMode> extractionModes = new EnumMap<ForgeDirection, RedstoneControlMode>(
|
||||
ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, DyeColor> extractionColors = new EnumMap<ForgeDirection, DyeColor>(
|
||||
ForgeDirection.class);
|
||||
|
||||
protected final Map<ForgeDirection, Integer> externalRedstoneSignals = new HashMap<ForgeDirection, Integer>();
|
||||
protected boolean redstoneStateDirty = true;
|
||||
|
||||
@Method(modid = GasUtil.API_NAME)
|
||||
public IGasHandler getExternalHandler(ForgeDirection direction) {
|
||||
IGasHandler con = GasUtil.getExternalGasHandler(
|
||||
getBundle().getWorld(), getLocation().getLocation(direction));
|
||||
IGasHandler con = GasUtil.getExternalGasHandler(getBundle().getWorld(), getLocation().getLocation(direction));
|
||||
return (con != null && !(con instanceof IConduitBundle)) ? con : null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.RaytraceResult;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import java.util.List;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public abstract class AbstractGasTankConduit extends AbstractGasConduit {
|
||||
|
||||
@@ -44,7 +48,11 @@ public abstract class AbstractGasTankConduit extends AbstractGasConduit {
|
||||
|
||||
BlockCoord loc = getLocation().getLocation(faceHit);
|
||||
IGasConduit n = ConduitUtil.getConduit(
|
||||
getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, IGasConduit.class);
|
||||
getBundle().getEntity().getWorldObj(),
|
||||
loc.x,
|
||||
loc.y,
|
||||
loc.z,
|
||||
IGasConduit.class);
|
||||
if (n == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
|
||||
public class AbstractGasTankConduitNetwork<T extends AbstractGasTankConduit>
|
||||
extends AbstractConduitNetwork<IGasConduit, T> {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.GasTank;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
|
||||
public class ConduitGasTank extends GasTank {
|
||||
|
||||
private int capacity;
|
||||
|
||||
@@ -1,7 +1,20 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
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;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -11,15 +24,6 @@ import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.config.Config;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class GasConduit extends AbstractGasTankConduit {
|
||||
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
|
||||
public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit> {
|
||||
|
||||
private final ConduitGasTank tank = new ConduitGasTank(0);
|
||||
@@ -77,11 +80,8 @@ public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit>
|
||||
}
|
||||
con.getTank().setGas(f);
|
||||
BlockCoord bc = con.getLocation();
|
||||
con.getBundle()
|
||||
.getEntity()
|
||||
.getWorldObj()
|
||||
.markTileEntityChunkModified(
|
||||
bc.x, bc.y, bc.z, con.getBundle().getEntity());
|
||||
con.getBundle().getEntity().getWorldObj()
|
||||
.markTileEntityChunkModified(bc.x, bc.y, bc.z, con.getBundle().getEntity());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,8 +154,7 @@ public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit>
|
||||
}
|
||||
|
||||
public GasStack drain(ForgeDirection from, GasStack resource, boolean doDrain) {
|
||||
if (resource == null
|
||||
|| tank.isEmpty()
|
||||
if (resource == null || tank.isEmpty()
|
||||
|| !tank.containsValidGas()
|
||||
|| !GasConduitNetwork.areGassCompatable(getGasType(), resource)) {
|
||||
return null;
|
||||
@@ -206,11 +205,11 @@ public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit>
|
||||
GasStack couldDrain = gasType.copy();
|
||||
couldDrain.amount = maxExtract;
|
||||
|
||||
// GasStack drained = extTank.drain(dir.getOpposite(), couldDrain, true);
|
||||
// if(drained == null || drained.amount <= 0) {
|
||||
// return false;
|
||||
// }
|
||||
// tank.addAmount(drained.amount);
|
||||
// GasStack drained = extTank.drain(dir.getOpposite(), couldDrain, true);
|
||||
// if(drained == null || drained.amount <= 0) {
|
||||
// return false;
|
||||
// }
|
||||
// tank.addAmount(drained.amount);
|
||||
|
||||
// Have to use this 'double handle' approach to work around an issue with TiC
|
||||
GasStack drained = extTank.drawGas(dir.getOpposite(), maxExtract);
|
||||
|
||||
@@ -2,10 +2,20 @@ package crazypants.enderio.conduit.gas;
|
||||
|
||||
import static com.enderio.core.client.render.CubeRenderer.addVecWithUV;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
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.RenderUtil;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
import com.enderio.core.common.vecmath.Vertex;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
@@ -15,12 +25,6 @@ import crazypants.enderio.conduit.geom.ConnectionModeGeometry;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
import java.util.List;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@@ -30,16 +34,8 @@ public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderEntity(
|
||||
ConduitBundleRenderer conduitBundleRenderer,
|
||||
IConduitBundle te,
|
||||
IConduit conduit,
|
||||
double x,
|
||||
double y,
|
||||
double z,
|
||||
float partialTick,
|
||||
float worldLight,
|
||||
RenderBlocks rb) {
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x,
|
||||
double y, double z, float partialTick, float worldLight, RenderBlocks rb) {
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
|
||||
if (!conduit.hasConnectionMode(ConnectionMode.INPUT) && !conduit.hasConnectionMode(ConnectionMode.OUTPUT)) {
|
||||
@@ -93,8 +89,8 @@ public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
vDir = RenderUtil.getUDirForFace(d);
|
||||
} else if ((component.dir == ForgeDirection.NORTH || component.dir == ForgeDirection.SOUTH)
|
||||
&& d.offsetY != 0) {
|
||||
vDir = RenderUtil.getUDirForFace(d);
|
||||
}
|
||||
vDir = RenderUtil.getUDirForFace(d);
|
||||
}
|
||||
|
||||
float minU = texture.getMinU();
|
||||
float maxU = texture.getMaxU();
|
||||
@@ -124,7 +120,11 @@ public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
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());
|
||||
component.dir,
|
||||
tex.getMinU(),
|
||||
tex.getMaxU(),
|
||||
tex.getMinV(),
|
||||
tex.getMaxV());
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
for (Vertex c : corners) {
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
@@ -154,7 +154,7 @@ public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
}
|
||||
|
||||
private int[] getClosest(ForgeDirection edge, List<Vertex> vertices) {
|
||||
int[] res = new int[] {-1, -1};
|
||||
int[] res = new int[] { -1, -1 };
|
||||
boolean highest = edge.offsetX > 0 || edge.offsetY > 0 || edge.offsetZ > 0;
|
||||
double minMax = highest ? -Double.MAX_VALUE : Double.MAX_VALUE;
|
||||
int index = 0;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
public class GasOutput {
|
||||
|
||||
final ForgeDirection dir;
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.common.ModAPIManager;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.config.Config;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public final class GasUtil {
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IExtractor;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Interface(iface = "mekanism.api.gas.IGasHandler", modid = GasUtil.API_NAME)
|
||||
public interface IGasConduit extends IConduit, IGasHandler, IExtractor {
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.client.handlers.SpecialTooltipHandler;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
@@ -12,22 +18,21 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.ItemConduitSubtype;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemGasConduit extends AbstractItemConduit implements IAdvancedTooltipProvider {
|
||||
|
||||
private static ItemConduitSubtype[] subtypes = new ItemConduitSubtype[] {
|
||||
new ItemConduitSubtype(ModObject.itemGasConduit.name(), "enderio:itemGasConduit"),
|
||||
};
|
||||
new ItemConduitSubtype(ModObject.itemGasConduit.name(), "enderio:itemGasConduit"), };
|
||||
|
||||
public static ItemGasConduit create() {
|
||||
ItemGasConduit result = new ItemGasConduit();
|
||||
if (GasUtil.isGasConduitEnabled()) {
|
||||
result.init();
|
||||
ConduitDisplayMode.registerDisplayMode(new ConduitDisplayMode(
|
||||
IGasConduit.class, IconEIO.WRENCH_OVERLAY_GAS, IconEIO.WRENCH_OVERLAY_GAS_OFF));
|
||||
ConduitDisplayMode.registerDisplayMode(
|
||||
new ConduitDisplayMode(
|
||||
IGasConduit.class,
|
||||
IconEIO.WRENCH_OVERLAY_GAS,
|
||||
IconEIO.WRENCH_OVERLAY_GAS_OFF));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import com.enderio.core.common.network.MessageTileEntity;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.util.ClientUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class PacketGasLevel extends MessageTileEntity<TileEntity> implements IMessageHandler<PacketGasLevel, IMessage> {
|
||||
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package crazypants.enderio.conduit.geom;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
|
||||
public class CollidableCache {
|
||||
|
||||
public static final CollidableCache instance = new CollidableCache();
|
||||
|
||||
private final Map<CacheKey, Collection<CollidableComponent>> cache =
|
||||
new HashMap<CollidableCache.CacheKey, Collection<CollidableComponent>>();
|
||||
private final Map<CacheKey, Collection<CollidableComponent>> cache = new HashMap<CollidableCache.CacheKey, Collection<CollidableComponent>>();
|
||||
|
||||
public CacheKey createKey(Class<? extends IConduit> baseType, Offset offset, ForgeDirection dir, boolean isStub) {
|
||||
return new CacheKey(baseType, offset, dir, isStub);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package crazypants.enderio.conduit.geom;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class CollidableComponent {
|
||||
|
||||
@@ -11,8 +12,8 @@ public class CollidableComponent {
|
||||
public final ForgeDirection dir;
|
||||
public final Object data;
|
||||
|
||||
public CollidableComponent(
|
||||
Class<? extends IConduit> conduitType, BoundingBox bound, ForgeDirection id, Object data) {
|
||||
public CollidableComponent(Class<? extends IConduit> conduitType, BoundingBox bound, ForgeDirection id,
|
||||
Object data) {
|
||||
this.conduitType = conduitType;
|
||||
this.bound = bound;
|
||||
this.dir = id;
|
||||
@@ -28,8 +29,7 @@ public class CollidableComponent {
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof CollidableComponent) {
|
||||
CollidableComponent other = (CollidableComponent) obj;
|
||||
return conduitType == other.conduitType
|
||||
&& bound.equals(((CollidableComponent) obj).bound)
|
||||
return conduitType == other.conduitType && bound.equals(((CollidableComponent) obj).bound)
|
||||
&& dir == other.dir;
|
||||
}
|
||||
return false;
|
||||
@@ -40,8 +40,7 @@ public class CollidableComponent {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((bound == null) ? 0 : bound.hashCode());
|
||||
result = prime * result
|
||||
+ ((conduitType == null) ? 0 : conduitType.getName().hashCode());
|
||||
result = prime * result + ((conduitType == null) ? 0 : conduitType.getName().hashCode());
|
||||
result = prime * result + ((dir == null) ? 0 : dir.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package crazypants.enderio.conduit.geom;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.common.util.ForgeDirectionOffsets;
|
||||
import com.enderio.core.common.vecmath.VecmathUtil;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ConduitGeometryUtil {
|
||||
|
||||
@@ -30,8 +32,7 @@ public class ConduitGeometryUtil {
|
||||
|
||||
public static final float CONNECTOR_DEPTH = 0.05f;
|
||||
|
||||
private static Map<ForgeDirection, BoundingBox[]> EXTERNAL_CONNECTOR_BOUNDS =
|
||||
new HashMap<ForgeDirection, BoundingBox[]>();
|
||||
private static Map<ForgeDirection, BoundingBox[]> EXTERNAL_CONNECTOR_BOUNDS = new HashMap<ForgeDirection, BoundingBox[]>();
|
||||
|
||||
static {
|
||||
setupBounds(0.5f);
|
||||
@@ -55,8 +56,8 @@ public class ConduitGeometryUtil {
|
||||
}
|
||||
}
|
||||
|
||||
private static BoundingBox[] createExternalConnector(
|
||||
ForgeDirection dir, float connectorDepth, float connectorWidth) {
|
||||
private static BoundingBox[] createExternalConnector(ForgeDirection dir, float connectorDepth,
|
||||
float connectorWidth) {
|
||||
|
||||
BoundingBox[] res = new BoundingBox[2];
|
||||
|
||||
@@ -77,8 +78,8 @@ public class ConduitGeometryUtil {
|
||||
return res;
|
||||
}
|
||||
|
||||
private static BoundingBox createConnectorComponent(
|
||||
ForgeDirection dir, float cornerMin, float cornerMax, float depthMin, float depthMax) {
|
||||
private static BoundingBox createConnectorComponent(ForgeDirection dir, float cornerMin, float cornerMax,
|
||||
float depthMin, float depthMax) {
|
||||
float minX = (1 - Math.abs(dir.offsetX)) * cornerMin + dir.offsetX * depthMin;
|
||||
float minY = (1 - Math.abs(dir.offsetY)) * cornerMin + dir.offsetY * depthMin;
|
||||
float minZ = (1 - Math.abs(dir.offsetZ)) * cornerMin + dir.offsetZ * depthMin;
|
||||
@@ -106,8 +107,8 @@ public class ConduitGeometryUtil {
|
||||
|
||||
private Map<GeometryKey, BoundingBox> boundsCache = new HashMap<GeometryKey, BoundingBox>();
|
||||
|
||||
private EnumMap<ConduitConnectorType, BoundingBox> connectorBounds =
|
||||
new EnumMap<ConduitConnectorType, BoundingBox>(ConduitConnectorType.class);
|
||||
private EnumMap<ConduitConnectorType, BoundingBox> connectorBounds = new EnumMap<ConduitConnectorType, BoundingBox>(
|
||||
ConduitConnectorType.class);
|
||||
|
||||
private ConduitGeometryUtil() {}
|
||||
|
||||
@@ -119,8 +120,8 @@ public class ConduitGeometryUtil {
|
||||
return EXTERNAL_CONNECTOR_BOUNDS.get(dir);
|
||||
}
|
||||
|
||||
public BoundingBox getBoundingBox(
|
||||
Class<? extends IConduit> type, ForgeDirection dir, boolean isStub, Offset offset) {
|
||||
public BoundingBox getBoundingBox(Class<? extends IConduit> type, ForgeDirection dir, boolean isStub,
|
||||
Offset offset) {
|
||||
GeometryKey key = new GeometryKey(dir, isStub, offset, type);
|
||||
BoundingBox result = boundsCache.get(key);
|
||||
if (result == null) {
|
||||
@@ -164,8 +165,8 @@ public class ConduitGeometryUtil {
|
||||
return createConduitBounds(type, key.dir, key.isStub, key.offset);
|
||||
}
|
||||
|
||||
private BoundingBox createConduitBounds(
|
||||
Class<? extends IConduit> type, ForgeDirection dir, boolean isStub, Offset offset) {
|
||||
private BoundingBox createConduitBounds(Class<? extends IConduit> type, ForgeDirection dir, boolean isStub,
|
||||
Offset offset) {
|
||||
BoundingBox bb = CORE_BOUNDS;
|
||||
|
||||
Vector3d min = bb.getMin();
|
||||
|
||||
@@ -2,6 +2,14 @@ package crazypants.enderio.conduit.geom;
|
||||
|
||||
import static com.enderio.core.common.util.ForgeDirectionOffsets.offsetScaled;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.api.client.render.VertexTransform;
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
@@ -10,17 +18,11 @@ import com.enderio.core.client.render.VertexTransformComposite;
|
||||
import com.enderio.core.client.render.VertexTranslation;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
import com.enderio.core.common.vecmath.Vertex;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ConnectionModeGeometry {
|
||||
|
||||
private static final EnumMap<ForgeDirection, List<Vertex>> VERTS =
|
||||
new EnumMap<ForgeDirection, List<Vertex>>(ForgeDirection.class);
|
||||
private static final EnumMap<ForgeDirection, List<Vertex>> VERTS = new EnumMap<ForgeDirection, List<Vertex>>(
|
||||
ForgeDirection.class);
|
||||
|
||||
static {
|
||||
float scale = 0.9f;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package crazypants.enderio.conduit.geom;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
|
||||
public final class GeometryKey {
|
||||
|
||||
public final ForgeDirection dir;
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
* @author brad
|
||||
*/
|
||||
public enum Offset {
|
||||
|
||||
NONE(0, 0, 0),
|
||||
UP(ForgeDirection.UP),
|
||||
DOWN(ForgeDirection.DOWN),
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package crazypants.enderio.conduit.geom;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.gas.IGasConduit;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
@@ -8,9 +13,6 @@ import crazypants.enderio.conduit.me.IMEConduit;
|
||||
import crazypants.enderio.conduit.oc.IOCConduit;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class Offsets {
|
||||
|
||||
|
||||
@@ -1,24 +1,28 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import com.enderio.core.api.client.gui.ITabPanel;
|
||||
import com.enderio.core.api.client.render.IWidgetIcon;
|
||||
import com.enderio.core.client.gui.button.CheckBox;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.client.handlers.SpecialTooltipHandler;
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.item.FunctionUpgrade;
|
||||
import crazypants.enderio.conduit.packet.PacketConnectionMode;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import javax.annotation.Nonnull;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class BaseSettingsPanel implements ITabPanel {
|
||||
|
||||
@@ -67,20 +71,13 @@ public class BaseSettingsPanel implements ITabPanel {
|
||||
protected @Nonnull GuiToolTip filterExtractUpgradeTooltip;
|
||||
protected @Nonnull GuiToolTip filterInsertUpgradeTooltip;
|
||||
|
||||
protected BaseSettingsPanel(
|
||||
@Nonnull IWidgetIcon icon,
|
||||
@Nonnull String typeName,
|
||||
@Nonnull GuiExternalConnection gui,
|
||||
protected BaseSettingsPanel(@Nonnull IWidgetIcon icon, @Nonnull String typeName, @Nonnull GuiExternalConnection gui,
|
||||
@Nonnull IConduit con) {
|
||||
this(icon, typeName, gui, con, "externalConduitConnection");
|
||||
}
|
||||
|
||||
protected BaseSettingsPanel(
|
||||
@Nonnull IWidgetIcon icon,
|
||||
@Nonnull String typeName,
|
||||
@Nonnull GuiExternalConnection gui,
|
||||
@Nonnull IConduit con,
|
||||
@Nonnull String texture) {
|
||||
protected BaseSettingsPanel(@Nonnull IWidgetIcon icon, @Nonnull String typeName, @Nonnull GuiExternalConnection gui,
|
||||
@Nonnull IConduit con, @Nonnull String texture) {
|
||||
this.icon = icon;
|
||||
this.typeName = typeName;
|
||||
this.gui = gui;
|
||||
@@ -113,51 +110,51 @@ public class BaseSettingsPanel implements ITabPanel {
|
||||
|
||||
x = rightColumn + 18 + 1;
|
||||
|
||||
filterExtractUpgradeTooltip =
|
||||
new GuiToolTip(
|
||||
new Rectangle(rightColumn, 70, 18, 18),
|
||||
EnderIO.lang.localize("gui.conduit.item.filterupgrade")) {
|
||||
@Override
|
||||
public boolean shouldDraw() {
|
||||
return !gui.getContainer().hasFilterUpgrades(true) && super.shouldDraw();
|
||||
}
|
||||
};
|
||||
filterExtractUpgradeTooltip = new GuiToolTip(
|
||||
new Rectangle(rightColumn, 70, 18, 18),
|
||||
EnderIO.lang.localize("gui.conduit.item.filterupgrade")) {
|
||||
|
||||
filterInsertUpgradeTooltip =
|
||||
new GuiToolTip(
|
||||
new Rectangle(leftColumn, 70, 18, 18),
|
||||
EnderIO.lang.localize("gui.conduit.item.filterupgrade")) {
|
||||
@Override
|
||||
public boolean shouldDraw() {
|
||||
return !gui.getContainer().hasFilterUpgrades(false) && super.shouldDraw();
|
||||
}
|
||||
};
|
||||
@Override
|
||||
public boolean shouldDraw() {
|
||||
return !gui.getContainer().hasFilterUpgrades(true) && super.shouldDraw();
|
||||
}
|
||||
};
|
||||
|
||||
speedUpgradeTooltip =
|
||||
new GuiToolTip(
|
||||
new Rectangle(rightColumn + 18, customTop + 43, 18, 18),
|
||||
EnderIO.lang.localize("gui.conduit.item.speedupgrade"),
|
||||
EnderIO.lang.localize("gui.conduit.item.speedupgrade2")) {
|
||||
@Override
|
||||
public boolean shouldDraw() {
|
||||
return !gui.getContainer().hasSpeedUpgrades() && super.shouldDraw();
|
||||
}
|
||||
};
|
||||
filterInsertUpgradeTooltip = new GuiToolTip(
|
||||
new Rectangle(leftColumn, 70, 18, 18),
|
||||
EnderIO.lang.localize("gui.conduit.item.filterupgrade")) {
|
||||
|
||||
@Override
|
||||
public boolean shouldDraw() {
|
||||
return !gui.getContainer().hasFilterUpgrades(false) && super.shouldDraw();
|
||||
}
|
||||
};
|
||||
|
||||
speedUpgradeTooltip = new GuiToolTip(
|
||||
new Rectangle(rightColumn + 18, customTop + 43, 18, 18),
|
||||
EnderIO.lang.localize("gui.conduit.item.speedupgrade"),
|
||||
EnderIO.lang.localize("gui.conduit.item.speedupgrade2")) {
|
||||
|
||||
@Override
|
||||
public boolean shouldDraw() {
|
||||
return !gui.getContainer().hasSpeedUpgrades() && super.shouldDraw();
|
||||
}
|
||||
};
|
||||
|
||||
ArrayList<String> funcUpgradeTips = new ArrayList<String>();
|
||||
SpecialTooltipHandler.addTooltipFromResources(funcUpgradeTips, "enderio.gui.conduit.item.functionupgrade.line");
|
||||
for (FunctionUpgrade upgrade : FunctionUpgrade.values()) {
|
||||
funcUpgradeTips.add(EnderIO.lang.localizeExact(upgrade.unlocName.concat(".name")));
|
||||
}
|
||||
functionUpgradeTooltip =
|
||||
new GuiToolTip(
|
||||
new Rectangle(rightColumn + 36, customTop + 43, 18, 18),
|
||||
funcUpgradeTips.toArray(new String[0])) {
|
||||
@Override
|
||||
public boolean shouldDraw() {
|
||||
return !gui.getContainer().hasFunctionUpgrades() && super.shouldDraw();
|
||||
}
|
||||
};
|
||||
functionUpgradeTooltip = new GuiToolTip(
|
||||
new Rectangle(rightColumn + 36, customTop + 43, 18, 18),
|
||||
funcUpgradeTips.toArray(new String[0])) {
|
||||
|
||||
@Override
|
||||
public boolean shouldDraw() {
|
||||
return !gui.getContainer().hasFunctionUpgrades() && super.shouldDraw();
|
||||
}
|
||||
};
|
||||
|
||||
gui.getContainer().setInoutSlotsVisible(false, false);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import com.enderio.core.client.gui.widget.GhostBackgroundItemSlot;
|
||||
import com.enderio.core.client.gui.widget.GhostSlot;
|
||||
import com.enderio.core.common.ContainerEnder;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.gui.item.InventoryUpgrades;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.SpeedUpgrade;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -23,6 +13,19 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.gui.widget.GhostBackgroundItemSlot;
|
||||
import com.enderio.core.client.gui.widget.GhostSlot;
|
||||
import com.enderio.core.common.ContainerEnder;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.gui.item.InventoryUpgrades;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.SpeedUpgrade;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
|
||||
public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrades> {
|
||||
|
||||
private final IItemConduit itemConduit;
|
||||
@@ -70,6 +73,7 @@ public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrade
|
||||
x = 131;
|
||||
y = 71;
|
||||
slotSpeedUpgrades = addSlotToContainer(new Slot(getInv(), 0, x, y) {
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
return getInv().isItemValidForSlot(0, par1ItemStack);
|
||||
@@ -86,6 +90,7 @@ public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrade
|
||||
x = 149;
|
||||
y = 71;
|
||||
slotFunctionUpgrades = addSlotToContainer(new Slot(getInv(), 1, x, y) {
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
return getInv().isItemValidForSlot(1, par1ItemStack);
|
||||
@@ -241,9 +246,8 @@ public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrade
|
||||
|
||||
boolean merged = false;
|
||||
if (slotIndex < outputFilterUpgradeSlot) {
|
||||
for (int targetSlotIdx = outputFilterUpgradeSlot;
|
||||
targetSlotIdx <= functionUpgradeSlot;
|
||||
targetSlotIdx++) {
|
||||
for (int targetSlotIdx = outputFilterUpgradeSlot; targetSlotIdx
|
||||
<= functionUpgradeSlot; targetSlotIdx++) {
|
||||
Slot targetSlot = (Slot) inventorySlots.get(targetSlotIdx);
|
||||
if (targetSlot.xDisplayPosition >= 0 && mergeItemStackSpecial(origStack, targetSlot)) {
|
||||
merged = true;
|
||||
@@ -277,6 +281,7 @@ public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrade
|
||||
}
|
||||
|
||||
private class FilterSlot extends Slot {
|
||||
|
||||
public FilterSlot(IInventory par1iInventory, int par2, int par3, int par4) {
|
||||
super(par1iInventory, par2, par3, par4);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.api.client.gui.IGuiScreen;
|
||||
import com.enderio.core.api.client.render.IWidgetIcon;
|
||||
import com.enderio.core.client.gui.button.TooltipButton;
|
||||
import javax.annotation.Nonnull;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class FakeButton extends TooltipButton {
|
||||
|
||||
@@ -61,15 +64,14 @@ public class FakeButton extends TooltipButton {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
icon.getMap()
|
||||
.render(
|
||||
icon,
|
||||
xPosition + marginX,
|
||||
yPosition + marginY,
|
||||
width - 2 * marginX,
|
||||
height - 2 * marginY,
|
||||
0,
|
||||
true);
|
||||
icon.getMap().render(
|
||||
icon,
|
||||
xPosition + marginX,
|
||||
yPosition + marginY,
|
||||
width - 2 * marginX,
|
||||
height - 2 * marginY,
|
||||
0,
|
||||
true);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import mekanism.api.gas.Gas;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import com.enderio.core.client.gui.button.ColorButton;
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
@@ -14,10 +22,6 @@ import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.IRedstoneModeControlable;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import java.awt.Color;
|
||||
import mekanism.api.gas.Gas;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class GasSettings extends BaseSettingsPanel {
|
||||
|
||||
|
||||
@@ -1,9 +1,26 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.api.client.gui.ITabPanel;
|
||||
import com.enderio.core.api.client.render.IWidgetIcon;
|
||||
import com.enderio.core.client.gui.widget.GhostSlot;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
@@ -16,19 +33,6 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GuiExternalConnection extends GuiContainerBaseEIO {
|
||||
|
||||
@@ -46,8 +50,7 @@ public class GuiExternalConnection extends GuiContainerBaseEIO {
|
||||
return id;
|
||||
}
|
||||
|
||||
private static final Map<Class<? extends IConduit>, Integer> TAB_ORDER =
|
||||
new HashMap<Class<? extends IConduit>, Integer>();
|
||||
private static final Map<Class<? extends IConduit>, Integer> TAB_ORDER = new HashMap<Class<? extends IConduit>, Integer>();
|
||||
|
||||
static {
|
||||
TAB_ORDER.put(IItemConduit.class, 0);
|
||||
@@ -135,8 +138,8 @@ public class GuiExternalConnection extends GuiContainerBaseEIO {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when slots outside of standard gui bounds are clicked to prevent
|
||||
* setting ghost filters dropping items on the ground.
|
||||
* Returns true when slots outside of standard gui bounds are clicked to prevent setting ghost filters dropping
|
||||
* items on the ground.
|
||||
*/
|
||||
private boolean handleOobClick(int x, int y, int button) {
|
||||
boolean outOfBounds = x < guiLeft || y < guiTop || x >= guiLeft + xSize || y >= guiTop + ySize;
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.redstone.IInsulatedRedstoneConduit;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import java.awt.Color;
|
||||
import java.awt.Point;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
@@ -21,6 +14,16 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.redstone.IInsulatedRedstoneConduit;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
|
||||
public class GuiExternalConnectionSelector extends GuiScreen {
|
||||
|
||||
Set<ForgeDirection> cons;
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.ColorButton;
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
@@ -7,6 +21,7 @@ import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
@@ -20,17 +35,6 @@ import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.IRedstoneModeControlable;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import java.awt.Color;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class LiquidSettings extends BaseSettingsPanel {
|
||||
|
||||
@@ -135,8 +139,13 @@ public class LiquidSettings extends BaseSettingsPanel {
|
||||
|
||||
if (isEnder) {
|
||||
x += rsB.getWidth();
|
||||
roundRobinB =
|
||||
new ToggleButton(gui, ID_ROUND_ROBIN_BUTTON, x, y, IconEIO.ROUND_ROBIN_OFF, IconEIO.ROUND_ROBIN);
|
||||
roundRobinB = new ToggleButton(
|
||||
gui,
|
||||
ID_ROUND_ROBIN_BUTTON,
|
||||
x,
|
||||
y,
|
||||
IconEIO.ROUND_ROBIN_OFF,
|
||||
IconEIO.ROUND_ROBIN);
|
||||
roundRobinB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.roundRobinEnabled"));
|
||||
roundRobinB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.roundRobinDisabled"));
|
||||
roundRobinB.setPaintSelectedBorder(false);
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
import com.enderio.core.client.gui.button.ColorButton;
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.oc.IOCConduit;
|
||||
import crazypants.enderio.conduit.packet.PacketOCConduitSignalColor;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import java.awt.Color;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
public class OCSettings extends BaseSettingsPanel {
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
@@ -9,7 +12,6 @@ import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import crazypants.enderio.conduit.packet.AbstractConduitPacket;
|
||||
import crazypants.enderio.conduit.packet.ConTypeEnum;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class PacketFluidChannel extends AbstractConduitPacket<ILiquidConduit>
|
||||
implements IMessageHandler<PacketFluidChannel, IMessage> {
|
||||
@@ -21,8 +23,8 @@ public class PacketFluidChannel extends AbstractConduitPacket<ILiquidConduit>
|
||||
|
||||
public PacketFluidChannel() {}
|
||||
|
||||
public PacketFluidChannel(
|
||||
AbstractEnderLiquidConduit eConduit, ForgeDirection dir, boolean isInput, DyeColor channel) {
|
||||
public PacketFluidChannel(AbstractEnderLiquidConduit eConduit, ForgeDirection dir, boolean isInput,
|
||||
DyeColor channel) {
|
||||
super(eConduit.getBundle().getEntity(), ConTypeEnum.FLUID);
|
||||
this.dir = dir;
|
||||
this.isInput = isInput;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
@@ -10,8 +13,6 @@ import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import crazypants.enderio.conduit.packet.AbstractConduitPacket;
|
||||
import crazypants.enderio.conduit.packet.ConTypeEnum;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class PacketFluidFilter extends AbstractConduitPacket<ILiquidConduit>
|
||||
implements IMessageHandler<PacketFluidFilter, IMessage> {
|
||||
@@ -22,8 +23,8 @@ public class PacketFluidFilter extends AbstractConduitPacket<ILiquidConduit>
|
||||
|
||||
public PacketFluidFilter() {}
|
||||
|
||||
public PacketFluidFilter(
|
||||
AbstractEnderLiquidConduit eConduit, ForgeDirection dir, FluidFilter filter, boolean isInput) {
|
||||
public PacketFluidFilter(AbstractEnderLiquidConduit eConduit, ForgeDirection dir, FluidFilter filter,
|
||||
boolean isInput) {
|
||||
super(eConduit.getBundle().getEntity(), ConTypeEnum.FLUID);
|
||||
this.dir = dir;
|
||||
this.filter = filter;
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.network.MessageTileEntity;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class PacketOpenConduitUI extends MessageTileEntity<TileEntity>
|
||||
implements IMessageHandler<PacketOpenConduitUI, IMessage> {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
||||
public class PacketSlotVisibility implements IMessage, IMessageHandler<PacketSlotVisibility, IMessage> {
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
import com.enderio.core.client.gui.button.ColorButton;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.packet.PacketExtractMode;
|
||||
@@ -11,7 +14,6 @@ import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.IRedstoneModeControlable;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
public class PowerSettings extends BaseSettingsPanel {
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
import com.enderio.core.client.gui.button.CheckBox;
|
||||
import com.enderio.core.client.gui.button.ColorButton;
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.packet.PacketRedstoneConduitOutputStrength;
|
||||
@@ -11,8 +16,6 @@ import crazypants.enderio.conduit.packet.PacketRedstoneConduitSignalColor;
|
||||
import crazypants.enderio.conduit.redstone.IInsulatedRedstoneConduit;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import java.awt.Color;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
public class RedstoneSettings extends BaseSettingsPanel {
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import com.enderio.core.api.client.gui.ITabPanel;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.gas.IGasConduit;
|
||||
import crazypants.enderio.conduit.gui.item.ItemSettings;
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
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;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class BasicItemFilterGui implements IItemFilterGui {
|
||||
|
||||
@@ -42,22 +45,13 @@ public class BasicItemFilterGui implements IItemFilterGui {
|
||||
|
||||
private boolean isInput;
|
||||
|
||||
public BasicItemFilterGui(
|
||||
GuiContainerBaseEIO gui,
|
||||
IItemFilterContainer filterContainer,
|
||||
boolean isStickyModeAvailable,
|
||||
boolean isInput) {
|
||||
public BasicItemFilterGui(GuiContainerBaseEIO gui, IItemFilterContainer filterContainer,
|
||||
boolean isStickyModeAvailable, boolean isInput) {
|
||||
this(gui, filterContainer, isStickyModeAvailable, isInput, isInput ? 104 : 6, 96, isInput ? 0 : 256);
|
||||
}
|
||||
|
||||
public BasicItemFilterGui(
|
||||
GuiContainerBaseEIO gui,
|
||||
IItemFilterContainer filterContainer,
|
||||
boolean isStickyModeAvailable,
|
||||
boolean isInput,
|
||||
int xOffset,
|
||||
int yOffset,
|
||||
int buttonIdOffset) {
|
||||
public BasicItemFilterGui(GuiContainerBaseEIO gui, IItemFilterContainer filterContainer,
|
||||
boolean isStickyModeAvailable, boolean isInput, int xOffset, int yOffset, int buttonIdOffset) {
|
||||
this.gui = gui;
|
||||
this.isStickyModeAvailable = isStickyModeAvailable;
|
||||
this.filterContainer = filterContainer;
|
||||
@@ -84,14 +78,24 @@ public class BasicItemFilterGui implements IItemFilterGui {
|
||||
|
||||
x += 16;
|
||||
stickyB = new ToggleButton(
|
||||
gui, ID_STICKY + buttonIdOffset, x, y, IconEIO.FILTER_STICKY_OFF, IconEIO.FILTER_STICKY);
|
||||
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);
|
||||
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);
|
||||
@@ -108,6 +112,7 @@ public class BasicItemFilterGui implements IItemFilterGui {
|
||||
|
||||
public void createFilterSlots() {
|
||||
filter.createGhostSlots(gui.getGhostSlots(), xOffset + 1, yOffset + 1, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
sendFilterChange();
|
||||
@@ -201,17 +206,13 @@ public class BasicItemFilterGui implements IItemFilterGui {
|
||||
|
||||
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")
|
||||
};
|
||||
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")
|
||||
};
|
||||
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") };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,19 @@
|
||||
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;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class BigItemFilterGui implements IItemFilterGui {
|
||||
|
||||
@@ -40,22 +43,13 @@ public class BigItemFilterGui implements IItemFilterGui {
|
||||
private int xOffset;
|
||||
private int yOffset;
|
||||
|
||||
public BigItemFilterGui(
|
||||
GuiContainerBaseEIO gui,
|
||||
IItemFilterContainer filterContainer,
|
||||
boolean isStickyModeAvailable,
|
||||
boolean isInput) {
|
||||
public BigItemFilterGui(GuiContainerBaseEIO gui, IItemFilterContainer filterContainer,
|
||||
boolean isStickyModeAvailable, boolean isInput) {
|
||||
this(gui, filterContainer, isStickyModeAvailable, isInput, isInput ? 104 : 6, 96, isInput ? 0 : 256);
|
||||
}
|
||||
|
||||
public BigItemFilterGui(
|
||||
GuiContainerBaseEIO gui,
|
||||
IItemFilterContainer filterContainer,
|
||||
boolean isStickyModeAvailable,
|
||||
boolean isInput,
|
||||
int xOffset,
|
||||
int yOffset,
|
||||
int buttonIdOffset) {
|
||||
public BigItemFilterGui(GuiContainerBaseEIO gui, IItemFilterContainer filterContainer,
|
||||
boolean isStickyModeAvailable, boolean isInput, int xOffset, int yOffset, int buttonIdOffset) {
|
||||
this.gui = gui;
|
||||
this.isStickyModeAvailable = isStickyModeAvailable;
|
||||
this.filterContainer = filterContainer;
|
||||
@@ -81,7 +75,12 @@ public class BigItemFilterGui implements IItemFilterGui {
|
||||
|
||||
x += 16;
|
||||
useOreDictB = new ToggleButton(
|
||||
gui, ID_ORE_DICT + buttonIdOffset, x, y, IconEIO.FILTER_ORE_DICT_OFF, IconEIO.FILTER_ORE_DICT);
|
||||
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);
|
||||
@@ -97,7 +96,12 @@ public class BigItemFilterGui implements IItemFilterGui {
|
||||
|
||||
x += 16;
|
||||
stickyB = new ToggleButton(
|
||||
gui, ID_STICKY + buttonIdOffset, x, y, IconEIO.FILTER_STICKY_OFF, IconEIO.FILTER_STICKY);
|
||||
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);
|
||||
@@ -110,6 +114,7 @@ public class BigItemFilterGui implements IItemFilterGui {
|
||||
|
||||
public void createFilterSlots() {
|
||||
filter.createGhostSlots(gui.getGhostSlots(), xOffset + 1, yOffset + 1, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
sendFilterChange();
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
package crazypants.enderio.conduit.gui.item;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.api.client.gui.IGuiOverlay;
|
||||
import com.enderio.core.api.client.gui.IGuiScreen;
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.vecmath.Vector4f;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
@@ -13,14 +25,6 @@ import crazypants.enderio.conduit.item.filter.ExistingItemFilter;
|
||||
import crazypants.enderio.conduit.packet.PacketItemConduitFilter;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ExistingItemFilterGui implements IItemFilterGui {
|
||||
|
||||
@@ -82,7 +86,12 @@ public class ExistingItemFilterGui implements IItemFilterGui {
|
||||
|
||||
x += 16;
|
||||
stickyB = new ToggleButton(
|
||||
gui, ID_STICKY + buttonIdOffset, x, y, IconEIO.FILTER_STICKY_OFF, IconEIO.FILTER_STICKY);
|
||||
gui,
|
||||
ID_STICKY + buttonIdOffset,
|
||||
x,
|
||||
y,
|
||||
IconEIO.FILTER_STICKY_OFF,
|
||||
IconEIO.FILTER_STICKY);
|
||||
String[] lines = EnderIO.lang.localizeList("gui.conduit.item.stickyEnabled");
|
||||
stickyB.setSelectedToolTip(lines);
|
||||
stickyB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.stickyDisbaled"));
|
||||
@@ -96,17 +105,37 @@ public class ExistingItemFilterGui implements IItemFilterGui {
|
||||
|
||||
x += 16;
|
||||
useOreDictB = new ToggleButton(
|
||||
gui, ID_ORE_DICT + buttonIdOffset, x, y, IconEIO.FILTER_ORE_DICT_OFF, IconEIO.FILTER_ORE_DICT);
|
||||
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);
|
||||
|
||||
snapshotB = new GuiButton(
|
||||
ID_SNAPSHOT + buttonIdOffset, 0, 0, 56, 20, EnderIO.lang.localize("gui.conduit.button.snap"));
|
||||
ID_SNAPSHOT + buttonIdOffset,
|
||||
0,
|
||||
0,
|
||||
56,
|
||||
20,
|
||||
EnderIO.lang.localize("gui.conduit.button.snap"));
|
||||
mergeB = new GuiButton(
|
||||
ID_MERGE + buttonIdOffset, 0, 0, 40, 20, EnderIO.lang.localize("gui.conduit.button.merge"));
|
||||
ID_MERGE + buttonIdOffset,
|
||||
0,
|
||||
0,
|
||||
40,
|
||||
20,
|
||||
EnderIO.lang.localize("gui.conduit.button.merge"));
|
||||
clearB = new GuiButton(
|
||||
ID_CLEAR + buttonIdOffset, 0, 0, 56, 20, EnderIO.lang.localize("gui.conduit.button.clear"));
|
||||
ID_CLEAR + buttonIdOffset,
|
||||
0,
|
||||
0,
|
||||
56,
|
||||
20,
|
||||
EnderIO.lang.localize("gui.conduit.button.clear"));
|
||||
showB = new GuiButton(ID_SHOW + buttonIdOffset, 0, 0, 40, 20, EnderIO.lang.localize("gui.conduit.button.show"));
|
||||
|
||||
snapshotOverlay = new SnapshotOverlay();
|
||||
@@ -199,8 +228,7 @@ public class ExistingItemFilterGui implements IItemFilterGui {
|
||||
} else if (guiButton == whiteListB) {
|
||||
filter.setBlacklist(!filter.isBlacklist());
|
||||
sendSnapshotPacket(
|
||||
filter.isBlacklist()
|
||||
? PacketExistingItemFilterSnapshot.Opcode.SET_BLACK
|
||||
filter.isBlacklist() ? PacketExistingItemFilterSnapshot.Opcode.SET_BLACK
|
||||
: PacketExistingItemFilterSnapshot.Opcode.UNSET_BLACK);
|
||||
}
|
||||
}
|
||||
@@ -210,8 +238,8 @@ public class ExistingItemFilterGui implements IItemFilterGui {
|
||||
}
|
||||
|
||||
private void sendSnapshotPacket(PacketExistingItemFilterSnapshot.Opcode opcode) {
|
||||
PacketHandler.INSTANCE.sendToServer(
|
||||
new PacketExistingItemFilterSnapshot(itemConduit, gui.getDir(), isInput, opcode));
|
||||
PacketHandler.INSTANCE
|
||||
.sendToServer(new PacketExistingItemFilterSnapshot(itemConduit, gui.getDir(), isInput, opcode));
|
||||
}
|
||||
|
||||
private void sendFilterChange() {
|
||||
@@ -234,12 +262,12 @@ public class ExistingItemFilterGui implements IItemFilterGui {
|
||||
|
||||
@Override
|
||||
public void renderCustomOptions(int top, float par1, int par2, int par3) {
|
||||
// GL11.glColor3f(1, 1, 1);
|
||||
// RenderUtil.bindTexture("enderio:textures/gui/itemFilter.png");
|
||||
// gui.drawTexturedModalRect(gui.getGuiLeft() + 32, gui.getGuiTop() + 68, 0, 238, 18 * 5, 18);
|
||||
// if(filter.isAdvanced()) {
|
||||
// gui.drawTexturedModalRect(gui.getGuiLeft() + 32, gui.getGuiTop() + 86, 0, 238, 18 * 5, 18);
|
||||
// }
|
||||
// GL11.glColor3f(1, 1, 1);
|
||||
// RenderUtil.bindTexture("enderio:textures/gui/itemFilter.png");
|
||||
// gui.drawTexturedModalRect(gui.getGuiLeft() + 32, gui.getGuiTop() + 68, 0, 238, 18 * 5, 18);
|
||||
// if(filter.isAdvanced()) {
|
||||
// gui.drawTexturedModalRect(gui.getGuiLeft() + 32, gui.getGuiTop() + 86, 0, 238, 18 * 5, 18);
|
||||
// }
|
||||
}
|
||||
|
||||
class SnapshotOverlay implements IGuiOverlay {
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package crazypants.enderio.conduit.gui.item;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilterUpgrade;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilterUpgrade;
|
||||
|
||||
public class InventoryUpgrades implements IInventory {
|
||||
|
||||
IItemConduit itemConduit;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package crazypants.enderio.conduit.gui.item;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.filter.ItemFilter;
|
||||
import crazypants.enderio.conduit.packet.PacketItemConduitFilter;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ItemConduitFilterContainer implements IItemFilterContainer {
|
||||
|
||||
|
||||
@@ -1,11 +1,21 @@
|
||||
package crazypants.enderio.conduit.gui.item;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.ColorButton;
|
||||
import com.enderio.core.client.gui.button.MultiIconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
@@ -21,11 +31,6 @@ import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.IRedstoneModeControlable;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import java.awt.*;
|
||||
import javax.annotation.Nonnull;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ItemSettings extends BaseSettingsPanel {
|
||||
|
||||
@@ -101,6 +106,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
colorB.setToolTipHeading(EnderIO.lang.localize("gui.conduit.item.channel"));
|
||||
|
||||
rsB = new RedstoneModeButton(gui, ID_REDSTONE_BUTTON, x, y, new IRedstoneModeControlable() {
|
||||
|
||||
@Override
|
||||
public void setRedstoneControlMode(RedstoneControlMode mode) {
|
||||
RedstoneControlMode curMode = getRedstoneControlMode();
|
||||
@@ -121,6 +127,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
priDownB = MultiIconButton.createMinusButton(gui, ID_PRIORITY_DOWN, x, y + 8);
|
||||
|
||||
FilterChangeListener fcl = new FilterChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onFilterChanged() {
|
||||
if (insertFilterGui != null) {
|
||||
@@ -206,9 +213,11 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
} else if (guiButton.id == ID_EXTRACT_CHANNEL) {
|
||||
DyeColor col = DyeColor.fromIndex(extractChannelB.getColorIndex());
|
||||
itemConduit.setInputColor(gui.getDir(), col);
|
||||
} else {
|
||||
if (insertFilterGui != null) insertFilterGui.actionPerformed(guiButton);
|
||||
if (extractFilterGui != null) extractFilterGui.actionPerformed(guiButton);
|
||||
return;
|
||||
}
|
||||
if (insertFilterGui != null) insertFilterGui.actionPerformed(guiButton);
|
||||
if (extractFilterGui != null) extractFilterGui.actionPerformed(guiButton);
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketItemConduitFilter(itemConduit, gui.getDir()));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
package crazypants.enderio.conduit.gui.item;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.filter.ModItemFilter;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import java.awt.Color;
|
||||
import java.awt.Rectangle;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ModItemFilterGui implements IItemFilterGui {
|
||||
|
||||
@@ -57,11 +61,8 @@ public class ModItemFilterGui implements IItemFilterGui {
|
||||
tfTextureX = 120;
|
||||
tfTextureY = 214;
|
||||
|
||||
inputBounds = new Rectangle[] {
|
||||
new Rectangle(inputOffsetX, y, 16, 16),
|
||||
new Rectangle(inputOffsetX, y + 18, 16, 16),
|
||||
new Rectangle(inputOffsetX, y + 36, 16, 16)
|
||||
};
|
||||
inputBounds = new Rectangle[] { new Rectangle(inputOffsetX, y, 16, 16),
|
||||
new Rectangle(inputOffsetX, y + 18, 16, 16), new Rectangle(inputOffsetX, y + 36, 16, 16) };
|
||||
|
||||
deleteButs = new IconButton[inputBounds.length];
|
||||
for (int i = 0; i < deleteButs.length; i++) {
|
||||
@@ -121,7 +122,12 @@ public class ModItemFilterGui implements IItemFilterGui {
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + r.x - 1, gui.getGuiTop() + r.y - 1, 24, 214, 18, 18);
|
||||
// text box
|
||||
gui.drawTexturedModalRect(
|
||||
gui.getGuiLeft() + r.x + 38, gui.getGuiTop() + r.y - 1, tfTextureX, tfTextureY, tfWidth, 18);
|
||||
gui.getGuiLeft() + r.x + 38,
|
||||
gui.getGuiTop() + r.y - 1,
|
||||
tfTextureX,
|
||||
tfTextureY,
|
||||
tfWidth,
|
||||
18);
|
||||
}
|
||||
|
||||
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
|
||||
|
||||
+5
-3
@@ -1,5 +1,10 @@
|
||||
package crazypants.enderio.conduit.gui.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
@@ -10,9 +15,6 @@ import crazypants.enderio.conduit.item.filter.ExistingItemFilter;
|
||||
import crazypants.enderio.conduit.packet.AbstractConduitPacket;
|
||||
import crazypants.enderio.conduit.packet.ConTypeEnum;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class PacketExistingItemFilterSnapshot extends AbstractConduitPacket<IItemConduit>
|
||||
implements IMessageHandler<PacketExistingItemFilterSnapshot, IMessage> {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package crazypants.enderio.conduit.gui.item;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
@@ -9,7 +11,6 @@ import crazypants.enderio.conduit.item.filter.ModItemFilter;
|
||||
import crazypants.enderio.conduit.packet.AbstractConduitPacket;
|
||||
import crazypants.enderio.conduit.packet.ConTypeEnum;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class PacketModItemFilter extends AbstractConduitPacket<IItemConduit>
|
||||
implements IMessageHandler<PacketModItemFilter, IMessage> {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package crazypants.enderio.conduit.gui.item;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
@@ -8,8 +12,6 @@ import crazypants.enderio.conduit.item.filter.PowerItemFilter;
|
||||
import crazypants.enderio.conduit.packet.PacketItemConduitFilter;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
public class PowerItemFilterGui implements IItemFilterGui {
|
||||
|
||||
@@ -145,11 +147,11 @@ public class PowerItemFilterGui implements IItemFilterGui {
|
||||
|
||||
@Override
|
||||
public void renderCustomOptions(int top, float par1, int par2, int par3) {
|
||||
// GL11.glColor3f(1, 1, 1);
|
||||
// RenderUtil.bindTexture("enderio:textures/gui/itemFilter.png");
|
||||
// gui.drawTexturedModalRect(gui.getGuiLeft() + 32, gui.getGuiTop() + 68, 0, 238, 18 * 5, 18);
|
||||
// if(filter.isAdvanced()) {
|
||||
// gui.drawTexturedModalRect(gui.getGuiLeft() + 32, gui.getGuiTop() + 86, 0, 238, 18 * 5, 18);
|
||||
// }
|
||||
// GL11.glColor3f(1, 1, 1);
|
||||
// RenderUtil.bindTexture("enderio:textures/gui/itemFilter.png");
|
||||
// gui.drawTexturedModalRect(gui.getGuiLeft() + 32, gui.getGuiTop() + 68, 0, 238, 18 * 5, 18);
|
||||
// if(filter.isAdvanced()) {
|
||||
// gui.drawTexturedModalRect(gui.getGuiLeft() + 32, gui.getGuiTop() + 86, 0, 238, 18 * 5, 18);
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
package crazypants.enderio.conduit.item;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import crazypants.enderio.Log;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilterUpgrade;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class FilterRegister {
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package crazypants.enderio.conduit.item;
|
||||
|
||||
public enum FunctionUpgrade {
|
||||
|
||||
INVENTORY_PANEL("enderio:inventoryPanelUpgrade", "item.itemInventoryPanelUpgrade", 1);
|
||||
|
||||
public final String iconName;
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package crazypants.enderio.conduit.item;
|
||||
|
||||
import cofh.api.transport.IItemDuct;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IExtractor;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.transport.IItemDuct;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IExtractor;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
|
||||
public interface IItemConduit extends IConduit, IItemDuct, IExtractor {
|
||||
|
||||
IIcon getTextureForInputMode();
|
||||
|
||||
@@ -1,9 +1,29 @@
|
||||
package crazypants.enderio.conduit.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.inventory.IInventoryConnection;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
@@ -18,22 +38,6 @@ import crazypants.enderio.conduit.item.filter.ItemFilter;
|
||||
import crazypants.enderio.item.PacketConduitProbe;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
@@ -84,37 +88,37 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
ItemConduitNetwork network;
|
||||
|
||||
protected final EnumMap<ForgeDirection, RedstoneControlMode> extractionModes =
|
||||
new EnumMap<ForgeDirection, RedstoneControlMode>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, DyeColor> extractionColors =
|
||||
new EnumMap<ForgeDirection, DyeColor>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, RedstoneControlMode> extractionModes = new EnumMap<ForgeDirection, RedstoneControlMode>(
|
||||
ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, DyeColor> extractionColors = new EnumMap<ForgeDirection, DyeColor>(
|
||||
ForgeDirection.class);
|
||||
|
||||
protected final EnumMap<ForgeDirection, IItemFilter> outputFilters =
|
||||
new EnumMap<ForgeDirection, IItemFilter>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, IItemFilter> inputFilters =
|
||||
new EnumMap<ForgeDirection, IItemFilter>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, ItemStack> outputFilterUpgrades =
|
||||
new EnumMap<ForgeDirection, ItemStack>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, ItemStack> inputFilterUpgrades =
|
||||
new EnumMap<ForgeDirection, ItemStack>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, ItemStack> speedUpgrades =
|
||||
new EnumMap<ForgeDirection, ItemStack>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, ItemStack> functionUpgrades =
|
||||
new EnumMap<ForgeDirection, ItemStack>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, IItemFilter> outputFilters = new EnumMap<ForgeDirection, IItemFilter>(
|
||||
ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, IItemFilter> inputFilters = new EnumMap<ForgeDirection, IItemFilter>(
|
||||
ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, ItemStack> outputFilterUpgrades = new EnumMap<ForgeDirection, ItemStack>(
|
||||
ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, ItemStack> inputFilterUpgrades = new EnumMap<ForgeDirection, ItemStack>(
|
||||
ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, ItemStack> speedUpgrades = new EnumMap<ForgeDirection, ItemStack>(
|
||||
ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, ItemStack> functionUpgrades = new EnumMap<ForgeDirection, ItemStack>(
|
||||
ForgeDirection.class);
|
||||
|
||||
protected final EnumMap<ForgeDirection, Boolean> selfFeed =
|
||||
new EnumMap<ForgeDirection, Boolean>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, Boolean> selfFeed = new EnumMap<ForgeDirection, Boolean>(
|
||||
ForgeDirection.class);
|
||||
|
||||
protected final EnumMap<ForgeDirection, Boolean> roundRobin =
|
||||
new EnumMap<ForgeDirection, Boolean>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, Boolean> roundRobin = new EnumMap<ForgeDirection, Boolean>(
|
||||
ForgeDirection.class);
|
||||
|
||||
protected final EnumMap<ForgeDirection, Integer> priority =
|
||||
new EnumMap<ForgeDirection, Integer>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, Integer> priority = new EnumMap<ForgeDirection, Integer>(
|
||||
ForgeDirection.class);
|
||||
|
||||
protected final EnumMap<ForgeDirection, DyeColor> outputColors =
|
||||
new EnumMap<ForgeDirection, DyeColor>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, DyeColor> inputColors =
|
||||
new EnumMap<ForgeDirection, DyeColor>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, DyeColor> outputColors = new EnumMap<ForgeDirection, DyeColor>(
|
||||
ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, DyeColor> inputColors = new EnumMap<ForgeDirection, DyeColor>(
|
||||
ForgeDirection.class);
|
||||
|
||||
private int metaData;
|
||||
|
||||
@@ -172,10 +176,8 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
@Override
|
||||
protected void writeTypeSettingsToNbt(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
dataRoot.setShort(
|
||||
"extractionSignalColor", (short) getExtractionSignalColor(dir).ordinal());
|
||||
dataRoot.setShort(
|
||||
"extractionRedstoneMode", (short) getExtractionRedstoneMode(dir).ordinal());
|
||||
dataRoot.setShort("extractionSignalColor", (short) getExtractionSignalColor(dir).ordinal());
|
||||
dataRoot.setShort("extractionRedstoneMode", (short) getExtractionRedstoneMode(dir).ordinal());
|
||||
dataRoot.setShort("inputColor", (short) getInputColor(dir).ordinal());
|
||||
dataRoot.setShort("outputColor", (short) getOutputColor(dir).ordinal());
|
||||
dataRoot.setBoolean("selfFeed", isSelfFeedEnabled(dir));
|
||||
@@ -183,9 +185,7 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
dataRoot.setInteger("outputPriority", getOutputPriority(dir));
|
||||
}
|
||||
|
||||
protected void convertToItemUpgrades(
|
||||
int filterMeta,
|
||||
Map<ForgeDirection, ItemStack> converted,
|
||||
protected void convertToItemUpgrades(int filterMeta, Map<ForgeDirection, ItemStack> converted,
|
||||
EnumMap<ForgeDirection, IItemFilter> sourceFilters) {
|
||||
for (Entry<ForgeDirection, IItemFilter> entry : sourceFilters.entrySet()) {
|
||||
if (entry.getValue() != null) {
|
||||
@@ -505,7 +505,10 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
if (network != null) {
|
||||
TileEntity te = bundle.getEntity();
|
||||
network.inventoryRemoved(
|
||||
this, te.xCoord + direction.offsetX, te.yCoord + direction.offsetY, te.zCoord + direction.offsetZ);
|
||||
this,
|
||||
te.xCoord + direction.offsetX,
|
||||
te.yCoord + direction.offsetY,
|
||||
te.zCoord + direction.offsetZ);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -591,8 +594,7 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
else if (inv instanceof IInventoryConnection) {
|
||||
return ((IInventoryConnection) inv).canConnectInventory(direction.getOpposite()).canConnect;
|
||||
} else if (inv instanceof ISidedInventory) {
|
||||
int[] slots = ((ISidedInventory) inv)
|
||||
.getAccessibleSlotsFromSide(direction.getOpposite().ordinal());
|
||||
int[] slots = ((ISidedInventory) inv).getAccessibleSlotsFromSide(direction.getOpposite().ordinal());
|
||||
return slots != null && slots.length > 0;
|
||||
} else {
|
||||
return true;
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
package crazypants.enderio.conduit.item;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.item.NetworkedInventory.Target;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import crazypants.enderio.machine.invpanel.server.InventoryDatabaseServer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.item.NetworkedInventory.Target;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import crazypants.enderio.machine.invpanel.server.InventoryDatabaseServer;
|
||||
|
||||
public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IItemConduit> {
|
||||
|
||||
final List<NetworkedInventory> inventories = new ArrayList<NetworkedInventory>();
|
||||
private final Map<BlockCoord, List<NetworkedInventory>> invMap =
|
||||
new HashMap<BlockCoord, List<NetworkedInventory>>();
|
||||
private final Map<BlockCoord, List<NetworkedInventory>> invMap = new HashMap<BlockCoord, List<NetworkedInventory>>();
|
||||
|
||||
final Map<BlockCoord, IItemConduit> conMap = new HashMap<BlockCoord, IItemConduit>();
|
||||
|
||||
@@ -56,8 +58,8 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
}
|
||||
}
|
||||
|
||||
public void inventoryAdded(
|
||||
IItemConduit itemConduit, ForgeDirection direction, int x, int y, int z, IInventory externalInventory) {
|
||||
public void inventoryAdded(IItemConduit itemConduit, ForgeDirection direction, int x, int y, int z,
|
||||
IInventory externalInventory) {
|
||||
BlockCoord bc = new BlockCoord(x, y, z);
|
||||
NetworkedInventory inv = new NetworkedInventory(this, externalInventory, itemConduit, direction, bc);
|
||||
inventories.add(inv);
|
||||
@@ -123,8 +125,7 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
}
|
||||
|
||||
public InventoryDatabaseServer getDatabase() {
|
||||
check:
|
||||
{
|
||||
check: {
|
||||
if (database == null) {
|
||||
database = new InventoryDatabaseServer(this);
|
||||
} else if (database.isCurrent()) {
|
||||
@@ -186,8 +187,11 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
for (Target t : source.sendPriority) {
|
||||
IItemFilter f = t.inv.con.getOutputFilter(t.inv.conDir);
|
||||
if (input == null || f == null || f.doesItemPassFilter(t.inv, input)) {
|
||||
String s = t.inv.getLocalizedInventoryName() + " " + t.inv.location.chatString()
|
||||
+ " Distance [" + t.distance + "] ";
|
||||
String s = t.inv.getLocalizedInventoryName() + " "
|
||||
+ t.inv.location.chatString()
|
||||
+ " Distance ["
|
||||
+ t.distance
|
||||
+ "] ";
|
||||
result.add(s);
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 792 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user