use of ValkyrienWarfareBase.Collision.Polygon in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class CallRunner method onGetEntitiesWithinAABB.
public static <T extends Entity> List<T> onGetEntitiesWithinAABB(World world, Class<? extends T> clazz, AxisAlignedBB aabb, @Nullable Predicate<? super T> filter) {
List toReturn = world.getEntitiesWithinAABB(clazz, aabb, filter);
BlockPos pos = new BlockPos((aabb.minX + aabb.maxX) / 2D, (aabb.minY + aabb.maxY) / 2D, (aabb.minZ + aabb.maxZ) / 2D);
PhysicsWrapperEntity wrapper = ValkyrienWarfareMod.physicsManager.getObjectManagingPos(world, pos);
if (wrapper != null) {
Polygon poly = new Polygon(aabb, wrapper.wrapping.coordTransform.lToWTransform);
//.contract(.3D);
aabb = poly.getEnclosedAABB();
toReturn.addAll(world.getEntitiesWithinAABB(clazz, aabb, filter));
}
return toReturn;
}
Aggregations