diff --git a/src/minecraft/biomesoplenty/api/BlockReferences.java b/src/minecraft/biomesoplenty/api/BlockReferences.java index 613806478..68e629d74 100644 --- a/src/minecraft/biomesoplenty/api/BlockReferences.java +++ b/src/minecraft/biomesoplenty/api/BlockReferences.java @@ -102,6 +102,7 @@ public class BlockReferences { holyGrass (Blocks.holyGrass, 0), holyDirt (Blocks.holyDirt, 0), holyStone (Blocks.holyStone, 0), + holyStoneCobble (Blocks.holyStone, 1), crystal (Blocks.crystal, 0), cragRock (Blocks.cragRock, 0), quicksand (Blocks.mud, 1), diff --git a/src/minecraft/biomesoplenty/api/Blocks.java b/src/minecraft/biomesoplenty/api/Blocks.java index f8c99f57a..09b0456b6 100644 --- a/src/minecraft/biomesoplenty/api/Blocks.java +++ b/src/minecraft/biomesoplenty/api/Blocks.java @@ -46,6 +46,8 @@ public class Blocks public static Optional redCobbleStairs = Optional.absent(); public static Optional redBricksStairs = Optional.absent(); public static Optional mudBricksStairs = Optional.absent(); + public static Optional holyCobbleStairs = Optional.absent(); + public static Optional holyBricksStairs = Optional.absent(); // Slabs public static Optional woodenSingleSlab1 = Optional.absent(); diff --git a/src/minecraft/biomesoplenty/blocks/BlockBOPSkystone.java b/src/minecraft/biomesoplenty/blocks/BlockBOPSkystone.java new file mode 100644 index 000000000..864a0a9f6 --- /dev/null +++ b/src/minecraft/biomesoplenty/blocks/BlockBOPSkystone.java @@ -0,0 +1,108 @@ +package biomesoplenty.blocks; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import biomesoplenty.BiomesOPlenty; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockBOPSkystone extends Block +{ + private static final String[] types = new String[] {"holystone", "holycobble", "holybrick"}; + private Icon[] textures = {null, null, null}; + + public BlockBOPSkystone(int par1) + { + super(par1, Material.rock); + this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty); + setStepSound(Block.soundStoneFootstep); + } + + @Override + public void registerIcons(IconRegister iconRegister) + { + textures = new Icon[types.length]; + + for (int i = 0; i < types.length; ++i) + textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+types[i]); + } + + @Override + public Icon getIcon(int side, int meta) + { + if (meta < 0 || meta >= textures.length) + meta = 0; + + return textures[meta]; + } + + @Override + public int getDamageValue(World world, int x, int y, int z) { + return world.getBlockMetadata(x, y, z); + } + + @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { + for (int i = 0; i < types.length; ++i) + list.add(new ItemStack(blockID, 1, i)); + } + + @Override + public int damageDropped(int meta) + { + return meta == 0 ? 1 : meta; + } + + @Override + public float getBlockHardness(World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + float hardness = this.blockHardness; + + switch (meta) + { + case 0: + hardness = 1.0F; + break; + + case 1: + hardness = 1.6F; + break; + + case 2: + hardness = 1.1F; + break; + } + + return hardness; + } + + @Override + public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) + { + int meta = world.getBlockMetadata(x, y, z); + float resistance = this.blockResistance; + + switch (meta) + { + case 1: + resistance = 7.5F; + break; + + case 2: + resistance = 7.0F; + break; + } + + return resistance / 5.0F; + } +} diff --git a/src/minecraft/biomesoplenty/blocks/BlockBOPSlab.java b/src/minecraft/biomesoplenty/blocks/BlockBOPSlab.java index 22461df23..439c183d3 100644 --- a/src/minecraft/biomesoplenty/blocks/BlockBOPSlab.java +++ b/src/minecraft/biomesoplenty/blocks/BlockBOPSlab.java @@ -26,7 +26,7 @@ public class BlockBOPSlab extends BlockHalfSlab WOOD1, WOOD2, STONE; } private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow"}; - private static final String[] rockTypes = new String[] {"redcobble", "redbrick", "mudbrick"}; + private static final String[] rockTypes = new String[] {"redcobble", "redbrick", "mudbrick", "holycobble", "holybrick"}; private Icon[] textures; protected final boolean isDoubleSlab; @@ -91,7 +91,7 @@ public class BlockBOPSlab extends BlockHalfSlab else if (category == SlabCategory.WOOD2) max = 2; else if (category == SlabCategory.STONE) - max = 3; + max = 5; for (int i = 0; i < max; ++i) list.add(new ItemStack(blockID, 1, i)); @@ -148,6 +148,14 @@ public class BlockBOPSlab extends BlockHalfSlab case 2: hardness = 1.0F; + break; + + case 3: + hardness = 1.6F; + break; + + case 4: + hardness = 1.1F; break; } } @@ -175,6 +183,14 @@ public class BlockBOPSlab extends BlockHalfSlab case 2: resistance = 2.0F; + break; + + case 3: + resistance = 7.0F; + break; + + case 4: + resistance = 7.5F; break; } } diff --git a/src/minecraft/biomesoplenty/blocks/BlockBOPStairs.java b/src/minecraft/biomesoplenty/blocks/BlockBOPStairs.java index db86a4f54..07d0b85cb 100644 --- a/src/minecraft/biomesoplenty/blocks/BlockBOPStairs.java +++ b/src/minecraft/biomesoplenty/blocks/BlockBOPStairs.java @@ -13,10 +13,10 @@ public class BlockBOPStairs extends BlockStairs { public static enum Category { - ACACIA, CHERRY, DARK, FIR, HOLY, MAGIC, MANGROVE, PALM, REDWOOD, WILLOW, RED_COBBLE, RED_BRICKS, MUD_BRICKS; + ACACIA, CHERRY, DARK, FIR, HOLY, MAGIC, MANGROVE, PALM, REDWOOD, WILLOW, RED_COBBLE, RED_BRICKS, MUD_BRICKS, HOLY_COBBLE, HOLY_BRICKS; } - private static final String[] types = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow", "redcobble", "redbrick", "mudbrick"}; + private static final String[] types = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow", "redcobble", "redbrick", "mudbrick", "holycobble", "holybrick"}; private Icon[] textures; private final Category category; diff --git a/src/minecraft/biomesoplenty/configuration/BOPBlocks.java b/src/minecraft/biomesoplenty/configuration/BOPBlocks.java index e4d24b841..3858a382a 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPBlocks.java +++ b/src/minecraft/biomesoplenty/configuration/BOPBlocks.java @@ -25,6 +25,7 @@ import biomesoplenty.blocks.BlockBOPPlank; import biomesoplenty.blocks.BlockBOPPlant; import biomesoplenty.blocks.BlockBOPRedRock; import biomesoplenty.blocks.BlockBOPSapling; +import biomesoplenty.blocks.BlockBOPSkystone; import biomesoplenty.blocks.BlockBOPSlab; import biomesoplenty.blocks.BlockBOPSlab.SlabCategory; import biomesoplenty.blocks.BlockBOPStairs; @@ -54,6 +55,7 @@ import biomesoplenty.items.ItemBOPPlank; import biomesoplenty.items.ItemBOPPlant; import biomesoplenty.items.ItemBOPRedRock; import biomesoplenty.items.ItemBOPSapling; +import biomesoplenty.items.ItemBOPSkystone; import biomesoplenty.items.ItemBOPSlab; import biomesoplenty.items.ItemBOPWillow; @@ -125,7 +127,9 @@ public class BOPBlocks { Blocks.hardDirt = Optional.of(new BlockBOPGeneric(BOPConfiguration.hardDirtID, Material.rock, BlockType.HARD_DIRT)); Blocks.holyGrass = Optional.of(new BlockBOPGrass(BOPConfiguration.holyGrassID).setUnlocalizedName("holyGrass")); Blocks.holyDirt = Optional.of(new BlockBOPGeneric(BOPConfiguration.holyDirtID, Material.sand, BlockType.HOLY_DIRT)); - Blocks.holyStone = Optional.of(new BlockBOPGeneric(BOPConfiguration.holyStoneID, Material.rock, BlockType.HOLY_STONE)); + Blocks.holyStone = Optional.of((new BlockBOPSkystone(BOPConfiguration.holyStoneID)).setUnlocalizedName("holyStone")); + Blocks.holyCobbleStairs = Optional.of((new BlockBOPStairs(BOPConfiguration.holyCobbleStairsID, Blocks.holyStone.get(), Category.HOLY_COBBLE)).setUnlocalizedName("holyCobbleStairs")); + Blocks.holyBricksStairs = Optional.of((new BlockBOPStairs(BOPConfiguration.holyBrickStairsID, Blocks.holyStone.get(), Category.HOLY_BRICKS)).setUnlocalizedName("holyBricksStairs")); Blocks.crystal = Optional.of(new BlockBOPGeneric(BOPConfiguration.crystalID, Material.glass, BlockType.CRYSTAL)); Blocks.promisedPortal = Optional.of(new BlockPromisedPortal(BOPConfiguration.promisedLandPortalID).setUnlocalizedName("promisedPortal").setBlockUnbreakable().setResistance(6000000.0F).setLightValue(1.0F)); // Blocks.amethystOre = Optional.of(new BlockBOPGeneric(BOPConfiguration.amethystOreID, Material.rock, BlockType.AMETHYST_ORE)); @@ -194,7 +198,9 @@ public class BOPBlocks { // GameRegistry.registerBlock(Blocks.holyGrass.get(), "holyGrass"); GameRegistry.registerBlock(Blocks.holyGrass.get(), ItemBOPGrass.class, "holyGrass"); GameRegistry.registerBlock(Blocks.holyDirt.get(), "holyDirt"); - GameRegistry.registerBlock(Blocks.holyStone.get(), "holyStone"); + GameRegistry.registerBlock(Blocks.holyStone.get(), ItemBOPSkystone.class, "holyStone"); + GameRegistry.registerBlock(Blocks.holyCobbleStairs.get(), "holyCobbleStairs"); + GameRegistry.registerBlock(Blocks.holyBricksStairs.get(), "holyBricksStairs"); GameRegistry.registerBlock(Blocks.promisedPortal.get(), "promisedPortal"); GameRegistry.registerBlock(Blocks.amethystOre.get(), ItemBOPAmethyst.class, "amethystOre"); // GameRegistry.registerBlock(Blocks.amethystBlock.get(), "amethystBlock"); @@ -322,7 +328,11 @@ public class BOPBlocks { LanguageRegistry.addName(new ItemStack(Blocks.holyGrass.get(), 1, 0), "Purified Grass"); LanguageRegistry.addName(new ItemStack(Blocks.holyGrass.get(), 1, 1), "Smoldering Grass"); LanguageRegistry.addName(Blocks.holyDirt.get(), "Purified Dirt"); - LanguageRegistry.addName(Blocks.holyStone.get(), "Skystone"); + LanguageRegistry.addName(new ItemStack(Blocks.holyStone.get(),1,0), "Skystone"); + LanguageRegistry.addName(new ItemStack(Blocks.holyStone.get(),1,1), "Skystone Cobblestone"); + LanguageRegistry.addName(Blocks.holyCobbleStairs.get(), "Skystone Cobblestone Stairs"); + LanguageRegistry.addName(new ItemStack(Blocks.holyStone.get(),1,2), "Skystone Bricks"); + LanguageRegistry.addName(Blocks.holyBricksStairs.get(), "Skystone Bricks Stairs"); LanguageRegistry.addName(Blocks.crystal.get(), "Celestial Crystal"); LanguageRegistry.addName(new ItemStack(Blocks.plants.get(),1,4), "Purified Tall Grass"); LanguageRegistry.addName(Blocks.promisedPortal.get(), "Promised Land Portal"); diff --git a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java index 932a0c705..1ad641dfd 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java +++ b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java @@ -145,6 +145,8 @@ public class BOPConfiguration { public static int colourizedSaplingsID; public static int redCobbleStairsID; public static int redBrickStairsID; + public static int holyCobbleStairsID; + public static int holyBrickStairsID; public static int promisedLandPortalID; public static int amethystOreID; @@ -603,7 +605,7 @@ public class BOPConfiguration { hardDirtID = config.getTerrainBlock("Terrain Block IDs", "Hard Dirt ID", 168, null).getInt(); holyGrassID = config.getTerrainBlock("Terrain Block IDs", "Holy Grass ID", 169, null).getInt(); holyDirtID = config.getTerrainBlock("Terrain Block IDs", "Holy Dirt ID", 170, null).getInt(); - holyStoneID = config.getTerrainBlock("Terrain Block IDs", "Holy Stone ID", 171, null).getInt(); + holyStoneID = config.getTerrainBlock("Terrain Block IDs", "Skystone ID", 171, null).getInt(); cragRockID = config.getTerrainBlock("Terrain Block IDs", "Crag Rock ID", 172, null).getInt(); // Get Crafted Block ID's @@ -660,6 +662,9 @@ public class BOPConfiguration { crystalID = config.getBlock("Crystal ID", 1963, null).getInt(); cloudID = config.getBlock("Cloud ID", 1964, null).getInt(); + + holyCobbleStairsID = config.getBlock("Skystone Cobble Stairs ID", 1965, null).getInt(); + holyBrickStairsID = config.getBlock("Skystone Brick Stairs ID", 1966, null).getInt(); // Get Item ID's shroomPowderID = config.getItem("Shroom Powder ID", 21001, null).getInt(); diff --git a/src/minecraft/biomesoplenty/items/ItemBOPSkystone.java b/src/minecraft/biomesoplenty/items/ItemBOPSkystone.java new file mode 100644 index 000000000..096f4f7df --- /dev/null +++ b/src/minecraft/biomesoplenty/items/ItemBOPSkystone.java @@ -0,0 +1,27 @@ +package biomesoplenty.items; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemBOPSkystone extends ItemBlock +{ + private static final String[] types = new String[] {"holystone", "holycobble", "holybrick"}; + + public ItemBOPSkystone(int par1) + { + super(par1); + setMaxDamage(0); + setHasSubtypes(true); + } + + @Override + public int getMetadata(int meta) + { + return meta & 15; + } + + @Override + public String getUnlocalizedName(ItemStack itemstack) { + return types[itemstack.getItemDamage() & 15]; + } +} diff --git a/src/minecraft/mods/BiomesOPlenty/textures/blocks/amethystore.png b/src/minecraft/mods/BiomesOPlenty/textures/blocks/amethystore.png index a4e424e7d..6024f8f5d 100644 Binary files a/src/minecraft/mods/BiomesOPlenty/textures/blocks/amethystore.png and b/src/minecraft/mods/BiomesOPlenty/textures/blocks/amethystore.png differ diff --git a/src/minecraft/mods/BiomesOPlenty/textures/blocks/holybrick.png b/src/minecraft/mods/BiomesOPlenty/textures/blocks/holybrick.png new file mode 100644 index 000000000..caaaf1316 Binary files /dev/null and b/src/minecraft/mods/BiomesOPlenty/textures/blocks/holybrick.png differ diff --git a/src/minecraft/mods/BiomesOPlenty/textures/blocks/holycobble.png b/src/minecraft/mods/BiomesOPlenty/textures/blocks/holycobble.png new file mode 100644 index 000000000..370cacc88 Binary files /dev/null and b/src/minecraft/mods/BiomesOPlenty/textures/blocks/holycobble.png differ diff --git a/src/minecraft/mods/BiomesOPlenty/textures/blocks/holystone.png b/src/minecraft/mods/BiomesOPlenty/textures/blocks/holystone.png index 73ea9d89a..56a37ba3d 100644 Binary files a/src/minecraft/mods/BiomesOPlenty/textures/blocks/holystone.png and b/src/minecraft/mods/BiomesOPlenty/textures/blocks/holystone.png differ