mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-14 01:04:12 +00:00
Ensure Forestry Queens from NEI are mated
This commit is contained in:
1 parent
bd8dbbeaf8
commit
862feea792
2 files changed
+13
-14
No files matched your search
@@ -98,15 +98,20 @@ public class BeeHelper extends SpeciesRoot implements IBeeRoot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getMemberStack(IIndividual bee, int type) {
|
||||
if (!isMember(bee)) {
|
||||
public ItemStack getMemberStack(IIndividual individual, int type) {
|
||||
if (!isMember(individual)) {
|
||||
return null;
|
||||
}
|
||||
IBee bee = (IBee) individual;
|
||||
|
||||
Item beeItem;
|
||||
switch (EnumBeeType.VALUES[type]) {
|
||||
case QUEEN:
|
||||
beeItem = ForestryItem.beeQueenGE.item();
|
||||
// ensure a queen is always mated
|
||||
if (bee.getMate() == null) {
|
||||
bee.mate(bee);
|
||||
}
|
||||
break;
|
||||
case PRINCESS:
|
||||
beeItem = ForestryItem.beePrincessGE.item();
|
||||
|
||||
@@ -112,27 +112,21 @@ public class ItemBeeGE extends ItemGE {
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
if (type == EnumBeeType.QUEEN) {
|
||||
return;
|
||||
}
|
||||
|
||||
addCreativeItems(itemList, true);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public void addCreativeItems(List itemList, boolean hideSecrets) {
|
||||
|
||||
for (IIndividual individual : BeeManager.beeRoot.getIndividualTemplates()) {
|
||||
for (IBee bee : BeeManager.beeRoot.getIndividualTemplates()) {
|
||||
// Don't show secret bees unless ordered to.
|
||||
if (hideSecrets && individual.isSecret() && !Config.isDebug) {
|
||||
if (hideSecrets && bee.isSecret() && !Config.isDebug) {
|
||||
continue;
|
||||
}
|
||||
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
ItemStack someStack = new ItemStack(this);
|
||||
individual.writeToNBT(nbttagcompound);
|
||||
someStack.setTagCompound(nbttagcompound);
|
||||
itemList.add(someStack);
|
||||
ItemStack beeStack = BeeManager.beeRoot.getMemberStack(bee, type.ordinal());
|
||||
if (beeStack != null) {
|
||||
itemList.add(beeStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user