diff --git a/src/main/java/com/cricketcraft/chisel/Crafting.java b/src/main/java/com/cricketcraft/chisel/Crafting.java index 3ef1d645..13322a03 100644 --- a/src/main/java/com/cricketcraft/chisel/Crafting.java +++ b/src/main/java/com/cricketcraft/chisel/Crafting.java @@ -2,6 +2,7 @@ package com.cricketcraft.chisel; import com.cricketcraft.chisel.init.ModBlocks; import com.cricketcraft.chisel.init.ModItems; + import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -154,5 +155,16 @@ public class Crafting { { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.scorching, 8, 0), new Object[]{"xxx", "xyx", "xxx", 'x', "stone", 'y', Items.blaze_rod})); } + if(Configurations.featureEnabled("coloredSand")) + { + for(int x = 0; x < 16; x++) + { + String[] dyes = { "Black", "Red", "Green", "Brown", "Blue", + "Purple", "Cyan", "LightGray", "Gray", "Pink", "Lime", + "Yellow", "LightBlue", "Magenta", "Orange", "White" }; + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.coloredSand, 1, x), new Object[]{"sss", "sds", "sss", 's', Blocks.sand, 'd', "dye" + dyes[x]})); + GameRegistry.addSmelting(new ItemStack(ModBlocks.coloredSand, 1, x), new ItemStack(Blocks.stained_glass, 1, x), 0.3F); + } + } } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockCarvableSand.java b/src/main/java/com/cricketcraft/chisel/block/BlockCarvableSand.java new file mode 100644 index 00000000..7317f4da --- /dev/null +++ b/src/main/java/com/cricketcraft/chisel/block/BlockCarvableSand.java @@ -0,0 +1,161 @@ +package com.cricketcraft.chisel.block; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSand; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +import com.cricketcraft.chisel.Chisel; +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.carving.CarvableHelper; +import com.cricketcraft.chisel.carving.CarvableVariation; +import com.cricketcraft.chisel.init.ModTabs; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockCarvableSand extends BlockSand implements ICarvable { + public CarvableHelper carverHelper; + private boolean isAlpha; + + public BlockCarvableSand() { + super(); + carverHelper = new CarvableHelper(); + setCreativeTab(ModTabs.tabOtherChiselBlocks); + setHarvestLevel("chisel", 0); + } + + public BlockCarvableSand setStained(boolean a) { + this.isAlpha = a; + return this; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return isAlpha ? 1 : 0; + } + + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } + + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return carverHelper.getIcon(world, x, y, z, side); + } + + @Override + public int damageDropped(int i) { + return i; + } + + @Override + public void registerBlockIcons(IIconRegister register) { + carverHelper.registerBlockIcons("Chisel", this, register); + } + + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } + + @Override + public int getRenderType() { + return Chisel.RenderCTMId; + } + + @Override + public CarvableVariation getVariation(int metadata) { + return carverHelper.getVariation(metadata); + } + + + public static class SoundType extends Block.SoundType { + public final String soundNameStep; + public final String soundNameBreak; + public final String soundNamePlace; + + /** + * Creates a SoundType with automatic names for step and break sounds. + * Sound names dig.soundName and step.soundName must be specified in the + * sounds.json + * + * @param soundName block of the sound. Will automatically be expanded to + * "mod:dig.soundName" and "mod:step.soundName" respectively) + * @param volume default 1.0f + * @param frequency default 1.0f + */ + public SoundType(String soundName, float volume, float frequency) { + super(soundName, volume, frequency); + this.soundNameStep = null; + this.soundNameBreak = null; + this.soundNamePlace = null; + } + + /** + * Creates a SoundType with manual names for step and break sounds. + * Sound names must be specified in the sounds.json + * + * @param soundNameBreak block break sound + * @param soundNameStep block step sound + * @param volume default 1.0f + * @param frequency default 1.0f + */ + public SoundType(String soundNameBreak, String soundNameStep, float volume, float frequency) { + super(soundNameStep, volume, frequency); + this.soundNameStep = soundNameStep; + this.soundNameBreak = soundNameBreak; + this.soundNamePlace = null; + } + + /** + * Creates a SoundType with manual names for step, break and place + * sounds. Sound names must be specified in the sounds.json + * + * @param soundNameBreak block break sound + * @param soundNameStep block step sound + * @param soundNamePlace block place sound + * @param volume default 1.0f + * @param frequency default 1.0f + */ + public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume, float frequency) { + super(soundNameStep, volume, frequency); + this.soundNameStep = soundNameStep; + this.soundNameBreak = soundNameBreak; + this.soundNamePlace = soundNamePlace; + } + + @Override + public String getBreakSound() { + if (soundNameBreak == null) + return Chisel.MOD_ID + ":dig." + this.soundName; + else + return this.soundNameBreak; + } + + @Override + public String getStepResourcePath() { + if (soundNameStep == null) + return Chisel.MOD_ID + ":step." + this.soundName; + else + return this.soundNameStep; + } + + @Override + public String func_150496_b() { + if (soundNamePlace == null) + return getBreakSound(); + else + return this.soundNamePlace; + } + } + +} diff --git a/src/main/java/com/cricketcraft/chisel/init/ModBlocks.java b/src/main/java/com/cricketcraft/chisel/init/ModBlocks.java index 4b4e7f62..7e6aa811 100644 --- a/src/main/java/com/cricketcraft/chisel/init/ModBlocks.java +++ b/src/main/java/com/cricketcraft/chisel/init/ModBlocks.java @@ -97,6 +97,7 @@ public class ModBlocks { public static BlockCarvable OCD; public static BlockCarvable OCD2; public static BlockCarvable bloodRune; + public static BlockCarvableSand coloredSand; // 1.7 public static BlockCarvableGlass[] stainedGlass = new BlockCarvableGlass[4]; @@ -1347,6 +1348,17 @@ public class ModBlocks { Carving.chisel.registerOre("woolen_clay", "woolen_clay"); } + if(Configurations.featureEnabled("coloredSand")) + { + coloredSand = (BlockCarvableSand) new BlockCarvableSand().setCreativeTab(ModTabs.tabOtherChiselBlocks); + coloredSand.carverHelper.setChiselBlockName("Colored Sand"); + + for(int i = 0; i < 16; i++) + coloredSand.carverHelper.addVariation(StatCollector.translateToLocal("tile.coloredSand." + i + ".desc"), i, "coloredSand/" + sGNames[i].replaceAll(" ", "").toLowerCase()); + coloredSand.carverHelper.register(coloredSand, "colored_sand"); + + Carving.chisel.registerOre("colored_sand", "colored_sand"); + } if(Configurations.featureEnabled("laboratory")) { diff --git a/src/main/resources/assets/chisel/lang/en_US.lang b/src/main/resources/assets/chisel/lang/en_US.lang index d7da1c74..bb8e72d8 100644 --- a/src/main/resources/assets/chisel/lang/en_US.lang +++ b/src/main/resources/assets/chisel/lang/en_US.lang @@ -1132,6 +1132,25 @@ tile.woolenClay.13.desc=Green Woolen Clay tile.woolenClay.14.desc=Red Woolen Clay tile.woolenClay.15.desc=Black Woolen Clay +#Colored Sand +tile.woolen_clay.name=Colored Sand +tile.coloredSand.0.desc=White Colored Sand +tile.coloredSand.1.desc=Orange Colored Sand +tile.coloredSand.2.desc=Magenta Colored Sand +tile.coloredSand.3.desc=Light Blue Colored Sand +tile.coloredSand.4.desc=Yellow Colored Sand +tile.coloredSand.5.desc=Lime Colored Sand +tile.coloredSand.6.desc=Pink Colored Sand +tile.coloredSand.7.desc=Grey Colored Sand +tile.coloredSand.8.desc=Light Grey Colored Sand +tile.coloredSand.9.desc=Cyan Colored Sand +tile.coloredSand.10.desc=Purple Colored Sand +tile.coloredSand.11.desc=Blue Colored Sand +tile.coloredSand.12.desc=Brown Colored Sand +tile.coloredSand.13.desc=Green Colored Sand +tile.coloredSand.14.desc=Red Colored Sand +tile.coloredSand.15.desc=Black Colored Sand + #Laboratory Block tile.laboratoryblock.name=Laboratory Block tile.laboratory.0.desc=Wall Panel diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/black.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/black.png new file mode 100755 index 00000000..2c433400 Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/black.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/blue.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/blue.png new file mode 100755 index 00000000..8097d39d Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/blue.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/brown.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/brown.png new file mode 100755 index 00000000..c4f90479 Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/brown.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/cyan.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/cyan.png new file mode 100755 index 00000000..001d0e6a Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/cyan.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/gray.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/gray.png new file mode 100755 index 00000000..9be736a2 Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/gray.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/green.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/green.png new file mode 100755 index 00000000..c544e358 Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/green.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/lightblue.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/lightblue.png new file mode 100755 index 00000000..ea9c250a Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/lightblue.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/lightgray.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/lightgray.png new file mode 100755 index 00000000..9b5a3488 Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/lightgray.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/lime.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/lime.png new file mode 100755 index 00000000..996bc100 Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/lime.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/magenta.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/magenta.png new file mode 100755 index 00000000..87b9e3a2 Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/magenta.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/orange.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/orange.png new file mode 100755 index 00000000..350d1340 Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/orange.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/pink.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/pink.png new file mode 100755 index 00000000..76dbcd60 Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/pink.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/purple.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/purple.png new file mode 100755 index 00000000..7e16a24e Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/purple.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/red.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/red.png new file mode 100755 index 00000000..4ecfe491 Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/red.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/white.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/white.png new file mode 100755 index 00000000..3f32562d Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/white.png differ diff --git a/src/main/resources/assets/chisel/textures/blocks/coloredSand/yellow.png b/src/main/resources/assets/chisel/textures/blocks/coloredSand/yellow.png new file mode 100755 index 00000000..4ff2184c Binary files /dev/null and b/src/main/resources/assets/chisel/textures/blocks/coloredSand/yellow.png differ