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; 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.ISmileyCloudEasterEgg;
import de.ellpeck.actuallyadditions.mod.misc.cloud.SmileyCloudEasterEggs; import de.ellpeck.actuallyadditions.mod.misc.cloud.SmileyCloudEasterEggs;
import de.ellpeck.actuallyadditions.mod.misc.special.RenderSpecial; import de.ellpeck.actuallyadditions.mod.misc.special.RenderSpecial;
@ -49,18 +50,20 @@ public class RenderSmileyCloud extends TileEntitySpecialRenderer{
if(triggerName != null && theCloud.name != null){ if(triggerName != null && theCloud.name != null){
if(triggerName.equalsIgnoreCase(theCloud.name)){ if(triggerName.equalsIgnoreCase(theCloud.name)){
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
IBlockState state = theCloud.getWorld().getBlockState(theCloud.getPos());
switch(state.getValue(BlockHorizontal.FACING)){ IBlockState state = theCloud.getWorld().getBlockState(theCloud.getPos());
case NORTH: if(state.getBlock() == InitBlocks.blockSmileyCloud){
GlStateManager.rotate(180, 0, 1, 0); switch(state.getValue(BlockHorizontal.FACING)){
break; case NORTH:
case EAST: GlStateManager.rotate(180, 0, 1, 0);
GlStateManager.rotate(270, 0, 1, 0); break;
break; case EAST:
case WEST: GlStateManager.rotate(270, 0, 1, 0);
GlStateManager.rotate(90, 0, 1, 0); break;
break; case WEST:
GlStateManager.rotate(90, 0, 1, 0);
break;
}
} }
cloud.renderExtra(0.0625F); cloud.renderExtra(0.0625F);