Fix a crash issue with the smiley cloud when the world is weird

Closes #688
This commit is contained in:
Ellpeck 2017-03-16 12:05:02 +01:00
parent cca76e5020
commit ba9a7a5016

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.blocks.render;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.misc.cloud.ISmileyCloudEasterEgg;
import de.ellpeck.actuallyadditions.mod.misc.cloud.SmileyCloudEasterEggs;
import de.ellpeck.actuallyadditions.mod.misc.special.RenderSpecial;
@ -49,8 +50,9 @@ public class RenderSmileyCloud extends TileEntitySpecialRenderer{
if(triggerName != null && theCloud.name != null){
if(triggerName.equalsIgnoreCase(theCloud.name)){
GlStateManager.pushMatrix();
IBlockState state = theCloud.getWorld().getBlockState(theCloud.getPos());
IBlockState state = theCloud.getWorld().getBlockState(theCloud.getPos());
if(state.getBlock() == InitBlocks.blockSmileyCloud){
switch(state.getValue(BlockHorizontal.FACING)){
case NORTH:
GlStateManager.rotate(180, 0, 1, 0);
@ -62,6 +64,7 @@ public class RenderSmileyCloud extends TileEntitySpecialRenderer{
GlStateManager.rotate(90, 0, 1, 0);
break;
}
}
cloud.renderExtra(0.0625F);
GlStateManager.popMatrix();