[1.12.2] Acclimated bee crash game
maratth opened this issue · 7 comments
When i put tropical acclimated bee in apiary, my game crash in few minutes.
The Binnie mod don't report in stacktrace but i think not become from forestry because my forestry bees have normal operation.
Description: Ticking block entity
java.lang.IllegalStateException
at com.google.common.base.Preconditions.checkState(Preconditions.java:429)
at forestry.apiculture.BeekeepingLogic.queenWorkTick(BeekeepingLogic.java:295)
at forestry.apiculture.BeekeepingLogic.doWork(BeekeepingLogic.java:252)
at forestry.apiculture.tiles.TileBeeHousingBase.updateServerSide(TileBeeHousingBase.java:151)
at forestry.core.tiles.TileForestry.func_73660_a(TileForestry.java:86)
at net.minecraft.world.World.func_72939_s(World.java:1829)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:612)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:765)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:666)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:239)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:524)
at java.lang.Thread.run(Thread.java:745)
crash-2017-12-20_17.54.57-server.txt
same issue too.
@Ruidolph Yes, normal bees are completely safe.
I have hit this error also. Looking into the Forestry side, here is the context of the error:
IBeeGenome mate = queen.getMate();
Preconditions.checkState(mate != null);
I looked into the acclimatiser code to see if something was causing the queen to return a null mate and tracked it down to Splicer.setGene
IIndividual individual = speciesRoot.templateAsIndividual(primaryAlleles, secondaryAlleles);
if (original.isAnalyzed()) {
individual.analyze();
}
if (original instanceof IBee) {
IBee individualBee = (IBee) individual;
IBee originalBee = (IBee) original;
individualBee.setIsNatural(originalBee.isNatural());
}
NBTTagCompound nbt = new NBTTagCompound();
individual.writeToNBT(nbt);
target.setTagCompound(nbt);
Apparently, speciesRoot.templateAsIndividual creates a new instance using the genome constructor of the Bee class which does not set the mate field. This is a hunch, rather than actually running it to see. If I get some time, I'll try to load up the the mods in a dev instance to try it out, but this is the best I can offer at the moment.
I tracked that down to checking queen conditions myself, but seeing your summary of the code gave me an idea. Sure enough, this bug does not occur if you acclimatize a princess and drone rather than a queen. Many other bee manipulation machines (like the Genetic Imprinter from Gendustry) do not accept queens at all, possibly because of issues like this. I recommend disallowing queens from the Acclimatizer immediately, pending a possible fix.