Add some null safety for extended state props

This commit is contained in:
Xander committed 2017-09-02 11:51:30 +08:00
1 parent 42efc07d3a
commit 3cc755f33d
3 files changed
+6 -4

No files matched your search

@@ -112,7 +112,9 @@ public class TileEntityGlowPanel extends TileEntity implements ITileNetwork
public static int hash(IExtendedBlockState state)
{
int hash = 1;
hash = 31 * hash + state.getValue(PropertyColor.INSTANCE).color.ordinal();
PropertyColor propColor = state.getValue(PropertyColor.INSTANCE);
EnumColor color = propColor != null ? propColor.color : EnumColor.WHITE;
hash = 31 * hash + color.ordinal();
hash = 31 * hash + state.getValue(BlockStateFacing.facingProperty).ordinal();
return hash;