Skip to content

Commit

Permalink
special case air in color calculations, this will prevent inappropria…
Browse files Browse the repository at this point in the history
…tely register handlers from crashing when they receive air.
  • Loading branch information
AlgorithmX2 committed May 21, 2018
1 parent 1132378 commit 2efb6c2
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -582,6 +582,12 @@ public static Integer getItemStackColor(
final ItemStack target,
final int tint )
{
// don't send air though to MC, some mods have registered their custom
// color handlers for it and it can crash.

if ( ModUtil.isEmpty( target ) )
return -1;

return Minecraft.getMinecraft().getItemColors().getColorFromItemstack( target, tint );
}

Expand Down

0 comments on commit 2efb6c2

Please sign in to comment.