diff --git a/src/main/java/com/hbm/blocks/BlockEnums.java b/src/main/java/com/hbm/blocks/BlockEnums.java index bf35a4e17..15a618779 100644 --- a/src/main/java/com/hbm/blocks/BlockEnums.java +++ b/src/main/java/com/hbm/blocks/BlockEnums.java @@ -58,6 +58,14 @@ public class BlockEnums { SMALL } + public static enum LightstoneType { + UNREFINED, + TILE, + BRICKS, + BRICKS_CHISELED, + CHISELED + } + public static enum DecoComputerEnum { IBM_300PL } diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index d86f1dd15..3c1570845 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -338,6 +338,8 @@ public class ModBlocks { public static Block brick_compound; public static Block brick_asbestos; public static Block brick_fire; + + public static Block lightstone; public static Block concrete_slab; public static Block concrete_double_slab; @@ -345,6 +347,8 @@ public class ModBlocks { public static Block concrete_brick_double_slab; public static Block brick_slab; public static Block brick_double_slab; + public static Block stones_slab; + public static Block stones_double_slab; public static Block concrete_smooth_stairs; public static Block concrete_stairs; @@ -364,6 +368,8 @@ public class ModBlocks { public static Block brick_asbestos_stairs; public static Block brick_fire_stairs; public static Block asphalt_stairs; + public static Block lightstone_tile_stairs; + public static Block lightstone_bricks_stairs; public static Block cmb_brick; public static Block cmb_brick_reinforced; @@ -1531,13 +1537,17 @@ public class ModBlocks { brick_ducrete = new BlockGeneric(Material.rock).setBlockName("brick_ducrete").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(750.0F).setBlockTextureName(RefStrings.MODID + ":brick_ducrete"); reinforced_ducrete = new BlockGeneric(Material.rock).setBlockName("reinforced_ducrete").setCreativeTab(MainRegistry.blockTab).setHardness(20.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_ducrete"); + lightstone = new BlockLightstone(Material.rock, LightstoneType.class, true, true).setBlockName("lightstone").setCreativeTab(MainRegistry.blockTab).setHardness(2F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":lightstone"); + concrete_slab = new BlockMultiSlab(null, Material.rock, concrete_smooth, concrete, concrete_asbestos, ducrete_smooth, ducrete, asphalt).setBlockName("concrete_slab").setCreativeTab(MainRegistry.blockTab); concrete_double_slab = new BlockMultiSlab(concrete_slab, Material.rock, concrete_smooth, concrete, concrete_asbestos, ducrete_smooth, ducrete, asphalt).setBlockName("concrete_double_slab").setCreativeTab(MainRegistry.blockTab); concrete_brick_slab = new BlockMultiSlab(null, Material.rock, brick_concrete, brick_concrete_mossy, brick_concrete_cracked, brick_concrete_broken, brick_ducrete).setBlockName("concrete_brick_slab").setCreativeTab(MainRegistry.blockTab); concrete_brick_double_slab = new BlockMultiSlab(concrete_brick_slab, Material.rock, brick_concrete, brick_concrete_mossy, brick_concrete_cracked, brick_concrete_broken, brick_ducrete).setBlockName("concrete_brick_double_slab").setCreativeTab(MainRegistry.blockTab); brick_slab = new BlockMultiSlab(null, Material.rock, reinforced_stone, reinforced_brick, brick_obsidian, brick_light, brick_compound, brick_asbestos, brick_fire).setBlockName("brick_slab").setCreativeTab(MainRegistry.blockTab); brick_double_slab = new BlockMultiSlab(brick_slab, Material.rock, reinforced_stone, reinforced_brick, brick_obsidian, brick_light, brick_compound, brick_asbestos, brick_fire).setBlockName("brick_double_slab").setCreativeTab(MainRegistry.blockTab); - + stones_slab = new BlockMultiSlabMeta(null, Material.rock, new Block[] { lightstone, lightstone }, LightstoneType.TILE.ordinal(), LightstoneType.BRICKS.ordinal()).setBlockName("stones_slab").setCreativeTab(MainRegistry.blockTab); + stones_double_slab = new BlockMultiSlabMeta(stones_slab, Material.rock, new Block[] { lightstone, lightstone }, LightstoneType.TILE.ordinal(), LightstoneType.BRICKS.ordinal()).setBlockName("stones_double_slab").setCreativeTab(MainRegistry.blockTab); + concrete_smooth_stairs = new BlockGenericStairs(concrete_smooth, 0).setBlockName("concrete_smooth_stairs").setCreativeTab(MainRegistry.blockTab); concrete_stairs = new BlockGenericStairs(concrete, 0).setBlockName("concrete_stairs").setCreativeTab(MainRegistry.blockTab); concrete_asbestos_stairs = new BlockGenericStairs(concrete_asbestos, 0).setBlockName("concrete_asbestos_stairs").setCreativeTab(MainRegistry.blockTab); @@ -1556,6 +1566,8 @@ public class ModBlocks { brick_asbestos_stairs = new BlockGenericStairs(brick_asbestos, 0).setBlockName("brick_asbestos_stairs").setCreativeTab(MainRegistry.blockTab); brick_fire_stairs = new BlockGenericStairs(brick_fire, 0).setBlockName("brick_fire_stairs").setCreativeTab(MainRegistry.blockTab); asphalt_stairs = new BlockSpeedyStairs(asphalt, 0, 1.5).setBlockName("asphalt_stairs").setCreativeTab(MainRegistry.blockTab); + lightstone_tile_stairs = new BlockGenericStairs(lightstone, LightstoneType.TILE.ordinal()).setBlockName("lightstone_tile_stairs").setCreativeTab(MainRegistry.blockTab); + lightstone_bricks_stairs = new BlockGenericStairs(lightstone, LightstoneType.BRICKS.ordinal()).setBlockName("lightstone_bricks_stairs").setCreativeTab(MainRegistry.blockTab); vinyl_tile = new BlockEnumMulti(Material.rock, TileType.class, true, true).setBlockName("vinyl_tile").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(10.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":vinyl_tile"); @@ -2676,7 +2688,14 @@ public class ModBlocks { GameRegistry.registerBlock(brick_light, ItemBlockBlastInfo.class, brick_light.getUnlocalizedName()); GameRegistry.registerBlock(brick_asbestos, brick_asbestos.getUnlocalizedName()); GameRegistry.registerBlock(brick_fire, ItemBlockBlastInfo.class, brick_fire.getUnlocalizedName()); - + + //Lightstone and its stair/slab variants + register(lightstone); + register(lightstone_tile_stairs); + register(lightstone_bricks_stairs); + register(stones_slab, ItemModSlab.class); + register(stones_double_slab, ItemModSlab.class); + GameRegistry.registerBlock(concrete_slab, ItemModSlab.class, concrete_slab.getUnlocalizedName()); GameRegistry.registerBlock(concrete_double_slab, ItemModSlab.class, concrete_double_slab.getUnlocalizedName()); GameRegistry.registerBlock(concrete_brick_slab, ItemModSlab.class, concrete_brick_slab.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/generic/BlockLightstone.java b/src/main/java/com/hbm/blocks/generic/BlockLightstone.java new file mode 100644 index 000000000..c055a50a3 --- /dev/null +++ b/src/main/java/com/hbm/blocks/generic/BlockLightstone.java @@ -0,0 +1,39 @@ +package com.hbm.blocks.generic; + +import com.hbm.blocks.BlockEnumMulti; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + +public class BlockLightstone extends BlockEnumMulti { + + public BlockLightstone(Material mat, Class theEnum, boolean multiName, boolean multiTexture) { + super(mat, theEnum, multiName, multiTexture); + } + + protected IIcon[] topIcons; + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) { + + Enum[] enums = theEnum.getEnumConstants(); + this.icons = new IIcon[enums.length]; + this.topIcons = new IIcon[enums.length]; + + for(int i = 0; i < icons.length; i++) { + Enum num = enums[i]; + this.icons[i] = reg.registerIcon(this.getTextureMultiName(num)); + if(i >= 3) this.topIcons[i] = reg.registerIcon(this.getTextureMultiName(num) + ".top"); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return (side == 0 || side == 1) && this.topIcons[meta % this.icons.length] != null ? this.topIcons[meta % this.icons.length] : this.icons[meta % this.icons.length]; + } +} diff --git a/src/main/java/com/hbm/blocks/generic/BlockMultiSlab.java b/src/main/java/com/hbm/blocks/generic/BlockMultiSlab.java index 8374ba803..77dbfb7fd 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockMultiSlab.java +++ b/src/main/java/com/hbm/blocks/generic/BlockMultiSlab.java @@ -35,13 +35,17 @@ public class BlockMultiSlab extends BlockSlab implements IStepTickReceiver { if(single == null) { for(int i = 0; i < slabMaterials.length; i++) { - recipeGen.add(new Object[] {slabMaterials[i], this, i}); + recipeGen.add(new Object[] {slabMaterials[i], 0, this, i}); } } this.setBlockTextureName(RefStrings.MODID + ":concrete"); } + public BlockMultiSlab(boolean b, Material mat) { + super(b, mat); + } + @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { diff --git a/src/main/java/com/hbm/blocks/generic/BlockMultiSlabMeta.java b/src/main/java/com/hbm/blocks/generic/BlockMultiSlabMeta.java new file mode 100644 index 000000000..956d5a261 --- /dev/null +++ b/src/main/java/com/hbm/blocks/generic/BlockMultiSlabMeta.java @@ -0,0 +1,49 @@ +package com.hbm.blocks.generic; + +import com.hbm.lib.RefStrings; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.util.IIcon; + +// kinda ugly solution, but no other stairs use metadata-dependent blocks anyway. feel free to refactor/merge them once needed +public class BlockMultiSlabMeta extends BlockMultiSlab { + + public int[] metas; + + public BlockMultiSlabMeta(Block single, Material mat, Block[] slabMaterials, int...metas) { + super(single != null, mat); + this.single = single; + this.slabMaterials = slabMaterials; + this.metas = new int[slabMaterials.length]; //initialized to 0s + for(int i = 0; i < metas.length; i++) { + this.metas[i] = metas[i]; + } + + this.useNeighborBrightness = true; + + if(single == null) { + for(int i = 0; i < slabMaterials.length; i++) { + recipeGen.add(new Object[] {slabMaterials[i], metas[i], this, i}); + } + } + + this.setBlockTextureName(RefStrings.MODID + ":concrete"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + meta = (meta & 7) % slabMaterials.length; + Block block = slabMaterials[meta]; + return block.getIcon(side, metas[meta]); + } + + //blocks don't have meta-dependent unlocalized names by default, so we have to do this ugly solution + @Override + public String func_150002_b(int meta) { + return super.func_150002_b(meta) + "." + metas[meta]; + } +} diff --git a/src/main/java/com/hbm/items/block/ItemModSlab.java b/src/main/java/com/hbm/items/block/ItemModSlab.java index 9a6720064..97f0c7d69 100644 --- a/src/main/java/com/hbm/items/block/ItemModSlab.java +++ b/src/main/java/com/hbm/items/block/ItemModSlab.java @@ -18,6 +18,7 @@ public class ItemModSlab extends ItemSlab { if(b == ModBlocks.concrete_slab || b == ModBlocks.concrete_double_slab) return (BlockSlab) ModBlocks.concrete_slab; if(b == ModBlocks.concrete_brick_slab || b == ModBlocks.concrete_brick_double_slab) return (BlockSlab) ModBlocks.concrete_brick_slab; if(b == ModBlocks.brick_slab || b == ModBlocks.brick_double_slab) return (BlockSlab) ModBlocks.brick_slab; + if(b == ModBlocks.stones_slab || b == ModBlocks.stones_double_slab) return (BlockSlab) ModBlocks.stones_slab; return null; } @@ -25,6 +26,7 @@ public class ItemModSlab extends ItemSlab { if(b == ModBlocks.concrete_slab || b == ModBlocks.concrete_double_slab) return (BlockSlab) ModBlocks.concrete_double_slab; if(b == ModBlocks.concrete_brick_slab || b == ModBlocks.concrete_brick_double_slab) return (BlockSlab) ModBlocks.concrete_brick_double_slab; if(b == ModBlocks.brick_slab || b == ModBlocks.brick_double_slab) return (BlockSlab) ModBlocks.brick_double_slab; + if(b == ModBlocks.stones_slab || b == ModBlocks.stones_double_slab) return (BlockSlab) ModBlocks.stones_double_slab; return null; } } diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index c9c6a1eeb..34f5571a8 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -1,6 +1,7 @@ package com.hbm.main; import com.hbm.blocks.BlockEnums.DecoCabinetEnum; +import com.hbm.blocks.BlockEnums.LightstoneType; import com.hbm.blocks.ModBlocks; import com.hbm.blocks.generic.BlockConcreteColoredExt.EnumConcreteType; import com.hbm.blocks.generic.BlockGenericStairs; @@ -79,7 +80,7 @@ public class CraftingManager { public static void AddCraftingRec() { for(Object[] array : BlockMultiSlab.recipeGen) { - addRecipeAuto(new ItemStack((Block) array[1], 6, (int) array[2]), new Object[] { "###", '#', (Block) array[0] }); + addRecipeAuto(new ItemStack((Block) array[2], 6, (int) array[3]), new Object[] { "###", '#', new ItemStack((Block) array[0], 1, (int) array[1]) }); } for(Object[] array : BlockGenericStairs.recipeGen) { addRecipeAuto(new ItemStack((Block) array[2], 4), new Object[] { "# ", "## ", "###", '#', new ItemStack((Block) array[0], 1, (int) array[1]) }); @@ -408,7 +409,12 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModBlocks.basalt_polished, 4), new Object[] { "CC", "CC", 'C', ModBlocks.basalt_smooth }); addRecipeAuto(new ItemStack(ModBlocks.basalt_brick, 4), new Object[] { "CC", "CC", 'C', ModBlocks.basalt_polished }); addRecipeAuto(new ItemStack(ModBlocks.basalt_tiles, 4), new Object[] { "CC", "CC", 'C', ModBlocks.basalt_brick }); - + + addShapelessAuto(new ItemStack(ModBlocks.lightstone, 4), new Object[] { Blocks.stone, Blocks.stone, Blocks.stone, ModItems.powder_limestone }); + addRecipeAuto(new ItemStack(ModBlocks.lightstone, 4, LightstoneType.TILE.ordinal()), new Object[] { "CC", "CC", 'C', new ItemStack(ModBlocks.lightstone, 1, 0) }); + addRecipeAuto(new ItemStack(ModBlocks.lightstone, 4, LightstoneType.BRICKS.ordinal()), new Object[] { "CC", "CC", 'C', new ItemStack(ModBlocks.lightstone, 1, LightstoneType.TILE.ordinal()) }); + addShapelessAuto(new ItemStack(ModBlocks.lightstone, 1, LightstoneType.BRICKS_CHISELED.ordinal()), new Object[] { new ItemStack(ModBlocks.lightstone, 1, LightstoneType.BRICKS.ordinal()) }); + addShapelessAuto(new ItemStack(ModBlocks.lightstone, 1, LightstoneType.CHISELED.ordinal()), new Object[] { ModBlocks.lightstone }); addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.reinforced_brick), 4), new Object[] { "FBF", "BFB", "FBF", 'F', Blocks.iron_bars, 'B', ModBlocks.brick_concrete }); addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.brick_compound), 4), new Object[] { "FBF", "BTB", "FBF", 'F', STEEL.bolt(), 'B', ModBlocks.reinforced_brick, 'T', ANY_TAR.any() }); diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 25e9ef98a..7dbb3e158 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -5557,6 +5557,13 @@ tile.launch_pad_large.name=Launch Pad tile.launch_pad_rusted.name=Old Launch Pad tile.launch_table.name=Large Launch Pad tile.leaves_layer.name=Fallen Leaves +tile.lightstone.unrefined.name=Raw Lightstone +tile.lightstone.tile.name=Lightstone Tile +tile.lightstone.bricks.name=Lightstone Bricks +tile.lightstone.bricks_chiseled.name=Lightstone Chiseled Bricks +tile.lightstone.chiseled.name=Chiseled Lightstone +tile.lightstone_tile_stairs.name=Lightstone Tile Stairs +tile.lightstone_bricks_stairs.name=Lightstone Brick Stairs tile.lox_barrel.name=LOX Barrel tile.machine_amgen.name=Ambience Radiation Generator tile.machine_ammo_press.name=Ammo Press @@ -6071,6 +6078,8 @@ tile.stone_resource.hematite.name=Hematite tile.stone_resource.limestone.name=Limestone tile.stone_resource.malachite.name=Malachite tile.stone_resource.sulfur.name=Sulfurous Stone +tile.stones_slab.lightstone.1.name=Lightstone Tile Slab +tile.stones_slab.lightstone.2.name=Lightstone Brick Slab tile.struct_icf_core.name=Inertial Confinement Fusion Reactor Core Component tile.struct_iter_core.name=Fusion Reactor Core Component tile.struct_launcher.name=Launch Pad Component Block diff --git a/src/main/resources/assets/hbm/textures/blocks/lightstone.bricks.png b/src/main/resources/assets/hbm/textures/blocks/lightstone.bricks.png new file mode 100644 index 000000000..34aeb4c05 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/lightstone.bricks.png differ diff --git a/src/main/resources/assets/hbm/textures/blocks/lightstone.bricks_chiseled.png b/src/main/resources/assets/hbm/textures/blocks/lightstone.bricks_chiseled.png new file mode 100644 index 000000000..8154f33c7 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/lightstone.bricks_chiseled.png differ diff --git a/src/main/resources/assets/hbm/textures/blocks/lightstone.bricks_chiseled.top.png b/src/main/resources/assets/hbm/textures/blocks/lightstone.bricks_chiseled.top.png new file mode 100644 index 000000000..4e3b2e629 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/lightstone.bricks_chiseled.top.png differ diff --git a/src/main/resources/assets/hbm/textures/blocks/lightstone.chiseled.png b/src/main/resources/assets/hbm/textures/blocks/lightstone.chiseled.png new file mode 100644 index 000000000..b53955893 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/lightstone.chiseled.png differ diff --git a/src/main/resources/assets/hbm/textures/blocks/lightstone.chiseled.top.png b/src/main/resources/assets/hbm/textures/blocks/lightstone.chiseled.top.png new file mode 100644 index 000000000..6816a5232 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/lightstone.chiseled.top.png differ diff --git a/src/main/resources/assets/hbm/textures/blocks/lightstone.tile.png b/src/main/resources/assets/hbm/textures/blocks/lightstone.tile.png new file mode 100644 index 000000000..1663fa30e Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/lightstone.tile.png differ diff --git a/src/main/resources/assets/hbm/textures/blocks/lightstone.unrefined.png b/src/main/resources/assets/hbm/textures/blocks/lightstone.unrefined.png new file mode 100644 index 000000000..67602d43b Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/lightstone.unrefined.png differ