From b0ddda617e6d918472e45979558273f921f9d145 Mon Sep 17 00:00:00 2001 From: warlordjones Date: Sun, 11 Jan 2015 19:39:43 +0000 Subject: [PATCH] Fix #133 Also refactor BlockLightstoneCarvable to BlockCarvableGlowstone (Consistency) --- .../chisel/block/BlockCarvableGlowstone.java | 42 +++++++++++++++++++ .../chisel/block/BlockLightstoneCarvable.java | 30 ------------- .../chisel/init/ChiselBlocks.java | 4 +- .../cricketcraft/chisel/init/Features.java | 4 +- 4 files changed, 46 insertions(+), 34 deletions(-) create mode 100644 src/main/java/com/cricketcraft/chisel/block/BlockCarvableGlowstone.java delete mode 100644 src/main/java/com/cricketcraft/chisel/block/BlockLightstoneCarvable.java diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockCarvableGlowstone.java b/src/main/java/com/cricketcraft/chisel/block/BlockCarvableGlowstone.java new file mode 100644 index 00000000..c38c4fed --- /dev/null +++ b/src/main/java/com/cricketcraft/chisel/block/BlockCarvableGlowstone.java @@ -0,0 +1,42 @@ +package com.cricketcraft.chisel.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class BlockCarvableGlowstone extends BlockCarvable { + + public BlockCarvableGlowstone() { + super(Material.glass); + } + + @Override + public int quantityDropped(Random random) { + return Blocks.glowstone.quantityDropped(random); + } + + @Override + public Item getItemDropped(int i, Random random, int a) { + return Items.glowstone_dust; + } + + @Override + public int damageDropped(int i) { + return 0; + } + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) + { + Block glowstone = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + return new ItemStack(Item.getItemFromBlock(glowstone), 1, meta); + } +} diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockLightstoneCarvable.java b/src/main/java/com/cricketcraft/chisel/block/BlockLightstoneCarvable.java deleted file mode 100644 index 27ab5799..00000000 --- a/src/main/java/com/cricketcraft/chisel/block/BlockLightstoneCarvable.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.cricketcraft.chisel.block; - -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; - -public class BlockLightstoneCarvable extends BlockCarvable { - - public BlockLightstoneCarvable() { - super(Material.glass); - } - - @Override - public int quantityDropped(Random random) { - return Blocks.glowstone.quantityDropped(random); - } - - @Override - public Item getItemDropped(int i, Random random, int a) { - return Items.glowstone_dust; - } - - @Override - public int damageDropped(int i) { - return 0; - } -} diff --git a/src/main/java/com/cricketcraft/chisel/init/ChiselBlocks.java b/src/main/java/com/cricketcraft/chisel/init/ChiselBlocks.java index 8467f67b..323d2035 100644 --- a/src/main/java/com/cricketcraft/chisel/init/ChiselBlocks.java +++ b/src/main/java/com/cricketcraft/chisel/init/ChiselBlocks.java @@ -16,7 +16,7 @@ import com.cricketcraft.chisel.block.BlockConcrete; import com.cricketcraft.chisel.block.BlockGrimstone; import com.cricketcraft.chisel.block.BlockHolystone; import com.cricketcraft.chisel.block.BlockLavastone; -import com.cricketcraft.chisel.block.BlockLightstoneCarvable; +import com.cricketcraft.chisel.block.BlockCarvableGlowstone; import com.cricketcraft.chisel.block.BlockMarbleCarpet; import com.cricketcraft.chisel.block.BlockMarbleIce; import com.cricketcraft.chisel.block.BlockMarbleIceStairs; @@ -55,7 +55,7 @@ public final class ChiselBlocks { public static final BlockCarvable iron_block = null; public static final BlockCarvable gold_block = null; public static final BlockCarvable diamond_block = null; - public static final BlockLightstoneCarvable glowstone = null; + public static final BlockCarvableGlowstone glowstone = null; public static final BlockCarvable lapis_block = null; public static final BlockCarvable emerald_block = null; public static final BlockCarvable nether_brick = null; diff --git a/src/main/java/com/cricketcraft/chisel/init/Features.java b/src/main/java/com/cricketcraft/chisel/init/Features.java index e066870a..145b1755 100644 --- a/src/main/java/com/cricketcraft/chisel/init/Features.java +++ b/src/main/java/com/cricketcraft/chisel/init/Features.java @@ -32,7 +32,7 @@ import com.cricketcraft.chisel.block.BlockGrimstone; import com.cricketcraft.chisel.block.BlockHolystone; import com.cricketcraft.chisel.block.BlockLavastone; import com.cricketcraft.chisel.block.BlockLeaf; -import com.cricketcraft.chisel.block.BlockLightstoneCarvable; +import com.cricketcraft.chisel.block.BlockCarvableGlowstone; import com.cricketcraft.chisel.block.BlockMarbleBookshelf; import com.cricketcraft.chisel.block.BlockMarbleCarpet; import com.cricketcraft.chisel.block.BlockMarbleIce; @@ -828,7 +828,7 @@ public enum Features { @Override void addBlocks() { - BlockLightstoneCarvable glowstone = (BlockLightstoneCarvable) new BlockLightstoneCarvable().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F).setLightLevel(1.0F) + BlockCarvableGlowstone glowstone = (BlockCarvableGlowstone) new BlockCarvableGlowstone().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F).setLightLevel(1.0F) .setStepSound(Block.soundTypeGlass); Carving.chisel.addVariation("glowstone", Blocks.glowstone, 0, 0); glowstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.1.desc"), 1, "lightstone/terrain-sulphur-cobble");