We no longer need to distinguish between primary and secondary, since we are now using [ArrayList<ItemStack> getDrops()].
We could possibly just get rid of the class altogether, but it keeps BlockOre's code significantly cleaner.
This commit is contained in:
parent
8ca4950b02
commit
999567e6df
2 changed files with 6 additions and 9 deletions
|
@ -59,7 +59,7 @@ public class OreDrop
|
|||
}
|
||||
}
|
||||
|
||||
//Each fortune level increases probability by 50% of base, up to a limit of 100%.
|
||||
//Each fortune level increases probability by 50% (configurable) of base, up to a limit of 100%, obviously.
|
||||
//So, if base is 5% and we have Fortune III, chance is 5% + (3 * 2.5%) = 12.5%
|
||||
private boolean calculateFortuneSingle(int level, Random random)
|
||||
{
|
||||
|
|
|
@ -13,25 +13,22 @@ import net.minecraft.block.Block;
|
|||
|
||||
public class OreDropSet
|
||||
{
|
||||
public OreDropSet(OreDrop primary, OreDrop... secondaries)
|
||||
public OreDropSet(OreDrop... oreDrops)
|
||||
{
|
||||
this.primary = primary;
|
||||
this.secondaries = secondaries;
|
||||
this.dropSet = oreDrops;
|
||||
}
|
||||
|
||||
public ArrayList<ItemStack> drop(int fortune, Random random)
|
||||
{
|
||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
|
||||
for (OreDrop drop : secondaries)
|
||||
for (OreDrop drop : dropSet)
|
||||
{
|
||||
drops.add(drop.getDrops(fortune, random));
|
||||
}
|
||||
|
||||
drops.add(primary.getDrops(fortune, random));
|
||||
return drops;
|
||||
}
|
||||
|
||||
public OreDrop primary;
|
||||
public OreDrop[] secondaries;
|
||||
|
||||
public OreDrop[] dropSet;
|
||||
}
|
Loading…
Add table
Reference in a new issue