public virtual bool CheckForProductionBuff() { if (!CheckIncentive(lstProductionBuffs)) { return(false); } // If it's an egg producing entity, scan for a bed to hatch. if (theEntity.Buffs.HasBuff(strProductionFinishedBuff)) { Vector3 TargetBlock = ModGeneralUtilities.ScanForBlockInList(this.theEntity.position, lstBeds, 20); if (TargetBlock != Vector3.zero) { theEntity.SetInvestigatePosition(TargetBlock, 120); return(true); } } return(false); }
public virtual bool CheckForSanitation() { if (!CheckIncentive(lstSanitationBuffs)) { return(false); } if (lstSanitation.Count > 0) { Vector3 TargetBlock = ModGeneralUtilities.ScanForBlockInList(this.theEntity.position, lstSanitation, 20); if (TargetBlock == Vector3.zero) { return(false); } theEntity.SetInvestigatePosition(TargetBlock, 120); } return(true); }
// Scans for the water block in the area. public virtual bool CheckForHomeBlock() { if (lstHomeBlocks.Count == 0) { return(false); } Vector3 TargetBlock = ModGeneralUtilities.ScanForBlockInList(this.theEntity.position, lstHomeBlocks, 20); if (TargetBlock == Vector3.zero) { return(false); } Vector3i position; position.x = Utils.Fastfloor(TargetBlock.x); position.z = Utils.Fastfloor(TargetBlock.z); position.y = Utils.Fastfloor(TargetBlock.y); theEntity.setHomeArea(position, MaxDistance); return(true); }