Merge pull request #25 from rmunn/mc-1.7.10

Fix #23: Allow Valiant bees to sometimes drop from hives
This commit is contained in:
mezz authored and GitHub committed 2017-07-20 20:27:45 -07:00
commit d13d5ec3dd
1 file changed
+5 -3
@@ -127,14 +127,16 @@ public enum HiveType
ArrayList<ItemStack> hiveDrops = new ArrayList<ItemStack>();
int dart;
Collections.shuffle(this.drops);
// Get a princess.
int throttle = 0;
while (hiveDrops.size() <= 0 && throttle < 10)
{
++throttle;
dart = world.rand.nextInt(100);
for (IHiveDrop drop : drops)
{
dart = world.rand.nextInt(100);
if (dart <= drop.getChance(world, x, y, z))
{
hiveDrops.add(drop.getPrincess(world, x, y, z, fortune));
@@ -144,9 +146,9 @@ public enum HiveType
}
// Get a drone, maybe.
dart = world.rand.nextInt(100);
for (IHiveDrop drop : drops)
{
dart = world.rand.nextInt(100);
if (dart <= drop.getChance(world, x, y, z))
{
hiveDrops.addAll(drop.getDrones(world, x, y, z, fortune));
@@ -155,9 +157,9 @@ public enum HiveType
}
// Get additional drops.
dart = world.rand.nextInt(100);
for (IHiveDrop drop : drops)
{
dart = world.rand.nextInt(100);
if (dart <= drop.getChance(world, x, y, z))
{
hiveDrops.addAll(drop.getAdditional(world, x, y, z, fortune));