diff options
author | Martin Robertz <dream-master@gmx.net> | 2020-02-17 07:16:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-17 07:16:53 +0100 |
commit | b27e466de94ac1650707de92d90479cd20406831 (patch) | |
tree | 3b4b5389b6e1eb30458a2d051cabeb27a52ada08 | |
parent | b7ce9db75baaf5a60b659fb565d4f9505f77e509 (diff) | |
parent | 0310080be0378bdae6994069285e619ec897ea80 (diff) | |
download | GT5-Unofficial-b27e466de94ac1650707de92d90479cd20406831.tar.gz GT5-Unofficial-b27e466de94ac1650707de92d90479cd20406831.tar.bz2 GT5-Unofficial-b27e466de94ac1650707de92d90479cd20406831.zip |
Merge pull request #241 from GTNewHorizons/dont_blowup_on_bad_texture
Don't blowup on bad texture
-rw-r--r-- | build.properties | 2 | ||||
-rw-r--r-- | gradle/wrapper/gradle-wrapper.jar | bin | 53324 -> 54333 bytes | |||
-rw-r--r-- | gradle/wrapper/gradle-wrapper.properties | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | gradlew | 26 | ||||
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java | 37 |
5 files changed, 42 insertions, 24 deletions
diff --git a/build.properties b/build.properties index b6898a307f..a878a9ede6 100644 --- a/build.properties +++ b/build.properties @@ -1,6 +1,6 @@ minecraft.version=1.7.10 forge.version=10.13.4.1614-1.7.10 -gt.version=5.09.33.31 +gt.version=5.09.33.32 ae2.version=rv2-beta-33 applecore.version=1.7.10-1.2.1+107.59407 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar Binary files differindex 3baa851b28..99340b4ad1 100644 --- a/gradle/wrapper/gradle-wrapper.jar +++ b/gradle/wrapper/gradle-wrapper.jar diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 82b0d2f5d7..2c2bbe5f9a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,3 @@ -#Sat Jan 04 01:52:14 CET 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh ############################################################################## ## @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS="" # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -154,11 +154,19 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=$(save "$@") -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +# 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" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java index d57aff8fc9..26e816a52c 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch.java @@ -43,19 +43,30 @@ public abstract class GT_MetaTileEntity_Hatch extends GT_MetaTileEntity_BasicTan @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - int textureIndex=actualTexture|(mTexturePage<<7);//Shift seven since one page is 128 textures! - int texturePointer=(byte)(actualTexture&0x7F);//just to be sure, from my testing the 8th bit cannot be set clientside - return aSide != aFacing ? - textureIndex > 0 ? - new ITexture[]{Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer]} : - new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]} : - textureIndex > 0 ? - aActive ? - getTexturesActive(Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer]) : - getTexturesInactive(Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer]) : - aActive ? - getTexturesActive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]) : - getTexturesInactive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]); + int textureIndex = actualTexture | (mTexturePage << 7);//Shift seven since one page is 128 textures! + int texturePointer = (byte) (actualTexture & 0x7F);//just to be sure, from my testing the 8th bit cannot be set clientside + try { + if (aSide != aFacing) { + if (textureIndex > 0) + return new ITexture[]{Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer]}; + else + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]}; + } else { + if (textureIndex > 0) { + if (aActive) + return getTexturesActive(Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer]); + else + return getTexturesInactive(Textures.BlockIcons.casingTexturePages[mTexturePage][texturePointer]); + } else { + if (aActive) + return getTexturesActive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]); + else + return getTexturesInactive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]); + } + } + } catch (NullPointerException npe) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[0][0]}; + } } @Override |