Skip to content

Commit

Permalink
fixed NPE when holding a frame w/ missing material
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursivePineapple committed Sep 27, 2024
1 parent 96f2d08 commit d15fe75
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/gregtech/common/blocks/ItemFrames.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public String getItemStackDisplayName(ItemStack aStack) {
public int getColorFromItemStack(ItemStack aStack, int aPass) {
int meta = aStack.getItemDamage();
Materials material = BlockFrameBox.getMaterial(meta);
if (material == null) return 0;
return (material.mRGBa[0] << 16) | (material.mRGBa[1] << 8) | material.mRGBa[2];
}

Expand Down

0 comments on commit d15fe75

Please sign in to comment.