Made the smiley cloud not crash with blocks without items

Closes #208
This commit is contained in:
Ellpeck 2016-08-14 23:38:32 +02:00
parent 7dc7d0f98a
commit cba12aabe0
2 changed files with 12 additions and 10 deletions

View file

@ -91,7 +91,7 @@ public final class SmileyCloudEasterEggs{
@Override @Override
public void renderExtra(float f){ public void renderExtra(float f){
renderHoldingItem(true, new ItemStack(Items.MILK_BUCKET)); renderHoldingItem(true, new ItemStack(Items.MILK_BUCKET));
renderHeadBlock(Blocks.LIT_REDSTONE_LAMP, 0, 35F); renderHeadBlock(Blocks.REDSTONE_LAMP, 0, 35F);
} }
}); });
//Vazkii //Vazkii

View file

@ -62,6 +62,7 @@ public final class AssetUtil{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public static void renderItemInWorld(ItemStack stack){ public static void renderItemInWorld(ItemStack stack){
if(stack != null && stack.getItem() != null){
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.disableLighting(); GlStateManager.disableLighting();
GlStateManager.pushAttrib(); GlStateManager.pushAttrib();
@ -72,6 +73,7 @@ public final class AssetUtil{
GlStateManager.enableLighting(); GlStateManager.enableLighting();
GlStateManager.popMatrix(); GlStateManager.popMatrix();
} }
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public static void renderStackToGui(ItemStack stack, int x, int y, float scale){ public static void renderStackToGui(ItemStack stack, int x, int y, float scale){