public void Load(BaseNetworkable.LoadInfo info) { if (info.msg.growableEntity != null) { GrowableGeneEncoding.DecodeIntToGenes(info.msg.growableEntity.genes, this); GrowableGeneEncoding.DecodeIntToPreviousGenes(info.msg.growableEntity.previousGenes, this); } }
public void TakeClones(BasePlayer player) { if (player == null || !CanClone() || Interface.CallHook("CanTakeCutting", player, this) != null) { return; } int num = Properties.BaseCloneCount + Genes.GetGeneTypeCount(GrowableGenetics.GeneType.Yield) / 2; if (num > 0) { Item item = ItemManager.Create(Properties.CloneItem, num, 0uL); GrowableGeneEncoding.EncodeGenesToItem(this, item); player.GiveItem(item, GiveItemReason.PickedUp); if (Properties.pickEffect.isValid) { Effect.server.Run(Properties.pickEffect.resourcePath, base.transform.position, Vector3.up); } Die(); } }
public void ReceiveInstanceData(ProtoBuf.Item.InstanceData data) { GrowableGeneEncoding.DecodeIntToGenes(data.dataInt, Genes); GrowableGeneEncoding.DecodeIntToPreviousGenes(data.dataInt, Genes); }
public void Save(BaseNetworkable.SaveInfo info) { info.msg.growableEntity.genes = GrowableGeneEncoding.EncodeGenesToInt(this); info.msg.growableEntity.previousGenes = GrowableGeneEncoding.EncodePreviousGenesToInt(this); }