Fix for slabs.

This commit is contained in:
Amnet 2014-02-15 22:16:50 +01:00
parent 155780276d
commit 009df6aa0e

View file

@ -93,9 +93,9 @@ public class BlockBOPSlab extends BlockSlab
public IIcon getIcon(int side, int meta) public IIcon getIcon(int side, int meta)
{ {
if (category == SlabCategory.STONE) if (category == SlabCategory.STONE)
return textures[getTypeFromMeta(meta)]; return textures[getRockType(meta)];
else else
return textures[(getTypeFromMeta(meta) + category.ordinal() * 8)]; return textures[getWoodType(meta)];
} }
@Override @Override
@ -123,7 +123,7 @@ public class BlockBOPSlab extends BlockSlab
public String func_150002_b(int meta) public String func_150002_b(int meta)
{ {
if (category == SlabCategory.STONE) if (category == SlabCategory.STONE)
return (new StringBuilder()).append(rockTypes[getTypeFromMeta(meta)]).append("Slab").toString(); return (new StringBuilder()).append(rockTypes[getRockType(meta)]).append("Slab").toString();
else else
return (new StringBuilder()).append(woodTypes[getWoodType(meta)]).append("Slab").toString(); return (new StringBuilder()).append(woodTypes[getWoodType(meta)]).append("Slab").toString();
} }
@ -243,12 +243,17 @@ public class BlockBOPSlab extends BlockSlab
return 0; return 0;
} }
private int getRockType(int meta)
{
meta = getTypeFromMeta(meta);
if (meta < rockTypes.length)
return meta;
return 0;
}
private static int getTypeFromMeta(int meta) private static int getTypeFromMeta(int meta)
{ {
meta = meta & 7; return meta & 7;
if (meta < rockTypes.length)
meta = 0;
return meta;
} }
} }