fixed reinforced stone slab variants not showing up in creative tab
package net.geforcemods.securitycraft.blocks;
+import java.util.List;
import java.util.Random;
import net.geforcemods.securitycraft.main.mod_SecurityCraft;
@@ -12,6 +13,7 @@ import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
+import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -40,12 +42,7 @@ public class BlockReinforcedSlabs extends BlockSlab implements ITileEntityProvid
this.useNeighborBrightness = true;
}
- if(blockMaterial == Material.GROUND){
- this.setSoundType(SoundType.GROUND);
- }else{
this.setSoundType(SoundType.STONE);
- }
-
this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockReinforcedSlabs.EnumType.STONE));
}
@@ -60,21 +57,17 @@ public class BlockReinforcedSlabs extends BlockSlab implements ITileEntityProvid
return Item.getItemFromBlock(mod_SecurityCraft.reinforcedStoneSlabs);
}
- /* TODO: no clue about this, also check registration, maybe it changed
- @SideOnly(Side.CLIENT)
- public void getSubBlocks(Item itemIn, CreativeTabs tab, List list){
- if(slabMaterial != Material.GROUND){
- BlockReinforcedSlabs.EnumType[] aenumtype = BlockReinforcedSlabs.EnumType.values();
-
- for(int i = 0; i < aenumtype.length - 1; i++){
- BlockReinforcedSlabs.EnumType enumtype = aenumtype[i];
-
- list.add(new ItemStack(itemIn, 1, enumtype.getMetadata()));
+ @Override
+ public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list)
+ {
+ if(!itemIn.equals(mod_SecurityCraft.reinforcedDoubleStoneSlabs))
+ {
+ for (EnumType et : EnumType.values())
+ {
+ list.add(new ItemStack(itemIn, 1, et.getMetadata()));
+ }
}
- }else{
- list.add(new ItemStack(itemIn, 1, BlockReinforcedSlabs.EnumType.DIRT.getMetadata()));
}
- }*/
@Override
@SideOnly(Side.CLIENT)
@@ -125,7 +118,7 @@ public class BlockReinforcedSlabs extends BlockSlab implements ITileEntityProvid
@Override
protected BlockStateContainer createBlockState(){
- return slabMaterial == Material.GROUND ? new BlockStateContainer(this, new IProperty[] {HALF}) : new BlockStateContainer(this, new IProperty[] {HALF, VARIANT});
+ return new BlockStateContainer(this, new IProperty[] {HALF, VARIANT});
}
@Override
