use of nex.entity.passive.EntityPigtificate in project NetherEx by LogicTechCorp.
the class WorldGenUtil method addEntitiesToWorld.
private static void addEntitiesToWorld(World world, BlockPos pos, PlacementSettings placementSettings, List<Template.EntityInfo> entities, StructureBoundingBox boundingBox) {
for (Template.EntityInfo entityInfo : entities) {
BlockPos blockPos = Template.transformedBlockPos(placementSettings, entityInfo.blockPos).add(pos);
if (boundingBox == null || boundingBox.isVecInside(blockPos)) {
NBTTagCompound compound = entityInfo.entityData;
Vec3d vec3d = transformedVec3d(entityInfo.pos, placementSettings.getMirror(), placementSettings.getRotation());
Vec3d vec3d1 = vec3d.addVector((double) pos.getX(), (double) pos.getY(), (double) pos.getZ());
NBTTagList tagList = new NBTTagList();
tagList.appendTag(new NBTTagDouble(vec3d1.xCoord));
tagList.appendTag(new NBTTagDouble(vec3d1.yCoord));
tagList.appendTag(new NBTTagDouble(vec3d1.zCoord));
compound.setTag("Pos", tagList);
compound.setUniqueId("UUID", UUID.randomUUID());
Entity entity;
try {
entity = EntityList.createEntityFromNBT(compound, world);
} catch (Exception var15) {
entity = null;
}
if (entity != null) {
if (entity instanceof EntityPigtificateLeader) {
entity = new EntityPigtificateLeader(world);
} else if (entity instanceof EntityPigtificate) {
entity = new EntityPigtificate(world);
}
float f = entity.getMirroredYaw(placementSettings.getMirror());
f = f + (entity.rotationYaw - entity.getRotatedYaw(placementSettings.getRotation()));
entity.setLocationAndAngles(vec3d1.xCoord, vec3d1.yCoord, vec3d1.zCoord, f, entity.rotationPitch);
world.spawnEntity(entity);
}
}
}
}
use of nex.entity.passive.EntityPigtificate in project NetherEx by LogicTechCorp.
the class PigtificateVillage method updateNumPigtificates.
private void updateNumPigtificates() {
List<EntityPigtificate> list = world.getEntitiesWithinAABB(EntityPigtificate.class, new AxisAlignedBB((double) (center.getX() - villageRadius), (double) (center.getY() - 4), (double) (center.getZ() - villageRadius), (double) (center.getX() + villageRadius), (double) (center.getY() + 4), (double) (center.getZ() + villageRadius)));
numPigtificates = list.size();
if (numPigtificates == 0) {
playerReputation.clear();
}
}
Aggregations