mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 20:42:35 +00:00
Fix #1874 Crash when adding bee to BQM quest / chestloot
This commit is contained in:
1 parent
2002dff3c9
commit
3c9572eb83
2 files changed
+10
-5
No files matched your search
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.items;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
@@ -35,6 +36,7 @@ import forestry.api.core.Tabs;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.apiculture.genetics.BeeDefinition;
|
||||
import forestry.apiculture.genetics.BeeGenome;
|
||||
import forestry.apiculture.genetics.DefaultBeeModelProvider;
|
||||
import forestry.core.config.Config;
|
||||
@@ -54,10 +56,14 @@ public class ItemBeeGE extends ItemGE implements IColoredItem {
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
@Nullable
|
||||
public IBee getIndividual(ItemStack itemstack) {
|
||||
return BeeManager.beeRoot.getMember(itemstack);
|
||||
IBee individual = BeeManager.beeRoot.getMember(itemstack);
|
||||
if(individual == null){
|
||||
individual = BeeDefinition.FOREST.getIndividual();
|
||||
}
|
||||
return individual;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,7 +77,7 @@ public class ItemBeeGE extends ItemGE implements IColoredItem {
|
||||
return super.getItemStackDisplayName(itemstack);
|
||||
}
|
||||
|
||||
IBee individual = BeeManager.beeRoot.getMember(itemstack);
|
||||
IBee individual = getIndividual(itemstack);
|
||||
String customBeeKey = "for.bees.custom." + type.getName() + "." + individual.getGenome().getPrimary().getUnlocalizedName().replace("bees.species.", "");
|
||||
if (Translator.canTranslateToLocal(customBeeKey)) {
|
||||
return Translator.translateToLocal(customBeeKey);
|
||||
@@ -90,7 +96,7 @@ public class ItemBeeGE extends ItemGE implements IColoredItem {
|
||||
}
|
||||
|
||||
if (type != EnumBeeType.DRONE) {
|
||||
IBee individual = BeeManager.beeRoot.getMember(itemstack);
|
||||
IBee individual = getIndividual(itemstack);
|
||||
if (individual.isNatural()) {
|
||||
list.add(TextFormatting.YELLOW + TextFormatting.ITALIC.toString() + Translator.translateToLocal("for.bees.stock.pristine"));
|
||||
} else {
|
||||
|
||||
@@ -258,7 +258,6 @@ public abstract class Genome implements IGenome {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public IAllele getActiveAllele(IChromosomeType chromosomeType) {
|
||||
return chromosomes[chromosomeType.ordinal()].getActiveAllele();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user