mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-21 04:32:34 +00:00
Porting to 1.6.
This commit is contained in:
1 parent
c5d59a4505
commit
f9ceeba358
16 files changed
+131
-95
No files matched your search
@@ -6,6 +6,7 @@ import java.util.Collection;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
import forestry.api.genetics.IAllele;
|
||||
|
||||
@@ -14,6 +15,7 @@ public class HiveDrop implements IHiveDrop
|
||||
private IAllele[] template;
|
||||
private int chance;
|
||||
private ItemStack[] bonus;
|
||||
private float ignoblePercent = 0f;
|
||||
|
||||
public HiveDrop(IAllele[] beeTemplate, ItemStack[] bonusDrops, int dropChance)
|
||||
{
|
||||
@@ -21,18 +23,36 @@ public class HiveDrop implements IHiveDrop
|
||||
this.bonus = bonusDrops;
|
||||
this.chance = dropChance;
|
||||
}
|
||||
|
||||
public HiveDrop setIgnoblePercentage(float f)
|
||||
{
|
||||
this.ignoblePercent = f;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private IBee getBee(World w)
|
||||
{
|
||||
IBee bee = BeeManager.beeRoot.getBee(w, BeeManager.beeRoot.templateAsGenome(this.template));
|
||||
if (w.rand.nextFloat() < this.ignoblePercent)
|
||||
{
|
||||
bee.setIsNatural(false);
|
||||
}
|
||||
|
||||
return bee;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPrincess(World world, int x, int y, int z, int fortune)
|
||||
{
|
||||
return BeeManager.beeRoot.getMemberStack(BeeManager.beeRoot.getBee(world, BeeManager.beeRoot.templateAsGenome(this.template)), EnumBeeType.PRINCESS.ordinal());
|
||||
return BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.PRINCESS.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ItemStack> getDrones(World world, int x, int y, int z, int fortune)
|
||||
{
|
||||
ArrayList<ItemStack> value = new ArrayList<ItemStack>(1);
|
||||
value.add(BeeManager.beeRoot.getMemberStack(BeeManager.beeRoot.getBee(world, BeeManager.beeRoot.templateAsGenome(this.template)), EnumBeeType.DRONE.ordinal()));
|
||||
value.add(BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.DRONE.ordinal()));
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user