Advertisement
Guest User

OreBlock

a guest
Dec 8th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.29 KB | None | 0 0
  1. package fr.dodo.rainbow.blocks;
  2.  
  3. import com.google.common.collect.Lists;
  4. import fr.dodo.rainbow.init.ModBlocks;
  5. import fr.dodo.rainbow.init.ModItems;
  6. import fr.dodo.rainbow.items.CSMMBlock;
  7. import net.minecraft.block.Block;
  8. import net.minecraft.block.material.Material;
  9. import net.minecraft.item.Item;
  10.  
  11. import static net.minecraft.block.material.Material.IRON;
  12. import static net.minecraft.block.material.Material.ROCK;
  13.  
  14. public class OreBlock extends CSMMBlock {
  15.  
  16.     public OreBlock(String name, Material materialV, float v, float v1, int i, String pickaxe) {
  17.         super(name, materialV);
  18.  
  19.     }
  20.  
  21.     public Item getItemDropped(IBlockState state, Random rand, int fortune)
  22.     {
  23.         return this == ModBlocks.rainbow_block ? ModItems.mixed : Item.getItemFromBlock(this);
  24.     }
  25.  
  26.  
  27.     public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune)
  28.     {
  29.         Random rand = world instanceof World ? ((World)world).rand : new Random();
  30.         if (this.getItemDropped(state, rand, fortune) != Item.getItemFromBlock(this))
  31.         {
  32.             int i = 0;
  33.  
  34.             if (this == BlockInit.CHICKEN_ORE)
  35.             {
  36.                 i = MathHelper.getInt(rand, 250, 500);
  37.             }
  38.  
  39.             return i;
  40.         }
  41.         return 0;
  42.     }
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement