-
-
Save suppergerrie2/04ee5f30f54505cf0faa747c359cbac2 to your computer and use it in GitHub Desktop.
Multiple Items Drop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BlockOre extends BlockBasic { | |
Item toDrop; | |
int minDropAmount = 1; | |
int maxDropAmount = 0; | |
public BlockOre(String name, Material material) { | |
this(name, material, null, 1, 1); | |
} | |
public BlockOre(String name, Material material, Item toDrop) { | |
this(name, material, toDrop, 1, 1); | |
} | |
public BlockOre(String name, Material material, Item toDrop, int dropAmount) { | |
this(name, material, toDrop, dropAmount, dropAmount); | |
} | |
public BlockOre(String name, Material material, Item toDrop, int minDropAmount, int maxDropAmount) { | |
super(name,material); | |
this.toDrop = toDrop; | |
this.minDropAmount = minDropAmount; | |
this.maxDropAmount = maxDropAmount; | |
} | |
@Override | |
public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState blockstate, int fortune){ | |
ArrayList<ItemStack> drops = new ArrayList<ItemStack>(); | |
drops.add(new ItemStack(Items.REDSTONE, 10)); | |
drops.add(new ItemStack(Items.DIAMOND, RANDOM.nextInt(10))); | |
return drops; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment