From 8ca4950b0206dab7e1ea38090baab869a52ca5f6 Mon Sep 17 00:00:00 2001 From: joflashstudios Date: Mon, 8 Jun 2015 00:31:28 -0400 Subject: [PATCH] Added ruby and sapphire ore drops. --- src/main/java/techreborn/blocks/BlockOre.java | 44 ++++++++++++++----- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/src/main/java/techreborn/blocks/BlockOre.java b/src/main/java/techreborn/blocks/BlockOre.java index ef7828bfd..54809de90 100644 --- a/src/main/java/techreborn/blocks/BlockOre.java +++ b/src/main/java/techreborn/blocks/BlockOre.java @@ -19,6 +19,8 @@ import techreborn.init.ModItems; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import techreborn.init.ModBlocks; +import techreborn.items.ItemDusts; +import techreborn.items.ItemGems; public class BlockOre extends Block { @@ -55,21 +57,42 @@ public class BlockOre extends Block { } @Override - public Item getItemDropped(int meta, Random random, int fortune) + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - if (meta == 2) + //Ruby + if (metadata == 2) { - return new ItemStack(ModItems.gems, fortune, 0).getItem(); + OreDrop ruby = new OreDrop(ItemGems.getGemByName("ruby")); + OreDrop redGarnet = new OreDrop(ItemGems.getGemByName("redGarnet"), 2); + OreDropSet set = new OreDropSet(ruby, redGarnet); + return set.drop(fortune, world.rand); } - if (meta == 3) + + //Sapphire + if (metadata == 3) { - return new ItemStack(ModItems.gems, fortune, 1).getItem(); + OreDrop sapphire = new OreDrop(ItemGems.getGemByName("sapphire")); + OreDrop peridot = new OreDrop(ItemGems.getGemByName("peridot"), 3); + OreDropSet set = new OreDropSet(sapphire, peridot); + return set.drop(fortune, world.rand); } - if (meta == 5) - { - return new ItemStack(ModItems.dusts, fortune, 60).getItem(); - } - return Item.getItemFromBlock(this); + + //Pyrite 1 + //if (metadata == 5) + //{ + // OreDrop pyriteDust = new OreDrop(ItemDusts.getDustByName("pyrite")); + // OreDropSet = new OreDropSet(pyriteDust); + //} + + //Sodolite 6, aluminum 1/2 + + //Cinnabar 1, 1/4 redstone + + //Sphalerite 1, 1/8 yellow garnet + + ArrayList block = new ArrayList(); + block.add(new ItemStack(Item.getItemFromBlock(this))); + return block; } @Override @@ -135,5 +158,4 @@ public class BlockOre extends Block { return textures[metaData]; } } - }