use of forestry.lepidopterology.genetics.Butterfly in project ForestryMC by ForestryMC.
the class TileCocoon method readFromNBT.
/* SAVING & LOADING */
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
super.readFromNBT(nbttagcompound);
if (nbttagcompound.hasKey("Caterpillar")) {
caterpillar = new Butterfly(nbttagcompound.getCompoundTag("Caterpillar"));
}
ownerHandler.readFromNBT(nbttagcompound);
age = nbttagcompound.getInteger("Age");
maturationTime = nbttagcompound.getInteger("CATMAT");
isSolid = nbttagcompound.getBoolean("isSolid");
}
use of forestry.lepidopterology.genetics.Butterfly in project ForestryMC by ForestryMC.
the class EntityButterfly method readEntityFromNBT.
@Override
public void readEntityFromNBT(NBTTagCompound nbttagcompound) {
super.readEntityFromNBT(nbttagcompound);
IButterfly butterfly = null;
if (nbttagcompound.hasKey("BTFLY")) {
butterfly = new Butterfly((NBTTagCompound) nbttagcompound.getTag("BTFLY"));
}
setIndividual(butterfly);
if (nbttagcompound.hasKey("PLN")) {
NBTTagCompound pollenNBT = nbttagcompound.getCompoundTag("PLN");
ISpeciesRoot root;
if (pollenNBT.hasKey("Root")) {
root = AlleleManager.alleleRegistry.getSpeciesRoot(pollenNBT.getString("Root"));
} else {
root = TreeManager.treeRoot;
}
pollen = root.getMember(pollenNBT);
}
EnumButterflyState state = EnumButterflyState.VALUES[nbttagcompound.getByte("STATE")];
setState(state);
exhaustion = nbttagcompound.getInteger("EXH");
BlockPos home = new BlockPos(nbttagcompound.getInteger("homeX"), nbttagcompound.getInteger("homeY"), nbttagcompound.getInteger("homeZ"));
setHomePosAndDistance(home, ModuleLepidopterology.maxDistance);
}
Aggregations