use of nex.village.PigtificateVillage in project NetherEx by LogicTechCorp.
the class EntityAIRestrictFenceGateUse method shouldExecute.
@Override
public boolean shouldExecute() {
if (entityObj.world.isDaytime()) {
return false;
} else {
BlockPos blockpos = new BlockPos(entityObj);
PigtificateVillage village = PigtificateVillageManager.getPigtificateVillages(entityObj.getEntityWorld()).getNearestVillage(blockpos, 16);
if (village == null) {
return false;
} else {
fenceGate = village.getNearestFenceGate(blockpos);
return fenceGate != null && (double) fenceGate.getDistanceToInsideBlockSq(blockpos) < 2.25D;
}
}
}
Aggregations